@aigens/aigens-sdk-preferences
v5.0.0
Published
Aigens SDK preferences
Readme
aigens-sdk-preferences
Aigens SDK Preferences
Install
npm install @aigens/aigens-sdk-preferences
npx cap syncAPI
get(...)set(...)remove(...)clear()saveImmediately()setIsAutoSaveNormal(...)setIsAutoSaveMember(...)enableUserDefault(...)keys()log(...)hasStoragePermission(...)deleteLog(...)isElectronUniversalApp()isNativeUniversalApp()generatePath(...)electronClearNavigationHistory()electronLoadURL(...)- 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>
log(...)
log(options: { log: string; logDirName?: string | string[]; toTop?: boolean; }) => Promise<{ result: number; message?: string; }>| Param | Type |
| ------------- | ------------------------------------------------------------------------------- |
| options | { log: string; logDirName?: string | string[]; toTop?: boolean; } |
Returns: Promise<{ result: number; message?: string; }>
hasStoragePermission(...)
hasStoragePermission(options?: { logDirName?: string | string[] | undefined; } | undefined) => Promise<{ result: boolean; }>| Param | Type |
| ------------- | ------------------------------------------------- |
| options | { logDirName?: string | string[]; } |
Returns: Promise<{ result: boolean; }>
deleteLog(...)
deleteLog(options?: { keepMonths?: number | undefined; logDirName?: string | string[] | undefined; } | undefined) => Promise<void>| Param | Type |
| ------------- | ---------------------------------------------------------------------- |
| options | { keepMonths?: number; logDirName?: string | string[]; } |
isElectronUniversalApp()
isElectronUniversalApp() => Promise<{ result: boolean; }>Returns: Promise<{ result: boolean; }>
isNativeUniversalApp()
isNativeUniversalApp() => Promise<{ result: boolean; }>Returns: Promise<{ result: boolean; }>
generatePath(...)
generatePath(options: { path: string[]; }) => Promise<{ result: string; }>| Param | Type |
| ------------- | -------------------------------- |
| options | { path: string[]; } |
Returns: Promise<{ result: string; }>
electronClearNavigationHistory()
electronClearNavigationHistory() => Promise<any>Returns: Promise<any>
electronLoadURL(...)
electronLoadURL(options: { url: string; }) => Promise<any>| Param | Type |
| ------------- | ----------------------------- |
| options | { url: string; } |
Returns: Promise<any>
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 |
