Class IndexedDB

IndexedDB Store.Driver. This class provides a facade derived from the built-in Storage interface to IDBDatabases within the browser. This class implementing the Store.Driver contract is used as backing storage by the StateWorker, if run in a browser environment.

Implements

Constructors

Properties

Accessors

Methods

Constructors

Properties

name: string

The name to address this instance by.

version: string

The version of this instance.

database: Promise<IDBDatabase>

Private database used as backing storage to read/write key/value pairs.

Accessors

Methods

  • Returns the current value associated with the given key, or null if the given key does not exist.

    Parameters

    • key: string

      The key to retrieve the current value for.

    Returns Promise<null | string>

    A Promise resolving to the current value or null.

  • Returns the name of the nth key, or null if n is greater than or equal to the number of key/value pairs.

    Parameters

    • index: number

      The index of the key to retrieve.

    Returns Promise<null | string>

    A Promise resolving to the name of the key or null.

  • Removes the key/value pair with the given key, if a key/value pair with the given key exists.

    Parameters

    • key: string

      The key to delete the key/value pair by.

    Returns Promise<void>

    A Promise resolving when the key/value pair was removed.

  • Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.

    Parameters

    • key: string

      The key to set the key/value pair by.

    • value: string

      The value to associate with the key.

    Returns Promise<void>

    A Promise resolving when the key/value pair was set.

Generated using TypeDoc