!14332 preferences sync api

Merge pull request !14332 from 李芮/preferences_js_sdk
This commit is contained in:
openharmony_ci 2024-10-31 04:39:36 +00:00 committed by Gitee
commit 8f09b38c5c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 21 additions and 0 deletions

View File

@ -1706,6 +1706,17 @@ declare namespace preferences {
*/
flush(): Promise<void>;
/**
* Asynchronously saves the {@link Preferences} object to the file.
*
* @throws { BusinessError } 15500000 - Inner error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 14
*/
flushSync(): void;
/**
* Registers an observer to listen for the change of a {@link Preferences} object.
*

View File

@ -409,6 +409,16 @@ declare namespace sendablePreferences {
*/
flush(): Promise<void>;
/**
* Flushes the {@link Preferences} object to the file.
*
* @throws { BusinessError } 15500000 - Inner error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @atomicservice
* @since 14
*/
flushSync(): void;
/**
* Registers an observer to listen for the change of a {@link Preferences} object.
*