From 303a5ff86d536a457da5df8ced812df24127a147 Mon Sep 17 00:00:00 2001 From: lvxiaoqiang Date: Tue, 26 Apr 2022 20:03:52 +0800 Subject: [PATCH] add code type Signed-off-by: lvxiaoqiang --- en/application-dev/reference/apis/js-apis-settings.md | 8 ++++---- zh-cn/application-dev/reference/apis/js-apis-settings.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-settings.md b/en/application-dev/reference/apis/js-apis-settings.md index 82ae2c2f0c..9b56d25f9f 100644 --- a/en/application-dev/reference/apis/js-apis-settings.md +++ b/en/application-dev/reference/apis/js-apis-settings.md @@ -9,7 +9,7 @@ This module provides APIs for setting data items. ## Modules to Import -``` +```typescript import settings from '@ohos.settings'; ``` @@ -34,7 +34,7 @@ Obtains the URI of a data item. | string | URI of the data item.| - Example - ``` + ```typescript // Obtain the URI of a data item. let urivar = settings.getUriSync('settings.screen.brightness'); ``` @@ -61,7 +61,7 @@ Obtains the value of a data item. | string | Value of the data item.| - Example - ``` + ```typescript import featureAbility from '@ohos.featureAbility'; // Obtain the value of 'settings.screen.brightness' (this data item already exists in the database). @@ -96,7 +96,7 @@ If the specified data item exists in the database, the **setValueSync** method u | boolean | Result indicating whether the value is set successfully. Returns **true** if the value is set successfully; returns **false** otherwise.| - Example - ``` + ```typescript import featureAbility from '@ohos.featureAbility'; // Update the value of 'settings.screen.brightness'. (As this data item exists in the database, the setValueSync diff --git a/zh-cn/application-dev/reference/apis/js-apis-settings.md b/zh-cn/application-dev/reference/apis/js-apis-settings.md index 20e0739395..80f832bab5 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-settings.md +++ b/zh-cn/application-dev/reference/apis/js-apis-settings.md @@ -9,7 +9,7 @@ ## 导入模块 -``` +```typescript import settings from '@ohos.settings'; ``` @@ -34,7 +34,7 @@ getUriSync(name: string): string | string | 数据项的URI。 | - 示例: - ``` + ```typescript // 获取数据项的URI let urivar = settings.getUriSync('settings.screen.brightness'); ``` @@ -61,7 +61,7 @@ getValueSync(dataAbilityHelper: DataAbilityHelper, name: string, defValue: strin | string | 返回数据项的值。 | - 示例: - ``` + ```typescript import featureAbility from '@ohos.featureAbility'; //获取数据项亮度的值(该数据项在数据库中已存在) @@ -96,7 +96,7 @@ setValueSync(dataAbilityHelper: DataAbilityHelper, name: string, value: string): | boolean | 返回设置数据项的值是否成功的结果。true表示设置成功,false则表示设置失败。 | - 示例: - ``` + ```typescript import featureAbility from '@ohos.featureAbility'; //更新数据项亮度的值(该数据项在数据库中已存在,故setValueSync方法将更新该数据项的值) -- GitLab