export declare type MemoizedFunction = ((...args: any) => any) & { cache: Map; }; export declare type Memoize = ( any>(func: T, resolver?: (...args: Parameters) => any) => MemoizedFunction) & { Cache: MapConstructor; LIMIT: number; }; /** * @warn 虽然缓存函数确实可以提升性能,但是过度优化的案例也不再少数,这里只做提供。什么情况下使用需要自行判断. * @param {Function} fn 需要缓存的函数 * @param {Function} resolver 自定义MapKey的获取方式. * @returns {MemoizedFunction} 返回传入函数的缓存版本 */ declare const memoize: Memoize; export default memoize;