UNPKG

qus-node-redis-cache

Version:
20 lines 809 B
import { Logger } from '@nestjs/common'; import { RedisClientType } from 'redis'; interface BaseDto { id: string; } export declare abstract class CachingService<T extends BaseDto> { protected ttl: number; private keyPrefix; protected _client: RedisClientType | null; protected logger: Logger; protected url: string; constructor(ttl: number, keyPrefix: string, url?: string); protected getClient(): RedisClientType; protected getFromCache(key: string, fetchData: (...args: any[]) => Promise<T>, ...args: any[]): Promise<T>; protected getListFromCache(keys: string[], fetchAllData: (keys: string[]) => Promise<T[]>): Promise<T[]>; protected getKeyPrefix(): string; clearCache(key: string): Promise<void>; } export {}; //# sourceMappingURL=caching-service.d.ts.map