import type { EvaluationPayload } from "./types"; /** * ONE SLOT PER SDK KEY (v2). v1 kept an entry per distinct context * (`quonfig.lkg.v1::`) and never removed any, so * localStorage grew without bound (and could exhaust the origin quota the * customer's own app shares) and the raw context sat in the key. LKG serves * the returning visitor in a total outage, and that visitor is the last * context this browser held, so one slot is enough. The slot records a hash of * the context, never the context, and is served only when the hash matches. */ export type LkgEntry = { /** Meta.generation stamped on the cached payload (0 if unversioned). */ generation: number; payload: EvaluationPayload; /** * When the entry was written (epoch ms), for the "cached config from * ago" log line. Absent on entries written before it was recorded. */ savedAt?: number; }; /** * Read the cached entry for (sdkKey, context), or undefined if absent, for a * different context, unreadable or corrupt. */ export declare function readLkg(sdkKey: string, contextSig: string): LkgEntry | undefined; /** * Persist `entry` as the last-known-good for (sdkKey, context), replacing the * sdkKey's single slot. Best-effort: a thrown quota or serialization error is * swallowed. Callers persist only what the client actually installed (post * reject-older guard), so the entry is already monotonic for its context — an * older live response is dropped by the guard before it ever reaches here, * satisfying "the watermark rule applies to the cache too". */ export declare function writeLkg(sdkKey: string, contextSig: string, entry: LkgEntry): void;