import type { FnAny } from "@thi.ng/api"; import type { MapLike } from "./api.js"; /** * Function memoization for arbitrary argument counts. Returns augmented * function, which uses the given `Map` implementation to obtain and store * memoized result of given args. Supports generics for up to 4 args (otherwise * untyped). * * @remarks * **Important:** It only makes sense to use `Map` types which support value * (rather than object) equality, e.g. those provided by * [`thi.ng/associative`](https://thi.ng/associative). Using a native `Map` type * here will lead to memory leaks! * * Also see {@link memoizeJ}, {@link memoize1}, {@link memoizeO}. * * @param fn - * @param cache - */ export declare function memoize>(fn: T, cache: MapLike): T; /** * Async version of {@link memoize}. * * @param fn * @param cache */ export declare function memoizeAsync>(fn: T, cache: MapLike): (...xs: Parameters) => Promise>>; //# sourceMappingURL=memoize.d.ts.map