import type { AnyFn, VoidLike } from "../ts/types.js"; export type Memoized = G & { clear: (...args: Parameters) => VoidLike; }; export interface MemoMap { get: (key: K) => V | undefined; has: (key: K) => boolean; set: (key: K, value: V) => V; delete: (key: K) => boolean; clear: () => void; } /** * Memoizes a function with a custom cache implementation. * * @param {G} generator - The function to memoize. * @param {C} cache - The cache implementation to use (must extend or implement MemoMap). * @returns {O} The memoized function with a `clear` method. */ export declare const withCache: , C extends MemoMap>(generator: G, cache: C) => O; /** * Memoizes a function ignoring its arguments. * * @param {G} generator - The function to memoize. * @returns {O} The memoized function with a `clear` method. */ export declare const memoizeArgless: >(generator: G) => O; /** * Memoizes a function using a ArgsMap for caching. * * @param {G} generator - The function to memoize. * @returns {O} The memoized function with a `clear` method. */ export declare const memoize: >(generator: G) => O; /** * Memoizes a function using deep equality checks for arguments via DequalMap. * Note: Performance depends on the number of cached entries, as DequalMap involves iteration for deep checks. * * @param {G} generator - The function to memoize. * @returns {O} The memoized function with a `clear` method. */ export declare const memoizeDequal: >(generator: G) => O; /** * Memoizes a function using simple caching based on argument presence or JSON stringification. * * @param {G} generator - The function to memoize. * @returns {O} The memoized function with a `clear` method. */ export declare const memoizeStringify: >(generator: G) => O; //# sourceMappingURL=Memo.d.ts.map