import { createPinboard } from "./server.js"; //#region src/license.d.ts type RedisKV = createPinboard.RedisKV; declare namespace createLease { type Options = { key: string; value: string; ttlMs: number; operation: string; /** Compare-and-deletes the key on close, freeing it without waiting out the TTL. */ releaseOnClose?: boolean | undefined; now?: (() => number) | undefined; /** Fires once per transition into mismatch, never on repeats. */ onMismatch?: (() => void) | undefined; /** Fires once per transition into mismatch against a higher-epoch holder. */ onDisplaced?: (() => void) | undefined; }; type Instance = { held(): Promise; refresh(): Promise; start(): void; close(): Promise; }; } /** * Single-holder lease on `key`: claimed with this holder's `value` when * absent, compare-and-refreshed atomically every tick (a matching value * extends the TTL, a mismatched one is never overwritten — a stalled old * holder delays takeover instead of split-braining). The verdict is cached * for one tick; a stale verdict re-checks on the next request, so a holder * that lost the lease regains it once the key expires or matches again. * With `releaseOnClose`, a clean close compare-and-deletes the key, freeing * it for the next holder without waiting out the TTL; a displaced holder's * close leaves the new holder's key intact. */ declare const createLease: (redis: RedisKV, options: createLease.Options) => createLease.Instance; //#endregion export { createLease }; //# sourceMappingURL=license.d.ts.map