Cache Interface

interface Cache {
    clear(): Promise<void>;
    configure(config): CacheConfig;
    createInstance(config): Cache;
    getAllKeys(): Promise<string[]>;
    getCurrentCacheSize(): Promise<number>;
    getItem(key, options?): Promise<any>;
    removeItem(key): Promise<void>;
    setItem(key, value, options?): Promise<void>;
}

Implemented by

Methods

  • Remove all items from cache

    Returns Promise<void>

  • create a new instance with customized config

    Parameters

    Returns Cache

  • Get all keys form cache

    Returns Promise<string[]>

  • Get current size of the cache

    Returns Promise<number>

  • Get item from cache

    Parameters

    Returns Promise<any>

  • Remove item from cache

    Parameters

    • key: string

    Returns Promise<void>

  • Put item into cache

    Parameters

    Returns Promise<void>