/**
 * NOTE: Added reference types here to avoid a `pnpm` bug during build.
 * https://github.com/enboxorg/enbox/pull/507
 */
import type { AnonymousDwnApi } from '@enbox/agent';
import type { RecordsWriteMessage, RecordsWriteTags } from '@enbox/dwn-sdk-js';
/**
 * Construction options for a {@link ReadOnlyRecord}.
 *
 * @beta
 */
export type ReadOnlyRecordOptions = {
    /** The raw `RecordsWriteMessage` returned from a query or read reply. */
    rawMessage: RecordsWriteMessage;
    /** The initial write message, if the record has been updated. */
    initialWrite?: RecordsWriteMessage;
    /** Encoded data (Base64URL string) if the data was small enough to be inlined in the query reply. */
    encodedData?: string;
    /** A readable data stream, present when the record comes from a `RecordsRead` reply. */
    data?: ReadableStream;
    /** The DID of the remote DWN this record was fetched from. Used for data re-fetch. */
    remoteOrigin: string;
    /** The {@link AnonymousDwnApi} instance used to re-fetch data when needed. */
    anonymousDwn: AnonymousDwnApi;
};
/**
 * An immutable, read-only view of a DWN record.
 *
 * `ReadOnlyRecord` is returned by {@link DwnReaderApi} methods and provides
 * access to the record's metadata and data without any mutation capabilities.
 * There are no `update()`, `delete()`, `send()`, `store()`, or `import()`
 * methods — the compiler prevents accidental writes.
 *
 * Data access works identically to the full {@link Record} class:
 * - If the data was inlined (small payloads from query replies), it is
 *   available immediately.
 * - If the data was not inlined, `data.stream()` / `data.text()` / etc.
 *   automatically perform an anonymous `RecordsRead` to fetch it.
 *
 * @beta
 */
export declare class ReadOnlyRecord {
    private readonly _anonymousDwn;
    private readonly _remoteOrigin;
    private readonly _author;
    private readonly _creator;
    private readonly _descriptor;
    private readonly _recordId;
    private readonly _contextId?;
    private readonly _initialWrite?;
    private readonly _encodedData?;
    private _readableStream?;
    private readonly _authorization;
    private readonly _attestation?;
    private readonly _encryption?;
    constructor(options: ReadOnlyRecordOptions);
    /** Record's unique identifier. */
    get id(): string;
    /** Record's context ID. */
    get contextId(): string | undefined;
    /** Record's creation date. */
    get dateCreated(): string;
    /** Record's parent ID. */
    get parentId(): string | undefined;
    /** Record's protocol URI. */
    get protocol(): string | undefined;
    /** Record's protocol path. */
    get protocolPath(): string | undefined;
    /** Record's recipient. */
    get recipient(): string | undefined;
    /** Record's schema. */
    get schema(): string | undefined;
    /** Record's data format / MIME type. */
    get dataFormat(): string;
    /** Record's data CID. */
    get dataCid(): string;
    /** Record's data size in bytes. */
    get dataSize(): number;
    /** Record's published date. */
    get datePublished(): string | undefined;
    /** Whether the record is published. */
    get published(): boolean | undefined;
    /** Tags associated with the record. */
    get tags(): RecordsWriteTags | undefined;
    /** DID that is the logical author of the record. */
    get author(): string;
    /** DID that originally created the record. */
    get creator(): string;
    /** Record's message timestamp (time of most recent create/update). */
    get timestamp(): string;
    /** Record's encryption metadata, if encrypted. */
    get encryption(): RecordsWriteMessage['encryption'];
    /** Record's authorization. */
    get authorization(): RecordsWriteMessage['authorization'];
    /** Record's attestation signatures. */
    get attestation(): RecordsWriteMessage['attestation'];
    /** The initial write message, if the record has been updated. */
    get initialWrite(): RecordsWriteMessage | undefined;
    /** The DID of the remote DWN this record was fetched from. */
    get remoteOrigin(): string;
    /**
     * Returns the data of the current record.
     * If the data is not available in-memory, it is fetched from the remote DWN
     * using an anonymous `RecordsRead`.
     *
     * @returns A data accessor with `blob()`, `bytes()`, `json()`, `text()`, and `stream()` methods.
     *
     * @beta
     */
    get data(): {
        blob: () => Promise<Blob>;
        bytes: () => Promise<Uint8Array>;
        json: <T = unknown>() => Promise<T>;
        text: () => Promise<string>;
        stream: () => Promise<ReadableStream>;
        then: (onFulfilled?: (value: ReadableStream) => ReadableStream | PromiseLike<ReadableStream>, onRejected?: (reason: any) => PromiseLike<never>) => Promise<ReadableStream>;
        catch: (onRejected?: (reason: any) => PromiseLike<never>) => Promise<ReadableStream>;
    };
    /**
     * Returns a JSON representation of the record.
     * Called by `JSON.stringify(...)` automatically.
     */
    toJSON(): Record<string, unknown>;
    /**
     * Convenience string representation.
     */
    toString(): string;
    /**
     * Fetches the record's data from the remote DWN using an anonymous `RecordsRead`.
     */
    private readRecordData;
}
//# sourceMappingURL=read-only-record.d.ts.map