import { Script } from "./twins.js"; //#region src/scripts/lease.d.ts /** Fleet epoch of a stored value: absent field = 0, non-JSON = null. * Arrays count as epoch 0, matching Lua's cjson table decoding. */ declare const epochOf: (raw: string | null) => number | null; /** * KEYS: lease * ARGV: value, ttlMs * Claims the lease when absent (SET + TTL), extends the TTL when the stored * value matches. A mismatched value is overwritten only when both values are * JSON objects and the incoming epoch (absent = 0) is higher. * Returns 'claimed' | 'serving' | 'mismatch'. */ declare const leaseScript: Script.Def; /** * KEYS: members * ARGV: nodeId, config, now(ms), ttlMs, op('join'/'leave') * Join: prunes expired members, refuses while any live member's config * differs — unless that member's config carries a lower epoch (absent = 0), * i.e. it is being displaced. Otherwise upserts self with expiry = now + ttl. * Leave: HDELs self. * Returns ['ok'] | ['incompatible', otherConfig]. */ declare const membershipScript: Script.Def; /** * KEYS: lease * ARGV: value * Compare-and-delete: DELs the lease only while the stored value matches. * Returns 1 when deleted, 0 otherwise. */ declare const leaseReleaseScript: Script.Def; //#endregion export { epochOf, leaseReleaseScript, leaseScript, membershipScript }; //# sourceMappingURL=lease.d.ts.map