Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
8acd07f1
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8acd07f1
编写于
4月 24, 2022
作者:
A
aqxyjay
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add code type for md codes
Signed-off-by:
N
aqxyjay
<
zhangchunxin@huawei.com
>
上级
1375c6b9
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
28 addition
and
28 deletion
+28
-28
zh-cn/application-dev/reference/apis/js-apis-battery-info.md
zh-cn/application-dev/reference/apis/js-apis-battery-info.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-brightness.md
zh-cn/application-dev/reference/apis/js-apis-brightness.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-power.md
zh-cn/application-dev/reference/apis/js-apis-power.md
+5
-5
zh-cn/application-dev/reference/apis/js-apis-screen-lock.md
zh-cn/application-dev/reference/apis/js-apis-screen-lock.md
+7
-7
zh-cn/application-dev/reference/apis/js-apis-system-battery.md
.../application-dev/reference/apis/js-apis-system-battery.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-system-brightness.md
...plication-dev/reference/apis/js-apis-system-brightness.md
+6
-6
zh-cn/application-dev/reference/apis/js-apis-thermal.md
zh-cn/application-dev/reference/apis/js-apis-thermal.md
+4
-4
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-battery-info.md
浏览文件 @
8acd07f1
...
...
@@ -8,7 +8,7 @@
## 导入模块
```
```
js
import
batteryInfo
from
'
@ohos.batteryInfo
'
;
```
...
...
@@ -32,7 +32,7 @@ SystemCapability.PowerManager.BatteryManager.Core
| isBatteryPresent
<sup>
7+
</sup>
| boolean | 是 | 否 | 表示当前设备是否支持电池或者电池是否在位。 |
-
示例:
```
```
js
import
batteryInfo
from
'
@ohos.batteryInfo
'
;
var
batterySoc
=
batteryInfo
.
batterySOC
;
```
...
...
zh-cn/application-dev/reference/apis/js-apis-brightness.md
浏览文件 @
8acd07f1
...
...
@@ -8,7 +8,7 @@
## 导入模块
```
```
js
import
brightness
from
'
@ohos.brightness
'
;
```
...
...
@@ -30,6 +30,6 @@ setValue(value: number): void
**示例:**
```
```
js
brightness
.
setValue
(
128
);
```
zh-cn/application-dev/reference/apis/js-apis-power.md
浏览文件 @
8acd07f1
...
...
@@ -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
);
...
...
zh-cn/application-dev/reference/apis/js-apis-screen-lock.md
浏览文件 @
8acd07f1
...
...
@@ -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
)
=>
{
...
...
zh-cn/application-dev/reference/apis/js-apis-system-battery.md
浏览文件 @
8acd07f1
...
...
@@ -9,7 +9,7 @@
## 导入模块
```
```
js
import
battery
from
'
@system.battery
'
;
```
...
...
@@ -39,7 +39,7 @@ success返回值:
**示例:**
```
```
js
export
default
{
getStatus
()
{
battery
.
getStatus
({
...
...
zh-cn/application-dev/reference/apis/js-apis-system-brightness.md
浏览文件 @
8acd07f1
...
...
@@ -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
({
...
...
zh-cn/application-dev/reference/apis/js-apis-thermal.md
浏览文件 @
8acd07f1
...
...
@@ -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>): 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
);
```
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录