@freedomofpress/webcat
    Preparing search index...

    Class KVStore

    Persistent key-value storage backed by the browser.storage API.

    Implemented by

    Index
    • Clears all values whose key matches the specified prefix.

      Parameters

      • prefix: string = ""

        The prefix to match against.

      • area: "local" | "session" = "local"

        The name of the storage area to use.

      Returns Promise<void>

    • Reads a persisted value.

      Parameters

      • key: string

        The key to read.

      • area: "local" | "session" = "local"

        The name of the storage area to read from.

      Returns Promise<any>

      A Promise that resolves to the value read.

    • Retrieves a list of stored keys matching the specified prefix.

      Parameters

      • prefix: string = ""

        The prefix to match against.

      • area: "local" | "session" = "local"

        The name of the storage area to read from.

      Returns Promise<string[]>

      A Promise that resolves to an array of matching keys.

    • Clears a single persisted value.

      Parameters

      • key: string

        The key to clear.

      • area: "local" | "session" = "local"

        The name of the storage area to use.

      Returns Promise<void>

    • Stores values.

      Parameters

      • items: { [key: string]: unknown }

        An object consisting of one or more key/value pairs to store.

      • area: "local" | "session" = "local"

        The name of the storage area to use.

      Returns Promise<void>