Interface IterableCache<Records, NonEmpty>

IterableCache is a cache that can be iterated over.

Type Parameters

  • Records extends Record<string, Some | null> = Record<string, Some | null>

  • NonEmpty extends boolean = false

Hierarchy

Implemented by

Methods

  • Iterates over all the records in the cache.

    Returns IterableIterator<[keyof Records, NonEmpty extends true
        ? Records[keyof Records]
        : undefined | Records[keyof Records]]>

  • Clears a value from the cache.

    Type Parameters

    • Key extends string | number | symbol

      The type of the record key.

    Parameters

    • key: Key

      The record key.

    Returns void

  • Checks whether the cache has a value for the specified key.

    Type Parameters

    • Key extends string | number | symbol

      The type of the record key.

    Parameters

    • key: Key

      The record key.

    Returns boolean

    Whether the cache has a value for the specified key.

  • Reads a value from the cache.

    Type Parameters

    • Key extends string | number | symbol

      The type of the record key.

    Parameters

    • key: Key

      The record key.

    Returns NonEmpty extends true
        ? Records[Key]
        : undefined | Records[Key]

    The record value or undefined if the record does not exist.

  • Saves a value to the cache.

    Type Parameters

    • Key extends string | number | symbol

      The type of the record key.

    Parameters

    • key: Key

      The record key.

    • value: Records[Key]

      The record value.

    Returns void

Generated using TypeDoc