export interface ICache { get(key: string): Promise; set(key: string, val: T, options: CacheSetOptions): Promise; del(key: string): Promise; } export interface CacheSetOptions { /** * Time-to-live in seconds */ ttl: number; } /** * "cluster": use ioRedis.Cluster() * undefined: use ioRedis() */ export declare type RedisConnectionMode = "cluster" | undefined; /** * NOTE: copied from types of ioredis */ export interface RedisClientOptions { port?: number; host?: string; /** * 4 (IPv4) or 6 (IPv6), Defaults to 4. */ family?: number; /** * Local domain socket path. If set the port, host and family will be ignored. */ path?: string; /** * TCP KeepAlive on the socket with a X ms delay before start. Set to a non-number value to disable keepAlive. */ keepAlive?: number; connectionName?: string; /** * If set, client will send AUTH command with the value of this option when connected. */ password?: string; /** * Database index to use. */ db?: number; /** * When a connection is established to the Redis server, the server might still be loading * the database from disk. While loading, the server not respond to any commands. * To work around this, when this option is true, ioredis will check the status of the Redis server, * and when the Redis server is able to process commands, a ready event will be emitted. */ enableReadyCheck?: boolean; keyPrefix?: string; } /** * extra options (not part of ioredis) */ export interface RedisCacheConstructorOptions extends RedisClientOptions { /** * default: undefined */ mode?: RedisConnectionMode; /** * default: undefined (falsy) */ tls?: boolean; /** * in milliseconds; default: undefined */ slotsRefreshTimeout?: number; } /** * fixme: use any for now. there is an on-going discussion on bringing native support for the types: * https://github.com/luin/ioredis/issues/1053 */ export declare type TRedisClient = any; //# sourceMappingURL=caching.d.ts.map