export default class CacheService { private cacheRepository; private cacheConfig; /** * Constructor */ constructor(); /** * Get cache item */ get(key: string): Promise; /** * Get multiple cache items by multiple keys */ getMany(keys: string[]): Promise; /** * Get cache item and delete it from cache immediately */ pull(key: string): Promise; /** * Put data into cache for certain time */ put(key: string, data: any, ttlInSeconds?: number): Promise; /** * Put multiple key-value pairs into cache for certain time */ putMany(data: { key: string; value: any; }[], ttlInSeconds?: number): Promise; /** * Put data into cache forever */ putForever(key: string, data: any): Promise; /** * Check whether the key exists in the cache */ has(key: string): Promise; /** * Get cache keys */ keys(regex?: RegExp): Promise; /** * Remove item from the cache */ delete(key: string): Promise; /** * Delete items from the cache */ deleteMany(keys: string[]): Promise; /** * Clear the entire cache */ flush(): Promise; /** * Internal method which runs in endless loop and expires cache items */ private cacheExpirationLoop; }