import type { FileLockRetryOptions } from "./file-lock.js"; import type { SidecarLockStaleRecovery } from "./sidecar-lock.js"; export type JsonStoreLockOptions = { staleMs?: number; timeoutMs?: number; retry?: FileLockRetryOptions; staleRecovery?: SidecarLockStaleRecovery; managerKey?: string; }; export type JsonFileStoreOptions = { trailingNewline?: boolean; lock?: boolean | JsonStoreLockOptions; }; export type JsonStore = { readonly filePath: string; read(): Promise; readOr(fallback: T): Promise; readRequired(): Promise; write(value: T): Promise; update(run: (current: T | undefined) => T | Promise): Promise; updateOr(fallback: T, run: (current: T) => T | Promise): Promise; }; export type JsonStoreAdapter = { filePath: string; readIfExists(): Promise; readRequired(): Promise; write(value: T, options?: { trailingNewline?: boolean; }): Promise; }; export declare function createJsonStore(adapter: JsonStoreAdapter, options?: JsonFileStoreOptions): JsonStore; //# sourceMappingURL=json-document-store.d.ts.map