UNPKG

@amirmarmul/waba-common

Version:

![GitHub release](https://img.shields.io/github/v/release/amirmarmul/waba-common?style=flat-square)

21 lines (20 loc) 624 B
/// <reference types="node" /> import { Cache as CacheContract } from '../../../core/domain/cache/Cache'; type CacheRecord<T> = { data: T; expire: number; }; /** * @deprecated */ export declare class InMemoryCache implements CacheContract { protected readonly TTL: number; protected readonly store: Map<string, CacheRecord<any>>; protected readonly timeoutRefs: Map<string, NodeJS.Timeout>; constructor(); get<T>(key: string): Promise<T | null>; set<T>(key: string, data: T, ttl?: number): Promise<void>; invalidate(key: string): Promise<void>; clear(): Promise<void>; } export {};