提交 48a75c8e 编写于 作者: Y yuyaozhi

Modify the secondary import module of ability

Signed-off-by: Nyuyaozhi <yuyaozhi@huawei.com>
上级 d1bda80e
...@@ -7,14 +7,12 @@ AbilityLifecycleCallback模块提供应用上下文[ApplicationContext](js-apis- ...@@ -7,14 +7,12 @@ AbilityLifecycleCallback模块提供应用上下文[ApplicationContext](js-apis-
> 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。 > 本模块接口仅可在Stage模型下使用。
## 导入模块 ## 导入模块
```ts ```ts
import AbilityLifecycleCallback from '@ohos.app.ability.AbilityLifecycleCallback'; import AbilityLifecycleCallback from '@ohos.app.ability.AbilityLifecycleCallback';
``` ```
## AbilityLifecycleCallback.onAbilityCreate ## AbilityLifecycleCallback.onAbilityCreate
onAbilityCreate(ability: UIAbility): void; onAbilityCreate(ability: UIAbility): void;
......
...@@ -11,7 +11,6 @@ appRecovery模块提供了应用在故障状态下的恢复能力。 ...@@ -11,7 +11,6 @@ appRecovery模块提供了应用在故障状态下的恢复能力。
import appRecovery from '@ohos.app.ability.appRecovery'; import appRecovery from '@ohos.app.ability.appRecovery';
``` ```
## appRecovery.RestartFlag ## appRecovery.RestartFlag
应用重启标志,[enableAppRecovery](#apprecoveryenableapprecovery)接口重启选项参数,该类型为枚举。 应用重启标志,[enableAppRecovery](#apprecoveryenableapprecovery)接口重启选项参数,该类型为枚举。
......
# AbilityResult # AbilityResult
定义Ability被拉起并退出后返回的结果码和数据,可以通过[startAbilityForResult](js-apis-ability-context.md#abilitycontextstartabilityforresult)获取被拉起Ability退出后返回的AbilityResult对象,被startAbilityForResult拉起的Ability对象可以通过[terminateSelfWithResult](js-apis-ability-context.md#abilitycontextterminateselfwithresult)返回AbilityResult对象。 定义Ability被拉起并退出后返回的结果码和数据,可以通过[startAbilityForResult](js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartabilityforresult)获取被拉起Ability退出后返回的AbilityResult对象,被startAbilityForResult拉起的Ability对象可以通过[terminateSelfWithResult](js-apis-inner-application-uiAbilityContext.md#uiabilitycontextterminateselfwithresult)返回AbilityResult对象。
> **说明:** > **说明:**
> >
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
```ts
import ability from '@ohos.ability.ability';
```
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase
| 名称 | 可读 | 可写 | 类型 | 必填 | 说明 | | 名称 | 可读 | 可写 | 类型 | 必填 | 说明 |
......
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
在连接指定的后台服务时作为入参,用于接收连接过程中的状态变化,如作为[connectServiceExtensionAbility](js-apis-inner-application-uiAbilityContext.md#uiabilitycontextconnectserviceextensionability)的入参,连接指定的ServiceExtensionAbility。 在连接指定的后台服务时作为入参,用于接收连接过程中的状态变化,如作为[connectServiceExtensionAbility](js-apis-inner-application-uiAbilityContext.md#uiabilitycontextconnectserviceextensionability)的入参,连接指定的ServiceExtensionAbility。
## 导入模块
```ts
import common from '@ohos.app.ability.common';
```
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
...@@ -18,7 +24,7 @@ ...@@ -18,7 +24,7 @@
abilityName: 'MyAbility' abilityName: 'MyAbility'
}; };
let connectOptions = { let connectOptions: common.ConnectOptions = {
onConnect(elementName, remote) { onConnect(elementName, remote) {
console.log('onConnect elementName: ${elementName}'); console.log('onConnect elementName: ${elementName}');
}, },
......
...@@ -7,6 +7,12 @@ ...@@ -7,6 +7,12 @@
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在FA模型下使用。 > 本模块接口仅可在FA模型下使用。
## 导入模块
```ts
import ability from '@ohos.ability.ability';
```
## 使用说明 ## 使用说明
使用前根据具体情况引入如下模块 使用前根据具体情况引入如下模块
...@@ -35,7 +41,7 @@ openFile(uri: string, mode: string, callback: AsyncCallback\<number>): void ...@@ -35,7 +41,7 @@ openFile(uri: string, mode: string, callback: AsyncCallback\<number>): void
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
let mode = 'rw'; let mode = 'rw';
...@@ -73,7 +79,7 @@ openFile(uri: string, mode: string): Promise\<number> ...@@ -73,7 +79,7 @@ openFile(uri: string, mode: string): Promise\<number>
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
let mode = 'rw'; let mode = 'rw';
...@@ -102,7 +108,7 @@ on(type: 'dataChange', uri: string, callback: AsyncCallback\<void>): void ...@@ -102,7 +108,7 @@ on(type: 'dataChange', uri: string, callback: AsyncCallback\<void>): void
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
function onChangeNotify() { function onChangeNotify() {
...@@ -135,7 +141,7 @@ off(type: 'dataChange', uri: string, callback?: AsyncCallback\<void>): void ...@@ -135,7 +141,7 @@ off(type: 'dataChange', uri: string, callback?: AsyncCallback\<void>): void
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
function onChangeNotify() { function onChangeNotify() {
...@@ -171,7 +177,7 @@ getType(uri: string, callback: AsyncCallback\<string>): void ...@@ -171,7 +177,7 @@ getType(uri: string, callback: AsyncCallback\<string>): void
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
DAHelper.getType('dataability:///com.example.DataAbility', (error, data) => { DAHelper.getType('dataability:///com.example.DataAbility', (error, data) => {
...@@ -207,7 +213,7 @@ getType(uri: string): Promise\<string> ...@@ -207,7 +213,7 @@ getType(uri: string): Promise\<string>
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
DAHelper.getType('dataability:///com.example.DataAbility').then((data) => { DAHelper.getType('dataability:///com.example.DataAbility').then((data) => {
...@@ -235,7 +241,7 @@ getFileTypes(uri: string, mimeTypeFilter: string, callback: AsyncCallback<Array\ ...@@ -235,7 +241,7 @@ getFileTypes(uri: string, mimeTypeFilter: string, callback: AsyncCallback<Array\
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
DAHelper.getFileTypes( 'dataability:///com.example.DataAbility', 'image/*', (error, data) => { DAHelper.getFileTypes( 'dataability:///com.example.DataAbility', 'image/*', (error, data) => {
...@@ -272,7 +278,7 @@ getFileTypes(uri: string, mimeTypeFilter: string): Promise\<Array\<string>> ...@@ -272,7 +278,7 @@ getFileTypes(uri: string, mimeTypeFilter: string): Promise\<Array\<string>>
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
DAHelper.getFileTypes('dataability:///com.example.DataAbility', 'image/*').then((data) => { DAHelper.getFileTypes('dataability:///com.example.DataAbility', 'image/*').then((data) => {
...@@ -299,7 +305,7 @@ normalizeUri(uri: string, callback: AsyncCallback\<string>): void ...@@ -299,7 +305,7 @@ normalizeUri(uri: string, callback: AsyncCallback\<string>): void
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
DAHelper.normalizeUri('dataability:///com.example.DataAbility', (error, data) => { DAHelper.normalizeUri('dataability:///com.example.DataAbility', (error, data) => {
...@@ -335,7 +341,7 @@ normalizeUri(uri: string): Promise\<string> ...@@ -335,7 +341,7 @@ normalizeUri(uri: string): Promise\<string>
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
DAHelper.normalizeUri('dataability:///com.example.DataAbility',).then((data) => { DAHelper.normalizeUri('dataability:///com.example.DataAbility',).then((data) => {
...@@ -362,7 +368,7 @@ denormalizeUri(uri: string, callback: AsyncCallback\<string>): void ...@@ -362,7 +368,7 @@ denormalizeUri(uri: string, callback: AsyncCallback\<string>): void
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
DAHelper.denormalizeUri('dataability:///com.example.DataAbility', (error, data) => { DAHelper.denormalizeUri('dataability:///com.example.DataAbility', (error, data) => {
...@@ -398,7 +404,7 @@ denormalizeUri(uri: string): Promise\<string> ...@@ -398,7 +404,7 @@ denormalizeUri(uri: string): Promise\<string>
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
DAHelper.denormalizeUri('dataability:///com.example.DataAbility',).then((data) => { DAHelper.denormalizeUri('dataability:///com.example.DataAbility',).then((data) => {
...@@ -425,7 +431,7 @@ notifyChange(uri: string, callback: AsyncCallback\<void>): void ...@@ -425,7 +431,7 @@ notifyChange(uri: string, callback: AsyncCallback\<void>): void
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
DAHelper.notifyChange('dataability:///com.example.DataAbility', (error) => { DAHelper.notifyChange('dataability:///com.example.DataAbility', (error) => {
...@@ -461,7 +467,7 @@ notifyChange(uri: string): Promise\<void> ...@@ -461,7 +467,7 @@ notifyChange(uri: string): Promise\<void>
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
DAHelper.notifyChange('dataability:///com.example.DataAbility').then(() => { DAHelper.notifyChange('dataability:///com.example.DataAbility').then(() => {
...@@ -489,7 +495,7 @@ insert(uri: string, valuesBucket: rdb.ValuesBucket, callback: AsyncCallback\<num ...@@ -489,7 +495,7 @@ insert(uri: string, valuesBucket: rdb.ValuesBucket, callback: AsyncCallback\<num
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
const valueBucket = { const valueBucket = {
...@@ -532,7 +538,7 @@ insert(uri: string, valuesBucket: rdb.ValuesBucket): Promise\<number> ...@@ -532,7 +538,7 @@ insert(uri: string, valuesBucket: rdb.ValuesBucket): Promise\<number>
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
const valueBucket = { const valueBucket = {
...@@ -566,7 +572,7 @@ batchInsert(uri: string, valuesBuckets: Array\<rdb.ValuesBucket>, callback: Asyn ...@@ -566,7 +572,7 @@ batchInsert(uri: string, valuesBuckets: Array\<rdb.ValuesBucket>, callback: Asyn
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
let cars = new Array({'name': 'roe11', 'age': 21, 'salary': 20.5, 'blobType': 'u8',}, let cars = new Array({'name': 'roe11', 'age': 21, 'salary': 20.5, 'blobType': 'u8',},
...@@ -606,7 +612,7 @@ batchInsert(uri: string, valuesBuckets: Array<rdb.ValuesBucket>): Promise\<numbe ...@@ -606,7 +612,7 @@ batchInsert(uri: string, valuesBuckets: Array<rdb.ValuesBucket>): Promise\<numbe
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
let cars = new Array({'name': 'roe11', 'age': 21, 'salary': 20.5, 'blobType': 'u8',}, let cars = new Array({'name': 'roe11', 'age': 21, 'salary': 20.5, 'blobType': 'u8',},
...@@ -638,7 +644,7 @@ delete(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: Asy ...@@ -638,7 +644,7 @@ delete(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: Asy
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
import ohos_data_ability from '@ohos.data.dataAbility'; import ohos_data_ability from '@ohos.data.dataAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
let da = new ohos_data_ability.DataAbilityPredicates(); let da = new ohos_data_ability.DataAbilityPredicates();
...@@ -677,7 +683,7 @@ delete(uri: string, predicates?: dataAbility.DataAbilityPredicates): Promise\<nu ...@@ -677,7 +683,7 @@ delete(uri: string, predicates?: dataAbility.DataAbilityPredicates): Promise\<nu
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
import ohos_data_ability from '@ohos.data.dataAbility'; import ohos_data_ability from '@ohos.data.dataAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
let da = new ohos_data_ability.DataAbilityPredicates(); let da = new ohos_data_ability.DataAbilityPredicates();
...@@ -708,7 +714,7 @@ update(uri: string, valuesBucket: rdb.ValuesBucket, predicates: dataAbility.Data ...@@ -708,7 +714,7 @@ update(uri: string, valuesBucket: rdb.ValuesBucket, predicates: dataAbility.Data
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
import ohos_data_ability from '@ohos.data.dataAbility'; import ohos_data_ability from '@ohos.data.dataAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
const va = { const va = {
...@@ -754,7 +760,7 @@ update(uri: string, valuesBucket: rdb.ValuesBucket, predicates?: dataAbility.Dat ...@@ -754,7 +760,7 @@ update(uri: string, valuesBucket: rdb.ValuesBucket, predicates?: dataAbility.Dat
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
import ohos_data_ability from '@ohos.data.dataAbility'; import ohos_data_ability from '@ohos.data.dataAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
const va = { const va = {
...@@ -791,7 +797,7 @@ query(uri: string, columns: Array\<string>, predicates: dataAbility.DataAbilityP ...@@ -791,7 +797,7 @@ query(uri: string, columns: Array\<string>, predicates: dataAbility.DataAbilityP
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
import ohos_data_ability from '@ohos.data.dataAbility'; import ohos_data_ability from '@ohos.data.dataAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
let cars=new Array('value1', 'value2', 'value3', 'value4'); let cars=new Array('value1', 'value2', 'value3', 'value4');
...@@ -834,7 +840,7 @@ query(uri: string, columns?: Array\<string>, predicates?: dataAbility.DataAbilit ...@@ -834,7 +840,7 @@ query(uri: string, columns?: Array\<string>, predicates?: dataAbility.DataAbilit
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
import ohos_data_ability from '@ohos.data.dataAbility'; import ohos_data_ability from '@ohos.data.dataAbility';
let DAHelper = featureAbility.acquireDataAbilityHelper( let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.DataAbility' 'dataability:///com.example.DataAbility'
); );
let cars = new Array('value1', 'value2', 'value3', 'value4'); let cars = new Array('value1', 'value2', 'value3', 'value4');
...@@ -867,7 +873,7 @@ call(uri: string, method: string, arg: string, extras: PacMap, callback: AsyncCa ...@@ -867,7 +873,7 @@ call(uri: string, method: string, arg: string, extras: PacMap, callback: AsyncCa
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let dataAbilityHelper = featureAbility.acquireDataAbilityHelper( let dataAbilityHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.jsapidemo.UserDataAbility' 'dataability:///com.example.jsapidemo.UserDataAbility'
); );
dataAbilityHelper.call('dataability:///com.example.jsapidemo.UserDataAbility', dataAbilityHelper.call('dataability:///com.example.jsapidemo.UserDataAbility',
...@@ -908,7 +914,7 @@ call(uri: string, method: string, arg: string, extras: PacMap): Promise\<PacMap> ...@@ -908,7 +914,7 @@ call(uri: string, method: string, arg: string, extras: PacMap): Promise\<PacMap>
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let dataAbilityHelper = featureAbility.acquireDataAbilityHelper( let dataAbilityHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.jsapidemo.UserDataAbility' 'dataability:///com.example.jsapidemo.UserDataAbility'
); );
dataAbilityHelper.call('dataability:///com.example.jsapidemo.UserDataAbility', dataAbilityHelper.call('dataability:///com.example.jsapidemo.UserDataAbility',
...@@ -942,7 +948,7 @@ import featureAbility from '@ohos.ability.featureAbility'; ...@@ -942,7 +948,7 @@ import featureAbility from '@ohos.ability.featureAbility';
// 根据DataAbilityOperation列表选择要对数据库做的操作 // 根据DataAbilityOperation列表选择要对数据库做的操作
let op=new Array(); let op=new Array();
let dataAbilityHelper = featureAbility.acquireDataAbilityHelper( let dataAbilityHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.jsapidemo.UserDataAbility' 'dataability:///com.example.jsapidemo.UserDataAbility'
); );
dataAbilityHelper.executeBatch('dataability:///com.example.jsapidemo.UserDataAbility', op, (error, data) => { dataAbilityHelper.executeBatch('dataability:///com.example.jsapidemo.UserDataAbility', op, (error, data) => {
...@@ -982,7 +988,7 @@ import featureAbility from '@ohos.ability.featureAbility'; ...@@ -982,7 +988,7 @@ import featureAbility from '@ohos.ability.featureAbility';
// 根据DataAbilityOperation列表选择要对数据库做的操作 // 根据DataAbilityOperation列表选择要对数据库做的操作
let op=new Array(); let op=new Array();
let dataAbilityHelper = featureAbility.acquireDataAbilityHelper( let dataAbilityHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelper(
'dataability:///com.example.jsapidemo.UserDataAbility' 'dataability:///com.example.jsapidemo.UserDataAbility'
); );
dataAbilityHelper.executeBatch('dataability:///com.example.jsapidemo.UserDataAbility', op).then((data) => { dataAbilityHelper.executeBatch('dataability:///com.example.jsapidemo.UserDataAbility', op).then((data) => {
......
...@@ -7,6 +7,12 @@ ...@@ -7,6 +7,12 @@
> 本接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本接口仅可在FA模型下使用 > 本接口仅可在FA模型下使用
## 导入模块
```ts
import ability from '@ohos.ability.ability';
```
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.FAModel **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.FAModel
| 名称 | 类型 | 必填| 说明 | | 名称 | 类型 | 必填| 说明 |
......
...@@ -7,6 +7,12 @@ ...@@ -7,6 +7,12 @@
> 本接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本接口仅可在FA模型下使用 > 本接口仅可在FA模型下使用
## 导入模块
```ts
import ability from '@ohos.ability.ability';
```
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.FAModel **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.FAModel
| 名称 | 类型 | 必填 | 说明 | | 名称 | 类型 | 必填 | 说明 |
...@@ -22,7 +28,7 @@ import featureAbility from '@ohos.ability.featureAbility'; ...@@ -22,7 +28,7 @@ import featureAbility from '@ohos.ability.featureAbility';
// 批量执行数据库操作 // 批量执行数据库操作
function executeBatchOperation() { function executeBatchOperation() {
let dataAbilityUri = ('dataability:///com.example.myapplication.TestDataAbility'); let dataAbilityUri = ('dataability:///com.example.myapplication.TestDataAbility');
let DAHelper; let DAHelper: ability.DataAbilityHelper;
try { try {
DAHelper = featureAbility.acquireDataAbilityHelper(dataAbilityUri); DAHelper = featureAbility.acquireDataAbilityHelper(dataAbilityUri);
if (DAHelper === null) { if (DAHelper === null) {
...@@ -61,7 +67,7 @@ function executeBatchOperation() { ...@@ -61,7 +67,7 @@ function executeBatchOperation() {
try { try {
DAHelper.executeBatch(dataAbilityUri, operations).then((data) => { DAHelper.executeBatch(dataAbilityUri, operations).then((data) => {
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
let dataAbilityResult = data[i]; let dataAbilityResult: ability.DataAbilityResult = data[i];
console.log('dataAbilityResult.uri: ${dataAbilityResult.uri}'); console.log('dataAbilityResult.uri: ${dataAbilityResult.uri}');
console.log('dataAbilityResult.count: ${dataAbilityResult.count}'); console.log('dataAbilityResult.count: ${dataAbilityResult.count}');
} }
......
...@@ -7,6 +7,12 @@ ...@@ -7,6 +7,12 @@
> 本接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本接口仅可在FA模型下使用 > 本接口仅可在FA模型下使用
## 导入模块
```ts
import ability from '@ohos.ability.ability';
```
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.FAModel **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.FAModel
| 名称 | 类型 | 必填 | 说明 | | 名称 | 类型 | 必填 | 说明 |
...@@ -30,7 +36,7 @@ let abilityStartSetting ={ ...@@ -30,7 +36,7 @@ let abilityStartSetting ={
[featureAbility.AbilityStartSetting.DISPLAY_ID_KEY] : 1, [featureAbility.AbilityStartSetting.DISPLAY_ID_KEY] : 1,
}; };
let startAbilityParameter = { let startAbilityParameter: ability.StartAbilityParameter = {
want : Want, want : Want,
abilityStartSetting : abilityStartSetting abilityStartSetting : abilityStartSetting
}; };
......
...@@ -6,6 +6,12 @@ Want是对象间信息传递的载体, 可以用于应用组件间的信息传 ...@@ -6,6 +6,12 @@ Want是对象间信息传递的载体, 可以用于应用组件间的信息传
> >
> 本模块首批接口从API version 6开始支持,从API version 9废弃,使用[@ohos.app.ability.Want](js-apis-app-ability-want.md)模块替代。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 6开始支持,从API version 9废弃,使用[@ohos.app.ability.Want](js-apis-app-ability-want.md)模块替代。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
```ts
import Want from '@ohos.app.ability.Want';
```
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase
| 名称 | 类型 | 必填 | 说明 | | 名称 | 类型 | 必填 | 说明 |
......
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
> >
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
```ts
import featureAbility from '@ohos.ability.featureAbility';
```
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 类型 | 可读 | 可写 | 说明 | | 名称 | 类型 | 可读 | 可写 | 说明 |
......
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
> >
> 本模块首批接口从API version 7开始支持,仅支持FA模型。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 7开始支持,仅支持FA模型。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
```ts
import featureAbility from '@ohos.ability.featureAbility';
```
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 类型 | 可读 | 可写 | 说明 | | 名称 | 类型 | 可读 | 可写 | 说明 |
......
...@@ -6,6 +6,12 @@ AbilityDelegator提供添加用于监视指定ability的生命周期状态更改 ...@@ -6,6 +6,12 @@ AbilityDelegator提供添加用于监视指定ability的生命周期状态更改
> >
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
```ts
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
```
## 使用说明 ## 使用说明
通过AbilityDelegatorRegistry中[getAbilityDelegator](js-apis-app-ability-abilityDelegatorRegistry.md#abilitydelegatorregistrygetabilitydelegator)方法获取。 通过AbilityDelegatorRegistry中[getAbilityDelegator](js-apis-app-ability-abilityDelegatorRegistry.md#abilitydelegatorregistrygetabilitydelegator)方法获取。
...@@ -33,7 +39,7 @@ addAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\<void>): void ...@@ -33,7 +39,7 @@ addAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\<void>): void
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
function onAbilityCreateCallback(data) { function onAbilityCreateCallback(data) {
console.info('onAbilityCreateCallback, data: ${JSON.stringify(data)}'); console.info('onAbilityCreateCallback, data: ${JSON.stringify(data)}');
...@@ -73,7 +79,7 @@ addAbilityMonitor(monitor: AbilityMonitor): Promise\<void>; ...@@ -73,7 +79,7 @@ addAbilityMonitor(monitor: AbilityMonitor): Promise\<void>;
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
function onAbilityCreateCallback(data) { function onAbilityCreateCallback(data) {
console.info('onAbilityCreateCallback'); console.info('onAbilityCreateCallback');
...@@ -108,7 +114,7 @@ removeAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\<void>): v ...@@ -108,7 +114,7 @@ removeAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\<void>): v
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
function onAbilityCreateCallback(data) { function onAbilityCreateCallback(data) {
console.info('onAbilityCreateCallback'); console.info('onAbilityCreateCallback');
...@@ -148,7 +154,7 @@ removeAbilityMonitor(monitor: AbilityMonitor): Promise\<void>; ...@@ -148,7 +154,7 @@ removeAbilityMonitor(monitor: AbilityMonitor): Promise\<void>;
- 示例 - 示例
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
function onAbilityCreateCallback(data) { function onAbilityCreateCallback(data) {
console.info('onAbilityCreateCallback'); console.info('onAbilityCreateCallback');
...@@ -183,7 +189,7 @@ waitAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\<UIAbility>) ...@@ -183,7 +189,7 @@ waitAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\<UIAbility>)
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
function onAbilityCreateCallback(data) { function onAbilityCreateCallback(data) {
console.info('onAbilityCreateCallback'); console.info('onAbilityCreateCallback');
...@@ -223,7 +229,7 @@ waitAbilityMonitor(monitor: AbilityMonitor, timeout: number, callback: AsyncCall ...@@ -223,7 +229,7 @@ waitAbilityMonitor(monitor: AbilityMonitor, timeout: number, callback: AsyncCall
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let timeout = 100; let timeout = 100;
function onAbilityCreateCallback(data) { function onAbilityCreateCallback(data) {
...@@ -271,7 +277,7 @@ waitAbilityMonitor(monitor: AbilityMonitor, timeout?: number): Promise\<UIAbilit ...@@ -271,7 +277,7 @@ waitAbilityMonitor(monitor: AbilityMonitor, timeout?: number): Promise\<UIAbilit
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
function onAbilityCreateCallback(data) { function onAbilityCreateCallback(data) {
console.info('onAbilityCreateCallback'); console.info('onAbilityCreateCallback');
...@@ -305,7 +311,7 @@ getAppContext(): Context; ...@@ -305,7 +311,7 @@ getAppContext(): Context;
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
let context = abilityDelegator.getAppContext(); let context = abilityDelegator.getAppContext();
...@@ -334,7 +340,7 @@ getAbilityState(ability: UIAbility): number; ...@@ -334,7 +340,7 @@ getAbilityState(ability: UIAbility): number;
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let ability; let ability;
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
...@@ -363,7 +369,7 @@ getCurrentTopAbility(callback: AsyncCallback\<UIAbility>): void; ...@@ -363,7 +369,7 @@ getCurrentTopAbility(callback: AsyncCallback\<UIAbility>): void;
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let ability; let ability;
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
...@@ -390,7 +396,7 @@ getCurrentTopAbility(): Promise\<UIAbility>; ...@@ -390,7 +396,7 @@ getCurrentTopAbility(): Promise\<UIAbility>;
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let ability; let ability;
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
...@@ -418,7 +424,7 @@ startAbility(want: Want, callback: AsyncCallback\<void>): void; ...@@ -418,7 +424,7 @@ startAbility(want: Want, callback: AsyncCallback\<void>): void;
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let want = { let want = {
bundleName: 'bundleName', bundleName: 'bundleName',
abilityName: 'abilityName' abilityName: 'abilityName'
...@@ -453,7 +459,7 @@ startAbility(want: Want): Promise\<void>; ...@@ -453,7 +459,7 @@ startAbility(want: Want): Promise\<void>;
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let want = { let want = {
bundleName: 'bundleName', bundleName: 'bundleName',
abilityName: 'abilityName' abilityName: 'abilityName'
...@@ -483,7 +489,7 @@ doAbilityForeground(ability: UIAbility, callback: AsyncCallback\<void>): void; ...@@ -483,7 +489,7 @@ doAbilityForeground(ability: UIAbility, callback: AsyncCallback\<void>): void;
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let ability; let ability;
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
...@@ -519,7 +525,7 @@ doAbilityForeground(ability: UIAbility): Promise\<void>; ...@@ -519,7 +525,7 @@ doAbilityForeground(ability: UIAbility): Promise\<void>;
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let ability; let ability;
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
...@@ -550,7 +556,7 @@ doAbilityBackground(ability: UIAbility, callback: AsyncCallback\<void>): void; ...@@ -550,7 +556,7 @@ doAbilityBackground(ability: UIAbility, callback: AsyncCallback\<void>): void;
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let ability; let ability;
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
...@@ -586,7 +592,7 @@ doAbilityBackground(ability: UIAbility): Promise\<void>; ...@@ -586,7 +592,7 @@ doAbilityBackground(ability: UIAbility): Promise\<void>;
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let ability; let ability;
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
...@@ -616,7 +622,7 @@ printSync(msg: string): void; ...@@ -616,7 +622,7 @@ printSync(msg: string): void;
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let msg = 'msg'; let msg = 'msg';
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
...@@ -641,7 +647,7 @@ print(msg: string, callback: AsyncCallback\<void>): void; ...@@ -641,7 +647,7 @@ print(msg: string, callback: AsyncCallback\<void>): void;
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let msg = 'msg'; let msg = 'msg';
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
...@@ -673,7 +679,7 @@ print(msg: string): Promise\<void>; ...@@ -673,7 +679,7 @@ print(msg: string): Promise\<void>;
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let msg = 'msg'; let msg = 'msg';
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
...@@ -700,7 +706,7 @@ executeShellCommand(cmd: string, callback: AsyncCallback\<ShellCmdResult>): void ...@@ -700,7 +706,7 @@ executeShellCommand(cmd: string, callback: AsyncCallback\<ShellCmdResult>): void
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let cmd = 'cmd'; let cmd = 'cmd';
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
...@@ -728,7 +734,7 @@ executeShellCommand(cmd: string, timeoutSecs: number, callback: AsyncCallback\<S ...@@ -728,7 +734,7 @@ executeShellCommand(cmd: string, timeoutSecs: number, callback: AsyncCallback\<S
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let cmd = 'cmd'; let cmd = 'cmd';
let timeout = 100; let timeout = 100;
...@@ -762,7 +768,7 @@ executeShellCommand(cmd: string, timeoutSecs?: number): Promise\<ShellCmdResult> ...@@ -762,7 +768,7 @@ executeShellCommand(cmd: string, timeoutSecs?: number): Promise\<ShellCmdResult>
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let cmd = 'cmd'; let cmd = 'cmd';
let timeout = 100; let timeout = 100;
...@@ -791,7 +797,7 @@ finishTest(msg: string, code: number, callback: AsyncCallback\<void>): void; ...@@ -791,7 +797,7 @@ finishTest(msg: string, code: number, callback: AsyncCallback\<void>): void;
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let msg = 'msg'; let msg = 'msg';
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
...@@ -824,7 +830,7 @@ finishTest(msg: string, code: number): Promise\<void>; ...@@ -824,7 +830,7 @@ finishTest(msg: string, code: number): Promise\<void>;
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let msg = 'msg'; let msg = 'msg';
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
...@@ -851,7 +857,7 @@ addAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback\<vo ...@@ -851,7 +857,7 @@ addAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback\<vo
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let monitor = { let monitor = {
moduleName: 'moduleName', moduleName: 'moduleName',
...@@ -887,7 +893,7 @@ addAbilityStageMonitor(monitor: AbilityStageMonitor): Promise\<void>; ...@@ -887,7 +893,7 @@ addAbilityStageMonitor(monitor: AbilityStageMonitor): Promise\<void>;
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let monitor = { let monitor = {
moduleName: 'moduleName', moduleName: 'moduleName',
...@@ -918,7 +924,7 @@ removeAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback\ ...@@ -918,7 +924,7 @@ removeAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback\
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let monitor = { let monitor = {
moduleName: 'moduleName', moduleName: 'moduleName',
...@@ -954,7 +960,7 @@ removeAbilityStageMonitor(monitor: AbilityStageMonitor): Promise\<void>; ...@@ -954,7 +960,7 @@ removeAbilityStageMonitor(monitor: AbilityStageMonitor): Promise\<void>;
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let monitor = { let monitor = {
moduleName: 'moduleName', moduleName: 'moduleName',
...@@ -985,7 +991,7 @@ waitAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback\<A ...@@ -985,7 +991,7 @@ waitAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback\<A
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
function onAbilityCreateCallback(data) { function onAbilityCreateCallback(data) {
console.info('onAbilityCreateCallback'); console.info('onAbilityCreateCallback');
...@@ -1026,7 +1032,7 @@ waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout?: number): Promise ...@@ -1026,7 +1032,7 @@ waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout?: number): Promise
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
function onAbilityCreateCallback(data) { function onAbilityCreateCallback(data) {
console.info('onAbilityCreateCallback'); console.info('onAbilityCreateCallback');
...@@ -1062,7 +1068,7 @@ waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout: number, callback: ...@@ -1062,7 +1068,7 @@ waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout: number, callback:
**示例:** **示例:**
```ts ```ts
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let timeout = 100; let timeout = 100;
function onAbilityCreateCallback(data) { function onAbilityCreateCallback(data) {
......
...@@ -6,6 +6,12 @@ AbilityDelegatorArgs模块提供在应用程序执行测试用例期间,获取 ...@@ -6,6 +6,12 @@ AbilityDelegatorArgs模块提供在应用程序执行测试用例期间,获取
> >
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
```ts
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
```
## 使用说明 ## 使用说明
通过AbilityDelegatorRegistry中[getArguments](js-apis-app-ability-abilityDelegatorRegistry.md#abilitydelegatorregistrygetarguments)方法获取。 通过AbilityDelegatorRegistry中[getArguments](js-apis-app-ability-abilityDelegatorRegistry.md#abilitydelegatorregistrygetarguments)方法获取。
...@@ -28,5 +34,5 @@ AbilityDelegatorArgs模块提供在应用程序执行测试用例期间,获取 ...@@ -28,5 +34,5 @@ AbilityDelegatorArgs模块提供在应用程序执行测试用例期间,获取
```ts ```ts
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
let args = AbilityDelegatorRegistry.getArguments(); let args: AbilityDelegatorRegistry.AbilityDelegatorArgs = AbilityDelegatorRegistry.getArguments();
``` ```
...@@ -6,6 +6,12 @@ AbilityMonitor模块提供匹配满足指定条件的受监视能力对象的方 ...@@ -6,6 +6,12 @@ AbilityMonitor模块提供匹配满足指定条件的受监视能力对象的方
> >
> 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
```ts
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
```
## 使用说明 ## 使用说明
可以作为abilityDelegator中的[addAbilityMonitor](js-apis-inner-application-abilityDelegator.md#addabilitymonitor9)的入参来监听指定Ability的生命周期变化。 可以作为abilityDelegator中的[addAbilityMonitor](js-apis-inner-application-abilityDelegator.md#addabilitymonitor9)的入参来监听指定Ability的生命周期变化。
...@@ -43,7 +49,7 @@ let monitor = { ...@@ -43,7 +49,7 @@ let monitor = {
onAbilityCreate: onAbilityCreateCallback onAbilityCreate: onAbilityCreateCallback
}; };
let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.addAbilityMonitor(monitor, (error : any) => { abilityDelegator.addAbilityMonitor(monitor, (error : any) => {
if (error && error.code !== 0) { if (error && error.code !== 0) {
console.error('addAbilityMonitor fail, error: ${JSON.stringify(error)}'); console.error('addAbilityMonitor fail, error: ${JSON.stringify(error)}');
......
...@@ -6,6 +6,12 @@ AbilityRunningInfo模块提供对Ability运行的相关信息和状态的定义 ...@@ -6,6 +6,12 @@ AbilityRunningInfo模块提供对Ability运行的相关信息和状态的定义
> >
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
```ts
import abilitymanager from '@ohos.app.ability.abilityManager';
```
## 使用说明 ## 使用说明
通过abilityManager中[getAbilityRunningInfos](js-apis-app-ability-abilityManager.md#getabilityrunninginfos)方法获取。 通过abilityManager中[getAbilityRunningInfos](js-apis-app-ability-abilityManager.md#getabilityrunninginfos)方法获取。
......
...@@ -9,6 +9,12 @@ AbilityStageContext提供允许访问特定于abilityStage的资源的能力, ...@@ -9,6 +9,12 @@ AbilityStageContext提供允许访问特定于abilityStage的资源的能力,
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。 > 本模块接口仅可在Stage模型下使用。
## 导入模块
```ts
import common from '@ohos.app.ability.common';
```
## 使用说明 ## 使用说明
通过AbilityStage实例来获取。 通过AbilityStage实例来获取。
......
# AbilityStageMonitor # AbilityStageMonitor
提供用于匹配满足指定条件的受监视的AbilityStage对象的方法。最近匹配的AbilityStage对象将保存在AbilityStageMonitor对象中。 提供用于匹配满足指定条件的受监视的AbilityStage对象的方法。最近匹配的AbilityStage对象将保存在AbilityStageMonitor对象中。
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
......
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
定义Ability状态信息,可以通过[registerApplicationStateObserver](js-apis-application-appManager.md#appmanagerregisterapplicationstateobserver8)注册生命周期变化监听后,通过[ApplicationStateObserver](js-apis-inner-application-applicationStateObserver.md)的onAbilityStateChanged生命周期回调获取。 定义Ability状态信息,可以通过[registerApplicationStateObserver](js-apis-application-appManager.md#appmanagerregisterapplicationstateobserver8)注册生命周期变化监听后,通过[ApplicationStateObserver](js-apis-inner-application-applicationStateObserver.md)的onAbilityStateChanged生命周期回调获取。
## 导入模块
```ts
import appManager from '@ohos.application.appManager';
```
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 类型 | 可读 | 可写 | 说明 | | 名称 | 类型 | 可读 | 可写 | 说明 |
......
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
定义应用状态信息,可以通过[getForegroundApplications](js-apis-app-ability-appManager.md#appmanagergetforegroundapplications)获取当前应用的相关信息。 定义应用状态信息,可以通过[getForegroundApplications](js-apis-app-ability-appManager.md#appmanagergetforegroundapplications)获取当前应用的相关信息。
## 导入模块
```ts
import appManager from '@ohos.app.ability.appManager';
```
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
**系统API**:本模块被标记为@systemapi,对三方应用隐藏 **系统API**:本模块被标记为@systemapi,对三方应用隐藏
......
...@@ -7,12 +7,18 @@ ApplicationContext模块提供开发者应用级别的的上下文的能力, ...@@ -7,12 +7,18 @@ ApplicationContext模块提供开发者应用级别的的上下文的能力,
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。 > 本模块接口仅可在Stage模型下使用。
## 导入模块
```ts
import common from '@ohos.app.ability.common';
```
## 使用说明 ## 使用说明
在使用ApplicationContext的功能前,需要通过context的实例获取。 在使用ApplicationContext的功能前,需要通过context的实例获取。
```ts ```ts
let applicationContext = this.context.getApplicationContext(); let applicationContext: common.ApplicationContext = this.context.getApplicationContext();
``` ```
## ApplicationContext.on(type: 'abilityLifecycle', callback: AbilityLifecycleCallback) ## ApplicationContext.on(type: 'abilityLifecycle', callback: AbilityLifecycleCallback)
......
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
定义应用状态监听,可以作为[registerApplicationStateObserver](js-apis-application-appManager.md#appmanagerregisterapplicationstateobserver8)的入参监听当前应用的生命周期变化。 定义应用状态监听,可以作为[registerApplicationStateObserver](js-apis-application-appManager.md#appmanagerregisterapplicationstateobserver8)的入参监听当前应用的生命周期变化。
## 导入模块
```ts
import appManager from '@ohos.application.appManager';
```
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
**系统API**:该接口为系统接口,三方应用不支持调用。 **系统API**:该接口为系统接口,三方应用不支持调用。
......
...@@ -6,6 +6,12 @@ BaseContext抽象类用于表示继承的子类Context是Stage模型还是FA模 ...@@ -6,6 +6,12 @@ BaseContext抽象类用于表示继承的子类Context是Stage模型还是FA模
> >
> 本模块首批接口从API version 8 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 8 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
```ts
import common from '@ohos.app.ability.common';
```
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core **系统能力**:SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 类型 | 可读 | 可写 | 说明 | | 名称 | 类型 | 可读 | 可写 | 说明 |
......
...@@ -7,6 +7,12 @@ Context模块提供了ability或application的上下文的能力,包括访问 ...@@ -7,6 +7,12 @@ Context模块提供了ability或application的上下文的能力,包括访问
> - 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > - 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> - 本模块接口仅可在Stage模型下使用。 > - 本模块接口仅可在Stage模型下使用。
## 导入模块
```ts
import common from '@ohos.app.ability.common';
```
## 属性 ## 属性
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
...@@ -58,7 +64,7 @@ createBundleContext(bundleName: string): Context; ...@@ -58,7 +64,7 @@ createBundleContext(bundleName: string): Context;
**示例:** **示例:**
```ts ```ts
let bundleContext; let bundleContext: common.Context;
try { try {
bundleContext = this.context.createBundleContext('com.example.test'); bundleContext = this.context.createBundleContext('com.example.test');
} catch (error) { } catch (error) {
...@@ -97,7 +103,7 @@ createModuleContext(moduleName: string): Context; ...@@ -97,7 +103,7 @@ createModuleContext(moduleName: string): Context;
**示例:** **示例:**
```ts ```ts
let moduleContext; let moduleContext: common.Context;
try { try {
moduleContext = this.context.createModuleContext('entry'); moduleContext = this.context.createModuleContext('entry');
} catch (error) { } catch (error) {
...@@ -137,7 +143,7 @@ createModuleContext(bundleName: string, moduleName: string): Context; ...@@ -137,7 +143,7 @@ createModuleContext(bundleName: string, moduleName: string): Context;
**示例:** **示例:**
```ts ```ts
let moduleContext; let moduleContext: common.Context;
try { try {
moduleContext = this.context.createModuleContext('com.example.test', 'entry'); moduleContext = this.context.createModuleContext('com.example.test', 'entry');
} catch (error) { } catch (error) {
...@@ -162,7 +168,7 @@ getApplicationContext(): ApplicationContext; ...@@ -162,7 +168,7 @@ getApplicationContext(): ApplicationContext;
**示例:** **示例:**
```ts ```ts
let applicationContext; let applicationContext: common.Context;
try { try {
applicationContext = this.context.getApplicationContext(); applicationContext = this.context.getApplicationContext();
} catch (error) { } catch (error) {
......
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
定义异常监听,可以作为[ErrorManager.on](js-apis-app-ability-errorManager.md#errormanageron)的入参监听当前应用发生的异常。 定义异常监听,可以作为[ErrorManager.on](js-apis-app-ability-errorManager.md#errormanageron)的入参监听当前应用发生的异常。
## 导入模块
```ts
import errorManager from '@ohos.app.ability.errorManager';
```
## ErrorObserver.onUnhandledException ## ErrorObserver.onUnhandledException
onUnhandledException(errMsg: string): void; onUnhandledException(errMsg: string): void;
......
...@@ -7,6 +7,12 @@ EventHub模块提供了事件中心,提供订阅、取消订阅、触发事件 ...@@ -7,6 +7,12 @@ EventHub模块提供了事件中心,提供订阅、取消订阅、触发事件
> - 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > - 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> - 本模块接口仅可在Stage模型下使用。 > - 本模块接口仅可在Stage模型下使用。
## 导入模块
```ts
import common from '@ohos.app.ability.common';
```
## 使用说明 ## 使用说明
在使用eventHub的功能前,需要通过UIAbility实例的成员变量context获取。 在使用eventHub的功能前,需要通过UIAbility实例的成员变量context获取。
......
...@@ -9,6 +9,12 @@ ExtensionContext模块提供访问特定Extension的资源的能力,对于拓 ...@@ -9,6 +9,12 @@ ExtensionContext模块提供访问特定Extension的资源的能力,对于拓
> - 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > - 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> - 本模块接口仅可在Stage模型下使用。 > - 本模块接口仅可在Stage模型下使用。
## 导入模块
```ts
import common from '@ohos.app.ability.common';
```
## 属性 ## 属性
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core **系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......
...@@ -7,6 +7,12 @@ ExtensionRunningInfo模块封装了Extension运行的相关信息,可以通过 ...@@ -7,6 +7,12 @@ ExtensionRunningInfo模块封装了Extension运行的相关信息,可以通过
> - 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > - 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> - 本模块被标记为@systemapi,对三方应用隐藏 > - 本模块被标记为@systemapi,对三方应用隐藏
## 导入模块
```ts
import abilityManager from '@ohos.app.ability.abilityManager';
```
## 使用说明 ## 使用说明
导入abilityManager模块,通过调用abilityManager中的方法获取ExtensionRunningInfo。 导入abilityManager模块,通过调用abilityManager中的方法获取ExtensionRunningInfo。
......
...@@ -9,6 +9,12 @@ FormExtensionContext模块提供FormExtensionAbility具有的接口和能力。 ...@@ -9,6 +9,12 @@ FormExtensionContext模块提供FormExtensionAbility具有的接口和能力。
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。 > 本模块接口仅可在Stage模型下使用。
## 导入模块
```ts
import common from '@ohos.app.ability.common';
```
## 使用说明 ## 使用说明
在使用FormExtensionContext的功能前,需要通过FormExtensionAbility获取。 在使用FormExtensionContext的功能前,需要通过FormExtensionAbility获取。
......
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
表示任务的详细信息,可以通过[getMissionInfo](js-apis-app-ability-missionManager.md#missionmanagergetmissioninfo)获取。 表示任务的详细信息,可以通过[getMissionInfo](js-apis-app-ability-missionManager.md#missionmanagergetmissioninfo)获取。
## 导入模块
```ts
import missionManager from '@ohos.app.ability.missionManager';
```
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Mission **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Mission
**系统API**: 此接口为系统接口,三方应用不支持调用。 **系统API**: 此接口为系统接口,三方应用不支持调用。
......
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
定义系统任务状态监听,可以通过[on](js-apis-app-ability-missionManager.md#missionmanageron)注册。 定义系统任务状态监听,可以通过[on](js-apis-app-ability-missionManager.md#missionmanageron)注册。
## 导入模块
```ts
import missionManager from '@ohos.app.ability.missionManager';
```
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Mission **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Mission
| 名称 | 类型 | 必填 | 说明 | | 名称 | 类型 | 必填 | 说明 |
......
...@@ -7,6 +7,12 @@ ...@@ -7,6 +7,12 @@
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口均为系统接口,三方应用不支持调用 > 本模块接口均为系统接口,三方应用不支持调用
## 导入模块
```ts
import missionManager from '@ohos.app.ability.missionManager';
```
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Mission **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Mission
| 名称 | 类型 | 可读 | 可写 | 说明 | | 名称 | 类型 | 可读 | 可写 | 说明 |
......
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
进程数据的对象定义。使用接口[registerApplicationStateObserver](js-apis-application-appManager.md#appmanagerregisterapplicationstateobserver8)注册生命周期变化监听后,当应用或组件的生命周期变化时,系统通过[ApplicationStateObserver](js-apis-inner-application-applicationStateObserver.md)的onProcessCreated等方法回调给开发者。 进程数据的对象定义。使用接口[registerApplicationStateObserver](js-apis-application-appManager.md#appmanagerregisterapplicationstateobserver8)注册生命周期变化监听后,当应用或组件的生命周期变化时,系统通过[ApplicationStateObserver](js-apis-inner-application-applicationStateObserver.md)的onProcessCreated等方法回调给开发者。
## 导入模块
```ts
import appManager from '@ohos.app.ability.appManager';
```
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
**系统API**:该接口为系统接口,三方应用不支持调用。 **系统API**:该接口为系统接口,三方应用不支持调用。
......
...@@ -6,6 +6,12 @@ ProcessInformation模块提供对进程运行信息进行查询的能力。 ...@@ -6,6 +6,12 @@ ProcessInformation模块提供对进程运行信息进行查询的能力。
> >
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
```ts
import appManager from '@ohos.app.ability.appManager';
```
## 使用说明 ## 使用说明
通过appManager的[getRunningProcessInformation](js-apis-app-ability-appManager.md#appmanagergetrunningprocessinformation9)来获取。 通过appManager的[getRunningProcessInformation](js-apis-app-ability-appManager.md#appmanagergetrunningprocessinformation9)来获取。
......
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
> - 本模块接口从API version 9 开始废弃,建议使用[ProcessInformation<sup>9+</sup>](js-apis-inner-application-processInformation.md)替代。 > - 本模块接口从API version 9 开始废弃,建议使用[ProcessInformation<sup>9+</sup>](js-apis-inner-application-processInformation.md)替代。
> - 本模块首批接口从API version 8 开始支持。 > - 本模块首批接口从API version 8 开始支持。
## 导入模块
```ts
import appManager from '@ohos.app.ability.appManager';
```
## 属性 ## 属性
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Mission **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Mission
......
...@@ -9,6 +9,12 @@ ServiceExtensionContext模块提供ServiceExtensionAbility具有的能力,包 ...@@ -9,6 +9,12 @@ ServiceExtensionContext模块提供ServiceExtensionAbility具有的能力,包
> - 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > - 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> - 本模块接口仅可在Stage模型下使用。 > - 本模块接口仅可在Stage模型下使用。
## 导入模块
```ts
import common from '@ohos.app.ability.common';
```
## 使用说明 ## 使用说明
在使用ServiceExtensionContext的功能前,需要通过ServiceExtensionAbility子类实例获取。 在使用ServiceExtensionContext的功能前,需要通过ServiceExtensionAbility子类实例获取。
......
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
> >
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
```ts
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
```
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 类型 | 可读 | 可写 | 说明 | | 名称 | 类型 | 可读 | 可写 | 说明 |
...@@ -20,7 +26,7 @@ ...@@ -20,7 +26,7 @@
**示例:** **示例:**
```ts ```ts
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
let abilityDelegator; let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator;
let cmd = 'cmd'; let cmd = 'cmd';
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
......
...@@ -7,6 +7,12 @@ UIAbilityContext是[UIAbility](js-apis-app-ability-uiAbility.md)的上下文环 ...@@ -7,6 +7,12 @@ UIAbilityContext是[UIAbility](js-apis-app-ability-uiAbility.md)的上下文环
> - 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > - 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> - 本模块接口仅可在Stage模型下使用。 > - 本模块接口仅可在Stage模型下使用。
## 导入模块
```ts
import common from '@ohos.app.ability.common';
```
## 属性 ## 属性
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
......
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
作为[trigger](js-apis-app-ability-wantAgent.md#wantagenttrigger)的入参定义触发WantAgent所需要的信息。 作为[trigger](js-apis-app-ability-wantAgent.md#wantagenttrigger)的入参定义触发WantAgent所需要的信息。
## 导入模块
```ts
import wantAgent from '@ohos.app.ability.wantAgent';
```
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 类型 | 必填 | 说明 | | 名称 | 类型 | 必填 | 说明 |
......
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
定义触发WantAgent所需要的信息,可以作为[getWantAgent](js-apis-app-ability-wantAgent.md#wantagentgetwantagent)的入参创建指定的WantAgent对象。 定义触发WantAgent所需要的信息,可以作为[getWantAgent](js-apis-app-ability-wantAgent.md#wantagentgetwantagent)的入参创建指定的WantAgent对象。
## 导入模块
```ts
import wantAgent from '@ohos.app.ability.wantAgent';
```
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 类型 | 必填 | 说明 | | 名称 | 类型 | 必填 | 说明 |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册