Interface Cache<T>

Interface defining the standard operations for a cache.

interface Cache {
    capacity(): number;
    count(): number;
    delete(key): void;
    get(key): undefined | T;
    put(key, value, expiry?): void;
}

Type Parameters

  • T

    The type of items that the cache will store.

Implemented by

Methods

  • Parameters

    • key: string

    Returns void

  • Parameters

    • key: string

    Returns undefined | T

  • Parameters

    • key: string
    • value: T
    • Optional expiry: number

    Returns void

Generated using TypeDoc