@aigens/aigens-sdk-preferences
v0.4.2
Published
Aigens SDK preferences
Downloads
150
Readme
aigens-sdk-preferences
Aigens SDK Preferences
Install
npm install @aigens/aigens-sdk-preferences
npx cap sync
API
get(...)
set(...)
remove(...)
clear()
saveImmediately()
setIsAutoSaveNormal(...)
setIsAutoSaveMember(...)
enableUserDefault(...)
keys()
- Interfaces
get(...)
get(options: GetOptions) => Promise<GetResult>
| Param | Type |
| ------------- | ------------------------------------------------- |
| options
| GetOptions |
Returns: Promise<GetResult>
set(...)
set(options: SetOptions) => Promise<void>
| Param | Type |
| ------------- | ------------------------------------------------- |
| options
| SetOptions |
remove(...)
remove(options: RemoveOptions) => Promise<void>
| Param | Type |
| ------------- | ------------------------------------------------------- |
| options
| RemoveOptions |
clear()
clear() => Promise<void>
saveImmediately()
saveImmediately() => Promise<void>
setIsAutoSaveNormal(...)
setIsAutoSaveNormal(options: { isAutoSave: boolean; }) => Promise<void>
| Param | Type |
| ------------- | ------------------------------------- |
| options
| { isAutoSave: boolean; } |
setIsAutoSaveMember(...)
setIsAutoSaveMember(options: { isAutoSave: boolean; }) => Promise<void>
| Param | Type |
| ------------- | ------------------------------------- |
| options
| { isAutoSave: boolean; } |
enableUserDefault(...)
enableUserDefault(options: { enable: boolean; }) => Promise<void>
| Param | Type |
| ------------- | --------------------------------- |
| options
| { enable: boolean; } |
keys()
keys() => Promise<KeysResult>
Returns: Promise<KeysResult>
Interfaces
GetResult
| Prop | Type | Description | Since |
| ----------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ----- |
| value
| string | null | The value from preferences associated with the given key. If a value was not previously set or was removed, value will be null
. | 1.0.0 |
GetOptions
| Prop | Type | Description | Since |
| --------- | ------------------- | ------------------------------------------------- | ----- |
| key
| string | The key whose value to retrieve from preferences. | 1.0.0 |
SetOptions
| Prop | Type | Description | Since |
| ----------- | ------------------- | ------------------------------------------------------------- | ----- |
| key
| string | The key to associate with the value being set in preferences. | 1.0.0 |
| value
| string | The value to set in preferences with the associated key. | 1.0.0 |
RemoveOptions
| Prop | Type | Description | Since |
| --------- | ------------------- | ----------------------------------------------- | ----- |
| key
| string | The key whose value to remove from preferences. | 1.0.0 |
KeysResult
| Prop | Type | Description | Since |
| ---------- | --------------------- | ------------------------------ | ----- |
| keys
| string[] | The known keys in preferences. | 1.0.0 |