/**
 * NOTE: Added reference types here to avoid a `pnpm` bug during build.
 * https://github.com/enboxorg/enbox/pull/507
 */
import type { AnonymousDwnApi, DwnPaginationCursor, DwnResponseStatus } from '@enbox/agent';
import type { DateSort, Pagination, ProtocolDefinition, ProtocolsQueryFilter, RecordsFilter } from '@enbox/dwn-sdk-js';
import { ReadOnlyRecord } from './read-only-record.js';
/**
 * Request to query public records from a remote DWN.
 *
 * @beta
 */
export type ReaderRecordsQueryRequest = {
    /** The DID of the remote DWN to query (required — reader is remote-only). */
    from: string;
    /** Filter criteria for the query. */
    filter: RecordsFilter;
    /** Sort order for results. */
    dateSort?: DateSort;
    /** Pagination options. */
    pagination?: Pagination;
};
/**
 * Response from a reader records query.
 *
 * @beta
 */
export type ReaderRecordsQueryResponse = DwnResponseStatus & {
    /** Array of read-only records matching the query. */
    records: ReadOnlyRecord[];
    /** Pagination cursor for fetching the next page. */
    cursor?: DwnPaginationCursor;
};
/**
 * Request to read a specific public record from a remote DWN.
 *
 * @beta
 */
export type ReaderRecordsReadRequest = {
    /** The DID of the remote DWN to read from (required — reader is remote-only). */
    from: string;
    /** Filter to identify the record (typically `{ recordId: '...' }`). */
    filter: RecordsFilter;
};
/**
 * Response from a reader records read.
 *
 * @beta
 */
export type ReaderRecordsReadResponse = DwnResponseStatus & {
    /** The read-only record, if found. */
    record?: ReadOnlyRecord;
};
/**
 * Request to count public records on a remote DWN.
 *
 * @beta
 */
export type ReaderRecordsCountRequest = {
    /** The DID of the remote DWN to count records in (required). */
    from: string;
    /** Filter criteria for counting. */
    filter: RecordsFilter;
};
/**
 * Response from a reader records count.
 *
 * @beta
 */
export type ReaderRecordsCountResponse = DwnResponseStatus & {
    /** The number of matching public records. */
    count?: number;
};
/**
 * Request to query published protocols from a remote DWN.
 *
 * @beta
 */
export type ReaderProtocolsQueryRequest = {
    /** The DID of the remote DWN to query protocols from (required). */
    from: string;
    /** Optional filter for the protocol query. */
    filter?: ProtocolsQueryFilter;
};
/**
 * Response from a reader protocols query.
 *
 * @beta
 */
export type ReaderProtocolsQueryResponse = DwnResponseStatus & {
    /** Array of published protocol definitions. */
    protocols: ProtocolDefinition[];
};
/**
 * A read-only API for querying public data on remote DWNs without any identity or signing keys.
 *
 * This class mirrors the shape of {@link DwnApi}'s `records` and `protocols`
 * namespaces, but restricts to read-path operations and requires a `from` DID
 * on every call (remote-only). All messages are unsigned, so only published
 * records and protocols are accessible.
 *
 * Obtain an instance via {@link Enbox.anonymous | `Enbox.anonymous()`}.
 *
 * @example
 * ```ts
 * const { dwn } = Enbox.anonymous();
 *
 * const { records } = await dwn.records.query({
 *   from: 'did:dht:alice...',
 *   filter: { protocol: 'https://social.example/posts', protocolPath: 'post' },
 * });
 *
 * for (const record of records) {
 *   console.log(record.id, await record.data.text());
 * }
 * ```
 *
 * @beta
 */
export declare class DwnReaderApi {
    private readonly _anonymousDwn;
    constructor(anonymousDwn: AnonymousDwnApi);
    /**
     * API to interact with public DWN records (query, read, count).
     */
    get records(): {
        query: (request: ReaderRecordsQueryRequest) => Promise<ReaderRecordsQueryResponse>;
        read: (request: ReaderRecordsReadRequest) => Promise<ReaderRecordsReadResponse>;
        count: (request: ReaderRecordsCountRequest) => Promise<ReaderRecordsCountResponse>;
    };
    /**
     * API to query published protocol definitions from remote DWNs.
     */
    get protocols(): {
        query: (request: ReaderProtocolsQueryRequest) => Promise<ReaderProtocolsQueryResponse>;
    };
}
//# sourceMappingURL=dwn-reader-api.d.ts.map