UNPKG

492 BTypeScriptView Raw
1import { MemoCache } from '@naturalcycles/js-lib';
2import LRUCache = require('lru-cache');
3export declare type LRUMemoCacheOpts = LRUCache.Options<string, any>;
4/**
5 * @example
6 * Use it like this:
7 *
8 * @_Memo({ cacheFactory: () => new LRUMemoCache({...}) })
9 * method1 ()
10 */
11export declare class LRUMemoCache implements MemoCache {
12 constructor(opt: LRUMemoCacheOpts);
13 private lru;
14 has(k: any): boolean;
15 get(k: any): any;
16 set(k: any, v: any): void;
17 clear(): void;
18}