/** * Exhaustion Registry * * Tracks which providers are currently quota-exhausted and auto-resets * after a configurable cooldown period. Eliminates the need for callers * to maintain their own exhaustion maps. */ export interface ExhaustionEntry { provider: string; exhaustedAt: number; resetAt: number; } export interface ExhaustionRegistrySnapshot { version: 1; defaultResetMs: number; entries: ExhaustionEntry[]; } export declare class ExhaustionRegistry { private entries; defaultResetMs: number; constructor(defaultResetMs?: number); /** * Mark a provider as quota-exhausted. * Automatically clears after `resetAfterMs` (default: 5 min). */ markExhausted(provider: string, resetAfterMs?: number): void; /** * Check if a provider is currently exhausted. * Automatically clears expired entries. */ isExhausted(provider: string): boolean; /** Manually clear exhaustion for a provider. */ clearExhaustion(provider: string): void; /** Get list of currently exhausted providers. */ getExhaustedProviders(): string[]; /** Get the entry for a specific provider (if exhausted). */ getEntry(provider: string): ExhaustionEntry | undefined; /** Snapshot non-expired exhaustion state for external persistence. */ snapshot(): ExhaustionRegistrySnapshot; /** Serialize exhaustion state for Workers KV, D1, Redis, etc. */ serialize(): string; /** Restore exhaustion state onto this registry. */ restore(snapshot: ExhaustionRegistrySnapshot | string): void; static deserialize(json: string): ExhaustionRegistry; /** Clear all exhaustion state. */ reset(): void; } /** Shared singleton — same pattern as defaultCircuitBreakerManager. */ export declare const defaultExhaustionRegistry: ExhaustionRegistry; //# sourceMappingURL=exhaustion.d.ts.map