Represents a key-value store for the CLI

interface ICliKeyValueStore {
    clear(): Promise<void>;
    get<T = any>(key: string): Promise<undefined | T>;
    remove(key: string): Promise<void>;
    set(key: string, value: any): Promise<void>;
}

Methods

  • Clears all key-value pairs from the store.

    Returns Promise<void>

    A promise resolving when the store is cleared.

  • Retrieves a value by key.

    Type Parameters

    • T = any

    Parameters

    • key: string

      The key to retrieve the value for.

    Returns Promise<undefined | T>

    A promise resolving to the value or undefined if not found.

  • Removes a key-value pair by key.

    Parameters

    • key: string

      The key to remove.

    Returns Promise<void>

    A promise resolving when the key is removed.

  • Sets a key-value pair in the store.

    Parameters

    • key: string

      The key to set.

    • value: any

      The value to store.

    Returns Promise<void>

    A promise resolving when the value is stored.