TS-Scribe - v1.2.0
    Preparing search index...

    Type Alias MemoizedFunction<Args, ReturnType>

    A memoized function with additional cache management methods.

    type MemoizedFunction<Args extends unknown[], ReturnType> = {
        clear: () => void;
        delete: (...args: Args) => boolean;
        has: (...args: Args) => boolean;
        size: () => number;
        stats?: () => CacheStats;
        (...args: Args): ReturnType;
    }

    Type Parameters

    • Args extends unknown[]
    • ReturnType
    Index

    Properties

    clear: () => void

    Clears all cached results.

    delete: (...args: Args) => boolean

    Deletes a specific cache entry by key.

    Type Declaration

      • (...args: Args): boolean
      • Parameters

        • ...args: Args

          The arguments used to generate the cache key.

        Returns boolean

        true if an entry was deleted, false otherwise.

    has: (...args: Args) => boolean

    Checks if a cache entry exists for the given arguments.

    Type Declaration

      • (...args: Args): boolean
      • Parameters

        • ...args: Args

          The arguments to check.

        Returns boolean

        true if a cache entry exists, false otherwise.

    size: () => number

    Returns the current size of the cache.

    stats?: () => CacheStats

    Returns cache statistics if enabled.

    Type Declaration