export type V2IdempotencyStatus = "received" | "queued" | "accepted" | "committed" | "unknown_delivery"; export type V2ChannelState = { readonly senderRef: string; readonly channelId: string; readonly ready: true; readonly lastSeen: number; }; export type V2IdempotencyRequest = { senderRef: string; clientRequestId: string; payload: unknown; }; export type V2IdempotencyRecord = { readonly key: string; readonly generation: string; readonly senderRef: string; readonly clientRequestId: string; readonly fingerprint: string; status: V2IdempotencyStatus; messageId?: string; groupId?: string; touchedAt: number; }; type Clock = () => number; export type V2SessionStateOptions = { generation: string; maxEntries?: number; ttlMs?: number; clock?: Clock; }; type BeginResult = { kind: "new"; record: V2IdempotencyRecord; } | { kind: "replay"; record: V2IdempotencyRecord; } | { kind: "conflict"; record: V2IdempotencyRecord; }; export declare class V2SessionState { private generationValue; private readonly maxEntries; private readonly ttlMs; private readonly clock; private readonly channels; private readonly records; constructor(options: V2SessionStateOptions); get generation(): string; setGeneration(generation: string): void; hello(senderRef: string, channelId: string): V2ChannelState; touch(senderRef: string, channelId: string): V2ChannelState | undefined; get(senderRef: string, channelId: string): V2ChannelState | undefined; removeChannel(senderRef: string, channelId: string): void; removeOwner(senderRef: string): void; begin(request: V2IdempotencyRequest): BeginResult; update(key: string, status: V2IdempotencyStatus, details?: { messageId?: string; groupId?: string; }): V2IdempotencyRecord | undefined; rememberUnknownDelivery(key: string): V2IdempotencyRecord | undefined; getRecord(key: string): V2IdempotencyRecord | undefined; forget(key: string): boolean; snapshot(): { channels: V2ChannelState[]; records: V2IdempotencyRecord[]; }; private prune; private pruneCapacity; private recordKey; private channelKey; private assertId; } export declare function fingerprintV2Payload(value: unknown): string; export {};