Storage Class

A local disk-based cache for key value pairs for NativeApps.

@note This should be used only for local caching, since its not guaranteed to exist permanently.

Methods

Name Description
constructor(id: string): Storage    
getData(key: string): Promise<StorageValue> Get the value for a key  
getKeys(): Promise<string[]> Return an array of all keys in this Storage.  
getValueType(key: string): Promise<undefined | "string" | "number" | "boolean" | "Uint8Array" | "null"> get the type of a value for a key, or undefined if not present.  
removeAll(): Promise<void> Remove all keys and their data.  
removeData(key: string): Promise<void> Remove a key and its data.  
setData(key: string, value: StorageValue): Promise<void> Set value for a key  

Properties

Name Type Description
id Readonly string    

Defined in

Last Updated: 21 November, 2024