Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
2598f82f
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看板
未验证
提交
2598f82f
编写于
8月 29, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 29, 2023
浏览文件
操作
浏览文件
下载
差异文件
!23312 Rectify the arkts syntax2
Merge pull request !23312 from 189******51/master
上级
df22802c
f040f845
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
90 addition
and
38 deletion
+90
-38
zh-cn/application-dev/reference/apis/js-apis-distributedBundleManager.md
...on-dev/reference/apis/js-apis-distributedBundleManager.md
+29
-13
zh-cn/application-dev/reference/apis/js-apis-installer.md
zh-cn/application-dev/reference/apis/js-apis-installer.md
+35
-17
zh-cn/application-dev/reference/apis/js-apis-launcherBundleManager.md
...ation-dev/reference/apis/js-apis-launcherBundleManager.md
+26
-8
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-distributedBundleManager.md
浏览文件 @
2598f82f
...
...
@@ -69,14 +69,16 @@ try {
bundleName
:
'
com.example.application
'
,
abilityName
:
'
EntryAbility
'
},
(
err
:
BusinessError
,
data
:
distributedBundle
.
RemoteAbilityInfo
)
=>
{
if
(
err
)
{
console
.
log
(
`Operation failed: error code is
${
err
.
code
}
and error message is
${
err
.
message
}
`
);
}
else
{
console
.
info
(
'
Operation succeed:
'
+
JSON
.
stringify
(
data
));
}
if
(
err
)
{
console
.
log
(
`Operation failed: error code is
${
err
.
code
}
and error message is
${
err
.
message
}
`
);
}
else
{
console
.
info
(
'
Operation succeed:
'
+
JSON
.
stringify
(
data
));
}
});
}
catch
(
err
)
{
console
.
log
(
`Operation failed: error code is
${
err
.
code
}
and error message is
${
err
.
message
}
`
);
let
code
=
(
err
as
BusinessError
).
code
;
let
message
=
(
err
as
BusinessError
).
message
;
console
.
log
(
`Operation failed: error code is
${
code
}
and error message is
${
message
}
`
);
}
```
...
...
@@ -133,7 +135,9 @@ try {
console
.
log
(
`Operation failed: error code is
${
err
.
code
}
and error message is
${
err
.
message
}
`
);
});
}
catch
(
err
)
{
console
.
log
(
`Operation failed: error code is
${
err
.
code
}
and error message is
${
err
.
message
}
`
);
let
code
=
(
err
as
BusinessError
).
code
;
let
message
=
(
err
as
BusinessError
).
message
;
console
.
log
(
`Operation failed: error code is
${
code
}
and error message is
${
message
}
`
);
}
```
...
...
@@ -194,7 +198,9 @@ try {
}
});
}
catch
(
err
)
{
console
.
log
(
`Operation failed: error code is
${
err
.
code
}
and error message is
${
err
.
message
}
`
);
let
code
=
(
err
as
BusinessError
).
code
;
let
message
=
(
err
as
BusinessError
).
message
;
console
.
log
(
`Operation failed: error code is
${
code
}
and error message is
${
message
}
`
);
}
```
...
...
@@ -258,7 +264,9 @@ try {
console
.
log
(
`Operation failed: error code is
${
err
.
code
}
and error message is
${
err
.
message
}
`
);
});
}
catch
(
err
)
{
console
.
log
(
`Operation failed: error code is
${
err
.
code
}
and error message is
${
err
.
message
}
`
);
let
code
=
(
err
as
BusinessError
).
code
;
let
message
=
(
err
as
BusinessError
).
message
;
console
.
log
(
`Operation failed: error code is
${
code
}
and error message is
${
message
}
`
);
}
```
...
...
@@ -313,7 +321,9 @@ try {
}
});
}
catch
(
err
)
{
console
.
log
(
`Operation failed: error code is
${
err
.
code
}
and error message is
${
err
.
message
}
`
);
let
code
=
(
err
as
BusinessError
).
code
;
let
message
=
(
err
as
BusinessError
).
message
;
console
.
log
(
`Operation failed: error code is
${
code
}
and error message is
${
message
}
`
);
}
```
...
...
@@ -371,7 +381,9 @@ try {
console
.
log
(
`Operation failed: error code is
${
err
.
code
}
and error message is
${
err
.
message
}
`
);
});
}
catch
(
err
)
{
console
.
log
(
`Operation failed: error code is
${
err
.
code
}
and error message is
${
err
.
message
}
`
);
let
code
=
(
err
as
BusinessError
).
code
;
let
message
=
(
err
as
BusinessError
).
message
;
console
.
log
(
`Operation failed: error code is
${
code
}
and error message is
${
message
}
`
);
}
```
...
...
@@ -433,7 +445,9 @@ try {
}
});
}
catch
(
err
)
{
console
.
log
(
`Operation failed: error code is
${
err
.
code
}
and error message is
${
err
.
message
}
`
);
let
code
=
(
err
as
BusinessError
).
code
;
let
message
=
(
err
as
BusinessError
).
message
;
console
.
log
(
`Operation failed: error code is
${
code
}
and error message is
${
message
}
`
);
}
```
...
...
@@ -498,6 +512,8 @@ try {
console
.
log
(
`Operation failed: error code is
${
err
.
code
}
and error message is
${
err
.
message
}
`
);
});
}
catch
(
err
)
{
console
.
log
(
`Operation failed: error code is
${
err
.
code
}
and error message is
${
err
.
message
}
`
);
let
code
=
(
err
as
BusinessError
).
code
;
let
message
=
(
err
as
BusinessError
).
message
;
console
.
log
(
`Operation failed: error code is
${
code
}
and error message is
${
message
}
`
);
}
```
zh-cn/application-dev/reference/apis/js-apis-installer.md
浏览文件 @
2598f82f
...
...
@@ -57,7 +57,8 @@ try {
}
});
}
catch
(
error
)
{
console
.
error
(
'
getBundleInstaller failed:
'
+
error
.
message
);
let
message
=
(
error
as
BusinessError
).
message
;
console
.
error
(
'
getBundleInstaller failed:
'
+
message
);
}
```
...
...
@@ -89,7 +90,8 @@ try {
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
});
}
catch
(
error
)
{
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
let
message
=
(
error
as
BusinessError
).
message
;
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
message
);
}
```
...
...
@@ -112,12 +114,14 @@ getBundleInstallerSync(): BundleInstaller;
```
ts
import
installer
from
'
@ohos.bundle.installer
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
installer
.
getBundleInstallerSync
();
console
.
info
(
'
getBundleInstallerSync successfully.
'
);
}
catch
(
error
)
{
console
.
error
(
'
getBundleInstallerSync failed. Cause:
'
+
error
.
message
);
let
message
=
(
error
as
BusinessError
).
message
;
console
.
error
(
'
getBundleInstallerSync failed. Cause:
'
+
message
);
}
```
...
...
@@ -200,7 +204,8 @@ try {
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
});
}
catch
(
error
)
{
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
let
message
=
(
error
as
BusinessError
).
message
;
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
message
);
}
```
## BundleInstaller.install
...
...
@@ -275,7 +280,8 @@ try {
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
});
}
catch
(
error
)
{
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
let
message
=
(
error
as
BusinessError
).
message
;
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
message
);
}
```
...
...
@@ -363,7 +369,8 @@ try {
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
});
}
catch
(
error
)
{
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
let
message
=
(
error
as
BusinessError
).
message
;
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
message
);
}
```
...
...
@@ -425,7 +432,8 @@ try {
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
});
}
catch
(
error
)
{
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
let
message
=
(
error
as
BusinessError
).
message
;
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
message
);
}
```
...
...
@@ -480,7 +488,8 @@ try {
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
});
}
catch
(
error
)
{
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
let
message
=
(
error
as
BusinessError
).
message
;
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
message
);
}
```
## BundleInstaller.uninstall
...
...
@@ -544,7 +553,8 @@ try {
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
});
}
catch
(
error
)
{
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
let
message
=
(
error
as
BusinessError
).
message
;
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
message
);
}
```
...
...
@@ -603,7 +613,8 @@ try {
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
});
}
catch
(
error
)
{
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
let
message
=
(
error
as
BusinessError
).
message
;
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
message
);
}
```
...
...
@@ -656,7 +667,8 @@ try {
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
});
}
catch
(
error
)
{
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
let
message
=
(
error
as
BusinessError
).
message
;
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
message
);
}
```
...
...
@@ -718,7 +730,8 @@ try {
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
});
}
catch
(
error
)
{
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
let
message
=
(
error
as
BusinessError
).
message
;
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
message
);
}
```
...
...
@@ -774,7 +787,8 @@ try {
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
});
}
catch
(
error
)
{
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
let
message
=
(
error
as
BusinessError
).
message
;
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
message
);
}
```
...
...
@@ -835,7 +849,8 @@ try {
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
});
}
catch
(
error
)
{
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
let
message
=
(
error
as
BusinessError
).
message
;
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
message
);
}
```
...
...
@@ -910,7 +925,8 @@ try {
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
});
}
catch
(
error
)
{
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
let
message
=
(
error
as
BusinessError
).
message
;
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
message
);
}
```
...
...
@@ -978,7 +994,8 @@ try {
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
});
}
catch
(
error
)
{
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
let
message
=
(
error
as
BusinessError
).
message
;
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
message
);
}
```
...
...
@@ -1051,7 +1068,8 @@ try {
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
});
}
catch
(
error
)
{
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
error
.
message
);
let
message
=
(
error
as
BusinessError
).
message
;
console
.
error
(
'
getBundleInstaller failed. Cause:
'
+
message
);
}
```
...
...
zh-cn/application-dev/reference/apis/js-apis-launcherBundleManager.md
浏览文件 @
2598f82f
...
...
@@ -63,7 +63,9 @@ try {
}
})
}
catch
(
errData
)
{
console
.
error
(
`errData is errCode:
${
errData
.
code
}
message:
${
errData
.
message
}
`
);
let
code
=
(
errData
as
BusinessError
).
code
;
let
message
=
(
errData
as
BusinessError
).
message
;
console
.
error
(
`errData is errCode:
${
code
}
message:
${
message
}
`
);
}
```
...
...
@@ -115,7 +117,9 @@ try {
console
.
error
(
`errData is errCode:
${
errData
.
code
}
message:
${
errData
.
message
}
`
);
})
}
catch
(
errData
)
{
console
.
error
(
`errData is errCode:
${
errData
.
code
}
message:
${
errData
.
message
}
`
);
let
code
=
(
errData
as
BusinessError
).
code
;
let
message
=
(
errData
as
BusinessError
).
message
;
console
.
error
(
`errData is errCode:
${
code
}
message:
${
message
}
`
);
}
```
...
...
@@ -157,12 +161,15 @@ getLauncherAbilityInfoSync(bundleName: string, userId: number) : Array\<[Launche
```
ts
import
launcherBundleManager
from
'
@ohos.bundle.launcherBundleManager
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
let
data
=
launcherBundleManager
.
getLauncherAbilityInfoSync
(
"
com.example.demo
"
,
100
);
console
.
log
(
"
data is
"
+
JSON
.
stringify
(
data
));
}
catch
(
errData
)
{
console
.
error
(
`errData is errCode:
${
errData
.
code
}
message:
${
errData
.
message
}
`
);
let
code
=
(
errData
as
BusinessError
).
code
;
let
message
=
(
errData
as
BusinessError
).
message
;
console
.
error
(
`errData is errCode:
${
code
}
message:
${
message
}
`
);
}
```
...
...
@@ -214,7 +221,9 @@ try {
}
});
}
catch
(
errData
)
{
console
.
error
(
`errData is errCode:
${
errData
.
code
}
message:
${
errData
.
message
}
`
);
let
code
=
(
errData
as
BusinessError
).
code
;
let
message
=
(
errData
as
BusinessError
).
message
;
console
.
error
(
`errData is errCode:
${
code
}
message:
${
message
}
`
);
}
```
## launcherBundlemanager.getAllLauncherAbilityInfo<sup>9+</sup>
...
...
@@ -263,7 +272,9 @@ try {
console
.
error
(
`errData is errCode:
${
errData
.
code
}
message:
${
errData
.
message
}
`
);
});
}
catch
(
errData
)
{
console
.
error
(
`errData is errCode:
${
errData
.
code
}
message:
${
errData
.
message
}
`
);
let
code
=
(
errData
as
BusinessError
).
code
;
let
message
=
(
errData
as
BusinessError
).
message
;
console
.
error
(
`errData is errCode:
${
code
}
message:
${
message
}
`
);
}
```
...
...
@@ -313,7 +324,9 @@ try {
}
});
}
catch
(
errData
)
{
console
.
error
(
`errData is errCode:
${
errData
.
code
}
message:
${
errData
.
message
}
`
);
let
code
=
(
errData
as
BusinessError
).
code
;
let
message
=
(
errData
as
BusinessError
).
message
;
console
.
error
(
`errData is errCode:
${
code
}
message:
${
message
}
`
);
}
```
...
...
@@ -361,7 +374,9 @@ try {
console
.
error
(
`errData is errCode:
${
errData
.
code
}
message:
${
errData
.
message
}
`
);
});
}
catch
(
errData
)
{
console
.
error
(
`errData is errCode:
${
errData
.
code
}
message:
${
errData
.
message
}
`
);
let
code
=
(
errData
as
BusinessError
).
code
;
let
message
=
(
errData
as
BusinessError
).
message
;
console
.
error
(
`errData is errCode:
${
code
}
message:
${
message
}
`
);
}
```
...
...
@@ -399,11 +414,14 @@ getShortcutInfoSync(bundleName : string) : Array\<[ShortcutInfo](js-apis-bundleM
```
ts
import
launcherBundleManager
from
'
@ohos.bundle.launcherBundleManager
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
let
data
=
launcherBundleManager
.
getShortcutInfoSync
(
"
com.example.demo
"
);
console
.
log
(
"
data is
"
+
JSON
.
stringify
(
data
));
}
catch
(
errData
)
{
console
.
error
(
`errData is errCode:
${
errData
.
code
}
message:
${
errData
.
message
}
`
);
let
code
=
(
errData
as
BusinessError
).
code
;
let
message
=
(
errData
as
BusinessError
).
message
;
console
.
error
(
`errData is errCode:
${
code
}
message:
${
message
}
`
);
}
```
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录