import { LRUCache } from 'lru-cache'; import type { BatchDBOp, DB } from '@ethereumjs/util'; import type { Checkpoint, CheckpointDBOpts } from '../types.ts'; /** * Checkpoint-aware DB wrapper with optional LRU node cache for binary trees. */ export declare class CheckpointDB implements DB { checkpoints: Checkpoint[]; db: DB; readonly cacheSize: number; private readonly valueEncoding; protected _cache?: LRUCache; _stats: { cache: { reads: number; hits: number; writes: number; }; db: { reads: number; hits: number; writes: number; }; }; /** * Initialize a DB instance. */ constructor(opts: CheckpointDBOpts); /** * Replace the checkpoint stack with a copy of the given checkpoints. * * @param checkpoints Checkpoints to adopt (maps are cloned) */ setCheckpoints(checkpoints: Checkpoint[]): void; /** * Is the DB during a checkpoint phase? */ hasCheckpoints(): boolean; /** * Push a new checkpoint onto the stack. * * @param root Tree root hash at this checkpoint boundary */ checkpoint(root: Uint8Array): void; /** * Commits the latest checkpoint */ commit(): Promise; /** * Reverts the latest checkpoint */ revert(): Promise>; /** * @inheritDoc */ get(key: Uint8Array): Promise; /** * @inheritDoc */ put(key: Uint8Array, value: Uint8Array): Promise; /** * @inheritDoc */ del(key: Uint8Array): Promise; /** * @inheritDoc */ batch(opStack: BatchDBOp[]): Promise; stats(reset?: boolean): { size: number; cache: { reads: number; hits: number; writes: number; }; db: { reads: number; hits: number; writes: number; }; }; /** * @inheritDoc */ shallowCopy(): CheckpointDB; open(): Promise; } //# sourceMappingURL=checkpoint.d.ts.map