zibri
    Preparing search index...

    Interface for an cache store.

    interface CacheStoreInterface<K, V> {
        clear: () => void | Promise<void>;
        config: CacheStoreConfig;
        delete: (key: K) => void | Promise<void>;
        get: (
            key: K,
        ) => CachedValue<V> | Promise<CachedValue<V> | undefined> | undefined;
        invalidateTags: (tags: string[]) => void | Promise<void>;
        set: (key: K, value: CachedValue<V>) => void | Promise<void>;
        size: () => number | Promise<number>;
    }

    Type Parameters

    • K
    • V

    Implemented by

    Index

    Properties

    clear: () => void | Promise<void>

    Completely clears all values from the cache.

    The configuration for the store.

    delete: (key: K) => void | Promise<void>

    Deletes the cached value stored under the given key.

    get: (
        key: K,
    ) => CachedValue<V> | Promise<CachedValue<V> | undefined> | undefined

    Gets the cached value stored under the given key.

    invalidateTags: (tags: string[]) => void | Promise<void>

    Invalidates all cached values that have one of the given tags.

    set: (key: K, value: CachedValue<V>) => void | Promise<void>

    Stores a new cached value under the given key.

    size: () => number | Promise<number>

    The number of elements in the store.