import type { Clock, IdGenerator } from "./abstractions.js"; export declare const OPERATION_STORE_SCHEMA_VERSION: 2; export interface OperationRecord { operationId: string; } export interface OperationStore { get(operationId: string): Promise; list(): Promise; save(record: T): Promise; update(operationId: string, updater: (current: T | undefined) => T | undefined): Promise; remove(operationId: string): Promise; } export interface AtomicJsonOperationStoreOptions { validate?: (value: unknown) => value is T; idGenerator?: IdGenerator; forbiddenKeys?: readonly string[]; clock?: Clock; retentionPolicy?: OperationStoreRetentionPolicy; } export interface OperationStoreRetentionPolicy { maxRecords: number; terminalRetentionMs: number; isTerminal(record: T): boolean; updatedAt(record: T): Date | number | string; } export declare class OperationStoreCorruptError extends Error { readonly filePath: string; constructor(filePath: string, cause?: unknown); } export declare class OperationStorePolicyError extends Error { readonly field: string; constructor(field: string); } export declare class OperationStoreUnsupportedVersionError extends Error { readonly filePath: string; readonly schemaVersion: number; constructor(filePath: string, schemaVersion: number); } export declare class OperationStoreCapacityError extends Error { readonly filePath: string; readonly maxRecords: number; readonly protectedRecords: number; constructor(filePath: string, maxRecords: number, protectedRecords: number); } /** * Serializes writes within one process. Wrap cross-process read/modify/write sequences in a LockStore lease. */ export declare class AtomicJsonOperationStore implements OperationStore { #private; readonly filePath: string; constructor(filePath: string, options?: AtomicJsonOperationStoreOptions); get(operationId: string): Promise; list(): Promise; save(record: T): Promise; update(operationId: string, updater: (current: T | undefined) => T | undefined): Promise; remove(operationId: string): Promise; } //# sourceMappingURL=operation-store.d.ts.map