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

!4175 【OpenHarmony开源贡献者计划2022】api相关格式及表达问题-0520a

Merge pull request !4175 from king_he/0520-a
# Context Module # Context Module
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/> > **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.
## Modules to Import ## Modules to Import
...@@ -30,9 +30,9 @@ If this API is called for the first time, a root directory will be created. ...@@ -30,9 +30,9 @@ If this API is called for the first time, a root directory will be created.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | -------------------------- | | -------- | ---------------------- | ---- | -------------------------- |
| callback | AsyncCallback\<string> | Yes | Callback used to return the local root directory.| | callback | AsyncCallback\<string> | Yes | Callback used to return the local root directory. |
**Example** **Example**
...@@ -60,7 +60,7 @@ If this API is called for the first time, a root directory will be created. ...@@ -60,7 +60,7 @@ If this API is called for the first time, a root directory will be created.
| Type | Description | | Type | Description |
| ---------------- | ---------------------- | | ---------------- | ---------------------- |
| Promise\<string> | Promise used to return the local root directory.| | Promise\<string> | Promise used to return the local root directory. |
**Example** **Example**
...@@ -84,11 +84,11 @@ Verifies whether a specific PID and UID have the given permission. This API uses ...@@ -84,11 +84,11 @@ Verifies whether a specific PID and UID have the given permission. This API uses
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------- | --------------------------------------- | ---- | ------------------------------------- | | ---------- | --------------------------------------- | ---- | ------------------------------------- |
| permission | string | Yes | Name of the permission to verify. | | permission | string | Yes | Name of the permission to verify. |
| options | [PermissionOptions](#permissionoptions) | Yes | Permission options. | | options | [PermissionOptions](#permissionoptions) | Yes | Permission options. |
| callback | AsyncCallback\<number> | Yes | Callback used to return the permission verification result. The value **0** indicates that the PID and UID have the given permission, and the value **-1** indicates that the PID and UID do not have the given permission.| | callback | AsyncCallback\<number> | Yes | Callback used to return the permission verification result. The value **0** indicates that the PID and UID have the given permission, and the value **-1** indicates that the PID and UID do not have the given permission. |
**Example** **Example**
...@@ -113,10 +113,10 @@ Verifies whether the current PID and UID have the given permission. This API use ...@@ -113,10 +113,10 @@ Verifies whether the current PID and UID have the given permission. This API use
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------- | ---------------------- | ---- | ------------------------------------- | | ---------- | ---------------------- | ---- | ------------------------------------- |
| permission | string | Yes | Name of the permission to verify. | | permission | string | Yes | Name of the permission to verify. |
| callback | AsyncCallback\<number> | Yes | Callback used to return the permission verification result. The value **0** indicates that the PID and UID have the given permission, and the value **-1** indicates that the PID and UID do not have the given permission.| | callback | AsyncCallback\<number> | Yes | Callback used to return the permission verification result. The value **0** indicates that the PID and UID have the given permission, and the value **-1** indicates that the PID and UID do not have the given permission. |
**Example** **Example**
...@@ -136,16 +136,16 @@ Verifies whether a specific PID and UID have the given permission. This API uses ...@@ -136,16 +136,16 @@ Verifies whether a specific PID and UID have the given permission. This API uses
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------- | --------------------------------------- | ---- | ---------------- | | ---------- | --------------------------------------- | ---- | ---------------- |
| permission | string | Yes | Name of the permission to verify.| | permission | string | Yes | Name of the permission to verify. |
| options | [PermissionOptions](#permissionoptions) | No | Permission options. | | options | [PermissionOptions](#permissionoptions) | No | Permission options. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------- | ----------------------------------------------------------- | | ---------------- | ----------------------------------------------------------- |
| Promise\<number> | Promise used to return the permission verification result. The value **0** indicates that the PID and UID have the given permission, and the value **-1** indicates that the PID and UID do not have the given permission.| | Promise\<number> | Promise used to return the permission verification result. The value **0** indicates that the PID and UID have the given permission, and the value **-1** indicates that the PID and UID do not have the given permission. |
**Example** **Example**
...@@ -171,10 +171,10 @@ Requests certain permissions from the system. This API uses an asynchronous call ...@@ -171,10 +171,10 @@ Requests certain permissions from the system. This API uses an asynchronous call
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------------- | ------------------------------------------------------------ | ---- | ----------------------------------------------- | | -------------- | ------------------------------------------------------------ | ---- | ----------------------------------------------- |
| permissions | Array\<string> | Yes | Permissions to request. This parameter cannot be **null**. | | permissions | Array\<string> | Yes | Permissions to request. This parameter cannot be **null**. |
| requestCode | number | Yes | Request code to be passed to **PermissionRequestResult**.| | requestCode | number | Yes | Request code to be passed to **PermissionRequestResult**. |
| resultCallback | AsyncCallback<[PermissionRequestResult](#permissionrequestresult)> | Yes | Permission request result. | | resultCallback | AsyncCallback<[PermissionRequestResult](#permissionrequestresult)> | Yes | Permission request result. |
**Example** **Example**
...@@ -207,9 +207,9 @@ Obtains information about the current application. This API uses an asynchronous ...@@ -207,9 +207,9 @@ Obtains information about the current application. This API uses an asynchronous
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------- | ---- | ------------------------ | | -------- | ------------------------------- | ---- | ------------------------ |
| callback | AsyncCallback\<ApplicationInfo> | Yes | Callback used to return the application information.| | callback | AsyncCallback\<ApplicationInfo> | Yes | Callback used to return the application information. |
**Example** **Example**
...@@ -233,7 +233,7 @@ Obtains information about the current application. This API uses a promise to re ...@@ -233,7 +233,7 @@ Obtains information about the current application. This API uses a promise to re
| Type | Description | | Type | Description |
| ------------------------- | ------------------ | | ------------------------- | ------------------ |
| Promise\<ApplicationInfo> | Promise used to return the application information.| | Promise\<ApplicationInfo> | Promise used to return the application information. |
**Example** **Example**
...@@ -258,9 +258,9 @@ Obtains the bundle name of the current ability. This API uses an asynchronous ca ...@@ -258,9 +258,9 @@ Obtains the bundle name of the current ability. This API uses an asynchronous ca
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ----------------------------- | | -------- | ---------------------- | ---- | ----------------------------- |
| callback | AsyncCallback\<string> | Yes | Callback used to return the bundle name.| | callback | AsyncCallback\<string> | Yes | Callback used to return the bundle name. |
**Example** **Example**
...@@ -284,7 +284,7 @@ Obtains the bundle name of the current ability. This API uses a promise to retur ...@@ -284,7 +284,7 @@ Obtains the bundle name of the current ability. This API uses a promise to retur
| Type | Description | | Type | Description |
| ---------------- | ------------------------- | | ---------------- | ------------------------- |
| Promise\<string> | Promise used to return the bundle name.| | Promise\<string> | Promise used to return the bundle name. |
**Example** **Example**
...@@ -309,9 +309,9 @@ Obtains information about the current process, including the PID and process nam ...@@ -309,9 +309,9 @@ Obtains information about the current process, including the PID and process nam
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | --------------------------- | ---- | -------------------- | | -------- | --------------------------- | ---- | -------------------- |
| callback | AsyncCallback\<ProcessInfo> | Yes | Callback used to return the process information.| | callback | AsyncCallback\<ProcessInfo> | Yes | Callback used to return the process information. |
**Example** **Example**
...@@ -335,7 +335,7 @@ Obtains information about the current process, including the PID and process nam ...@@ -335,7 +335,7 @@ Obtains information about the current process, including the PID and process nam
| Type | Description | | Type | Description |
| --------------------- | -------------- | | --------------------- | -------------- |
| Promise\<ProcessInfo> | Promise used to return the process information.| | Promise\<ProcessInfo> | Promise used to return the process information. |
**Example** **Example**
...@@ -362,9 +362,9 @@ This API is available only to Page abilities. ...@@ -362,9 +362,9 @@ This API is available only to Page abilities.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | --------------------------- | ---- | ---------------------------------------------- | | -------- | --------------------------- | ---- | ---------------------------------------------- |
| callback | AsyncCallback\<ElementName> | Yes | Callback used to return the **ohos.bundle.ElementName** object.| | callback | AsyncCallback\<ElementName> | Yes | Callback used to return the **ohos.bundle.ElementName** object. |
**Example** **Example**
...@@ -390,7 +390,7 @@ This API is available only to Page abilities. ...@@ -390,7 +390,7 @@ This API is available only to Page abilities.
| Type | Description | | Type | Description |
| --------------------- | ------------------------------------------ | | --------------------- | ------------------------------------------ |
| Promise\<ElementName> | Promise used to return the **ohos.bundle.ElementName** object.| | Promise\<ElementName> | Promise used to return the **ohos.bundle.ElementName** object. |
**Example** **Example**
...@@ -413,9 +413,9 @@ Obtains the name of the current process. This API uses an asynchronous callback ...@@ -413,9 +413,9 @@ Obtains the name of the current process. This API uses an asynchronous callback
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | -------------------- | | -------- | ---------------------- | ---- | -------------------- |
| callback | AsyncCallback\<string> | Yes | Callback used to return the process name.| | callback | AsyncCallback\<string> | Yes | Callback used to return the process name. |
**Example** **Example**
...@@ -439,7 +439,7 @@ Obtains the name of the current process. This API uses a promise to return the r ...@@ -439,7 +439,7 @@ Obtains the name of the current process. This API uses a promise to return the r
| Type | Description | | Type | Description |
| ---------------- | -------------------- | | ---------------- | -------------------- |
| Promise\<string> | Promise used to return the process name.| | Promise\<string> | Promise used to return the process name. |
**Example** **Example**
...@@ -464,9 +464,9 @@ Obtains the bundle name of the calling ability. This API uses an asynchronous ca ...@@ -464,9 +464,9 @@ Obtains the bundle name of the calling ability. This API uses an asynchronous ca
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------------------- | | -------- | ---------------------- | ---- | ------------------------- |
| callback | AsyncCallback\<string> | Yes | Callback used to return the bundle name.| | callback | AsyncCallback\<string> | Yes | Callback used to return the bundle name. |
**Example** **Example**
...@@ -490,7 +490,7 @@ Obtains the bundle name of the calling ability. This API uses a promise to retur ...@@ -490,7 +490,7 @@ Obtains the bundle name of the calling ability. This API uses a promise to retur
| Type | Description | | Type | Description |
| --------------- | ------------------------- | | --------------- | ------------------------- |
| Promise\<string> | Promise used to return the bundle name.| | Promise\<string> | Promise used to return the bundle name. |
**Example** **Example**
...@@ -513,9 +513,9 @@ Obtains the cache directory of the application on the internal storage. This API ...@@ -513,9 +513,9 @@ Obtains the cache directory of the application on the internal storage. This API
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------------------- | | -------- | ---------------------- | ---- | ------------------------- |
| callback | AsyncCallback\<string> | Yes | Callback used to return the cache directory.| | callback | AsyncCallback\<string> | Yes | Callback used to return the cache directory. |
**Example** **Example**
...@@ -543,7 +543,7 @@ Obtains the cache directory of the application on the internal storage. This API ...@@ -543,7 +543,7 @@ Obtains the cache directory of the application on the internal storage. This API
| Type | Description | | Type | Description |
| --------------- | ------------------------- | | --------------- | ------------------------- |
| Promise\<string> | Promise used to return the cache directory.| | Promise\<string> | Promise used to return the cache directory. |
**Example** **Example**
...@@ -566,9 +566,9 @@ Obtains the file directory of the application on the internal storage. This API ...@@ -566,9 +566,9 @@ Obtains the file directory of the application on the internal storage. This API
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------------------- | | -------- | ---------------------- | ---- | ------------------------- |
| callback | AsyncCallback\<string> | Yes | Callback used to return the file directory.| | callback | AsyncCallback\<string> | Yes | Callback used to return the file directory. |
**Example** **Example**
...@@ -596,7 +596,7 @@ Obtains the file directory of the application on the internal storage. This API ...@@ -596,7 +596,7 @@ Obtains the file directory of the application on the internal storage. This API
| Type | Description | | Type | Description |
| --------------- | ------------------------- | | --------------- | ------------------------- |
| Promise\<string> | Promise used to return the file directory.| | Promise\<string> | Promise used to return the file directory. |
**Example** **Example**
...@@ -621,9 +621,9 @@ If the distributed file path does not exist, the system will create one and retu ...@@ -621,9 +621,9 @@ If the distributed file path does not exist, the system will create one and retu
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------------------- | | -------- | ---------------------- | ---- | ------------------------- |
| callback | AsyncCallback\<string> | Yes | Callback used to return the distributed file path. If the distributed file path does not exist, the system will create one and return the created path.| | callback | AsyncCallback\<string> | Yes | Callback used to return the distributed file path. If the distributed file path does not exist, the system will create one and return the created path. |
**Example** **Example**
...@@ -653,7 +653,7 @@ If the distributed file path does not exist, the system will create one and retu ...@@ -653,7 +653,7 @@ If the distributed file path does not exist, the system will create one and retu
| Type | Description | | Type | Description |
| --------------- | ------------------------- | | --------------- | ------------------------- |
| Promise\<string> | Promise used to return the distributed file path. If this API is called for the first time, a new path will be created.| | Promise\<string> | Promise used to return the distributed file path. If this API is called for the first time, a new path will be created. |
**Example** **Example**
...@@ -675,9 +675,9 @@ Obtains the application type. This API uses an asynchronous callback to return t ...@@ -675,9 +675,9 @@ Obtains the application type. This API uses an asynchronous callback to return t
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------------------- | | -------- | ---------------------- | ---- | ------------------------- |
| callback | AsyncCallback\<string> | Yes | Callback used to return the application type.| | callback | AsyncCallback\<string> | Yes | Callback used to return the application type. |
**Example** **Example**
...@@ -705,7 +705,7 @@ Obtains the application type. This API uses a promise to return the result. ...@@ -705,7 +705,7 @@ Obtains the application type. This API uses a promise to return the result.
| Type | Description | | Type | Description |
| --------------- | ------------------------- | | --------------- | ------------------------- |
| Promise\<string> | Promise used to return the application type.| | Promise\<string> | Promise used to return the application type. |
**Example** **Example**
...@@ -727,9 +727,9 @@ Obtains the **ModuleInfo** object of the application. This API uses an asynchron ...@@ -727,9 +727,9 @@ Obtains the **ModuleInfo** object of the application. This API uses an asynchron
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------------------- | | -------- | ---------------------- | ---- | ------------------------- |
| callback | AsyncCallback\<[HapModuleInfo](#hapmoduleinfo)> | Yes | Callback used to return the **ModuleInfo** object.| | callback | AsyncCallback\<[HapModuleInfo](#hapmoduleinfo)> | Yes | Callback used to return the **ModuleInfo** object. |
**Example** **Example**
...@@ -757,7 +757,7 @@ Obtains the **ModuleInfo** object of the application. This API uses a promise to ...@@ -757,7 +757,7 @@ Obtains the **ModuleInfo** object of the application. This API uses a promise to
| Type | Description | | Type | Description |
| --------------- | ------------------------- | | --------------- | ------------------------- |
| Promise\<[HapModuleInfo](#hapmoduleinfo)> | Promise used to return the **ModuleInfo** object.| | Promise\<[HapModuleInfo](#hapmoduleinfo)> | Promise used to return the **ModuleInfo** object. |
**Example** **Example**
...@@ -779,9 +779,9 @@ Obtains the version information of the application. This API uses an asynchronou ...@@ -779,9 +779,9 @@ Obtains the version information of the application. This API uses an asynchronou
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------------------- | | -------- | ---------------------- | ---- | ------------------------- |
| callback | AsyncCallback\<[AppVersionInfo](#appversioninfo)> | Yes | Callback used to return the version information.| | callback | AsyncCallback\<[AppVersionInfo](#appversioninfo)> | Yes | Callback used to return the version information. |
**Example** **Example**
...@@ -809,7 +809,7 @@ Obtains the version information of the application. This API uses a promise to r ...@@ -809,7 +809,7 @@ Obtains the version information of the application. This API uses a promise to r
| Type | Description | | Type | Description |
| --------------- | ------------------------- | | --------------- | ------------------------- |
| Promise\<[AppVersionInfo](#appversioninfo)> | Promise used to return the version information.| | Promise\<[AppVersionInfo](#appversioninfo)> | Promise used to return the version information. |
**Example** **Example**
...@@ -831,9 +831,9 @@ Obtains information of the current ability. This API uses an asynchronous callba ...@@ -831,9 +831,9 @@ Obtains information of the current ability. This API uses an asynchronous callba
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------------------- | | -------- | ---------------------- | ---- | ------------------------- |
| callback | AsyncCallback\<[AbilityInfo](#abilityInfo)> | Yes |Callback used to return the ability information.| | callback | AsyncCallback\<[AbilityInfo](#abilityInfo)> | Yes |Callback used to return the ability information. |
**Example** **Example**
...@@ -861,7 +861,7 @@ Obtains information of the current ability. This API uses a promise to return th ...@@ -861,7 +861,7 @@ Obtains information of the current ability. This API uses a promise to return th
| Type | Description | | Type | Description |
| --------------- | ------------------------- | | --------------- | ------------------------- |
| Promise\<[AbilityInfo](#abilityInfo)> | Promise used to return the ability information.| | Promise\<[AbilityInfo](#abilityInfo)> | Promise used to return the ability information. |
**Example** **Example**
...@@ -885,7 +885,7 @@ Obtains the context of the application. ...@@ -885,7 +885,7 @@ Obtains the context of the application.
| Type | Description | | Type | Description |
| --------- |------ | | --------- |------ |
| Context |Application context.| | Context |Application context. |
**Example** **Example**
...@@ -898,18 +898,18 @@ var context = featureAbility.getContext().getApplicationContext(); ...@@ -898,18 +898,18 @@ var context = featureAbility.getContext().getApplicationContext();
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name| Readable/Writable| Type | Mandatory| Description | | Name| Readable/Writable | Type | Mandatory | Description |
| ---- | -------- | ------ | ---- | ------ | | ---- | -------- | ------ | ---- | ------ |
| pid | Read-only | number | No | Process ID.| | pid | Read-only | number | No | Process ID. |
| uid | Read-only | number | No | User ID.| | uid | Read-only | number | No | User ID. |
## PermissionRequestResult<sup>7+</sup> ## PermissionRequestResult<sup>7+</sup>
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name | Readable/Writable| Type | Mandatory| Description | | Name | Readable/Writable | Type | Mandatory | Description |
| ----------- | -------- | -------------- | ---- | ------------------ | | ----------- | -------- | -------------- | ---- | ------------------ |
| requestCode | Read-only | number | Yes | Request code passed.| | requestCode | Read-only | number | Yes | Request code passed. |
| permissions | Read-only | Array\<string> | Yes | Permissions requested. | | permissions | Read-only | Array\<string> | Yes | Permissions requested. |
| authResults | Read-only | Array\<number> | Yes | Permission request result. | | authResults | Read-only | Array\<number> | Yes | Permission request result. |
...@@ -917,7 +917,7 @@ var context = featureAbility.getContext().getApplicationContext(); ...@@ -917,7 +917,7 @@ var context = featureAbility.getContext().getApplicationContext();
Describes the HAP module information. Describes the HAP module information.
| Name | Type| Readable| Writable| Description| | Name | Type| Readable | Writable | Description |
| ------ | ------ | ------ | ------ | ------ | | ------ | ------ | ------ | ------ | ------ |
| name | string | Yes | No | Module name. | | name | string | Yes | No | Module name. |
| description | string | Yes | No | Module description. | | description | string | Yes | No | Module description. |
...@@ -928,17 +928,17 @@ Describes the HAP module information. ...@@ -928,17 +928,17 @@ Describes the HAP module information.
| iconId | number | Yes | No | Module icon ID. | | iconId | number | Yes | No | Module icon ID. |
| backgroundImg | string | Yes | No | Module background image. | | backgroundImg | string | Yes | No | Module background image. |
| supportedModes | number | Yes | No | Modes supported by the module. | | supportedModes | number | Yes | No | Modes supported by the module. |
| reqCapabilities | Array<string> | Yes | No | Capabilities required for module running.| | reqCapabilities | Array<string> | Yes | No | Capabilities required for module running. |
| deviceTypes | Array<string> | Yes | No | An array of supported device types.| | deviceTypes | Array<string> | Yes | No | An array of supported device types. |
| abilityInfo | Array<AbilityInfo> | Yes | No | Ability information. | | abilityInfo | Array<AbilityInfo> | Yes | No | Ability information. |
| moduleName | string | Yes | No | Module name. | | moduleName | string | Yes | No | Module name. |
| mainAbilityName | string | Yes | No | Name of the entrance ability. | | mainAbilityName | string | Yes | No | Name of the entrance ability. |
| installationFree | boolean | Yes | No | When installation-free is supported. | | installationFree | boolean | Yes | No | When installation-free is supported. |
| mainElementName | string | Yes| No| Information about the entry ability.| | mainElementName | string | Yes| No| Information about the entry ability. |
## AppVersionInfo<sup>7+</sup> ## AppVersionInfo<sup>7+</sup>
| Name | Type| Readable | Writable | Description| | Name | Type| Readable | Writable | Description |
| ------ | ------ | ------| ------ | ------ | | ------ | ------ | ------| ------ | ------ |
| appName | string | Yes | No | Module name. | | appName | string | Yes | No | Module name. |
| versionCode | number | Yes | No | Module description. | | versionCode | number | Yes | No | Module description. |
......
# DataUriUtils Module # DataUriUtils Module
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > **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. > 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.
## Modules to Import ## Modules to Import
...@@ -19,15 +19,15 @@ Obtains the ID attached to the end of a given URI. ...@@ -19,15 +19,15 @@ Obtains the ID attached to the end of a given URI.
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---- | ------ | ---- | --------------------------- | | ---- | ------ | ---- | --------------------------- |
| uri | string | Yes | URI object from which the ID is to be obtained.| | uri | string | Yes | URI object from which the ID is to be obtained. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------ | ------------------------ | | ------ | ------------------------ |
| number | ID obtained from the URI object.| | number | ID obtained from the URI object. |
**Example** **Example**
...@@ -47,16 +47,16 @@ Attaches an ID to the end of a given URI. ...@@ -47,16 +47,16 @@ Attaches an ID to the end of a given URI.
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---- | ------ | ---- | --------------------------- | | ---- | ------ | ---- | --------------------------- |
| uri | string | Yes | URI object to which an ID is to be attached.| | uri | string | Yes | URI object to which an ID is to be attached. |
| id | number | Yes | ID to be attached. | | id | number | Yes | ID to be attached. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------ | --------------------- | | ------ | --------------------- |
| string | URI object with the ID attached.| | string | URI object with the ID attached. |
**Example** **Example**
...@@ -80,15 +80,15 @@ Deletes the ID from the end of a given URI. ...@@ -80,15 +80,15 @@ Deletes the ID from the end of a given URI.
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---- | ------ | ---- | --------------------------- | | ---- | ------ | ---- | --------------------------- |
| uri | string | Yes | URI object from which the ID is to be deleted.| | uri | string | Yes | URI object from which the ID is to be deleted. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------ | ------------------- | | ------ | ------------------- |
| string | URI object with the ID deleted.| | string | URI object with the ID deleted. |
**Example** **Example**
...@@ -108,16 +108,16 @@ Updates the ID in a given URI. ...@@ -108,16 +108,16 @@ Updates the ID in a given URI.
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ------------------- | | ---- | ------ | ---- | ------------------- |
| uri | string | Yes | URI object to be updated.| | uri | string | Yes | URI object to be updated. |
| id | number | Yes | New ID. | | id | number | Yes | New ID. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------ | --------------- | | ------ | --------------- |
| string | URI object with the new ID.| | string | URI object with the new ID. |
**Example** **Example**
......
# Work Scheduler Callbacks # Work Scheduler Callbacks
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/> > **NOTE**<br/>
> The initial APIs of this module are supported since API version 9. API version 9 is a canary version for trial use. The APIs of this version may be unstable. > The initial APIs of this module are supported since API version 9. API version 9 is a canary version for trial use. The APIs of this version may be unstable.
......
# AbilityContext # AbilityContext
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/> > **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. > 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.
...@@ -28,7 +28,7 @@ class MainAbility extends Ability { ...@@ -28,7 +28,7 @@ class MainAbility extends Ability {
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| abilityInfo | AbilityInfo | Yes| No| Ability information.| | abilityInfo | AbilityInfo | Yes| No| Ability information.|
| currentHapModuleInfo | HapModuleInfo | Yes| No| Information about the current HAP.| | currentHapModuleInfo | HapModuleInfo | Yes| No| Information about the current HAP.|
...@@ -44,7 +44,7 @@ Starts an ability. This API uses a callback to return the result. ...@@ -44,7 +44,7 @@ Starts an ability. This API uses a callback to return the result.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.| | want | [Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.|
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
...@@ -73,7 +73,7 @@ Starts an ability. This API uses a callback to return the result. ...@@ -73,7 +73,7 @@ Starts an ability. This API uses a callback to return the result.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.| | want | [Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.|
| options | StartOptions | Yes| Parameters used for starting the ability.| | options | StartOptions | Yes| Parameters used for starting the ability.|
...@@ -106,14 +106,14 @@ Starts an ability. This API uses a promise to return the result. ...@@ -106,14 +106,14 @@ Starts an ability. This API uses a promise to return the result.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.| | want | [Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.|
| options | StartOptions | No| Parameters used for starting the ability.| | options | StartOptions | No| Parameters used for starting the ability.|
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
...@@ -147,7 +147,7 @@ Starts an ability. This API uses a callback to return the execution result when ...@@ -147,7 +147,7 @@ Starts an ability. This API uses a callback to return the execution result when
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want |[Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.| | want |[Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.|
| callback | AsyncCallback&lt;[AbilityResult](js-apis-featureAbility.md#abilityresult)&gt; | Yes| Callback used to return the result.| | callback | AsyncCallback&lt;[AbilityResult](js-apis-featureAbility.md#abilityresult)&gt; | Yes| Callback used to return the result.|
...@@ -175,7 +175,7 @@ Starts an ability. This API uses a callback to return the execution result when ...@@ -175,7 +175,7 @@ Starts an ability. This API uses a callback to return the execution result when
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want |[Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.| | want |[Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.|
| options | StartOptions | Yes| Parameters used for starting the ability.| | options | StartOptions | Yes| Parameters used for starting the ability.|
...@@ -208,7 +208,7 @@ Starts an ability. This API uses a promise to return the execution result when t ...@@ -208,7 +208,7 @@ Starts an ability. This API uses a promise to return the execution result when t
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.| | want | [Want](js-apis-application-Want.md) | Yes| Information about the **Want** used for starting an ability.|
| options | StartOptions | No| Parameters used for starting the ability.| | options | StartOptions | No| Parameters used for starting the ability.|
...@@ -216,7 +216,7 @@ Starts an ability. This API uses a promise to return the execution result when t ...@@ -216,7 +216,7 @@ Starts an ability. This API uses a promise to return the execution result when t
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | -------- | -------- |
| Promise&lt;[AbilityResult](js-apis-featureAbility.md#abilityresult)&gt; | Promise used to return the result.| | Promise&lt;[AbilityResult](js-apis-featureAbility.md#abilityresult)&gt; | Promise used to return the result.|
...@@ -244,7 +244,7 @@ Terminates this ability. This API uses a callback to return the result. ...@@ -244,7 +244,7 @@ Terminates this ability. This API uses a callback to return the result.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result indicating whether the API is successfully called.| | callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result indicating whether the API is successfully called.|
...@@ -267,7 +267,7 @@ Terminates this ability. This API uses a promise to return the result. ...@@ -267,7 +267,7 @@ Terminates this ability. This API uses a promise to return the result.
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result indicating whether the API is successfully called.| | Promise&lt;void&gt; | Promise used to return the result indicating whether the API is successfully called.|
...@@ -292,7 +292,7 @@ Terminates this ability. This API uses a callback to return the information to t ...@@ -292,7 +292,7 @@ Terminates this ability. This API uses a callback to return the information to t
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| parameter | [AbilityResult](js-apis-featureAbility.md#abilityresult) | Yes| Information returned to the caller.| | parameter | [AbilityResult](js-apis-featureAbility.md#abilityresult) | Yes| Information returned to the caller.|
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
...@@ -321,13 +321,13 @@ Terminates this ability. This API uses a promise to return information to the ca ...@@ -321,13 +321,13 @@ Terminates this ability. This API uses a promise to return information to the ca
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| parameter | [AbilityResult](js-apis-featureAbility.md#abilityresult) | Yes| Information returned to the caller.| | parameter | [AbilityResult](js-apis-featureAbility.md#abilityresult) | Yes| Information returned to the caller.|
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
...@@ -355,13 +355,13 @@ Obtains the caller interface of the specified ability, and if the specified abil ...@@ -355,13 +355,13 @@ Obtains the caller interface of the specified ability, and if the specified abil
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | Yes| Information about the ability to start, including the ability name, bundle name, and device ID. If the device ID is left blank or the default value is used, the local ability will be started.| | want | [Want](js-apis-application-Want.md) | Yes| Information about the ability to start, including the ability name, bundle name, and device ID. If the device ID is left blank or the default value is used, the local ability will be started.|
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | -------- | -------- |
| Promise&lt;Caller&gt; | Promise used to return the caller object to communicate with.| | Promise&lt;Caller&gt; | Promise used to return the caller object to communicate with.|
...@@ -397,7 +397,7 @@ Requests permissions from the user by displaying a pop-up window. This API uses ...@@ -397,7 +397,7 @@ Requests permissions from the user by displaying a pop-up window. This API uses
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| permissions | Array&lt;string&gt; | Yes| Permissions to request.| | permissions | Array&lt;string&gt; | Yes| Permissions to request.|
| callback | AsyncCallback&lt;[PermissionRequestResult](js-apis-permissionrequestresult.md)&gt; | Yes| Callback used to return the result indicating whether the API is successfully called.| | callback | AsyncCallback&lt;[PermissionRequestResult](js-apis-permissionrequestresult.md)&gt; | Yes| Callback used to return the result indicating whether the API is successfully called.|
...@@ -421,13 +421,13 @@ Requests permissions from the user by displaying a pop-up window. This API uses ...@@ -421,13 +421,13 @@ Requests permissions from the user by displaying a pop-up window. This API uses
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| permissions | Array&lt;string&gt; | Yes| Permissions to request.| | permissions | Array&lt;string&gt; | Yes| Permissions to request.|
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | -------- | -------- |
| Promise&lt;[PermissionRequestResult](js-apis-permissionrequestresult.md)&gt; | Promise used to return the result indicating whether the API is successfully called.| | Promise&lt;[PermissionRequestResult](js-apis-permissionrequestresult.md)&gt; | Promise used to return the result indicating whether the API is successfully called.|
...@@ -452,7 +452,7 @@ Sets the label of the ability displayed in the task. This API uses a callback to ...@@ -452,7 +452,7 @@ Sets the label of the ability displayed in the task. This API uses a callback to
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| label | string | Yes| Label of the ability to set.| | label | string | Yes| Label of the ability to set.|
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result indicating whether the API is successfully called.| | callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result indicating whether the API is successfully called.|
...@@ -476,13 +476,13 @@ Sets the label of the ability displayed in the task. This API uses a promise to ...@@ -476,13 +476,13 @@ Sets the label of the ability displayed in the task. This API uses a promise to
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| label | string | Yes| Label of the ability to set.| | label | string | Yes| Label of the ability to set.|
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result indicating whether the API is successfully called.| | Promise&lt;void&gt; | Promise used to return the result indicating whether the API is successfully called.|
......
# ErrorCode # ErrorCode
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > **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.
...@@ -20,6 +20,6 @@ Defines the error code used when the ability is started. ...@@ -20,6 +20,6 @@ Defines the error code used when the ability is started.
| Name | Value | Description | | Name | Value | Description |
| ------------------------------ | ---- | ---------------------------------------- | | ------------------------------ | ---- | ---------------------------------------- |
| NO_ERROR | 0 | No error occurs. | | NO_ERROR | 0 | No error occurs. |
| INVALID_PARAMETER | -1 | Invalid parameter.| | INVALID_PARAMETER | -1 | Invalid parameter. |
| ABILITY_NOT_FOUND | -2 | The ability is not found.| | ABILITY_NOT_FOUND | -2 | The ability is not found. |
| PERMISSION_DENY | -3 | Permission denied. | | PERMISSION_DENY | -3 | Permission denied. |
# wantConstant # wantConstant
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > **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.
...@@ -78,11 +78,11 @@ Lists the permissions. ...@@ -78,11 +78,11 @@ Lists the permissions.
| FLAG_ABILITY_FORM_ENABLED | 0x00000020 | Indicates that an ability is enabled. | | FLAG_ABILITY_FORM_ENABLED | 0x00000020 | Indicates that an ability is enabled. |
| FLAG_AUTH_PERSISTABLE_URI_PERMISSION | 0x00000040 | Indicates the permission to make the URI persistent. | | FLAG_AUTH_PERSISTABLE_URI_PERMISSION | 0x00000040 | Indicates the permission to make the URI persistent. |
| FLAG_AUTH_PREFIX_URI_PERMISSION | 0x00000080 | Indicates the permission to verify URIs by prefix matching. | | FLAG_AUTH_PREFIX_URI_PERMISSION | 0x00000080 | Indicates the permission to verify URIs by prefix matching. |
| FLAG_ABILITYSLICE_MULTI_DEVICE | 0x00000100 | Supports cross-device startup in a distributed scheduler. | | FLAG_ABILITYSLICE_MULTI_DEVICE | 0x00000100 | Supports cross-device startup in a distributed scheduler.|
| FLAG_START_FOREGROUND_ABILITY | 0x00000200 | Indicates that the Service ability is started regardless of whether the host application has been started. | | FLAG_START_FOREGROUND_ABILITY | 0x00000200 | Indicates that the Service ability is started regardless of whether the host application has been started. |
| FLAG_ABILITY_CONTINUATION_REVERSIBLE | 0x00000400 | Indicates that ability continuation is reversible. | | FLAG_ABILITY_CONTINUATION_REVERSIBLE | 0x00000400 | Indicates that ability continuation 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 | Indicates the operation of creating a mission on the history mission stack. | | FLAG_ABILITY_NEW_MISSION | 0x10000000 | Indicates the operation of creating a mission on the history 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.
先完成此消息的编辑!
想要评论请 注册