import { type EvoPaths } from "./paths.ts"; export interface FileLockOptions { timeoutMs?: number; staleAfterMs?: number; heartbeatMs?: number | false; ownerToken?: string; afterLockPrepared?: () => void | Promise; onHeartbeatError?: (error: unknown) => void; } export type FileLockAttempt = { acquired: true; value: T; } | { acquired: false; }; export interface DurabilityOptions { syncDirectory?: (path: string) => Promise; } export declare function canonicalJson(value: unknown): string; export declare function sha256(data: string | Uint8Array): string; export declare function readJson(path: string): Promise; export declare function readJsonIfExists(path: string): Promise; export declare function atomicWriteFile(path: string, content: string): Promise; export declare function atomicWriteJson(path: string, value: unknown): Promise; export declare function appendJsonLine(path: string, value: unknown, options?: DurabilityOptions): Promise; export declare function durableUnlink(path: string, options?: DurabilityOptions): Promise; export declare function truncateIncompleteFinalLine(path: string): Promise; export declare function withFileLock(paths: EvoPaths, name: string, operation: () => Promise, options?: FileLockOptions): Promise; export declare function tryWithFileLock(paths: EvoPaths, name: string, operation: () => Promise, options?: Omit): Promise>; //# sourceMappingURL=storage.d.ts.map