Marmot-TS
    Preparing search index...

    Interface GenericKeyValueStore<T>

    A generic interface for a key-value store

    interface GenericKeyValueStore<T> {
        clear(): Promise<void>;
        getItem(key: string): Promise<T | null>;
        keys(): Promise<string[]>;
        removeItem(key: string): Promise<void>;
        setItem(key: string, value: T): Promise<T>;
    }

    Type Parameters

    • T

    Hierarchy (View Summary)

    Implemented by

    Index
    • Clear all items from the store

      Returns Promise<void>

    • Get an item from the store

      Parameters

      • key: string

      Returns Promise<T | null>

    • Get all keys in the store

      Returns Promise<string[]>

    • Remove an item from the store

      Parameters

      • key: string

      Returns Promise<void>

    • Set an item in the store

      Parameters

      • key: string
      • value: T

      Returns Promise<T>