UNPKG

bb-inspired

Version:

Core library for BB-inspired NestJS backend

20 lines (19 loc) 731 B
import { ICacheService, CacheItemOptions } from './cache.service'; import { CacheOptions } from './cache.module'; export declare class MemoryCacheService implements ICacheService { private readonly options; private readonly logger; private readonly cache; private readonly tagMap; private readonly defaultTtl; private readonly maxItems; constructor(options: CacheOptions); get<T>(key: string): Promise<T | null>; set<T>(key: string, value: T, options?: CacheItemOptions): Promise<void>; delete(key: string): Promise<boolean>; clear(): Promise<void>; has(key: string): Promise<boolean>; invalidateByTag(tag: string): Promise<void>; private cleanup; private evictOldest; }