import { RedisClientType, RedisClusterType } from 'redis'; import { CacheConfig } from './types.js'; /** * Represents a Redis cache connection class. */ export default class Redis { private static singletonMap; /** * A private static property that holds a reference to the redis.createClient function. * This property is used to create client. */ private static ClientFactory; /** * A private static property that references the createCluster function. * This property can be used to create clusters within the class. */ private static ClusterFactory; static connection(config: CacheConfig<'redis'>): Promise; private static clearSingletons; private static cacheKey; private static connectionFactory; /** * Establishes a connection to a Redis client based on the provided configuration * and holds it for reusability. If connection is detected closed, new connection is * initialized and established. * @param {CacheConfig<'redis'>} config - The configuration object for connecting to the Redis client. * @returns {Promise} A promise that resolves to the Redis client connection. */ private static redisClientConnection; private static redisClusterConnection; }