/** Exact, platform-native process-birth identity when the platform exposes one. * Never return an uptime estimate or a lower-precision timestamp: incomparable * identities could falsely reclaim a live owner's lock. */ export declare function readProcessBirthToken(pid: number): string | undefined; export type ProcessBirthTokenKind = "native" | "opaque"; export interface ProcessIdentity { pid: number; birthToken: string; birthTokenKind: ProcessBirthTokenKind; } export interface ObservedProcess { alive: boolean; /** Omitted when exact cross-process birth identity is unavailable. Alive but * unidentifiable owners are never reclaimed. */ birthToken?: string; birthTokenKind?: ProcessBirthTokenKind; } export type ProcessInspector = (pid: number) => ObservedProcess; export interface PersistentCoordinatorOptions { directory: string; namespace?: string; pollMs?: number; /** A malformed mutex file is recoverable only after this grace period. */ corruptLockStaleMs?: number; processIdentity?: ProcessIdentity; inspectProcess?: ProcessInspector; now?: () => number; } export declare class CoordinatorTimeoutError extends Error { readonly code = "TFWS_LEASE_TIMEOUT"; constructor(message: string); } export declare class CoordinatorAbortError extends Error { readonly code = "ABORT_ERR"; constructor(message?: string); } export declare function defaultProcessIdentity(): ProcessIdentity; export declare function defaultProcessInspector(pid: number): ObservedProcess; export declare function namespaceToken(namespace: string): string; export declare function ensureDirectory(directory: string): void; export declare function fsyncDirectory(directory: string): void; export declare function writeJsonAtomicDurable(filePath: string, value: unknown): void; export declare function readJsonFile(filePath: string, fallback: T): T; export declare function appendJsonLinesDurable(filePath: string, records: readonly unknown[]): void; export declare function readJsonLines(filePath: string): T[]; export interface MutexAcquireOptions { timeoutMs?: number; signal?: AbortSignal; } export declare class PersistentFileMutex { #private; readonly lockPath: string; readonly identity: ProcessIdentity; readonly inspectProcess: ProcessInspector; readonly pollMs: number; readonly corruptLockStaleMs: number; readonly now: () => number; constructor(lockPath: string, options?: Omit); acquire(options?: MutexAcquireOptions): Promise<() => void>; runExclusive(fn: () => T | Promise, options?: MutexAcquireOptions): Promise; } export declare function isPersistedOwnerStale(record: ProcessIdentity, identity: ProcessIdentity, inspect: ProcessInspector): boolean; //# sourceMappingURL=persistence.d.ts.map