Interface for a storage adapter, allowing for various implementations such as localStorage, sessionStorage, or custom storage mechanisms.

interface ESPRMStorageAdapterInterface {
    clear(): Promise<void>;
    getItem(name: string): Promise<null | string>;
    removeItem(name: string): Promise<void>;
    setItem(name: string, value: string): Promise<void>;
}

Implemented by

Methods

  • Clears all stored values.

    Returns Promise<void>

    A promise that resolves when all values are cleared.

  • Retrieves a stored value by its name.

    Parameters

    • name: string

      The key associated with the value to retrieve.

    Returns Promise<null | string>

    A promise that resolves with the retrieved value, or null if not found.

  • Removes the stored value associated with the specified name.

    Parameters

    • name: string

      The key of the value to remove.

    Returns Promise<void>

    A promise that resolves when the value is removed.

  • Stores a value under the specified name.

    Parameters

    • name: string

      The key under which the value will be stored.

    • value: string

      The value to store.

    Returns Promise<void>

    A promise that resolves when the value is stored.