@shopify/cli-kit
    Preparing search index...

    Class LocalStorage<T>

    A wrapper around the conf package that provides a strongly-typed interface for accessing the local storage.

    Type Parameters

    • T extends Record<string, any>
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Delete a value from the local storage.

      Type Parameters

      • TKey extends string | number | symbol

      Parameters

      • key: TKey

        The key to delete.

      Returns void

      AbortError if a permission error occurs.

      BugError if an unexpected error occurs.

    • Get a value from the local storage.

      Type Parameters

      • TKey extends string | number | symbol

      Parameters

      • key: TKey

        The key to get.

      Returns T[TKey] | undefined

      The value.

      AbortError if a permission error occurs.

      BugError if an unexpected error occurs.

    • Set a value in the local storage.

      Type Parameters

      • TKey extends string | number | symbol

      Parameters

      • key: TKey

        The key to set.

      • Optionalvalue: T[TKey]

        The value to set.

      Returns void

      AbortError if a permission error occurs.

      BugError if an unexpected error occurs.