Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
e458e188
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
e458e188
编写于
4月 13, 2022
作者:
O
openharmony_ci
提交者:
Gitee
4月 13, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3200 Delete Ability & Notification content of version 9plus
Merge pull request !3200 from xuzhihao/OpenHarmony-3.1-Release
上级
7b9a3807
e99943fc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
1 addition
and
547 deletion
+1
-547
zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegator.md
...ev/reference/apis/js-apis-application-abilityDelegator.md
+0
-540
zh-cn/application-dev/reference/apis/js-apis-configuration.md
...n/application-dev/reference/apis/js-apis-configuration.md
+1
-4
zh-cn/application-dev/reference/apis/js-apis-featureAbility.md
.../application-dev/reference/apis/js-apis-featureAbility.md
+0
-2
zh-cn/application-dev/reference/apis/js-apis-notification.md
zh-cn/application-dev/reference/apis/js-apis-notification.md
+0
-1
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegator.md
浏览文件 @
e458e188
...
...
@@ -13,404 +13,6 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry
## AbilityDelegator
### addAbilityMonitor<sup>9+</sup>
addAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback
\<
void>): void
添加AbilityMonitor实例(callback形式)
**系统能力:**
SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填说明 | 说明 |
| -------- | ------------------------------------------------------------ | -------- | ------------------------------------------------------------ |
| monitor |
[
AbilityMonitor
](
js-apis-application-abilityMonitor.md#AbilityMonitor
)
| 是 |
[
AbilityMonitor
](
js-apis-application-abilityMonitor.md#AbilityMonitor
)
实例 |
| callback | AsyncCallback
\<
void> | 是 | 表示指定的回调方法 |
**示例:**
```
js
var
abilityDelegator
;
function
onAbilityCreateCallback
()
{
console
.
info
(
"
onAbilityCreateCallback
"
);
}
var
monitor
=
{
abilityName
:
"
abilityname
"
,
onAbilityCreate
:
onAbilityCreateCallback
}
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
.
addAbilityMonitor
(
monitor
,
(
err
)
=>
{
console
.
info
(
"
addAbilityMonitor callback
"
);
});
```
### addAbilityMonitor<sup>9+</sup>
addAbilityMonitor(monitor: AbilityMonitor): Promise
\<
void>
添加AbilityMonitor实例(promise形式)
**系统能力:**
SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| monitor |
[
AbilityMonitor
](
js-apis-application-abilityMonitor.md#AbilityMonitor
)
| 是 |
[
AbilityMonitor
](
js-apis-application-abilityMonitor.md#AbilityMonitor
)
实例 |
**返回值:**
| 类型 | 说明 |
| -------------- | ------------------- |
| Promise
\<
void> | 以Promise形式返回。 |
**示例:**
```
js
var
abilityDelegator
;
function
onAbilityCreateCallback
()
{
console
.
info
(
"
onAbilityCreateCallback
"
);
}
var
monitor
=
{
abilityName
:
"
abilityname
"
,
onAbilityCreate
:
onAbilityCreateCallback
}
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
.
addAbilityMonitor
(
monitor
).
then
(()
=>
{
console
.
info
(
"
addAbilityMonitor promise
"
);
});
```
### removeAbilityMonitor<sup>9+</sup>
removeAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback
\<
void>): void
删除已经添加的AbilityMonitor实例(callback形式)
**系统能力:**
SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| monitor |
[
AbilityMonitor
](
js-apis-application-abilityMonitor.md#AbilityMonitor
)
| 是 |
[
AbilityMonitor
](
js-apis-application-abilityMonitor.md#AbilityMonitor
)
实例 |
| callback | AsyncCallback
\<
void> | 是 | 表示指定的回调方法 |
**示例:**
```
js
var
abilityDelegator
;
function
onAbilityCreateCallback
()
{
console
.
info
(
"
onAbilityCreateCallback
"
);
}
var
monitor
=
{
abilityName
:
"
abilityname
"
,
onAbilityCreate
:
onAbilityCreateCallback
}
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
.
removeAbilityMonitor
(
monitor
,
(
err
)
=>
{
console
.
info
(
"
removeAbilityMonitor callback
"
);
});
```
### removeAbilityMonitor<sup>9+</sup>
removeAbilityMonitor(monitor: AbilityMonitor): Promise
\<
void>
删除已经添加的AbilityMonitor实例(promise形式)
**系统能力:**
SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| ------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| monitor |
[
AbilityMonitor
](
js-apis-application-abilityMonitor.md#AbilityMonitor
)
| 是 |
[
AbilityMonitor
](
js-apis-application-abilityMonitor.md#AbilityMonitor
)
实例 |
**返回值:**
| 类型 | 说明 |
| -------------- | ------------------- |
| Promise
\<
void> | 以Promise形式返回。 |
-
示例
```
js
var
abilityDelegator
;
function
onAbilityCreateCallback
()
{
console
.
info
(
"
onAbilityCreateCallback
"
);
}
var
monitor
=
{
abilityName
:
"
abilityname
"
,
onAbilityCreate
:
onAbilityCreateCallback
}
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
.
removeAbilityMonitor
(
monitor
).
then
(()
=>
{
console
.
info
(
"
removeAbilityMonitor promise
"
);
});
```
### waitAbilityMonitor<sup>9+</sup>
waitAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback
\<
Ability>): void
等待与AbilityMonitor实例匹配的ability到达OnCreate生命周期,并返回ability实例(callback形式)
**系统能力:**
SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| monitor |
[
AbilityMonitor
](
js-apis-application-abilityMonitor.md#AbilityMonitor
)
| 是 |
[
AbilityMonitor
](
js-apis-application-abilityMonitor.md#AbilityMonitor
)
实例 |
| callback | AsyncCallback
\<
[
Ability
](
js-apis-application-ability.md#Ability
)
> | 是 | 表示指定的回调方法 |
**示例:**
```
js
var
abilityDelegator
;
function
onAbilityCreateCallback
()
{
console
.
info
(
"
onAbilityCreateCallback
"
);
}
var
monitor
=
{
abilityName
:
"
abilityname
"
,
onAbilityCreate
:
onAbilityCreateCallback
}
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
.
waitAbilityMonitor
(
monitor
,
(
err
,
data
)
=>
{
console
.
info
(
"
waitAbilityMonitor callback
"
);
});
```
### waitAbilityMonitor<sup>9+</sup>
waitAbilityMonitor(monitor: AbilityMonitor, timeout: number, callback: AsyncCallback
\<
Ability>): void
设置等待时间,等待与AbilityMonitor实例匹配的ability到达OnCreate生命周期,并返回ability实例(callback形式)
**系统能力:**
SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| monitor |
[
AbilityMonitor
](
js-apis-application-abilityMonitor.md#AbilityMonitor
)
| 是 |
[
AbilityMonitor
](
js-apis-application-abilityMonitor.md#AbilityMonitor
)
实例 |
| timeout | number | 是 | 最大等待时间,单位毫秒(ms) |
| callback | AsyncCallback
\<
[
Ability
](
js-apis-application-ability.md#Ability
)
> | 是 | 表示指定的回调方法 |
**示例:**
```
js
var
abilityDelegator
;
var
timeout
=
100
;
function
onAbilityCreateCallback
()
{
console
.
info
(
"
onAbilityCreateCallback
"
);
}
var
monitor
=
{
abilityName
:
"
abilityname
"
,
onAbilityCreate
:
onAbilityCreateCallback
}
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
.
waitAbilityMonitor
(
monitor
,
timeout
,
(
err
,
data
)
=>
{
console
.
info
(
"
waitAbilityMonitor callback
"
);
});
```
### waitAbilityMonitor<sup>9+</sup>
waitAbilityMonitor(monitor: AbilityMonitor, timeout?: number): Promise
\<
Ability>
设置等待时间,等待与AbilityMonitor实例匹配的ability到达OnCreate生命周期,并返回ability实例(promise形式)
**系统能力:**
SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| monitor |
[
AbilityMonitor
](
js-apis-application-abilityMonitor.md#AbilityMonitor
)
| 是 |
[
AbilityMonitor
](
js-apis-application-abilityMonitor.md#AbilityMonitor
)
实例 |
| timeout | number | 否 | 最大等待时间,单位毫秒(ms) |
**返回值:**
| 类型 | 说明 |
| ----------------------------------------------------------- | -------------------------- |
| Promise
\<
[
Ability
](
js-apis-application-ability.md#Ability
)
> | 以Promise形式返回Ability。 |
**示例:**
```
js
var
abilityDelegator
;
function
onAbilityCreateCallback
()
{
console
.
info
(
"
onAbilityCreateCallback
"
);
}
var
monitor
=
{
abilityName
:
"
abilityname
"
,
onAbilityCreate
:
onAbilityCreateCallback
}
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
.
waitAbilityMonitor
(
monitor
).
then
((
data
:
any
)
=>
{
console
.
info
(
"
waitAbilityMonitor promise
"
);
});
```
### getAppContext<sup>9+</sup>
getAppContext(): Context
获取应用Context
**系统能力:**
SystemCapability.Ability.AbilityRuntime.Core
**返回值:**
| 类型 | 说明 |
| ------------------------------------- | ------------------------------------------- |
|
[
Context
](
js-apis-Context.md#Context
)
| 应用
[
Context
](
js-apis-Context.md#Context
)
。 |
**示例:**
```
js
var
abilityDelegator
;
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
var
context
=
abilityDelegator
.
getAppContext
();
```
### getAbilityState<sup>9+</sup>
getAbilityState(ability: Ability): number
获取指定ability的生命周期状态
**系统能力:**
SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------------------------------------------------- | ---- | --------------- |
| ability |
[
Ability
](
js-apis-application-ability.md#Ability
)
| 是 | 指定Ability对象 |
**返回值:**
| 类型 | 说明 |
| ------ | ------------------------------------------------------------ |
| number | 指定ability的生命周期状态。状态枚举值使用
[
AbilityLifecycleState
](
js-apis-abilityDelegatorRegistry.md#AbilityLifecycleState
)
。 |
**示例:**
```
js
var
abilityDelegator
;
var
ability
;
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
.
getCurrentTopAbility
((
err
,
data
)
=>
{
console
.
info
(
"
getCurrentTopAbility callback
"
);
ability
=
data
;
var
state
=
abilityDelegator
.
getAbilityState
(
ability
);
console
.
info
(
"
getAbilityState
"
+
state
);
});
```
### getCurrentTopAbility<sup>9+</sup>
getCurrentTopAbility(callback: AsyncCallback
\<
Ability>): void
获取当前应用顶部ability(callback形式)
**系统能力:**
SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------ |
| callback | AsyncCallback
\<
[
Ability
](
js-apis-application-ability.md#Ability
)
> | 是 | 表示指定的回调方法 |
**示例:**
```
js
var
abilityDelegator
;
var
ability
;
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
.
getCurrentTopAbility
((
err
,
data
)
=>
{
console
.
info
(
"
getCurrentTopAbility callback
"
);
ability
=
data
;
});
```
### getCurrentTopAbility<sup>9+</sup>
getCurrentTopAbility(): Promise
\<
Ability>
获取当前应用顶部ability(promise形式)
**系统能力:**
SystemCapability.Ability.AbilityRuntime.Core
**返回值:**
| 类型 | 说明 |
| ----------------------------------------------------------- | -------------------------------------- |
| Promise
\<
[
Ability
](
js-apis-application-ability.md#Ability
)
> | 以Promise形式返回当前应用顶部ability。 |
**示例:**
```
js
var
abilityDelegator
;
var
ability
;
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
.
getCurrentTopAbility
().
then
((
data
:
any
)
=>
{
console
.
info
(
"
getCurrentTopAbility promise
"
);
ability
=
data
;
});
```
### startAbility
startAbility(want: Want, callback: AsyncCallback
\<
void>): void
...
...
@@ -480,148 +82,6 @@ abilityDelegator.startAbility(want).then((data: any) => {
### doAbilityForeground<sup>9+</sup>
doAbilityForeground(ability: Ability, callback: AsyncCallback
\<
boolean>): void
调度指定ability生命周期状态到Foreground状态(callback形式)
**系统能力:**
SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------- | ---- | ------------------------------------------------------- |
| ability | Ability | 是 | 指定Ability对象 |
| callback | AsyncCallback
\<
boolean> | 是 | 表示指定的回调方法
<br/>
\-
true:成功
<br/>
\-
false:失败 |
**示例:**
```
js
var
abilityDelegator
;
var
ability
;
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
.
getCurrentTopAbility
((
err
,
data
)
=>
{
console
.
info
(
"
getCurrentTopAbility callback
"
);
ability
=
data
;
abilityDelegator
.
doAbilityForeground
(
ability
,
(
err
,
data
)
=>
{
console
.
info
(
"
doAbilityForeground callback
"
);
});
});
```
### doAbilityForeground<sup>9+</sup>
doAbilityForeground(ability: Ability): Promise
\<
boolean>
调度指定ability生命周期状态到Foreground状态(promise形式)
**系统能力:**
SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------- | ---- | --------------- |
| ability | Ability | 是 | 指定Ability对象 |
**返回值:**
| 类型 | 说明 |
| ----------------- | ------------------------------------------------------------ |
| Promise
\<
boolean> | 以Promise形式返回执行结果。
<br/>
\-
true:成功
<br/>
\-
false:失败 |
**示例:**
```
js
var
abilityDelegator
;
var
ability
;
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
.
getCurrentTopAbility
((
err
,
data
)
=>
{
console
.
info
(
"
getCurrentTopAbility callback
"
);
ability
=
data
;
abilityDelegator
.
doAbilityForeground
(
ability
).
then
((
data
:
any
)
=>
{
console
.
info
(
"
doAbilityForeground promise
"
);
});
});
```
### doAbilityBackground<sup>9+</sup>
doAbilityBackground(ability: Ability, callback: AsyncCallback
\<
boolean>): void
调度指定ability生命周期状态到Background状态(callback形式)
**系统能力:**
SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------- | ---- | ------------------------------------------------------- |
| ability | Ability | 是 | 指定Ability对象 |
| callback | AsyncCallback
\<
boolean> | 是 | 表示指定的回调方法
<br/>
\-
true:成功
<br/>
\-
false:失败 |
**示例:**
```
js
var
abilityDelegator
;
var
ability
;
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
.
getCurrentTopAbility
((
err
,
data
)
=>
{
console
.
info
(
"
getCurrentTopAbility callback
"
);
ability
=
data
;
abilityDelegator
.
doAbilityBackground
(
ability
,
(
err
,
data
)
=>
{
console
.
info
(
"
doAbilityBackground callback
"
);
});
});
```
### doAbilityBackground<sup>9+</sup>
doAbilityBackground(ability: Ability): Promise
\<
boolean>
调度指定ability生命周期状态到Background状态(promise形式)
**系统能力:**
SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------- | ---- | --------------- |
| ability | Ability | 是 | 指定Ability对象 |
**返回值:**
| 类型 | 说明 |
| ----------------- | ------------------------------------------------------------ |
| Promise
\<
boolean> | 以Promise形式返回执行结果。
<br/>
\-
true:成功
<br/>
\-
false:失败 |
**示例:**
```
js
var
abilityDelegator
;
var
ability
;
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
.
getCurrentTopAbility
((
err
,
data
)
=>
{
console
.
info
(
"
getCurrentTopAbility callback
"
);
ability
=
data
;
abilityDelegator
.
doAbilityBackground
(
ability
).
then
((
data
)
=>
{
console
.
info
(
"
doAbilityBackground promise
"
);
});
});
```
### print
print(msg: string, callback: AsyncCallback
\<
void>): void
...
...
zh-cn/application-dev/reference/apis/js-apis-configuration.md
浏览文件 @
e458e188
...
...
@@ -22,7 +22,4 @@ import Configuration from '@ohos.application.Configuration';
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- | -------- |
| language | string | 是 | 是 | 表示应用程序的当前语言。 |
| colorMode |
[
ColorMode
](
js-apis-configurationconstant.md
)
| 是 | 是 | 表示深浅色模式,取值范围:浅色模式(COLOR_MODE_LIGHT),深色模式(COLOR_MODE_DARK)。默认为浅色。 |
| direction
<sup>
9+
</sup>
| Direction | 是 | 否 | 表示屏幕方向,取值范围:水平方向(DIRECTION_HORIZONTAL),垂直方向(DIRECTION_VERTICAL)。 |
| screenDensity
<sup>
9+
</sup>
| ScreenDensity | 是 | 否 | 表示屏幕分辨率,取值范围:SCREEN_DENSITY_SDPI(120)、SCREEN_DENSITY_MDPI(160)、SCREEN_DENSITY_LDPI(240)、SCREEN_DENSITY_XLDPI(320)、SCREEN_DENSITY_XXLDPI(480)、SCREEN_DENSITY_XXXLDPI(640)。 |
| displayId
<sup>
9+
</sup>
| number | 是 | 否 | 表示应用所在的displayId。 |
| colorMode |
[
ColorMode
](
js-apis-configurationconstant.md
)
| 是 | 是 | 表示深浅色模式,取值范围:浅色模式(COLOR_MODE_LIGHT),深色模式(COLOR_MODE_DARK)。默认为浅色。 |
\ No newline at end of file
zh-cn/application-dev/reference/apis/js-apis-featureAbility.md
浏览文件 @
e458e188
...
...
@@ -925,8 +925,6 @@ featureAbility.AbilityStartSetting.BOUNDS_KEY
| action | 只读 | string | 否 | 表示action选项描述。 |
| parameters | 只读 | {[key: string]: any} | 否 | 表示WantParams描述。 |
| entities | 只读 | Array
\<
string> | 否 | 表示entities相关描述。 |
| extensionAbilityName
<sup>
9+
<sup>
| 只读 | string | 否 | Want中扩展能力名称的描述。 |
| extensionAbilityType
<sup>
9+
<sup>
| 只读 | number | 否 | Want中扩展能力类型的描述。 |
## flags说明
...
...
zh-cn/application-dev/reference/apis/js-apis-notification.md
浏览文件 @
e458e188
...
...
@@ -2900,7 +2900,6 @@ Notification.subscribe(subscriber, subscribeCallback);
| title | 是 | 是 | string | 是 | 按钮标题。 |
| wantAgent | 是 | 是 | WantAgent | 是 | 点击按钮时触发的WantAgent。 |
| extras | 是 | 是 | { [key: string]: any } | 否 | 按钮扩展信息。 |
| userInput
<sup>
9+
</sup>
| 是 | 是 |
[
NotificationUserInput
](
#notificationuserinput8
)
| 否 | 用户输入对象实例。 |
## NotificationBasicContent
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录