@gabliam/cache
Version:
cache plugin for gabliam
18 lines (17 loc) • 619 B
TypeScript
import LRU from 'lru-cache';
import { Cache } from '../cache';
export declare class MemoryCache implements Cache {
private name;
private store;
private options;
constructor(name: string, options?: Partial<LRU.Options<any, any>>);
start(): Promise<void>;
stop(): Promise<void>;
getName(): string;
getNativeCache(): this;
get<T>(key: string): Promise<T | null | undefined>;
put(key: string, value: any): Promise<void>;
putIfAbsent<T>(key: string, value: T | null | undefined): Promise<T | null | undefined>;
evict(key: string): Promise<void>;
clear(): Promise<void>;
}