@squareboat/nest-cache
Version:
The cache package for your NestJS Applications
14 lines (13 loc) • 601 B
TypeScript
import { CacheDriver, InMemoryDriverOption } from "../interfaces";
export declare class InMemoryDriver implements CacheDriver {
private options;
private client;
constructor(options: InMemoryDriverOption);
get<T>(key: string): Promise<T>;
set(key: string, value: string | Record<string, any>, ttlInSec?: number | undefined): Promise<void>;
has(key: string): Promise<boolean>;
remember<T>(key: string, cb: Function, ttlInSec: number): Promise<T>;
rememberForever<T>(key: string, cb: Function): Promise<T>;
forget(key: string): Promise<void>;
getClient<T>(): T;
}