import { type FileHandle } from 'node:fs/promises'; import type { DurableJournalDomain, DurableJournalRecord, DurableOperation, DurableProjection, DurableReadState, DurableSnapshot, DurableTransactionRequest, RecoveryStatus } from './types.js'; export declare function stableJson(value: unknown): string; export declare function sha256(value: string | Uint8Array): string; export declare function compositeKey(left: string, right: string): string; export declare function validateIdentifier(value: string): void; export declare function emptyProjection(): DurableProjection; export declare function cloneProjection(value: DurableProjection): DurableProjection; export declare function applyOperation(projection: DurableProjection, operation: DurableOperation, record: Pick, _recoveryStatus: Exclude): void; export declare function validateTransaction(request: DurableTransactionRequest): void; export declare function journalChecksum(record: Omit | DurableJournalRecord): string; export declare function journalSignaturePayload(domain: DurableJournalDomain, checksum: string): Buffer; export declare function snapshotChecksum(snapshot: Omit): string; export interface RecoveryPaths { readonly journal: string; readonly snapshot: string; } export interface JournalVerification { readonly keyId: string; readonly publicKey: string; readonly domain: Omit; readonly bootstrap?: { readonly keyId: string; readonly signature: string; readonly validate: (record: DurableJournalRecord) => boolean; }; } export declare function readVerifiedFileSync(filePath: string): Buffer; export declare function recoverDurableState(paths: RecoveryPaths, maxRecordBytes: number, beforeMutation?: () => Promise, authority?: JournalVerification, journalHandle?: FileHandle): Promise; /** Lock-free authoritative read for synchronous authorization. Any concurrent/torn view fails closed. */ export declare function readDurableStateSync(paths: RecoveryPaths, maxRecordBytes: number, authority?: JournalVerification): DurableReadState; export declare function removeIfPresent(target: string): Promise;