export type TargetFun = (...args: any[]) => V export type DisposeFun = (value: V) => void export interface BaseCacheMap { delete(key: K): boolean; get(key: K): V | undefined; has(key: K): boolean; set(key: K, value: V): this; clear?(): void; addRef?(key: K): void; deleteRef?(key: K): boolean; } export interface CacheMap extends BaseCacheMap { clear(): void; } export type MemoizeCache = BaseCacheMap export interface MemoizeOptions { /** Generates a unique value based on the current parameter */ normalizer?: (args: any[]) => string; /** using weakMap */ weak?: boolean; /** use LFU cache */ LFU?: boolean; /** Timeout duration, expired delete */ maxAge?: number; /** How much data can be saved at most? Use LRU */ max?: number; /** manage the cache manually */ manual?: boolean; /** Reference count */ refCounter?: boolean; /** Called right before an item is evicted from the cache */ dispose?: DisposeFun; /** Provide shutdown cache */ closeable?: boolean } export interface ResultFun extends Function { delete?(key: string | object): boolean; get?(key: string | object): V | undefined; has?(key: string | object): boolean; set?(key: string | object, value: V): this; clear?(): void; addRef?(): void; deleteRef?(): void handleCacheClose(): void handleCacheOpen(): void }