import type { DidUrlDereferencer } from '@enbox/dids';
import type { DateSort, Pagination, ProtocolsQueryFilter, ProtocolsQueryReply, RecordsCountReply, RecordsFilter, RecordsQueryReply, RecordsReadReply, RecordsSubscribeReply, SubscriptionListener } from '@enbox/dwn-sdk-js';
import type { EnboxRpc } from '@enbox/dwn-clients';
/**
 * Parameters for constructing an {@link AnonymousDwnApi}.
 */
export type AnonymousDwnApiParams = {
    /** A DID URL dereferencer for resolving target DID service endpoints. */
    didResolver: DidUrlDereferencer;
    /** An RPC client for sending messages to remote DWNs. */
    rpcClient: EnboxRpc;
};
/**
 * Parameters for an anonymous records query.
 * Mirrors the DWN SDK's `RecordsQueryOptions` without `signer` or delegation fields.
 */
export type AnonymousRecordsQueryParams = {
    filter: RecordsFilter;
    dateSort?: DateSort;
    pagination?: Pagination;
    messageTimestamp?: string;
};
/**
 * Parameters for an anonymous records read.
 */
export type AnonymousRecordsReadParams = {
    filter: RecordsFilter;
    messageTimestamp?: string;
};
/**
 * Parameters for an anonymous records subscribe.
 */
export type AnonymousRecordsSubscribeParams = {
    filter: RecordsFilter;
    dateSort?: DateSort;
    pagination?: Pagination;
    messageTimestamp?: string;
};
/**
 * Parameters for an anonymous records count.
 */
export type AnonymousRecordsCountParams = {
    filter: RecordsFilter;
    messageTimestamp?: string;
};
/**
 * Parameters for an anonymous protocols query.
 */
export type AnonymousProtocolsQueryParams = {
    filter?: ProtocolsQueryFilter;
    messageTimestamp?: string;
};
/**
 * A lightweight DWN API that creates **unsigned** (anonymous) DWN messages and
 * sends them to remote DWNs via RPC.
 *
 * This class does not require a vault, agent DID, signing keys, or any identity
 * infrastructure. It leverages the DWN SDK's native support for optional
 * `signer` on read-path operations (RecordsQuery, RecordsRead, RecordsSubscribe,
 * RecordsCount, ProtocolsQuery).
 *
 * Anonymous queries return only published records. Anonymous reads succeed for
 * published records and for protocol records with `{ who: 'anyone', can: ['read'] }`.
 *
 * @example
 * ```ts
 * const resolver = new UniversalResolver({ didResolvers: [DidDht, DidJwk] });
 * const rpcClient = new EnboxRpcClient();
 * const anonymousDwn = new AnonymousDwnApi({ didResolver: resolver, rpcClient });
 *
 * const reply = await anonymousDwn.recordsQuery('did:dht:alice...', {
 *   filter: { protocol: 'https://social.example/posts', protocolPath: 'post' },
 * });
 * ```
 */
export declare class AnonymousDwnApi {
    private _didResolver;
    private _rpcClient;
    constructor({ didResolver, rpcClient }: AnonymousDwnApiParams);
    /**
     * Send an anonymous (unsigned) `RecordsQuery` to a remote DWN.
     *
     * Only published records are returned by the remote DWN.
     *
     * @param target - The DID whose DWN will be queried.
     * @param params - Query parameters (filter, sort, pagination).
     * @returns The raw `RecordsQueryReply` from the remote DWN.
     */
    recordsQuery(target: string, params: AnonymousRecordsQueryParams): Promise<RecordsQueryReply>;
    /**
     * Send an anonymous (unsigned) `RecordsRead` to a remote DWN.
     *
     * Succeeds for published records and for protocol records with
     * `{ who: 'anyone', can: ['read'] }` rules.
     *
     * @param target - The DID whose DWN will be read from.
     * @param params - Read parameters (filter).
     * @returns The raw `RecordsReadReply` from the remote DWN.
     */
    recordsRead(target: string, params: AnonymousRecordsReadParams): Promise<RecordsReadReply>;
    /**
     * Send an anonymous (unsigned) `RecordsSubscribe` to a remote DWN.
     *
     * Only published record events are received.
     *
     * @param target - The DID whose DWN to subscribe to.
     * @param params - Subscribe parameters (filter).
     * @param handler - Callback for incoming subscription messages (events and EOSE).
     * @returns The raw `RecordsSubscribeReply` from the remote DWN.
     */
    recordsSubscribe(target: string, params: AnonymousRecordsSubscribeParams, handler: SubscriptionListener): Promise<RecordsSubscribeReply>;
    /**
     * Send an anonymous (unsigned) `RecordsCount` to a remote DWN.
     *
     * Only published records are counted.
     *
     * @param target - The DID whose DWN to count records in.
     * @param params - Count parameters (filter).
     * @returns The raw `RecordsCountReply` from the remote DWN.
     */
    recordsCount(target: string, params: AnonymousRecordsCountParams): Promise<RecordsCountReply>;
    /**
     * Send an anonymous (unsigned) `ProtocolsQuery` to a remote DWN.
     *
     * Only published protocol definitions are returned.
     *
     * @param target - The DID whose DWN to query protocols from.
     * @param params - Optional query parameters (protocol filter).
     * @returns The raw `ProtocolsQueryReply` from the remote DWN.
     */
    protocolsQuery(target: string, params?: AnonymousProtocolsQueryParams): Promise<ProtocolsQueryReply>;
    /**
     * Resolve the target DID's DWN service endpoints and send an unsigned
     * message to the first one that responds.
     *
     * Follows the same retry-over-endpoints pattern as `AgentDwnApi.sendDwnRpcRequest()`.
     */
    private sendRequest;
}
//# sourceMappingURL=anonymous-dwn-api.d.ts.map