/** Identity of one lock generation, as observed by a would-be reclaimer. */
export interface LockGenerationIdentity {
    /** Device of the inode judged stale. */
    readonly dev: number;
    /** Inode judged stale. */
    readonly ino: number;
    /** Owner token when the lock was parseable; undefined when unowned. */
    readonly token: string | undefined;
    /** Owner pid when the lock was parseable. */
    readonly pid: number | undefined;
    /** Owner creation timestamp when the lock was parseable. */
    readonly createdAt: number | undefined;
}
/**
 * Run an operation while holding the sole right to delete one lock generation.
 *
 * The capability is what makes the caller's verify-then-unlink safe, and the
 * argument is not probabilistic:
 *
 * 1. Two reclaimers that observed the same lock derive the same capability
 *    path — dev, ino, and the owner triple are immutable for a lock file's
 *    lifetime, since owner metadata is written in full *before* it is linked
 *    into place and never rewritten — and the exclusive create admits exactly
 *    one of them. The loser deletes nothing at all.
 * 2. The lock path can therefore only change while the capability is held if
 *    its own owner released it, and the caller has already proven that owner's
 *    process is gone. A dead process performs no unlink.
 * 3. An acquisition cannot intervene either: acquiring requires the lock path
 *    to be free, and freeing it requires one of the two deletions ruled out
 *    above.
 *
 * So between the caller's proof and its unlink, the lock path still holds
 * exactly the generation that was proven stale. This cannot interleave.
 *
 * Never spins: a live contender means someone else is already reclaiming this
 * very generation, so `whenContended` is returned immediately and the caller's
 * own acquire loop — which owns the wall-clock budget — does the waiting.
 * @param lockPath - Shared lock path
 * @param identity - Identity of the generation to be deleted
 * @param whenContended - Result to return when another live holder has it
 * @param operation - Work performed while the capability is held
 * @returns The operation's result, or `whenContended`
 */
export declare function withReclaimCapability<T>(lockPath: string, identity: LockGenerationIdentity, whenContended: T, operation: () => Promise<T>): Promise<T>;
//# sourceMappingURL=learnings-lock-capability.d.ts.map