import { SchemaTypeDef } from '@based/schema/def';
export declare const destructureTreeKey: (key: number) => number[];
export declare const makeTreeKey: (typeId: number, start: number) => number;
export declare const nodeId2Start: (blockCapacity: number, nodeId: number) => number;
export declare const makeTreeKeyFromNodeId: (typeId: number, blockCapacity: number, nodeId: number) => number;
type Hash = Uint8Array;
export type VerifBlock = {
    key: number;
    /**
     * Last acquired hash of the block.
     * This is normally updated at load and save time but never during read/modify ops.
     */
    hash: Hash;
    /**
     * If false the block is offloaded to fs;
     * true doesn't necessarily mean that the block still exists because it could have been deleted.
     */
    inmem: boolean;
    /**
     * If set, the block is being loaded and it can be awaited with this promise.
     */
    loadPromise: null | Promise<void>;
};
export declare class VerifTree {
    #private;
    constructor(schemaTypesParsed: Record<string, SchemaTypeDef>);
    types(): Generator<any, void, unknown>;
    foreachBlock(cb: (block: VerifBlock) => void): void;
    get hash(): Uint8Array;
    update(key: number, hash: Hash, inmem?: boolean): void;
    remove(key: number): void;
    static blockSdbFile(typeId: number, start: number, end: number): string;
    getBlock(key: number): VerifBlock;
    getBlockFile(block: VerifBlock): string;
    updateTypes(schemaTypesParsed: Record<string, SchemaTypeDef>): void;
}
export {};
