/** * File Lock Utility - Atomic file operations with locking * * Provides thread-safe file operations for shared volumes across containers */ import type { FileLock } from '../types/exploration.types.js'; /** * Get error message from unknown error */ export interface LockOptions { retries?: number; retry_delay_ms?: number; timeout_ms?: number; } export interface WriteOptions extends LockOptions { pretty?: boolean; } export declare class FileLockManager { private defaultOptions; /** * Acquire a lock on a file */ acquireLock(filePath: string, lockerId: string, options?: LockOptions): Promise; /** * Release a lock */ releaseLock(filePath: string, lockId: string, force?: boolean): Promise; /** * Read a file with locking */ readWithLock(filePath: string, lockerId: string, options?: LockOptions): Promise; /** * Write a file with locking (atomic write) */ writeWithLock(filePath: string, data: T, lockerId: string, options?: WriteOptions): Promise; /** * Update a file with locking (read-modify-write) */ updateWithLock(filePath: string, lockerId: string, updater: (current: null | T) => T, options?: WriteOptions): Promise; /** * Append to an array in a JSON file with locking */ appendToArray(filePath: string, item: T, lockerId: string, arrayKey?: string, options?: WriteOptions): Promise; /** * Check if a file is locked */ isLocked(filePath: string): Promise; /** * Get lock information */ getLockInfo(filePath: string): Promise; /** * Clean up expired locks */ cleanupExpiredLocks(directory: string): Promise; /** * Force remove all locks in a directory */ forceRemoveAllLocks(directory: string): Promise; /** * Get lock file path */ private getLockPath; /** * Generate unique lock ID */ private generateLockId; /** * Sleep helper */ private sleep; } /** * Get global file lock manager instance */ export declare function getFileLockManager(): FileLockManager; //# sourceMappingURL=file-lock.d.ts.map