/** * Token Cache Interface * * Abstraction for storing OAuth tokens with TTL support. * Implementations: MemoryCache (built in) or an explicitly activated extension. */ export interface TokenCacheEntry { token: string; expiresAt: number; scope: "preview" | "production"; projectSlug?: string; } export interface TokenCache { get(key: string): Promise; set(key: string, entry: TokenCacheEntry): Promise; delete(key: string): Promise; clear(): Promise; has(key: string): Promise; stats(): Promise; close(): Promise; } export interface CacheStats { hits: number; misses: number; size: number; type: "memory" | "extension"; } export interface MemoryCacheOptions { /** Maximum number of entries. Must be between 1 and 100,000. */ maxSize?: number; /** Expiry sweep interval in milliseconds. `0` disables scheduled sweeps. */ cleanupInterval?: number; } export type CacheOptions = { type: "memory"; options?: MemoryCacheOptions; } | { /** Requires a previously registered `TokenCacheStore` extension contract. */ type: "extension"; options?: never; }; //# sourceMappingURL=types.d.ts.map