//#region src/adapters/cache.adapter.d.ts /** * Cache adapter interface * * Implement this interface to enable caching for subscription/permission lookups. * Caching is optional but recommended for performance. */ interface CacheAdapter { /** * Get a value from cache * @returns The cached value or null if not found/expired */ get(key: string): Promise; /** * Set a value in cache * @param key - Cache key * @param value - Value to cache * @param ttlSeconds - Time to live in seconds (optional) */ set(key: string, value: T, ttlSeconds?: number): Promise; /** * Delete a value from cache */ delete(key: string): Promise; /** * Delete all values matching a pattern * @param pattern - Key pattern (e.g., 'sub:tenant:*') */ deletePattern?(pattern: string): Promise; /** * Atomically increment a numeric value * @returns The new value after increment */ incrBy?(key: string, count: number): Promise; /** * Atomically decrement a numeric value * @returns The new value after decrement */ decrBy?(key: string, count: number): Promise; /** * Check if a key exists */ exists?(key: string): Promise; } /** * Create cache keys for subscription data */ declare const CacheKeys: { readonly subscription: (subscriberId: string) => string; readonly plan: (planId: string) => string; readonly plans: () => string; readonly activePlans: () => string; readonly features: (subscriberId: string) => string; readonly usage: (subscriberId: string, feature: string) => string; readonly usageAll: (subscriberId: string) => string; }; /** * No-op cache adapter for when caching is disabled */ declare const noopCacheAdapter: CacheAdapter; //#endregion export { CacheKeys as n, noopCacheAdapter as r, CacheAdapter as t }; //# sourceMappingURL=cache.adapter-z0MMDFoK.d.ts.map