type CacheClassType = new (...args: any[]) => ICache; type RedisCacheOptionsType = { namespace?: string; connectionString?: string; connectionTimeout?: number; idleTimeout?: number; autoReconnect?: boolean; maxRetries?: number; enableOfflineQueue?: boolean; enableAutoPipelining?: boolean; tls?: boolean | object; }; type UpstashRedisCacheOptionsType = { namespace?: string; url?: string; token?: string; }; type FilesystemCacheOptionsType = { cacheDir?: string; maxFileSize?: number; cleanupInterval?: number; enableCleanup?: boolean; }; interface ICache { get: (key: string) => Promise; set: (key: string, value: T, ttl?: number) => Promise; delete: (key: string) => Promise; deleteByPrefix: (prefix: string) => Promise; has: (key: string) => Promise; clear: () => Promise; } declare abstract class AbstractCache implements ICache { abstract get(key: string): Promise; abstract set(key: string, value: T, ttl?: number): Promise; abstract delete(key: string): Promise; abstract deleteByPrefix(prefix: string): Promise; abstract has(key: string): Promise; abstract clear(): Promise; } import { Exception } from "@ooneex/exception"; declare class CacheException extends Exception { constructor(message: string, key: string, data?: Record); } import { EContainerScope } from "@ooneex/container"; declare const decorator: { cache: (scope?: EContainerScope) => (target: CacheClassType) => void; }; declare class FilesystemCache extends AbstractCache { private cacheDir; private maxFileSize; constructor(options?: FilesystemCacheOptionsType); private ensureCacheDir; get(key: string): Promise; set(key: string, value: T, ttl?: number): Promise; delete(key: string): Promise; has(key: string): Promise; private getFilePath; private isExpired; private readCacheEntry; deleteByPrefix(prefix: string): Promise; clear(): Promise; private writeCacheEntry; } import { AppEnv } from "@ooneex/app-env"; declare class RedisCache extends AbstractCache { private readonly env; private readonly client; private readonly namespace; constructor(env: AppEnv, options?: RedisCacheOptionsType); private getKey; get(key: string): Promise; set(key: string, value: T, ttl?: number): Promise; delete(key: string): Promise; has(key: string): Promise; deleteByPrefix(prefix: string): Promise; clear(): Promise; } import { AppEnv as AppEnv2 } from "@ooneex/app-env"; declare class UpstashRedisCache extends AbstractCache { private readonly env; private client; private readonly namespace; constructor(env: AppEnv2, options?: UpstashRedisCacheOptionsType); private getKey; get(key: string): Promise; set(key: string, value: T, ttl?: number): Promise; delete(key: string): Promise; has(key: string): Promise; deleteByPrefix(prefix: string): Promise; clear(): Promise; } export { decorator, UpstashRedisCacheOptionsType, UpstashRedisCache, RedisCacheOptionsType, RedisCache, ICache, FilesystemCacheOptionsType, FilesystemCache, CacheException, CacheClassType, AbstractCache };