/// import { RedisClientOptions, RedisClientType } from 'redis'; import '@redis/client'; import '@redis/bloom'; import '@redis/graph'; import '@redis/json'; import '@redis/search'; import '@redis/time-series'; import { Cache, Store } from 'cache-manager'; declare type CachingConfig = { ttl?: number | ((value: unknown) => number); }; declare type CB = (err: NodeJS.ErrnoException | null, result: T | null) => void; declare type CBSet = (err: NodeJS.ErrnoException | null) => void; export interface CacheManagerOptions { ttl?: number; isCacheableValue?: (value: unknown) => boolean; } export interface RedisCache extends Cache { store: RedisStore; set: RedisStore['set']; get: RedisStore['get']; del: RedisStore['del']; reset: RedisStore['reset']; } export interface RedisStore extends Store { name: 'redis'; isCacheableValue: (value: unknown) => boolean; get getClient(): RedisClientType; set(key: string, value: T, options: CachingConfig, callback: CBSet): void; set(key: string, value: T, ttl: number, callback: CBSet): void; set(key: string, value: T, options?: CachingConfig): Promise; set(key: string, value: T, ttl: number): Promise; get(key: string, opt: null, callback: CB): void; get(key: string): Promise; del(key: string, callback: CBSet): void; del(key: string[], callback: CBSet): void; del(key: string): Promise; del(key: string[]): Promise; reset(cb: () => void): void; reset(): Promise; mset(args: [string, unknown][], ttl: number | undefined, cb: CBSet): void; mset(args: [string, unknown][], ttl?: number): Promise; mget(...args: [...string[], CB]): void; mget(...args: string[]): Promise; keys(pattern: string | undefined, cb: CB): void; keys(pattern?: string): Promise; ttl(key: string, cb: CB): void; ttl(key: string): Promise; } export declare function redisStore(options?: RedisClientOptions & CacheManagerOptions): Promise; export {};