js-apis-ability-ability.md 2.4 KB
Newer Older
Z
zengyawen 已提交
1
# @ohos.ability.ability (Ability)
M
m00512953 已提交
2 3 4 5 6 7

Ability模块将二级模块API组织在一起方便开发者进行导出。

> **说明:**
> 
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
M
m00512953 已提交
8
> 本模块接口仅可在FA模型下使用
M
m00512953 已提交
9 10 11

## 导入模块

M
m00512953 已提交
12
```ts
M
mingxihua 已提交
13
import ability from '@ohos.ability.ability';
M
m00512953 已提交
14 15
```

Y
yuyaozhi 已提交
16 17
## 属性

18 19 20 21 22 23 24 25
**系统能力**
DataAbilityHelper:SystemCapability.Ability.AbilityRuntime.FAModel
PacMap:SystemCapability.Ability.AbilityRuntime.FAModel
DataAbilityOperation:SystemCapability.Ability.AbilityRuntime.FAModel
DataAbilityResult:SystemCapability.Ability.AbilityRuntime.FAModel
AbilityResult:SystemCapability.Ability.AbilityBase
ConnectOptions:SystemCapability.Ability.AbilityRuntime.Core
StartAbilityParameter:SystemCapability.Ability.AbilityRuntime.FAModel
M
m00512953 已提交
26

W
wangkailong 已提交
27 28 29
| 名称         | 类型                 | 描述                                                         |
| ----------- | -------------------- | ------------------------------------------------------------ |
| DataAbilityHelper    | [DataAbilityHelper](js-apis-inner-ability-dataAbilityHelper.md)               | DataAbilityHelper二级模块。                                |
R
RayShih 已提交
30
| PacMap   | [PacMap](js-apis-inner-ability-dataAbilityHelper.md#pacmap)               | PacMap二级模块。 |
W
wangkailong 已提交
31 32 33 34 35
| DataAbilityOperation   | [DataAbilityOperation](js-apis-inner-ability-dataAbilityOperation.md)               | DataAbilityOperation二级模块。 |
| DataAbilityResult   | [DataAbilityResult](js-apis-inner-ability-dataAbilityResult.md)               | DataAbilityResult二级模块。 |
| AbilityResult   | [AbilityResult](js-apis-inner-ability-abilityResult.md)               | AbilityResult二级模块。 |
| ConnectOptions   | [ConnectOptions](js-apis-inner-ability-connectOptions.md)               | ConnectOptions二级模块。 |
| StartAbilityParameter   | [StartAbilityParameter](js-apis-inner-ability-startAbilityParameter.md)               | StartAbilityParameter二级模块。 |
M
m00512953 已提交
36 37

**示例:**
M
m00512953 已提交
38 39 40 41 42 43 44 45 46 47 48
```ts
import ability from '@ohos.ability.ability';

let dataAbilityHelper: ability.DataAbilityHelper;
let pacMap: ability.PacMap;
let dataAbilityOperation: ability.DataAbilityOperation;
let dataAbilityResult: ability.DataAbilityResult;
let abilityResult: ability.AbilityResult;
let connectOptions: ability.ConnectOptions;  
let startAbilityParameter: ability.StartAbilityParameter;
```