export interface FileLockOptions {
    staleMs?: number;
    retries?: number;
    retryDelayMs?: number;
}
interface LockInfo {
    pid: number;
    timestamp: number;
    token: string;
}
declare function getLockPath(filePath: string): string;
declare function readLockInfo(lockPath: string): Promise<LockInfo | null>;
declare function isLockStale(lockPath: string, staleMs: number): Promise<boolean>;
declare function tryAcquireLock(lockPath: string): Promise<string | null>;
declare function releaseLock(lockPath: string, expectedToken?: string): Promise<void>;
export declare function withFileLock<T>(filePath: string, fn: () => Promise<T>, options?: FileLockOptions): Promise<T>;
/**
 * Test-only handles for the internal lock primitives. These are NOT part of
 * the public API — they exist so the contract tests can validate token-keyed
 * release semantics and the mkdir-race window without re-implementing them.
 */
export declare const __internalsForTesting: {
    tryAcquireLock: typeof tryAcquireLock;
    releaseLock: typeof releaseLock;
    readLockInfo: typeof readLockInfo;
    isLockStale: typeof isLockStale;
    getLockPath: typeof getLockPath;
};
export {};
