From 71b56eef6eb6a615d19213b5b1ead457355a7c28 Mon Sep 17 00:00:00 2001 From: "ester.zhou" Date: Tue, 5 Sep 2023 16:53:21 +0800 Subject: [PATCH] Update docs (23553) Signed-off-by: ester.zhou --- .../reference/apis/js-apis-settings.md | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-settings.md b/en/application-dev/reference/apis/js-apis-settings.md index 4fa35b6878..57dba8b76f 100644 --- a/en/application-dev/reference/apis/js-apis-settings.md +++ b/en/application-dev/reference/apis/js-apis-settings.md @@ -608,20 +608,6 @@ Sets the value for a data item. This API uses an asynchronous callback to return | value | object | Yes | Value of the data item. The value range varies by service. | | callback | AsyncCallback\ | Yes | Callback used to return the result. Returns **true** if the operation is successful; returns **false** otherwise. | -**Example** - -```js -import featureAbility from '@ohos.ability.featureAbility'; - -// Update the value of SCREEN_BRIGHTNESS_STATUS. (As this data item exists in the database, the setValue API will update its value.) -let uri = settings.getUriSync(settings.display.SCREEN_BRIGHTNESS_STATUS); -let helper = featureAbility.acquireDataAbilityHelper(uri); -//@ts-ignore -// The value of the data item is a string. -settings.setValue(helper, settings.display.SCREEN_BRIGHTNESS_STATUS, '100', (status) => { - console.log('Callback return whether value is set.'); -}); -``` ## settings.setValue(deprecated) @@ -653,21 +639,6 @@ Sets the value for a data item. This API uses a promise to return the result. | ----------------- | -------------------------------------------------- | | Promise\ | Promise used to return the result. Returns **true** if the operation is successful; returns **false** otherwise.| -**Example** - -```js -import featureAbility from '@ohos.ability.featureAbility'; - -// Update the value of SCREEN_BRIGHTNESS_STATUS. (As this data item exists in the database, the setValue API will update its value.) -let uri = settings.getUriSync(settings.display.SCREEN_BRIGHTNESS_STATUS); -let helper = featureAbility.acquireDataAbilityHelper(uri); -//@ts-ignore -// The value of the data item is a string. -settings.setValue(helper, settings.display.SCREEN_BRIGHTNESS_STATUS, '100').then((status) => { - console.log('Callback return whether value is set.'); -}); -``` - ## setting.getValue(deprecated) getValue(dataAbilityHelper: DataAbilityHelper, name: string, callback: AsyncCallback\): void -- GitLab