UNPKG

@croct/cache

Version:

An abstraction layer for caching.

11 lines (10 loc) 378 B
import { CacheProvider } from './cacheProvider'; /** * In-memory cache implementation backed by a native `Map`. */ export declare class InMemoryCache<T = any> implements CacheProvider<string, T> { private cache; get(key: string, loader: (key: string) => Promise<T>): Promise<T>; set(key: string, value: T): Promise<void>; delete(key: string): Promise<void>; }