export interface RecoverableFileLockOwner { readonly protocolVersion?: 2; readonly nonce: string; readonly createdAt: number; readonly operation?: string; } export interface RecoverableFileLockOptions { readonly timeoutMs?: number; readonly retryMs?: number; readonly operation?: string; /** Accepted for callers upgrading from the old record format. */ readonly malformedLockStaleMs?: number; } export interface RecoverableFileLockDiagnosis { readonly status: 'missing' | 'active' | 'stale' | 'unknown' | 'malformed'; readonly owner: RecoverableFileLockOwner | null; readonly token: string | null; readonly coordinator?: Array<{ file: string; status: 'active' | 'unknown' | 'malformed'; owner: RecoverableFileLockOwner | null; token: string; }>; } /** A transaction is held by the open connection and released by the OS on process exit. */ export declare function acquireRecoverableFileLock(file: string, options?: RecoverableFileLockOptions): Promise<{ owner: RecoverableFileLockOwner; release(): Promise; }>; /** Metadata is diagnostic only; an old PID record cannot keep an unlocked transaction held. */ export declare function diagnoseRecoverableFileLock(file: string): Promise; export declare function repairRecoverableFileLock(file: string, expectedToken: string, options?: { confirmedOwnerStopped?: boolean; preserveAs?: string; }): Promise<'removed' | 'missing' | 'changed' | 'blocked'>; export declare function withRecoverableFileLock(file: string, operation: () => Promise, options?: RecoverableFileLockOptions): Promise; //# sourceMappingURL=recoverable-file-lock.d.ts.map