提交 23ff4f88 编写于 作者: W wusongqing

updated docs

Signed-off-by: Nwusongqing <wusongqing@huawei.com>
上级 e122fa58
# AbilityDelegator
> **Note**
> **NOTE**<br/>
>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
......@@ -423,7 +423,7 @@ Starts an ability. This API uses an asynchronous callback to return the result.
| Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | ---- | ------------------ |
| want | [Want](js-apis-featureAbility.md#Want) | Yes | **Want** parameter for starting the ability. |
| want | [Want](js-apis-application-Want.md) | Yes | **Want** parameter for starting the ability. |
| callback | AsyncCallback\<void> | Yes | Callback used to return the result.|
**Example**
......@@ -455,7 +455,7 @@ Starts an ability. This API uses a promise to return the result.
| Name| Type | Mandatory| Description |
| ------ | -------------------------------------- | ---- | --------------- |
| want | [Want](js-apis-featureAbility.md#Want) | Yes | **Want** parameter for starting the ability.|
| want | [Want](js-apis-application-Want.md) | Yes | **Want** parameter for starting the ability.|
**Return value**
......
# FeatureAbility Module (JavaScript)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Constraints
......@@ -17,7 +17,7 @@ import featureAbility from '@ohos.ability.featureAbility'
startAbility(parameter: StartAbilityParameter, callback: AsyncCallback\<number>): void
Starts an ability. This API uses a callback to return the result.
Starts an ability. This method uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
......@@ -42,9 +42,8 @@ featureAbility.startAbility(
type: "",
flags: wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION,
deviceId: "",
bundleName: "com.example.myapplication",
/* In the FA model, abilityName consists of package and ability name. */
abilityName: "com.example.entry.secondAbility",,
bundleName: "com.example.startability",
abilityName: "com.example.startability.MainAbility",
uri: ""
},
},
......@@ -57,7 +56,7 @@ featureAbility.startAbility(
startAbility(parameter: StartAbilityParameter): Promise\<number>
Starts an ability. This API uses a promise to return the result.
Starts an ability. This method uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
......@@ -81,9 +80,8 @@ featureAbility.startAbility(
type: "MIMETYPE",
flags: wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION,
deviceId: "",
bundleName: "com.example.myapplication",
/* In the FA model, abilityName consists of package and ability name. */
abilityName: "com.example.entry.secondAbility",
bundleName: "com.example.startability",
abilityName: "com.example.startability.MainAbility",
uri: ""
},
}
......@@ -125,7 +123,7 @@ featureAbility.acquireDataAbilityHelper(
startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback\<AbilityResult>): void
Starts an ability. This API uses a callback to return the execution result when the ability is destroyed.
Starts an ability. This method uses a callback to return the execution result when the ability is destroyed.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
......@@ -150,9 +148,8 @@ featureAbility.startAbilityForResult(
type: "MIMETYPE",
flags: wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION,
deviceId: "",
bundleName: "com.example.myapplication",
/* In the FA model, abilityName consists of package and ability name. */
abilityName: "com.example.entry.secondAbility",
bundleName: "com.example.featureabilitytest",
abilityName: "com.example.featureabilitytest.MainAbility",
uri:""
},
},
......@@ -166,7 +163,7 @@ featureAbility.startAbilityForResult(
startAbilityForResult(parameter: StartAbilityParameter): Promise\<AbilityResult>
Starts an ability. This API uses a promise to return the execution result when the ability is destroyed.
Starts an ability. This method uses a promise to return the execution result when the ability is destroyed.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
......@@ -196,9 +193,8 @@ featureAbility.startAbilityForResult(
type: "MIMETYPE",
flags: wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION,
deviceId: "",
bundleName: "com.example.myapplication",
/* In the FA model, abilityName consists of package and ability name. */
abilityName: "com.example.entry.secondAbility",
bundleName: "com.example.featureabilitytest",
abilityName: "com.example.featureabilitytest.MainAbility",
uri:"",
parameters:
{
......@@ -223,7 +219,7 @@ featureAbility.startAbilityForResult(
terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback\<void>): void
Destroys this Page ability, with the result code and data sent to the caller. This API uses a callback to return the result.
Destroys this Page ability, with the result code and data sent to the caller. This method uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
......@@ -249,9 +245,8 @@ featureAbility.terminateSelfWithResult(
type: "MIMETYPE",
flags: wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION,
deviceId: "",
bundleName: "com.example.myapplication",
/* In the FA model, abilityName consists of package and ability name. */
abilityName: "com.example.entry.secondAbility",
bundleName: "com.example.featureabilitytest",
abilityName: "com.example.featureabilitytest.MainAbility",
uri:"",
parameters: {
mykey0: 2222,
......@@ -272,7 +267,7 @@ featureAbility.terminateSelfWithResult(
terminateSelfWithResult(parameter: AbilityResult): Promise\<void>
Destroys this Page ability, with the result code and data sent to the caller. This API uses a promise to return the result.
Destroys this Page ability, with the result code and data sent to the caller. This method uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
......@@ -303,9 +298,8 @@ featureAbility.terminateSelfWithResult(
type: "MIMETYPE",
flags: wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION,
deviceId: "",
bundleName: "com.example.myapplication",
/* In the FA model, abilityName consists of package and ability name. */
abilityName: "com.example.entry.secondAbility",
bundleName: "com.example.featureabilitytest",
abilityName: "com.example.featureabilitytest.MainAbility",
uri:"",
parameters: {
mykey0: 2222,
......@@ -330,7 +324,7 @@ featureAbility.terminateSelfWithResult(
hasWindowFocus(callback: AsyncCallback\<boolean>): void
Checks whether the main window of this ability has the focus. This API uses a callback to return the result.
Checks whether the main window of this ability has the focus. This method uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
......@@ -353,7 +347,7 @@ featureAbility.hasWindowFocus()
hasWindowFocus(): Promise\<boolean>
Checks whether the main window of this ability has the focus. This API uses a promise to return the result.
Checks whether the main window of this ability has the focus. This method uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
......@@ -378,7 +372,7 @@ featureAbility.hasWindowFocus().then((data) => {
getWant(callback: AsyncCallback\<Want>): void
Obtains the **Want** object sent from this ability. This API uses a callback to return the result.
Obtains the **Want** object sent from this ability. This method uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
......@@ -401,7 +395,7 @@ featureAbility.getWant()
getWant(): Promise\<Want>
Obtains the **Want** object sent from this ability. This API uses a promise to return the result.
Obtains the **Want** object sent from this ability. This method uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
......@@ -448,7 +442,7 @@ context.getBundleName()
terminateSelf(callback: AsyncCallback\<void>): void
Destroys this Page ability, with the result code and data sent to the caller. This API uses a callback to return the result.
Destroys this Page ability, with the result code and data sent to the caller. This method uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
......@@ -471,7 +465,7 @@ featureAbility.terminateSelf()
terminateSelf(): Promise\<void>
Destroys this Page ability, with the result code and data sent to the caller. This API uses a promise to return the result.
Destroys this Page ability, with the result code and data sent to the caller. This method uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
......@@ -494,7 +488,7 @@ featureAbility.terminateSelf().then((data) => {
connectAbility(request: Want, options:ConnectOptions): number
Connects this ability to a specific Service ability. This API uses a callback to return the result.
Connects this ability to a specific Service ability. This method uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
......@@ -563,7 +557,7 @@ var connId = featureAbility.connectAbility(
disconnectAbility(connection: number, callback:AsyncCallback\<void>): void
Disconnects this ability from a specific Service ability. This API uses a callback to return the result.
Disconnects this ability from a specific Service ability. This method uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
......@@ -610,7 +604,7 @@ var result = featureAbility.disconnectAbility(connId,
disconnectAbility(connection: number): Promise\<void>
Disconnects this ability from a specific Service ability. This API uses a promise to return the result.
Disconnects this ability from a specific Service ability. This method uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
......@@ -662,7 +656,7 @@ featureAbility.disconnectAbility(connId).then((error,data) => {
getWindow(callback: AsyncCallback\<window.Window>): void
Obtains the window corresponding to this ability. This API uses a callback to return the result.
Obtains the window corresponding to this ability. This method uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
......@@ -682,7 +676,7 @@ featureAbility.getWindow()
getWindow(): Promise\<window.Window>;
Obtains the window corresponding to this ability. This API uses a promise to return the result.
Obtains the window corresponding to this ability. This method uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
......
# FormExtension
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
Provides **FormExtension** APIs.
......@@ -35,7 +35,7 @@ Called to notify the widget provider that a **Form** instance (widget) has been
| Name| Type | Mandatory| Description |
| ------ | -------------------------------------- | ---- | ------------------------------------------------------------ |
| want | [Want](js-apis-featureAbility.md#want) | Yes | Information related to the extension, including the widget ID, name, and style. The information must be managed as persistent data to facilitate subsequent widget update and deletion.|
| want | [Want](js-apis-application-Want.md) | Yes | Information related to the extension, including the widget ID, name, and style. The information must be managed as persistent data to facilitate subsequent widget update and deletion.|
**Return value**
......
# missionManager
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
Provides mission management. You can use the APIs to lock, unlock, and clear missions, and switch a mission to the foreground.
missionManager provides APIs to lock, unlock, and clear missions, and switch a mission to the foreground.
## Modules to Import
......@@ -34,7 +34,7 @@ Registers a listener to observe the mission status.
| Type| Description|
| -------- | -------- |
| number | Returns the index of the listener, which is created by the system and allocated when the mission status listener is registered. Each listener has a unique index.|
| number | Returns the unique index of the mission status listener, which is created by the system and allocated when the listener is registered.|
**Example**
......@@ -55,7 +55,7 @@ Registers a listener to observe the mission status.
unregisterMissionListener(listenerId: number, callback: AsyncCallback&lt;void&gt;): void;
Unregisters a mission status listener. This API uses an asynchronous callback to return the result.
Deregisters a mission status listener. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
......@@ -63,7 +63,7 @@ Unregisters a mission status listener. This API uses an asynchronous callback to
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| listenerId | number | Yes| Index of the mission status listener to unregister. Each listener has a unique index, which is returned by **registerMissionListener**.|
| listenerId | number | Yes| Unique index of the mission status listener to unregister. It is returned by **registerMissionListener**.|
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
**Example**
......@@ -88,7 +88,7 @@ Unregisters a mission status listener. This API uses an asynchronous callback to
unregisterMissionListener(listenerId: number): Promise&lt;void&gt;;
Unregisters a mission status listener. This API uses a promise to return the result.
Deregisters a mission status listener. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
......@@ -96,7 +96,7 @@ Unregisters a mission status listener. This API uses a promise to return the res
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| listenerId | number | Yes| Index of the mission status listener to unregister. Each listener has a unique index, which is returned by **registerMissionListener**.|
| listenerId | number | Yes| Unique index of the mission status listener to unregister. It is returned by **registerMissionListener**.|
**Return value**
......@@ -126,7 +126,7 @@ Unregisters a mission status listener. This API uses a promise to return the res
getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback&lt;MissionInfo&gt;): void;
Obtains the information of a given mission. This API uses an asynchronous callback to return the result.
Obtains the information about a given mission. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
......@@ -159,7 +159,7 @@ Obtains the information of a given mission. This API uses an asynchronous callba
getMissionInfo(deviceId: string, missionId: number): Promise&lt;MissionInfo&gt;;
Obtains the information of a given mission. This API uses a promise to return the result.
Obtains the information about a given mission. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
......@@ -191,7 +191,7 @@ Obtains the information of a given mission. This API uses a promise to return th
getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback&lt;Array&lt;MissionInfo&gt;&gt;): void;
Obtains information of all missions. This API uses an asynchronous callback to return the result.
Obtains information about all missions. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
......@@ -220,7 +220,7 @@ Obtains information of all missions. This API uses an asynchronous callback to r
getMissionInfos(deviceId: string, numMax: number): Promise&lt;Array&lt;MissionInfo&gt;&gt;;
Obtains information of all missions. This API uses a promise to return the result.
Obtains information about all missions. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
......@@ -617,7 +617,7 @@ Switches a given mission to the foreground. This API uses an asynchronous callba
moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCallback&lt;void&gt;): void;
Switches a given mission to the foreground, with the startup parameters for the switch specified, such as the window mode and device ID. This API uses an asynchronous callback to return the result.
Switches a given mission to the foreground, with the startup parameters for the switching specified. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
......@@ -651,7 +651,7 @@ Switches a given mission to the foreground, with the startup parameters for the
moveMissionToFront(missionId: number, options?: StartOptions): Promise&lt;void&gt;;
Switches a given mission to the foreground, with the startup parameters for the switch specified, such as the window mode and device ID. This API uses a promise to return the result.
Switches a given mission to the foreground, with the startup parameters for the switching specified. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
......@@ -697,7 +697,7 @@ Describes the mission information.
| runningState | number | Yes| Yes| Running state of the mission.|
| lockedState | boolean | Yes| Yes| Locked state of the mission.|
| timestamp | string | Yes| Yes| Latest time when the mission was created or updated.|
| want | [Want](js-apis-featureAbility.md#want) | Yes| Yes| **Want** information of the mission.|
| want | [Want](js-apis-application-Want.md) | Yes| Yes| **Want** information of the mission.|
| label | string | Yes| Yes| Label of the mission.|
| iconPath | string | Yes| Yes| Path of the mission icon.|
| continuable | boolean | Yes| Yes| Whether the mission is continuable.|
# ParticleAbility Module
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Constraints
......@@ -260,16 +260,16 @@ Requests a continuous task from the system. This API uses a promise to return th
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| id | number | Yes| Notification ID of a continuous task.|
| request | NotificationRequest | Yes| Notification parameter, which is used to display information in the notification bar.|
| id | number | Yes | Notification ID of a continuous task. |
| request | NotificationRequest | Yes | Notification parameter, which is used to display information in the notification bar. |
**Return value**
| Type | Description |
| Type | Description |
| -------------- | ------------------------- |
| Promise\<void> | Promise used to return the result.|
| Promise\<void> | Promise used to return the result. |
**Example**
......@@ -323,9 +323,9 @@ Requests to cancel a continuous task from the system. This API uses an asynchron
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Example**
......@@ -354,9 +354,9 @@ Requests a continuous task from the system. This API uses a promise to return th
**Return value**
| Type | Description |
| Type | Description |
| -------------- | ------------------------- |
| Promise\<void> | Promise used to return the result.|
| Promise\<void> | Promise used to return the result. |
**Example**
......@@ -382,21 +382,21 @@ Connects this ability to a specific Service ability. This API uses a callback to
**Parameters**
| Name | Type | Mandatory| Description |
| Name | Type | Mandatory | Description |
| ------- | -------------- | ---- | ---------------------------- |
| request | [Want](js-apis-featureAbility.md#want) | Yes | Service ability to connect.|
| options | ConnectOptions | Yes | Callback used to return the result. |
| request | [Want](js-apis-application-Want.md) | Yes | Service ability to connect. |
| options | ConnectOptions | Yes | Callback used to return the result. |
ConnectOptions
**ConnectOptions**
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name | Readable/Writable| Type | Mandatory | Description |
| Name | Readable/Writable | Type | Mandatory | Description |
| ------------ | ---- | -------- | ---- | ------------------------- |
| onConnect | Read only | function | Yes | Callback invoked when the connection is successful. |
| onDisconnect | Read only | function | Yes | Callback invoked when the connection fails. |
| onFailed | Read only | function | Yes | Callback invoked when **connectAbility** fails to be called.|
| onConnect | Read only | function | Yes | Callback invoked when the connection is successful. |
| onDisconnect | Read only | function | Yes | Callback invoked when the connection fails. |
| onFailed | Read only | function | Yes | Callback invoked when **connectAbility** fails to be called. |
**Example**
......@@ -440,9 +440,9 @@ Disconnects this ability from the Service ability. This API uses a callback to r
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Example**
......@@ -486,9 +486,9 @@ Disconnects this ability from the Service ability. This API uses a promise to re
**Return value**
| Type | Description |
| Type | Description |
| -------------- | ------------------------- |
| Promise\<void> | Promise used to return the result.|
| Promise\<void> | Promise used to return the result. |
**Example**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册