Set of methods to operate eitri-app data storage

Notes:

Storage data is not shared between different eitri-apps. Data is transmitted as a string and handled with JSON encoding/decoding. Pay attention to the size of the data to avoid affecting the experience.

Hierarchy

  • Storage

Methods

  • Clears all data created by the respective eitri-app from storage

    Note:

    This method does not clear other data saved by other eitri-apps

    Example:

    await Eitri.storage.clear()
    

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Returns Promise<void>

  • Retrieves a stored string from the eitri-app storage

    Example:

    const storedValue = await Eitri.storage.getItem('myData')
    

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Parameters

    • key: string

      Registration key

    Returns Promise<string>

  • Retrieves a stored Object from the eitri-app storage

    Example:

    const myObject = await Eitri.storage.getItemJson('myData')
    

    Parameters

    Returns Promise<any>

  • Retrieves all registration keys stored by the respective eitri-app from storage

    Example:

    const myKeys = await Eitri.storage.keys()
    

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Returns Promise<string[]>

  • Deletes the data associated with the specified key from the eitri-app storage

    Example:

    await Eitri.storage.removeItem('myData')
    

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Parameters

    • key: string

      Registration key

    Returns Promise<void>

  • Stores a string in the eitri-app storage

    Example:

    await Eitri.storage.setItem('myDataKey', "myData")
    

    Parameters

    • key: string

      Key for registration

    • value: string

      Value to be saved

      Compatibility Control

      • API LEVEL 1 - Functionality added

    Returns Promise<void>

  • Stores an Object in the eitri-app storage

    Example:

    let myObject = {myData: 'valueOfMyData'}
    await Eitri.storage.setItemJson('myData', myObject)

    Parameters

    • key: string

      Key for registration

    • value: any

      JSON object to be saved

      Compatibility Control

      • API LEVEL 1 - Functionality added

    Returns Promise<void>

Generated using TypeDoc