Installation
npm install --save @types/memory-cache
Summary
This package contains type definitions for memory-cache (https://github.com/ptarjan/node-cache).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/memory-cache.
export class CacheClass<K, V> {
put(key: K, value: V, time?: number, timeoutCallback?: (key: K, value: V) => void): V;
get(key: K): V | null;
del(key: K): boolean;
clear(): void;
size(): number;
memsize(): number;
debug(bool: boolean): void;
hits(): number;
misses(): number;
keys(): K[];
importJson(json: string, options?: { skipDuplicates?: boolean | undefined }): number;
exportJson(): string;
}
export const Cache: typeof CacheClass;
export function put<V>(key: any, value: V, time?: number, timeoutCallback?: (key: any, value: any) => void): V;
export function get(key: any): any;
export function del(key: any): boolean;
export function clear(): void;
export function size(): number;
export function memsize(): number;
export function debug(bool: boolean): void;
export function hits(): number;
export function misses(): number;
export function keys(): any[];
export function importJson(json: string, options?: { skipDuplicates?: boolean | undefined }): number;
export function exportJson(): string;
Additional Details
- Last updated: Mon, 29 Jul 2024 19:36:25 GMT
- Dependencies: none
Credits
These definitions were written by Travis Thieman.