export declare const HARNERY_DURABLE_HISTORY_SCHEMA: "harnery.durable-history/v1"; export interface DurableHistoryOptions { max_record_bytes: number; max_segment_bytes: number; fault?: (boundary: DurableHistoryFaultBoundary) => void; /** Fault-injection seam; production callers use the default syscall. */ write_sync?: DurableHistoryWriteSync; } export type DurableHistoryWriteSync = (fd: number, buffer: Buffer, offset: number, length: number) => number; export type DurableHistoryFaultBoundary = "after_segment_rename" | "before_append" | "after_append_before_sync" | "after_rewrite_temp_sync" | "after_rewrite_publish"; export interface DurableHistoryAppendReceipt { schema: typeof HARNERY_DURABLE_HISTORY_SCHEMA; segment: "active"; record_bytes: number; rotated: boolean; synced: true; } export interface DurableHistoryReadOptions { max_record_bytes: number; max_records?: number; } export interface CrashSafeJsonlUpdate { append?: readonly unknown[]; result: R; } export declare function appendDurableHistoryRecord(objectDir: string, record: unknown, options: DurableHistoryOptions): DurableHistoryAppendReceipt; export declare function appendCrashSafeJsonlFile(path: string, record: unknown, maxRecordBytes: number, fault?: DurableHistoryOptions["fault"]): number; export declare function appendSegmentedJsonlFile(activePath: string, record: unknown, options: DurableHistoryOptions): DurableHistoryAppendReceipt; export declare function updateCrashSafeJsonlFile(path: string, options: DurableHistoryReadOptions, update: (records: readonly T[]) => CrashSafeJsonlUpdate, fault?: DurableHistoryOptions["fault"]): R; export declare function streamDurableHistory(objectDir: string, options: DurableHistoryReadOptions): AsyncGenerator; export declare function readDurableHistorySync(objectDir: string, options: DurableHistoryReadOptions): T[]; export declare function readCrashSafeJsonlFile(path: string, options: DurableHistoryReadOptions): T[]; export declare function readSegmentedJsonlFileSync(activePath: string, options: DurableHistoryReadOptions): T[]; export declare function rewriteCrashSafeJsonlFile(path: string, records: readonly unknown[], maxRecordBytes: number, fault?: DurableHistoryOptions["fault"]): Promise; export declare function durableHistoryPaths(objectDir: string): string[]; //# sourceMappingURL=durable-history.d.ts.map