From 8acd07f1c8825bd7e70a698d6c5f18aa3b9b1aa6 Mon Sep 17 00:00:00 2001 From: aqxyjay Date: Sun, 24 Apr 2022 17:33:19 +0800 Subject: [PATCH] add code type for md codes Signed-off-by: aqxyjay --- .../reference/apis/js-apis-battery-info.md | 4 ++-- .../reference/apis/js-apis-brightness.md | 4 ++-- .../reference/apis/js-apis-power.md | 10 +++++----- .../reference/apis/js-apis-screen-lock.md | 14 +++++++------- .../reference/apis/js-apis-system-battery.md | 4 ++-- .../reference/apis/js-apis-system-brightness.md | 12 ++++++------ .../reference/apis/js-apis-thermal.md | 8 ++++---- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-battery-info.md b/zh-cn/application-dev/reference/apis/js-apis-battery-info.md index d627fed783..897ae78e35 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-battery-info.md +++ b/zh-cn/application-dev/reference/apis/js-apis-battery-info.md @@ -8,7 +8,7 @@ ## 导入模块 -``` +```js import batteryInfo from '@ohos.batteryInfo'; ``` @@ -32,7 +32,7 @@ SystemCapability.PowerManager.BatteryManager.Core | isBatteryPresent7+ | boolean | 是 | 否 | 表示当前设备是否支持电池或者电池是否在位。 | - 示例: - ``` + ```js import batteryInfo from '@ohos.batteryInfo'; var batterySoc = batteryInfo.batterySOC; ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-brightness.md b/zh-cn/application-dev/reference/apis/js-apis-brightness.md index bf0de9a4bb..17676f2c3a 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-brightness.md +++ b/zh-cn/application-dev/reference/apis/js-apis-brightness.md @@ -8,7 +8,7 @@ ## 导入模块 -``` +```js import brightness from '@ohos.brightness'; ``` @@ -30,6 +30,6 @@ setValue(value: number): void **示例:** -``` +```js brightness.setValue(128); ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-power.md b/zh-cn/application-dev/reference/apis/js-apis-power.md index d1223b75c2..33c658da30 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-power.md +++ b/zh-cn/application-dev/reference/apis/js-apis-power.md @@ -8,7 +8,7 @@ ## 导入模块 -``` +```js import power from '@ohos.power'; ``` @@ -35,7 +35,7 @@ shutdownDevice(reason: string): void **示例:** -``` +```js power.shutdownDevice("shutdown_test"); console.info('power_shutdown_device_test success') ``` @@ -57,7 +57,7 @@ rebootDevice(reason: string): void **示例:** -``` +```js power.rebootDevice("reboot_test"); console.info('power_reboot_device_test success') ``` @@ -77,7 +77,7 @@ isScreenOn(callback: AsyncCallback<boolean>): void **示例:** -``` +```js power.isScreenOn((error, screenOn) => { if (typeof error === "undefined") { console.info('screenOn status is ' + screenOn); @@ -101,7 +101,7 @@ isScreenOn(): Promise<boolean> **示例:** -``` +```js power.isScreenOn() .then(screenOn => { console.info('screenOn status is ' + screenOn); diff --git a/zh-cn/application-dev/reference/apis/js-apis-screen-lock.md b/zh-cn/application-dev/reference/apis/js-apis-screen-lock.md index ccb5244b06..09b8a7a4c4 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-screen-lock.md +++ b/zh-cn/application-dev/reference/apis/js-apis-screen-lock.md @@ -7,7 +7,7 @@ ## 导入模块 -``` +```js import screenlock from '@ohos.screenLock'; ``` @@ -27,7 +27,7 @@ isScreenLocked(callback: AsyncCallback<boolean>): void - 示例: - ``` + ```js screenlock.isScreenLocked((err, data)=>{ if (err) { console.error('isScreenLocked callback error -> ${JSON.stringify(err)}'); @@ -53,7 +53,7 @@ isScreenLocked(): Promise<boolean> - 示例: - ``` + ```js screenlock.isScreenLocked().then((data) => { console.log('isScreenLocked success: data -> ${JSON.stringify(data)}'); }).catch((err) => { @@ -80,7 +80,7 @@ isSecureMode(callback: AsyncCallback<boolean>): void - 示例: - ``` + ```js screenlock.isSecureMode((err, data)=>{ if (err) { console.error('isSecureMode callback error -> ${JSON.stringify(err)}'); @@ -106,7 +106,7 @@ isSecureMode(): Promise<boolean> - 示例: - ``` + ```js screenlock.isSecureMode().then((data) => { console.log('isSecureMode success: data->${JSON.stringify(data)}'); }).catch((err) => { @@ -133,7 +133,7 @@ unlockScreen(callback: AsyncCallback<void>): void - 示例: - ``` + ```js screenlock.unlockScreen((err)=>{ if (err) { console.error('unlockScreen callback error -> ${JSON.stringify(err)}'); @@ -159,7 +159,7 @@ unlockScreen(): Promise<void> - 示例: - ``` + ```js screenlock.unlockScreen().then(() => { console.log('unlockScreen success'); }).catch((err) => { diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-battery.md b/zh-cn/application-dev/reference/apis/js-apis-system-battery.md index 2f9e575a01..3a52e07121 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-system-battery.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-battery.md @@ -9,7 +9,7 @@ ## 导入模块 -``` +```js import battery from '@system.battery'; ``` @@ -39,7 +39,7 @@ success返回值: **示例:** -``` +```js export default { getStatus() { battery.getStatus({ diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-brightness.md b/zh-cn/application-dev/reference/apis/js-apis-system-brightness.md index b8e3a07ba1..aa52115fe4 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-system-brightness.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-brightness.md @@ -9,7 +9,7 @@ ## 导入模块 -``` +```js import brightness from '@system.brightness'; ``` @@ -37,7 +37,7 @@ success返回值: **示例:** - ``` + ```js export default { getValue() { brightness.getValue({ @@ -71,7 +71,7 @@ setValue(Object): void **示例:** - ``` + ```js export default { setValue() { brightness.setValue({ @@ -111,7 +111,7 @@ getMode(Object): void **示例:** - ``` + ```js export default { getMode() { brightness.getMode({ @@ -145,7 +145,7 @@ setMode(Object): void **示例:** - ``` + ```js export default { setMode() { brightness.setMode({ @@ -180,7 +180,7 @@ setKeepScreenOn(Object): void **示例:** - ``` + ```js export default { setKeepScreenOn() { brightness.setKeepScreenOn({ diff --git a/zh-cn/application-dev/reference/apis/js-apis-thermal.md b/zh-cn/application-dev/reference/apis/js-apis-thermal.md index a351b62f90..b79cd24da0 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-thermal.md +++ b/zh-cn/application-dev/reference/apis/js-apis-thermal.md @@ -8,7 +8,7 @@ ## 导入模块 -``` +```js import thermal from '@ohos.thermal'; ``` @@ -46,7 +46,7 @@ subscribeThermalLevel(callback: AsyncCallback<ThermalLevel>): void **示例:** -``` +```js var lev = 0; thermal.subscribeThermalLevel((lev) => { console.info("Thermal level is: " + lev); @@ -69,7 +69,7 @@ unsubscribeThermalLevel(callback?: AsyncCallback\): void **示例:** -``` +```js thermal.unsubscribeThermalLevel(() => { console.info("Unsubscribe completed."); }); @@ -91,7 +91,7 @@ getThermalLevel(): ThermalLevel **示例:** -``` +```js var lev = thermal.getThermalLevel(); console.info("Thermal level is: " + lev); ``` -- GitLab