import { type SessionLocatorOptions } from '../runtime/query/abandon-turn.js'; import { NamzuError } from '../types/errors/index.js'; import type { SessionId } from '../types/ids/index.js'; import type { FencingToken, LeaseSummary } from '../types/session/durable.js'; import type { ClaimSessionOptions, SessionLease, SessionLog } from './session-log/index.js'; /** * Take exclusive working possession of a session (its `lease.json`), or * report that somebody else holds it. `null` is the ordinary outcome of a * queue with more than one reader, not an error. * * A lease expires; claiming an expired one succeeds and mints a fence * strictly greater than every fence issued before, so the stalled holder's * next append is refused. */ export declare function claimSession(sessionId: SessionId, options: ClaimSessionOptions & Omit): Promise; /** * Give a lease up early. Idempotent; presenting a superseded lease releases * nothing. */ export declare function releaseSession(sessionId: SessionId, lease: SessionLease, options?: Omit): Promise; /** A lease as a listing reports it, judged against one clock. */ export declare function toClaimSummary(lease: SessionLease, now: number): LeaseSummary; /** The refusal for an append presented under a superseded lease. */ export declare function fencedOut(sessionId: SessionId, presented: FencingToken, current: FencingToken): NamzuError; /** What `session-log:single-open-writer` is evaluated against: one session and the fence a writer presents. */ export interface SingleOpenWriterContext { readonly log: SessionLog; readonly presentedFence: FencingToken; } //# sourceMappingURL=session-claim.d.ts.map