import type { SnapshotResponse } from "./types.js"; export interface ReadAuthBrokerSnapshotCacheOptions { path: string; token: string; url: string; ttlMs: number; /** Override clock for deterministic tests. */ now?: () => number; } export interface WriteAuthBrokerSnapshotCacheOptions { path: string; token: string; url: string; snapshot: SnapshotResponse; } export declare function readAuthBrokerSnapshotCache(opts: ReadAuthBrokerSnapshotCacheOptions): Promise; export declare function writeAuthBrokerSnapshotCache(opts: WriteAuthBrokerSnapshotCacheOptions): Promise; /** * Fire-and-forget cache write for snapshot callbacks. The first snapshot after * a quiet period is written immediately; later ones within * {@link WRITE_COALESCE_MS} collapse into a single trailing write of the * newest. A snapshot whose generation and credential content match the last * write is skipped (see {@link UNCHANGED_REWRITE_MS}). Pending writes are * flushed on process shutdown and by {@link flushAuthBrokerSnapshotCacheWrites}; * failures are logged, never thrown. */ export declare function scheduleAuthBrokerSnapshotCacheWrite(opts: WriteAuthBrokerSnapshotCacheOptions): void; /** Write every pending scheduled snapshot now and wait for in-flight writes to settle. */ export declare function flushAuthBrokerSnapshotCacheWrites(): Promise;