/** * Creates a function that memoizes the result of `fn`. * * @example * const expensive = memoize((x: number) => x * 2); * expensive(5); // computes 10 * expensive(5); // returns cached 10 * * @param fn The function to memoize. * @param keyResolver Optional function to compute the cache key from arguments. * @returns The memoized function with a `.cache` property. */ export declare function memoize any>(fn: T, keyResolver?: (...args: Parameters) => string): T & { cache: Map>; };