import type { Enum } from '../../../shared/src/enum.ts';
import type { Read } from '../dag/store.ts';
import * as FormatVersion from '../format-version-enum.ts';
import type { FrozenJSONValue } from '../frozen-json.ts';
import { type Hash } from '../hash.ts';
import { DataNodeImpl, type Entry, type InternalDiff, type InternalDiffOperation, InternalNodeImpl } from './node.ts';
type FormatVersion = Enum<typeof FormatVersion>;
/**
 * The size of the header of a node. (If we had compile time
 * constants we would have used that).
 *
 * There is a test ensuring this is correct.
 */
export declare const NODE_HEADER_SIZE = 11;
export declare class BTreeRead implements AsyncIterable<Entry<FrozenJSONValue>> {
    protected readonly _cache: Map<Hash, DataNodeImpl | InternalNodeImpl>;
    protected readonly _dagRead: Read;
    protected readonly _formatVersion: FormatVersion;
    rootHash: Hash;
    readonly getEntrySize: <K, V>(k: K, v: V) => number;
    readonly chunkHeaderSize: number;
    constructor(dagRead: Read, formatVersion: FormatVersion, root?: Hash, getEntrySize?: <K, V>(k: K, v: V) => number, chunkHeaderSize?: number);
    getNode(hash: Hash): Promise<DataNodeImpl | InternalNodeImpl>;
    get(key: string): Promise<FrozenJSONValue | undefined>;
    has(key: string): Promise<boolean>;
    isEmpty(): Promise<boolean>;
    scan(fromKey: string): AsyncIterableIterator<Entry<FrozenJSONValue>>;
    keys(): AsyncIterableIterator<string>;
    entries(): AsyncIterableIterator<Entry<FrozenJSONValue>>;
    [Symbol.asyncIterator](): AsyncIterableIterator<Entry<FrozenJSONValue>>;
    diff(last: BTreeRead): AsyncIterableIterator<InternalDiffOperation>;
}
export declare function allEntriesAsDiff(map: BTreeRead, op: 'add' | 'del'): Promise<InternalDiff>;
export {};
//# sourceMappingURL=read.d.ts.map