The NativeStorage API provides a key-value store for simple data.
Note: this API is not meant for high-performance data storage applications. Take a look at using SQLite API or a separate data engine if your application will store a lot of items, have high read/write load, or require complex querying.
set(reference: string, value: any): Promise <any>
remove(reference: string): Promise <any>
Removes a single stored item.
getBoolean(reference: string): Promise <any>
Gets a stored boolean.
putBoolean(reference: string, value: boolean): Promise <any>
Stores a boolean.
getInt(reference: string): Promise <any>
Gets a stored int.
putInt(reference: string, value: int): Promise <any>
Stores an int.
getDouble(reference: string): Promise <any>
Gets a stored double.
putDouble(reference: string, value: double): Promise <any>
Stores a double.
getString(reference: string): Promise <any>
Gets a stored string.
putString(reference: string, value: string): Promise <any>
Stores a string.
getObject(reference: string): Promise <any>
Gets a stored object.
putObject(reference: string, value: object): Promise <any>
Stores an object.
getItem(reference: string): Promise <any>
Gets a stored item.
setItem(reference: string, value: any): Promise <any>
Stores a value.
NativeStorageError { code: int; // One of NativeStorageErrorCode source: string; //"Native"|"JS" exception: string; // error description }
enum NativeStorageErrorCode{ NATIVE_WRITE_FAILED: 1, ITEM_NOT_FOUND: 2, NULL_REFERENCE: 3, UNDEFINED_TYPE: 4, JSON_ERROR: 5, WRONG_PARAMETER: 6 }