import type { Clock, IdGenerator } from "./abstractions.js"; export interface LeaseHandle { readonly keyHash: string; readonly ownerId: string; readonly token: string; readonly expiresAt: Date; assertOwned(): Promise; renew(ttlMs?: number): Promise; release(): Promise; } export interface LockStore { acquire(key: string, options: AcquireLeaseOptions): Promise; close(): Promise; } export interface FileLeaseLockOptions { directory: string; defaultTtlMs?: number; retryDelayMs?: number; clock?: Clock; idGenerator?: IdGenerator; } export interface AcquireLeaseOptions { ownerId: string; ttlMs?: number; waitTimeoutMs?: number; signal?: AbortSignal; } export declare class LeaseUnavailableError extends Error { readonly keyHash: string; constructor(keyHash: string); } export declare class LeaseLostError extends Error { readonly keyHash: string; constructor(keyHash: string); } /** * A cooperative local-filesystem lease based on atomic directory creation. * Callers should assert the fencing token immediately before consequential work. */ export declare class FileLeaseLock implements LockStore { #private; constructor(options: FileLeaseLockOptions); acquire(key: string, options: AcquireLeaseOptions): Promise; isOwned(keyHash: string, token: string): Promise; renew(keyHash: string, token: string, ttlMs: number): Promise; release(keyHash: string, token: string): Promise; close(): Promise; } //# sourceMappingURL=file-lease-lock.d.ts.map