export type FileLockAcquisitionOptions = Readonly<{ timeoutMs?: number; retryMs?: number; }>; export type FileLockOwner = Readonly<{ pid?: number; token?: string; }>; export interface FileLockCliRuntime { now(): Date; nowMs(): number; pid(): number; sleepSync(milliseconds: number): void; nonce?(): string; signalProcess?(pid: number): void; } export interface FileLockFileSystem { readonly constants: Readonly<{ O_CREAT: number; O_EXCL: number; O_WRONLY: number; O_NOFOLLOW?: number; }>; openSync(filePath: string, flags: number, mode: number): number; fchmodSync(fd: number, mode: number): void; writeFileSync(fd: number, data: string, encoding: "utf8"): void; fsyncSync(fd: number): void; closeSync(fd: number): void; lstatSync(filePath: string): Readonly<{ isSymbolicLink(): boolean; isFile(): boolean; mtimeMs: number; }>; unlinkSync(filePath: string): void; readFileSync(filePath: string, encoding: "utf8"): string; } export interface FileLockCliAdapter { acquire(lockPath: string, options?: FileLockAcquisitionOptions): () => void; stale(lockPath: string): boolean; owner(lockPath: string): FileLockOwner; } /** Bind the synchronous file-lock protocol to one CLI runtime boundary. */ export declare function createFileLockCliAdapter(runtime: FileLockCliRuntime, fileSystem?: FileLockFileSystem): FileLockCliAdapter;