import type { AuthTokenSource, FetchLike } from "./push-transport.js"; export declare const REALTIME_SYNC_CONTRACT_VERSION: 2; export declare const MAX_REALTIME_ROLLOUT_CACHE_MS = 30000; export declare const DEFAULT_REALTIME_AUTHORIZATION_TIMEOUT_MS = 15000; export interface RealtimeCapabilityVector { hqCloud: string; hqDesktop: string | "none"; protocol: 2; journal: number; durableApply: number; } export type RealtimeInventoryState = { state: "legacy"; v1Allowed: true; } | { state: "qualifying" | "frozen" | "seeding"; retryAfterMs: number; } | { state: "bootstrap-required"; snapshotDescriptorId: string; } | { state: "v2-ready"; cursor: string; } | { state: "paused"; reasonCode: string; } | { state: "reset-required"; resetId: string; snapshotDescriptorId: string; } | { state: "revoked"; localMaterialPolicy: string; } | { state: "restoring"; retryAfterMs: number; } | { state: "blocked"; reasonCode: string; }; export type RealtimeInventoryGrant = RealtimeInventoryState & { scopeUid: string; scopeHandle: string | null; scopeRevision: string; }; export interface RealtimeInventory { contractVersion: 2; scopes: readonly RealtimeInventoryGrant[]; } export interface RealtimeInventoryRequest { /** A changed token must never reuse a positive inventory result. */ bearer: string; deviceId: string; capabilityVector: RealtimeCapabilityVector; /** Identifies the active client configuration/capability selection. */ configurationFingerprint: string; /** Identifies the scopes this guarded pass is about to touch. */ scopeFingerprint: string; } export interface RealtimeRolloutClientOptions { apiUrl: string; fetchImpl?: FetchLike; now?: () => number; maxCacheAgeMs?: number; authorizationTimeoutMs?: number; } export declare function parseRealtimeInventory(value: unknown): RealtimeInventory; /** * Strict client for the authenticated inventory endpoint. The cache is keyed * by bearer, device, capability/configuration, and the scope selection. A * positive inventory record is only an optimization: callers must still mint * a new lease before I/O, where the server strongly rechecks all authority. */ export declare class RealtimeRolloutClient { private readonly apiUrl; private readonly fetchImpl; private readonly now; private readonly maxCacheAgeMs; private readonly authorizationTimeoutMs; private readonly cache; constructor(options: RealtimeRolloutClientOptions); invalidate(): void; inventory(request: RealtimeInventoryRequest): Promise; } export declare function resolveRealtimeBearer(source: AuthTokenSource): Promise; //# sourceMappingURL=realtime-rollout.d.ts.map