Options
All
  • Public
  • Public/Protected
  • All
Menu

Defines local key-value storage operations for JSON objects.

Hierarchy

Implemented by

Index

Methods

addStore

  • addStore(name: string): Promise<any>
  • Add a new store with the given name if it doesn't exist.

    Returns a promise that is fulfilled if the operation succeeded. The promise is rejected if an error occurred.

    Parameters

    • name: string

    Returns Promise<any>

clearValues

  • clearValues(store?: string): Promise<any>
  • Deletes all key-value pairs in the default store or the store specified.

    Returns a promise that is fulfilled if the delete operation succeeded. The promise is rejected if an error occurred.

    Parameters

    • Optional store: string

    Returns Promise<any>

close

  • close(): Promise<any>
  • Closes the local database. By closing, any file locks on the database file are removed. The database is reopened again when operations are invoked after the database has been closed.

    Returns a promise that is fulfilled if the close operation succeeded. The promise is rejected if an error occurred.

    Returns Promise<any>

deleteValue

  • deleteValue(key: string, store?: string): Promise<any>
  • Deletes the key-value pair for the given key in the default store or the store specified.

    Returns a promise that is fulfilled if the delete operation succeeded. The promise is rejected if an error occurred.

    Parameters

    • key: string
    • Optional store: string

    Returns Promise<any>

getValue

  • getValue(key: string, store?: string): Promise<any>
  • Gets the value for the given key in the default store or the store specified.

    Returns a promise that if fulfilled yields the value for the key. If the given key doesn't exist, the promise yields undefined. The promise is rejected if an error occurred.

    Parameters

    • key: string
    • Optional store: string

    Returns Promise<any>

getValues

  • getValues(store?: string): Promise<any>
  • Gets an object with all key-value pairs in the default store or the store specified.

    Returns a promise that if fulfilled yields an object of key-value pairs. The promise is rejected if an error occurred.

    Parameters

    • Optional store: string

    Returns Promise<any>

removeStore

  • removeStore(name: string): Promise<any>
  • Remove a store with the given name if it exists.

    Returns a promise that is fulfilled if the operation succeeded. The promise is rejected if an error occurred.

    Parameters

    • name: string

    Returns Promise<any>

setValue

  • setValue(key: string, value: any, store?: string): Promise<any>
  • Sets the value for the given key in the default store or the store specified.

    You can pass in any JavaScript object that can be represented in JSON format.

    Returns a promise that is fulfilled if the set operation succeeded. The promise is rejected if an error occurred.

    Parameters

    • key: string
    • value: any
    • Optional store: string

    Returns Promise<any>

Generated using TypeDoc