Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
79292a27
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看板
未验证
提交
79292a27
编写于
8月 29, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 29, 2023
浏览文件
操作
浏览文件
下载
差异文件
!23316 导入模块修正
Merge pull request !23316 from zengyawen/master
上级
e2784a7f
79fee6f1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
61 addition
and
8 deletion
+61
-8
zh-cn/application-dev/reference/apis/js-apis-app-ability-MediaControlExtensionAbility.md
.../apis/js-apis-app-ability-MediaControlExtensionAbility.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-file-picker.md
zh-cn/application-dev/reference/apis/js-apis-file-picker.md
+36
-1
zh-cn/application-dev/reference/apis/js-apis-system-parameter.md
...pplication-dev/reference/apis/js-apis-system-parameter.md
+11
-3
zh-cn/application-dev/reference/apis/js-apis-system-parameterEnhance.md
...ion-dev/reference/apis/js-apis-system-parameterEnhance.md
+13
-3
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-app-ability-MediaControlExtensionAbility.md
浏览文件 @
79292a27
...
...
@@ -13,5 +13,5 @@ MediaControlExtensionAbility模块提供播放控制的扩展能力,继承自[
## 导入模块
```
js
import
MediaControlExtensionAbility
from
@
ohos
.
app
.
ability
.
MediaControlExtensionAbility
;
import
MediaControlExtensionAbility
from
'
@ohos.app.ability.MediaControlExtensionAbility
'
;
```
zh-cn/application-dev/reference/apis/js-apis-file-picker.md
浏览文件 @
79292a27
...
...
@@ -10,7 +10,6 @@
```
ts
import
picker
from
'
@ohos.file.picker
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
```
## PhotoViewPicker
...
...
@@ -48,6 +47,8 @@ select(option?: PhotoSelectOptions) : Promise<PhotoSelectResult>
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
async
example01
()
{
try
{
let
PhotoSelectOptions
=
new
picker
.
PhotoSelectOptions
();
...
...
@@ -83,6 +84,8 @@ select(option: PhotoSelectOptions, callback: AsyncCallback<PhotoSelectResult&
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
async
example02
()
{
try
{
let
PhotoSelectOptions
=
new
picker
.
PhotoSelectOptions
();
...
...
@@ -119,6 +122,8 @@ select(callback: AsyncCallback<PhotoSelectResult>) : void
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
async
example03
()
{
try
{
let
photoPicker
=
new
picker
.
PhotoViewPicker
();
...
...
@@ -158,6 +163,8 @@ save(option?: PhotoSaveOptions) : Promise<Array<string>>
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
async
example04
()
{
try
{
let
PhotoSaveOptions
=
new
picker
.
PhotoSaveOptions
();
...
...
@@ -192,6 +199,8 @@ save(option: PhotoSaveOptions, callback: AsyncCallback<Array<string>>
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
async
example05
()
{
try
{
let
PhotoSaveOptions
=
new
picker
.
PhotoSaveOptions
();
...
...
@@ -227,6 +236,8 @@ save(callback: AsyncCallback<Array<string>>) : void
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
async
example06
()
{
try
{
let
photoPicker
=
new
picker
.
PhotoViewPicker
();
...
...
@@ -278,6 +289,8 @@ select(option?: DocumentSelectOptions) : Promise<Array<string>>
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
async
example07
()
{
try
{
let
DocumentSelectOptions
=
new
picker
.
DocumentSelectOptions
();
...
...
@@ -311,6 +324,8 @@ select(option: DocumentSelectOptions, callback: AsyncCallback<Array<string
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
async
example08
()
{
try
{
let
DocumentSelectOptions
=
new
picker
.
DocumentSelectOptions
();
...
...
@@ -345,6 +360,8 @@ select(callback: AsyncCallback<Array<string>>) : void
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
async
example09
()
{
try
{
let
documentPicker
=
new
picker
.
DocumentViewPicker
();
...
...
@@ -385,6 +402,8 @@ save(option?: DocumentSaveOptions) : Promise<Array<string>>
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
async
example10
()
{
try
{
let
DocumentSaveOptions
=
new
picker
.
DocumentSaveOptions
();
...
...
@@ -419,6 +438,8 @@ save(option: DocumentSaveOptions, callback: AsyncCallback<Array<string>
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
async
example11
()
{
try
{
let
DocumentSaveOptions
=
new
picker
.
DocumentSaveOptions
();
...
...
@@ -454,6 +475,8 @@ save(callback: AsyncCallback<Array<string>>) : void
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
async
example12
()
{
try
{
let
documentPicker
=
new
picker
.
DocumentViewPicker
();
...
...
@@ -505,6 +528,8 @@ select(option?: AudioSelectOptions) : Promise<Array<string>>
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
async
example13
()
{
try
{
let
AudioSelectOptions
=
new
picker
.
AudioSelectOptions
();
...
...
@@ -538,6 +563,8 @@ select(option: AudioSelectOptions, callback: AsyncCallback<Array<string>
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
async
example14
()
{
try
{
let
AudioSelectOptions
=
new
picker
.
AudioSelectOptions
();
...
...
@@ -572,6 +599,8 @@ select(callback: AsyncCallback<Array<string>>) : void
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
async
example15
()
{
try
{
let
audioPicker
=
new
picker
.
AudioViewPicker
();
...
...
@@ -611,6 +640,8 @@ save(option?: AudioSaveOptions) : Promise<Array<string>>
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
async
example16
()
{
try
{
let
AudioSaveOptions
=
new
picker
.
AudioSaveOptions
();
...
...
@@ -645,6 +676,8 @@ save(option: AudioSaveOptions, callback: AsyncCallback<Array<string>>
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
async
example17
()
{
try
{
let
AudioSaveOptions
=
new
picker
.
AudioSaveOptions
();
...
...
@@ -680,6 +713,8 @@ save(callback: AsyncCallback<Array<string>>) : void
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
async
example18
()
{
try
{
let
audioPicker
=
new
picker
.
AudioViewPicker
();
...
...
zh-cn/application-dev/reference/apis/js-apis-system-parameter.md
浏览文件 @
79292a27
# @ohos.systemParameter (系统属性)
系统参数(SystemParameter)是为各系统服务提供的简单易用的键值对访问接口,各个系统服务可以定义系统参数来描述该服务的状态信息,或者通过系统参数来改变系统服务的行为。其基本操作原语为get和set,通过get可以查询系统参数的值,通过set可以修改系统参数的值。
详细的系统参数设计原理及定义可参考
[
系统参数
](
../../../device-dev/subsystems/subsys-boot-init-sysparam.md
)
。
详细的系统参数设计原理及定义可参考
[
系统参数
](
../../../device-dev/subsystems/subsys-boot-init-sysparam.md
)
。
> **说明:**
> - 本模块接口从API version 9开始不再维护,建议使用新接口[`@ohos.systemParameterEnhance`](js-apis-system-parameterEnhance.md)替代。
...
...
@@ -15,7 +14,6 @@
```
ts
import
systemparameter
from
'
@ohos.systemparameter
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
```
## systemparameter.getSync<sup>(deprecated)</sup>
...
...
@@ -68,6 +66,8 @@ get(key: string, callback: AsyncCallback<string>): void
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
systemparameter
.
get
(
"
const.ohos.apiversion
"
,
(
err
:
BusinessError
,
data
:
string
)
=>
{
if
(
err
==
undefined
)
{
...
...
@@ -99,6 +99,8 @@ get(key: string, def: string, callback: AsyncCallback<string>): void
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
systemparameter
.
get
(
"
const.ohos.apiversion
"
,
"
default
"
,
(
err
:
BusinessError
,
data
:
string
)
=>
{
if
(
err
==
undefined
)
{
...
...
@@ -136,6 +138,8 @@ get(key: string, def?: string): Promise<string>
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
let
p
=
systemparameter
.
get
(
"
const.ohos.apiversion
"
);
p
.
then
((
value
:
string
)
=>
{
...
...
@@ -201,6 +205,8 @@ set(key: string, value: string, callback: AsyncCallback<void>): void
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
systemparameter
.
set
(
"
test.parameter.key
"
,
"
testValue
"
,
(
err
:
BusinessError
,
data
:
string
)
=>
{
if
(
err
==
undefined
)
{
...
...
@@ -241,6 +247,8 @@ set(key: string, value: string): Promise<void>
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
let
p
=
systemparameter
.
set
(
"
test.parameter.key
"
,
"
testValue
"
);
p
.
then
((
value
:
string
)
=>
{
...
...
zh-cn/application-dev/reference/apis/js-apis-system-parameterEnhance.md
浏览文件 @
79292a27
# @ohos.systemParameterEnhance (系统参数)
系统参数(SystemParameter)是为各系统服务提供的简单易用的键值对访问接口,各个系统服务可以定义系统参数来描述该服务的状态信息,或者通过系统参数来改变系统服务的行为。其基本操作原语为get和set,通过get可以查询系统参数的值,通过set可以修改系统参数的值。
详细的系统参数设计原理及定义可参考
[
系统参数
](
../../../device-dev/subsystems/subsys-boot-init-sysparam.md
)
。
详细的系统参数设计原理及定义可参考
[
系统参数
](
../../../device-dev/subsystems/subsys-boot-init-sysparam.md
)
。
> **说明:**
>
...
...
@@ -14,7 +13,6 @@
```
ts
import
systemparameter
from
'
@ohos.systemParameterEnhance
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
```
## systemparameter.getSync
...
...
@@ -67,6 +65,8 @@ get(key: string, callback: AsyncCallback<string>): void
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
systemparameter
.
get
(
"
const.ohos.apiversion
"
,
(
err
:
BusinessError
,
data
:
string
)
=>
{
if
(
err
==
undefined
)
{
...
...
@@ -98,6 +98,8 @@ get(key: string, def: string, callback: AsyncCallback<string>): void
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
systemparameter
.
get
(
"
const.ohos.apiversion
"
,
"
default
"
,
(
err
:
BusinessError
,
data
:
string
)
=>
{
if
(
err
==
undefined
)
{
...
...
@@ -135,6 +137,8 @@ get(key: string, def?: string): Promise<string>
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
let
p
=
systemparameter
.
get
(
"
const.ohos.apiversion
"
);
p
.
then
((
value
:
string
)
=>
{
...
...
@@ -165,6 +169,8 @@ setSync(key: string, value: string): void
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
systemparameter
.
setSync
(
"
test.parameter.key
"
,
"
default
"
);
}
catch
(
e
)
{
...
...
@@ -191,6 +197,8 @@ set(key: string, value: string, callback: AsyncCallback<void>): void
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
systemparameter
.
set
(
"
test.parameter.key
"
,
"
testValue
"
,
(
err
:
BusinessError
,
data
:
string
)
=>
{
if
(
err
==
undefined
)
{
...
...
@@ -227,6 +235,8 @@ set(key: string, value: string): Promise<void>
**示例:**
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
let
p
=
systemparameter
.
set
(
"
test.parameter.key
"
,
"
testValue
"
);
p
.
then
((
value
:
string
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录