import { SchemaTypeDef } from '@based/schema/def';
import { DbServer } from './index.js';
import { IoJobSave } from './workers/io_worker_types.js';
/**
 * Save a block.
 */
export declare function saveBlock(db: DbServer, typeId: number, start: number, end: number): void;
export declare function saveBlocks(db: DbServer, blocks: IoJobSave['blocks']): Promise<void>;
/**
 * Load an existing block (typically of a partial type) back to memory.
 */
export declare function loadBlock(db: DbServer, def: SchemaTypeDef, start: number): Promise<void>;
/**
 * Save a block and remove it from memory.
 */
export declare function unloadBlock(db: DbServer, def: SchemaTypeDef, start: number): Promise<void>;
/**
 * Execute cb() for each block in memory.
 */
export declare function foreachBlock(db: DbServer, def: SchemaTypeDef, cb: (start: number, end: number, hash: Uint8Array) => void, includeEmptyBlocks?: boolean): void;
/**
 * Execute cb() for each dirty block.
 * A dirty block is one that is changed in memory but not yet persisted in the
 * file system.
 */
export declare function foreachDirtyBlock(db: DbServer, cb: (mtKey: number, typeId: number, start: number, end: number) => void): void;
