未验证 提交 562f25c1 编写于 作者: O openharmony_ci 提交者: Gitee

!4074 【OpenHarmony开源贡献者计划2022】API相关格式及表达问题-2

Merge pull request !4074 from king_he/api-b
...@@ -11,7 +11,7 @@ Implements the extension context. This module is inherited from **Context**. ...@@ -11,7 +11,7 @@ Implements the extension context. This module is inherited from **Context**.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| currentHapModuleInfo | HapModuleInfo | Yes| No| Information about the current HAP. | | currentHapModuleInfo | HapModuleInfo | Yes| No | Information about the current HAP. |
| config | Configuration | Yes| No| Module configuration information.| | config | Configuration | Yes| No | Module configuration information. |
...@@ -15,12 +15,12 @@ Enumerates the fault types. ...@@ -15,12 +15,12 @@ Enumerates the fault types.
**System capability**: SystemCapability.HiviewDFX.Hiview.FaultLogger **System capability**: SystemCapability.HiviewDFX.Hiview.FaultLogger
| Name| Default Value| Description| | Name | Default Value | Description |
| -------- | -------- | -------- | | -------- | -------- | -------- |
| NO_SPECIFIC | 0 | No specific fault type.| | NO_SPECIFIC | 0 | No specific fault type. |
| CPP_CRASH | 2 | C++ program crash.| | CPP_CRASH | 2 | C++ program crash. |
| JS_CRASH | 3 | JS program crash.| | JS_CRASH | 3 | JS program crash. |
| APP_FREEZE | 4 | Application freezing.| | APP_FREEZE | 4 | Application freezing. |
## FaultLogInfo ## FaultLogInfo
...@@ -30,20 +30,20 @@ Defines the data structure of the fault log information. ...@@ -30,20 +30,20 @@ Defines the data structure of the fault log information.
| Name| Type| Description| | Name| Type| Description|
| -------- | -------- | -------- | | -------- | -------- | -------- |
| pid | number | Process ID of the faulty process.| | pid | number | Process ID of the faulty process. |
| uid | number | User ID of the faulty process.| | uid | number | User ID of the faulty process. |
| type | [FaultType](#faulttype) | Fault type.| | type | [FaultType](#faulttype) | Fault type. |
| timestamp | number | Second-level timestamp when the log was generated.| | timestamp | number | Second-level timestamp when the log was generated. |
| reason | string | Reason for the fault.| | reason | string | Reason for the fault. |
| module | string | Module on which the fault occurred.| | module | string | Module on which the fault occurred. |
| summary | string | Summary of the fault.| | summary | string | Summary of the fault. |
| fullLog | string | Full log text.| | fullLog | string | Full log text. |
## faultLogger.querySelfFaultLog ## faultLogger.querySelfFaultLog
querySelfFaultLog(faultType: FaultType, callback: AsyncCallback<Array<FaultLogInfo>>) : void querySelfFaultLog(faultType: FaultType, callback: AsyncCallback<Array<FaultLogInfo>>) : void
Obtains the fault information about the current process. This API uses a callback to return the fault information array obtained, which contains a maximum of 10 pieces of fault information. Obtains the fault information about the current process. This API uses an asynchronous callback to return the fault information array obtained, which contains a maximum of 10 pieces of fault information.
**System capability**: SystemCapability.HiviewDFX.Hiview.FaultLogger **System capability**: SystemCapability.HiviewDFX.Hiview.FaultLogger
...@@ -51,7 +51,7 @@ Obtains the fault information about the current process. This API uses a callbac ...@@ -51,7 +51,7 @@ Obtains the fault information about the current process. This API uses a callbac
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| faultType | [FaultType](#faulttype) | Yes| Fault type.| | faultType | [FaultType](#faulttype) | Yes| Fault type. |
| callback | AsyncCallbackArray&lt;Array&lt;[FaultLogInfo](#faultloginfo)&gt;&gt; | Yes| Callback used to return the fault information array.<br>The value is the fault information array obtained. If the value is **undefined**, an exception occurs during the information retrieval. In this case, an error string will be returned. | callback | AsyncCallbackArray&lt;Array&lt;[FaultLogInfo](#faultloginfo)&gt;&gt; | Yes| Callback used to return the fault information array.<br>The value is the fault information array obtained. If the value is **undefined**, an exception occurs during the information retrieval. In this case, an error string will be returned.
**Example** **Example**
...@@ -91,13 +91,13 @@ Obtains the fault information about the current process. This API uses a promise ...@@ -91,13 +91,13 @@ Obtains the fault information about the current process. This API uses a promise
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| faultType | [FaultType](#faulttype) | Yes| Fault type.| | faultType | [FaultType](#faulttype) | Yes| Fault type. |
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;Array&lt;[FaultLogInfo](#faultloginfo)&gt;&gt; | Promise used to return the fault information array. You can obtain the fault information instance in its **then()** method or use **await**.<br>The value is the fault information array obtained. If the value is **undefined**, an exception occurs during the information retrieval.| | Promise&lt;Array&lt;[FaultLogInfo](#faultloginfo)&gt;&gt; | Promise used to return the fault information array. You can obtain the fault information instance in its **then()** method or use **await**.<br>The value is the fault information array obtained. If the value is **undefined**, an exception occurs during the information retrieval. |
**Example** **Example**
...@@ -120,4 +120,4 @@ async function getLog() { ...@@ -120,4 +120,4 @@ async function getLog() {
} }
} }
} }
``` ```
\ No newline at end of file
# FeatureAbility Module (JavaScript) # FeatureAbility (JavaScript)
> ![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 6. Newly added APIs will be marked with a superscript to indicate their earliest API version. > 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 ## Constraints
...@@ -17,7 +17,7 @@ import featureAbility from '@ohos.ability.featureAbility' ...@@ -17,7 +17,7 @@ import featureAbility from '@ohos.ability.featureAbility'
startAbility(parameter: StartAbilityParameter, callback: AsyncCallback\<number>): void startAbility(parameter: StartAbilityParameter, callback: AsyncCallback\<number>): void
Starts an ability. This method uses a callback to return the result. Starts an ability. This API uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -25,7 +25,7 @@ Starts an ability. This method uses a callback to return the result. ...@@ -25,7 +25,7 @@ Starts an ability. This method uses a callback to return the result.
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| --------- | ---------------------------------------- | ---- | -------------- | | --------- | ---------------------------------------- | ---- | -------------- |
| parameter | [StartAbilityParameter](#startabilityparameter) | Yes | Ability to start.| | parameter | [StartAbilityParameter](#startabilityparameter) | Yes | Ability to start. |
| callback | AsyncCallback\<number> | Yes | Callback used to return the result. | | callback | AsyncCallback\<number> | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -56,7 +56,7 @@ featureAbility.startAbility( ...@@ -56,7 +56,7 @@ featureAbility.startAbility(
startAbility(parameter: StartAbilityParameter): Promise\<number> startAbility(parameter: StartAbilityParameter): Promise\<number>
Starts an ability. This method uses a promise to return the result. Starts an ability. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -64,7 +64,7 @@ Starts an ability. This method uses a promise to return the result. ...@@ -64,7 +64,7 @@ Starts an ability. This method uses a promise to return the result.
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| --------- | ---------------------------------------- | ---- | -------------- | | --------- | ---------------------------------------- | ---- | -------------- |
| parameter | [StartAbilityParameter](#startabilityparameter) | Yes | Ability to start.| | parameter | [StartAbilityParameter](#startabilityparameter) | Yes | Ability to start. |
**Example** **Example**
...@@ -102,13 +102,13 @@ Obtains a **dataAbilityHelper** object. ...@@ -102,13 +102,13 @@ Obtains a **dataAbilityHelper** object.
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ------------ | | ---- | ------ | ---- | ------------ |
| uri | string | Yes | URI of the file to open.| | uri | string | Yes | URI of the file to open. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ----------------- | ------------------------------- | | ----------------- | ------------------------------- |
| DataAbilityHelper | A utility class used to help other abilities access the Data ability.| | DataAbilityHelper | A utility class used to help other abilities access the Data ability. |
**Example** **Example**
...@@ -123,7 +123,7 @@ featureAbility.acquireDataAbilityHelper( ...@@ -123,7 +123,7 @@ featureAbility.acquireDataAbilityHelper(
startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback\<AbilityResult>): void startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback\<AbilityResult>): void
Starts an ability. This method uses a callback to return the execution result when the ability is destroyed. Starts an ability. This API uses a callback to return the execution result when the ability is destroyed.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -131,7 +131,7 @@ Starts an ability. This method uses a callback to return the execution result wh ...@@ -131,7 +131,7 @@ Starts an ability. This method uses a callback to return the execution result wh
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| --------- | ---------------------------------------- | ---- | -------------- | | --------- | ---------------------------------------- | ---- | -------------- |
| parameter | [StartAbilityParameter](#startabilityparameter) | Yes | Ability to start.| | parameter | [StartAbilityParameter](#startabilityparameter) | Yes | Ability to start. |
| callback | AsyncCallback\<[AbilityResult](#abilityresult)> | Yes | Callback used to return the result. | | callback | AsyncCallback\<[AbilityResult](#abilityresult)> | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -163,7 +163,7 @@ featureAbility.startAbilityForResult( ...@@ -163,7 +163,7 @@ featureAbility.startAbilityForResult(
startAbilityForResult(parameter: StartAbilityParameter): Promise\<AbilityResult> startAbilityForResult(parameter: StartAbilityParameter): Promise\<AbilityResult>
Starts an ability. This method uses a promise to return the execution result when the ability is destroyed. Starts an ability. This API uses a promise to return the execution result when the ability is destroyed.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -171,13 +171,13 @@ Starts an ability. This method uses a promise to return the execution result whe ...@@ -171,13 +171,13 @@ Starts an ability. This method uses a promise to return the execution result whe
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| --------- | ---------------------------------------- | ---- | ------------- | | --------- | ---------------------------------------- | ---- | ------------- |
| parameter | [StartAbilityParameter](#startabilityparameter) | Yes | Ability to start.| | parameter | [StartAbilityParameter](#startabilityparameter) | Yes | Ability to start. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------- | ------- | | ---------------------------------------- | ------- |
| Promise\<[AbilityResult](#abilityresult)> | Promised returned with the execution result.| | Promise\<[AbilityResult](#abilityresult)> | Promised returned with the execution result. |
**Example** **Example**
...@@ -219,7 +219,7 @@ featureAbility.startAbilityForResult( ...@@ -219,7 +219,7 @@ featureAbility.startAbilityForResult(
terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback\<void>): void terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback\<void>): void
Destroys this Page ability, with the result code and data sent to the caller. This method uses a callback to return the result. Destroys this Page ability, with the result code and data sent to the caller. This API uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -227,7 +227,7 @@ Destroys this Page ability, with the result code and data sent to the caller. Th ...@@ -227,7 +227,7 @@ Destroys this Page ability, with the result code and data sent to the caller. Th
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| --------- | ------------------------------- | ---- | -------------- | | --------- | ------------------------------- | ---- | -------------- |
| parameter | [AbilityResult](#abilityresult) | Yes | Ability to start.| | parameter | [AbilityResult](#abilityresult) | Yes | Ability to start. |
| callback | AsyncCallback\<void> | Yes | Callback used to return the result. | | callback | AsyncCallback\<void> | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -267,7 +267,7 @@ featureAbility.terminateSelfWithResult( ...@@ -267,7 +267,7 @@ featureAbility.terminateSelfWithResult(
terminateSelfWithResult(parameter: AbilityResult): Promise\<void> terminateSelfWithResult(parameter: AbilityResult): Promise\<void>
Destroys this Page ability, with the result code and data sent to the caller. This method uses a promise to return the result. Destroys this Page ability, with the result code and data sent to the caller. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -275,13 +275,13 @@ Destroys this Page ability, with the result code and data sent to the caller. Th ...@@ -275,13 +275,13 @@ Destroys this Page ability, with the result code and data sent to the caller. Th
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| --------- | ------------------------------- | ---- | ------------- | | --------- | ------------------------------- | ---- | ------------- |
| parameter | [AbilityResult](#abilityresult) | Yes | Ability to start.| | parameter | [AbilityResult](#abilityresult) | Yes | Ability to start. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| -------------- | --------------- | | -------------- | --------------- |
| Promise\<void> | Promise used to return the result.| | Promise\<void> | Promise used to return the result. |
**Example** **Example**
...@@ -324,7 +324,7 @@ featureAbility.terminateSelfWithResult( ...@@ -324,7 +324,7 @@ featureAbility.terminateSelfWithResult(
hasWindowFocus(callback: AsyncCallback\<boolean>): void hasWindowFocus(callback: AsyncCallback\<boolean>): void
Checks whether the main window of this ability has the focus. This method uses a callback to return the result. Checks whether the main window of this ability has the focus. This API uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -332,7 +332,7 @@ Checks whether the main window of this ability has the focus. This method uses a ...@@ -332,7 +332,7 @@ Checks whether the main window of this ability has the focus. This method uses a
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ----------------------- | ---- | ---------------------------------------- | | -------- | ----------------------- | ---- | ---------------------------------------- |
| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result.<br>Returns **true** if the main window of this ability has the focus; returns **false** otherwise.| | callback | AsyncCallback\<boolean> | Yes | Callback used to return the result.<br>Returns **true** if the main window of this ability has the focus; returns **false** otherwise. |
**Example** **Example**
...@@ -347,7 +347,7 @@ featureAbility.hasWindowFocus() ...@@ -347,7 +347,7 @@ featureAbility.hasWindowFocus()
hasWindowFocus(): Promise\<boolean> hasWindowFocus(): Promise\<boolean>
Checks whether the main window of this ability has the focus. This method uses a promise to return the result. Checks whether the main window of this ability has the focus. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -355,7 +355,7 @@ Checks whether the main window of this ability has the focus. This method uses a ...@@ -355,7 +355,7 @@ Checks whether the main window of this ability has the focus. This method uses a
| Type | Description | | Type | Description |
| ----------------- | ------------------------------------- | | ----------------- | ------------------------------------- |
| Promise\<boolean> | Returns **true** if the main window of this ability has the focus; returns **false** otherwise.| | Promise\<boolean> | Returns **true** if the main window of this ability has the focus; returns **false** otherwise. |
**Example** **Example**
...@@ -372,7 +372,7 @@ featureAbility.hasWindowFocus().then((data) => { ...@@ -372,7 +372,7 @@ featureAbility.hasWindowFocus().then((data) => {
getWant(callback: AsyncCallback\<Want>): void getWant(callback: AsyncCallback\<Want>): void
Obtains the **Want** object sent from this ability. This method uses a callback to return the result. Obtains the **Want** object sent from this ability. This API uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -380,7 +380,7 @@ Obtains the **Want** object sent from this ability. This method uses a callback ...@@ -380,7 +380,7 @@ Obtains the **Want** object sent from this ability. This method uses a callback
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ----------------------------- | ---- | --------- | | -------- | ----------------------------- | ---- | --------- |
| callback | AsyncCallback\<[Want](#want)> | Yes | Callback used to return the result.| | callback | AsyncCallback\<[Want](#want)> | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -395,7 +395,7 @@ featureAbility.getWant() ...@@ -395,7 +395,7 @@ featureAbility.getWant()
getWant(): Promise\<Want> getWant(): Promise\<Want>
Obtains the **Want** object sent from this ability. This method uses a promise to return the result. Obtains the **Want** object sent from this ability. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -403,7 +403,7 @@ Obtains the **Want** object sent from this ability. This method uses a promise t ...@@ -403,7 +403,7 @@ Obtains the **Want** object sent from this ability. This method uses a promise t
| Type | Description | | Type | Description |
| ----------------------- | ---------------- | | ----------------------- | ---------------- |
| Promise\<[Want](#want)> | Promise used to return the result.| | Promise\<[Want](#want)> | Promise used to return the result. |
**Example** **Example**
...@@ -426,7 +426,7 @@ Obtains the application context. ...@@ -426,7 +426,7 @@ Obtains the application context.
| Type | Description | | Type | Description |
| ------- | ---------- | | ------- | ---------- |
| Context | Application context returned.| | Context | Application context returned. |
**Example** **Example**
...@@ -442,7 +442,7 @@ context.getBundleName() ...@@ -442,7 +442,7 @@ context.getBundleName()
terminateSelf(callback: AsyncCallback\<void>): void terminateSelf(callback: AsyncCallback\<void>): void
Destroys this Page ability, with the result code and data sent to the caller. This method uses a callback to return the result. Destroys this Page ability, with the result code and data sent to the caller. This API uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -450,7 +450,7 @@ Destroys this Page ability, with the result code and data sent to the caller. Th ...@@ -450,7 +450,7 @@ Destroys this Page ability, with the result code and data sent to the caller. Th
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | -------------------- | ---- | -------- | | -------- | -------------------- | ---- | -------- |
| callback | AsyncCallback\<void> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void> | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -465,7 +465,7 @@ featureAbility.terminateSelf() ...@@ -465,7 +465,7 @@ featureAbility.terminateSelf()
terminateSelf(): Promise\<void> terminateSelf(): Promise\<void>
Destroys this Page ability, with the result code and data sent to the caller. This method uses a promise to return the result. Destroys this Page ability, with the result code and data sent to the caller. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -473,7 +473,7 @@ Destroys this Page ability, with the result code and data sent to the caller. Th ...@@ -473,7 +473,7 @@ Destroys this Page ability, with the result code and data sent to the caller. Th
| Type | Description | | Type | Description |
| -------------- | ---------------- | | -------------- | ---------------- |
| Promise\<void> | Promise used to return the result.| | Promise\<void> | Promise used to return the result. |
**Example** **Example**
...@@ -488,7 +488,7 @@ featureAbility.terminateSelf().then((data) => { ...@@ -488,7 +488,7 @@ featureAbility.terminateSelf().then((data) => {
connectAbility(request: Want, options:ConnectOptions): number connectAbility(request: Want, options:ConnectOptions): number
Connects this ability to a specific Service ability. This method uses a callback to return the result. Connects this ability to a specific Service ability. This API uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -496,7 +496,7 @@ Connects this ability to a specific Service ability. This method uses a callback ...@@ -496,7 +496,7 @@ Connects this ability to a specific Service ability. This method uses a callback
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------- | -------------- | ---- | --------------------- | | ------- | -------------- | ---- | --------------------- |
| request | [Want](#want) | Yes | Service ability to connect.| | request | [Want](#want) | Yes | Service ability to connect. |
| options | ConnectOptions | Yes | Callback used to return the result. | | options | ConnectOptions | Yes | Callback used to return the result. |
Want Want
...@@ -505,7 +505,7 @@ Want ...@@ -505,7 +505,7 @@ Want
| Name | Readable/Writable| Type | Mandatory | Description | | Name | Readable/Writable| Type | Mandatory | Description |
| ----------- | ---- | ------ | ---- | ---------------------------------------- | | ----------- | ---- | ------ | ---- | ---------------------------------------- |
| deviceId | Read-only | string | No | Device ID of the Service ability to connect. The default value is the local device ID.| | deviceId | Read-only | string | No | Device ID of the Service ability to connect. The default value is the local device ID. |
| bundleName | Read-only | string | Yes | Bundle name of the Service ability to connect. | | bundleName | Read-only | string | Yes | Bundle name of the Service ability to connect. |
| abilityName | Read-only | string | Yes | Class name of the Service ability to connect. | | abilityName | Read-only | string | Yes | Class name of the Service ability to connect. |
...@@ -517,13 +517,13 @@ ConnectOptions ...@@ -517,13 +517,13 @@ ConnectOptions
| ------------ | ---- | -------- | ---- | ------------------------- | | ------------ | ---- | -------- | ---- | ------------------------- |
| onConnect | Read-only | function | Yes | Callback invoked when the connection is successful. | | onConnect | Read-only | function | Yes | Callback invoked when the connection is successful. |
| onDisconnect | Read-only | function | Yes | Callback invoked when the connection fails. | | onDisconnect | Read-only | function | Yes | Callback invoked when the connection fails. |
| onFailed | Read-only | function | Yes | Callback invoked when **connectAbility** fails to be called.| | onFailed | Read-only | function | Yes | Callback invoked when **connectAbility** fails to be called. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------ | -------------------- | | ------ | -------------------- |
| number | Returns the ID of the Service ability connected.| | number | Returns the ID of the Service ability connected. |
**Example** **Example**
...@@ -557,7 +557,7 @@ var connId = featureAbility.connectAbility( ...@@ -557,7 +557,7 @@ var connId = featureAbility.connectAbility(
disconnectAbility(connection: number, callback:AsyncCallback\<void>): void disconnectAbility(connection: number, callback:AsyncCallback\<void>): void
Disconnects this ability from a specific Service ability. This method uses a callback to return the result. Disconnects this ability from a specific Service ability. This API uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -565,7 +565,7 @@ Disconnects this ability from a specific Service ability. This method uses a cal ...@@ -565,7 +565,7 @@ Disconnects this ability from a specific Service ability. This method uses a cal
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ---------- | -------------------- | ---- | ----------------------- | | ---------- | -------------------- | ---- | ----------------------- |
| connection | number | Yes | ID of the Service ability to disconnect.| | connection | number | Yes | ID of the Service ability to disconnect. |
| callback | AsyncCallback\<void> | Yes | Callback used to return the result. | | callback | AsyncCallback\<void> | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -604,7 +604,7 @@ var result = featureAbility.disconnectAbility(connId, ...@@ -604,7 +604,7 @@ var result = featureAbility.disconnectAbility(connId,
disconnectAbility(connection: number): Promise\<void> disconnectAbility(connection: number): Promise\<void>
Disconnects this ability from a specific Service ability. This method uses a promise to return the result. Disconnects this ability from a specific Service ability. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -612,13 +612,13 @@ Disconnects this ability from a specific Service ability. This method uses a pro ...@@ -612,13 +612,13 @@ Disconnects this ability from a specific Service ability. This method uses a pro
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | ----------------------- | | ---------- | ------ | ---- | ----------------------- |
| connection | number | Yes | ID of the Service ability to disconnect.| | connection | number | Yes | ID of the Service ability to disconnect. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| -------------- | --------------- | | -------------- | --------------- |
| Promise\<void> | Promise used to return the result.| | Promise\<void> | Promise used to return the result. |
**Example** **Example**
...@@ -656,7 +656,7 @@ featureAbility.disconnectAbility(connId).then((error,data) => { ...@@ -656,7 +656,7 @@ featureAbility.disconnectAbility(connId).then((error,data) => {
getWindow(callback: AsyncCallback\<window.Window>): void getWindow(callback: AsyncCallback\<window.Window>): void
Obtains the window corresponding to this ability. This method uses a callback to return the result. Obtains the window corresponding to this ability. This API uses a callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -664,7 +664,7 @@ Obtains the window corresponding to this ability. This method uses a callback to ...@@ -664,7 +664,7 @@ Obtains the window corresponding to this ability. This method uses a callback to
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------------- | ---- | ----------------------------- | | -------- | ----------------------------- | ---- | ----------------------------- |
| callback | AsyncCallback\<window.Window> | Yes | Callback used to return the window.| | callback | AsyncCallback\<window.Window> | Yes | Callback used to return the window. |
**Example** **Example**
...@@ -676,7 +676,7 @@ featureAbility.getWindow() ...@@ -676,7 +676,7 @@ featureAbility.getWindow()
getWindow(): Promise\<window.Window>; getWindow(): Promise\<window.Window>;
Obtains the window corresponding to this ability. This method uses a promise to return the result. Obtains the window corresponding to this ability. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
...@@ -684,7 +684,7 @@ Obtains the window corresponding to this ability. This method uses a promise to ...@@ -684,7 +684,7 @@ Obtains the window corresponding to this ability. This method uses a promise to
| Type | Description | | Type | Description |
| ----------------------- | ----------------------------- | | ----------------------- | ----------------------------- |
| Promise\<window.Window> | Promise used to return the window.| | Promise\<window.Window> | Promise used to return the window. |
**Example** **Example**
...@@ -707,7 +707,7 @@ Callback invoked when the connection is successful. ...@@ -707,7 +707,7 @@ Callback invoked when the connection is successful.
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | ----------------- | ---- | -------- | | ----------- | ----------------- | ---- | -------- |
| elementName | ElementName | Yes | Element name. | | elementName | ElementName | Yes | Element name. |
| remote | rpc.IRemoteObject | Yes | RPC remote object.| | remote | rpc.IRemoteObject | Yes | RPC remote object. |
**Example** **Example**
...@@ -749,7 +749,7 @@ Callback invoked when the connection fails. ...@@ -749,7 +749,7 @@ Callback invoked when the connection fails.
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | ----------- | ---- | ---- | | ----------- | ----------- | ---- | ---- |
| elementName | ElementName | Yes | Element name.| | elementName | ElementName | Yes | Element name. |
**Example** **Example**
...@@ -791,7 +791,7 @@ Callback invoked when **connectAbility** fails to be called. ...@@ -791,7 +791,7 @@ Callback invoked when **connectAbility** fails to be called.
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ---- | ------ | ---- | --------- | | ---- | ------ | ---- | --------- |
| code | number | Yes | Number type.| | code | number | Yes | Number type. |
**Example** **Example**
...@@ -839,11 +839,11 @@ featureAbility.AbilityWindowConfiguration.WINDOW_MODE_UNDEFINED ...@@ -839,11 +839,11 @@ featureAbility.AbilityWindowConfiguration.WINDOW_MODE_UNDEFINED
| Name | Name | Description | | Name | Name | Description |
| ---------------------------------------- | ---- | ---------------------------------------- | | ---------------------------------------- | ---- | ---------------------------------------- |
| WINDOW_MODE_UNDEFINED<sup>7+</sup> | 0 | The Page ability is in an undefined window display mode.| | WINDOW_MODE_UNDEFINED<sup>7+</sup> | 0 | The Page ability is in an undefined window display mode. |
| WINDOW_MODE_FULLSCREEN<sup>7+</sup> | 1 | The Page ability is in full screen mode. | | WINDOW_MODE_FULLSCREEN<sup>7+</sup> | 1 | The Page ability is in full screen mode. |
| WINDOW_MODE_SPLIT_PRIMARY<sup>7+</sup> | 100 | The Page ability is displayed in the primary window when it is in split-screen mode.| | WINDOW_MODE_SPLIT_PRIMARY<sup>7+</sup> | 100 | The Page ability is displayed in the primary window when it is in split-screen mode. |
| WINDOW_MODE_SPLIT_SECONDARY<sup>7+</sup> | 101 | The Page ability is displayed in the secondary window when it is in split-screen mode.| | WINDOW_MODE_SPLIT_SECONDARY<sup>7+</sup> | 101 | The Page ability is displayed in the secondary window when it is in split-screen mode. |
| WINDOW_MODE_FLOATING<sup>7+</sup> | 102 | The Page ability is displayed in floating window mode.| | WINDOW_MODE_FLOATING<sup>7+</sup> | 102 | The Page ability is displayed in floating window mode. |
## AbilityStartSetting ## AbilityStartSetting
...@@ -862,9 +862,9 @@ featureAbility.AbilityStartSetting.BOUNDS_KEY ...@@ -862,9 +862,9 @@ featureAbility.AbilityStartSetting.BOUNDS_KEY
| Name | Name | Description | | Name | Name | Description |
| ---------------------------- | --------------- | ---------------------------------------- | | ---------------------------- | --------------- | ---------------------------------------- |
| BOUNDS_KEY<sup>7+</sup> | "abilityBounds" | Ability window size.| | BOUNDS_KEY<sup>7+</sup> | "abilityBounds" | Ability window size. |
| WINDOW_MODE_KEY<sup>7+</sup> | "windowMode" | Ability window display mode.| | WINDOW_MODE_KEY<sup>7+</sup> | "windowMode" | Ability window display mode. |
| DISPLAY_ID_KEY<sup>7+</sup> | "displayId" | Display device ID.| | DISPLAY_ID_KEY<sup>7+</sup> | "displayId" | Display device ID. |
## ErrorCode ## ErrorCode
...@@ -874,10 +874,10 @@ Enumerates error codes. ...@@ -874,10 +874,10 @@ Enumerates error codes.
| Variable | Value | Description | | Variable | Value | Description |
| ------------------------------ | ---- | ---------------------------------------- | | ------------------------------ | ---- | ---------------------------------------- |
| NO_ERROR<sup>7+</sup> | 0 | No error occurs.| | NO_ERROR<sup>7+</sup> | 0 | No error occurs. |
| INVALID_PARAMETER<sup>7+</sup> | -1 | Invalid parameter.| | INVALID_PARAMETER<sup>7+</sup> | -1 | Invalid parameter. |
| ABILITY_NOT_FOUND<sup>7+</sup> | -2 | The ability is not found.| | ABILITY_NOT_FOUND<sup>7+</sup> | -2 | The ability is not found. |
| PERMISSION_DENY<sup>7+</sup> | -3 | The request is denied.| | PERMISSION_DENY<sup>7+</sup> | -3 | The request is denied. |
## DataAbilityOperationType ## DataAbilityOperationType
...@@ -888,10 +888,10 @@ Enumerates operation types of the Data ability. ...@@ -888,10 +888,10 @@ Enumerates operation types of the Data ability.
| Variable | Value | Description | | Variable | Value | Description |
| ------------------------ | ---- | ---------------------------------------- | | ------------------------ | ---- | ---------------------------------------- |
| TYPE_INSERT<sup>7+</sup> | 1 | Insert operation.| | TYPE_INSERT<sup>7+</sup> | 1 | Insert operation. |
| TYPE_UPDATE<sup>7+</sup> | 2 | Update operation.| | TYPE_UPDATE<sup>7+</sup> | 2 | Update operation. |
| TYPE_DELETE<sup>7+</sup> | 3 | Deletion operation.| | TYPE_DELETE<sup>7+</sup> | 3 | Deletion operation. |
| TYPE_ASSERT<sup>7+</sup> | 4 | Assert operation.| | TYPE_ASSERT<sup>7+</sup> | 4 | Assert operation. |
...@@ -901,7 +901,7 @@ Enumerates operation types of the Data ability. ...@@ -901,7 +901,7 @@ Enumerates operation types of the Data ability.
| Name | Readable/Writable| Type | Mandatory | Description | | Name | Readable/Writable| Type | Mandatory | Description |
| ----------------------- | ---- | ------------- | ---- | ------------------------------------- | | ----------------------- | ---- | ------------- | ---- | ------------------------------------- |
| resultCode<sup>7+</sup> | Read-only | number | Yes | Result code returned after the ability is destroyed. The feature for defining error-specific result codes is coming soon.| | resultCode<sup>7+</sup> | Read-only | number | Yes | Result code returned after the ability is destroyed. The feature for defining error-specific result codes is coming soon. |
| want<sup>7+</sup> | Read-only | [Want](#want) | No | Data returned after the ability is destroyed. You can define the data to be returned. This parameter can be **null**. | | want<sup>7+</sup> | Read-only | [Want](#want) | No | Data returned after the ability is destroyed. You can define the data to be returned. This parameter can be **null**. |
## StartAbilityParameter ## StartAbilityParameter
...@@ -911,7 +911,7 @@ Enumerates operation types of the Data ability. ...@@ -911,7 +911,7 @@ Enumerates operation types of the Data ability.
| Name | Readable/Writable| Type | Mandatory | Description | | Name | Readable/Writable| Type | Mandatory | Description |
| ------------------- | ---- | -------------------- | ---- | -------------------------------------- | | ------------------- | ---- | -------------------- | ---- | -------------------------------------- |
| want | Read-only | [Want](#want) | Yes | Information about the ability to start. | | want | Read-only | [Want](#want) | Yes | Information about the ability to start. |
| abilityStartSetting | Read-only | {[key: string]: any} | No | Special attribute of the ability to start. This attribute can be passed in the method call.| | abilityStartSetting | Read-only | {[key: string]: any} | No | Special attribute of the ability to start. This attribute can be passed in the method call. |
## Want ## Want
...@@ -921,11 +921,11 @@ Enumerates operation types of the Data ability. ...@@ -921,11 +921,11 @@ Enumerates operation types of the Data ability.
| Name | Readable/Writable| Type | Mandatory| Description | | Name | Readable/Writable| Type | Mandatory| Description |
| -------------------------------- | -------- | -------------------- | ---- | ------------------------------------------------------------ | | -------------------------------- | -------- | -------------------- | ---- | ------------------------------------------------------------ |
| deviceId | Read-only | string | No | ID of the device that runs the ability. | | deviceId | Read-only | string | No | ID of the device that runs the ability. |
| bundleName | Read-only | string | No | Bundle name of the ability to start.| | bundleName | Read-only | string | No | Bundle name of the ability to start. |
| abilityName | Read-only | string | No | Name of the ability to start. If both **package** and **AbilityName** are specified in this field in a **Want** object, the **Want** object can directly match the specified ability.| | abilityName | Read-only | string | No | Name of the ability to start. If both **package** and **AbilityName** are specified in this field in a **Want** object, the **Want** object can directly match the specified ability. |
| uri | Read-only | string | No | URI information to match. If **uri** is specified in a **Want** object, the **Want** object will match the specified URI information, including **scheme**, **schemeSpecificPart**, **authority**, and **path**.| | uri | Read-only | string | No | URI information to match. If **uri** is specified in a **Want** object, the **Want** object will match the specified URI information, including **scheme**, **schemeSpecificPart**, **authority**, and **path**. |
| type | Read-only | string | No | MIME type, for example, text/plain or image/*. | | type | Read-only | string | No | MIME type, for example, text/plain or image/*. |
| flags | Read-only | number | No | How the **Want** object will be handled. By default, a number is passed. For details, see [flags](#flags).| | flags | Read-only | number | No | How the **Want** object will be handled. By default, a number is passed. For details, see [flags](#flags). |
| action | Read-only | string | No | Action option. | | action | Read-only | string | No | Action option. |
| parameters | Read-only | {[key: string]: any} | No | List of parameters in the **Want** object. | | parameters | Read-only | {[key: string]: any} | No | List of parameters in the **Want** object. |
| entities | Read-only | Array\<string> | No | List of entities. | | entities | Read-only | Array\<string> | No | List of entities. |
...@@ -951,6 +951,6 @@ Enumerates operation types of the Data ability. ...@@ -951,6 +951,6 @@ Enumerates operation types of the Data ability.
| FLAG_ABILITY_CONTINUATION_REVERSIBLE | 0x00000400 | Indicates that the migration is reversible. | | FLAG_ABILITY_CONTINUATION_REVERSIBLE | 0x00000400 | Indicates that the migration is reversible. |
| FLAG_INSTALL_ON_DEMAND | 0x00000800 | Indicates that the specific ability will be installed if it has not been installed. | | FLAG_INSTALL_ON_DEMAND | 0x00000800 | Indicates that the specific ability will be installed if it has not been installed. |
| FLAG_INSTALL_WITH_BACKGROUND_MODE | 0x80000000 | Indicates that the specific ability will be installed in the background if it has not been installed. | | FLAG_INSTALL_WITH_BACKGROUND_MODE | 0x80000000 | Indicates that the specific ability will be installed in the background if it has not been installed. |
| FLAG_ABILITY_CLEAR_MISSION | 0x00008000 | Clears other operation missions. This flag can be set for the **Want** object in the **startAbility** API passed to [ohos.app.Context](js-apis-ability-context.md) and must be used together with **flag_ABILITY_NEW_MISSION**.| | FLAG_ABILITY_CLEAR_MISSION | 0x00008000 | Clears other operation missions. This flag can be set for the **Want** object in the **startAbility** API passed to [ohos.app.Context](js-apis-ability-context.md) and must be used together with **flag_ABILITY_NEW_MISSION**. |
| FLAG_ABILITY_NEW_MISSION | 0x10000000 | Creates a mission on the historical mission stack. | | FLAG_ABILITY_NEW_MISSION | 0x10000000 | Creates a mission on the historical mission stack. |
| FLAG_ABILITY_MISSION_TOP | 0x20000000 | Starts the mission on the top of the existing mission stack; creates an ability instance if no mission exists.| | FLAG_ABILITY_MISSION_TOP | 0x20000000 | Starts the mission on the top of the existing mission stack; creates an ability instance if no mission exists. |
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册