提交 4d493a04 编写于 作者: W wusongqing

updated docs against 5273

Signed-off-by: Nwusongqing <wusongqing@huawei.com>
上级 0a916418
# Context Module # Context
## Modules to Import ## Modules to Import
...@@ -925,9 +925,9 @@ Describes the HAP module information. ...@@ -925,9 +925,9 @@ 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. |
......
# Audio Management # Audio Management
> **NOTE**<br/> > **NOTE**
>
> 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.
> >
> API version 9 is a canary release for trial use. The APIs of this version may be unstable. > API version 9 is a canary release for trial use. The APIs of this version may be unstable.
......
...@@ -120,7 +120,7 @@ Creates an **AudioRecorder** instance to control audio recording. ...@@ -120,7 +120,7 @@ Creates an **AudioRecorder** instance to control audio recording.
**Example** **Example**
```js ```js
let audiorecorder = media.createAudioRecorder(); let audioRecorder = media.createAudioRecorder();
``` ```
## media.createVideoRecorder<sup>9+</sup> ## media.createVideoRecorder<sup>9+</sup>
......
# Media Library Management # MediaLibrary
> **NOTE**<br> > **NOTE**
>
> This component is supported since API version 6. Updates will be marked with a superscript to indicate their earliest API version. > This component is supported since API version 6. Updates will be marked with a superscript to indicate their earliest API version.
## Modules to Import ## Modules to Import
......
# Prompt # Prompt
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > **NOTE**
>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import ## Modules to Import
......
# ServiceExtAbilityContext # ServiceExtAbilityContext
> **NOTE**<br/> > **NOTE**
> >
> 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.
...@@ -27,7 +27,7 @@ Starts an ability. This API uses an asynchronous callback to return the result. ...@@ -27,7 +27,7 @@ Starts an ability. This API uses an asynchronous callback to return the result.
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-featureAbility.md#want)| Yes| Information about the **Want** used for starting an ability.| | want | [Want](js-apis-featureAbility.md#Want)| 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.|
**Example** **Example**
...@@ -55,7 +55,7 @@ Starts an ability with **options** specified. This API uses an asynchronous call ...@@ -55,7 +55,7 @@ Starts an ability with **options** specified. This API uses an asynchronous call
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-featureAbility.md#want) | Yes| Information about the **Want** used for starting an ability.| | want | [Want](js-apis-featureAbility.md#Want) | 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.|
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
...@@ -88,7 +88,7 @@ Starts an ability with **options** specified. This API uses a promise to return ...@@ -88,7 +88,7 @@ Starts an ability with **options** specified. This API uses a promise to return
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-featureAbility.md#want)| Yes| Information about the **Want** used for starting an ability.| | want | [Want](js-apis-featureAbility.md#Want)| 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.|
**Return value** **Return value**
...@@ -127,7 +127,7 @@ Starts an ability based on an account. This API uses an asynchronous callback to ...@@ -127,7 +127,7 @@ Starts an ability based on an account. This API uses an asynchronous callback to
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-featureAbility.md#want)| Yes| Information about the **Want** used for starting an ability.| | want | [Want](js-apis-featureAbility.md#Want)| Yes| Information about the **Want** used for starting an ability.|
| accountId | number | Yes| Account ID. | | accountId | number | Yes| Account ID. |
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
...@@ -157,7 +157,7 @@ Starts an ability based on an account and **options**. This API uses an asynchro ...@@ -157,7 +157,7 @@ Starts an ability based on an account and **options**. This API uses an asynchro
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-featureAbility.md#want) | Yes| Information about the **Want** used for starting an ability.| | want | [Want](js-apis-featureAbility.md#Want) | Yes| Information about the **Want** used for starting an ability.|
| accountId | number | Yes| Account ID. | | accountId | number | Yes| Account ID. |
| options | StartOptions | Yes| Parameters used for starting the ability.| | options | StartOptions | Yes| Parameters used for starting the 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.|
...@@ -192,7 +192,7 @@ Starts an ability based on an account and **options**. This API uses a promise t ...@@ -192,7 +192,7 @@ Starts an ability based on an account and **options**. This API uses a promise t
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-featureAbility.md#want)| Yes| Information about the **Want** used for starting an ability.| | want | [Want](js-apis-featureAbility.md#Want)| Yes| Information about the **Want** used for starting an ability.|
| accountId | number | Yes| Account ID. | | accountId | number | Yes| Account ID. |
| options | StartOptions | No| Parameters used for starting the ability.| | options | StartOptions | No| Parameters used for starting the ability.|
...@@ -280,7 +280,7 @@ Uses the **AbilityInfo.AbilityType.SERVICE** template to connect this ability to ...@@ -280,7 +280,7 @@ Uses the **AbilityInfo.AbilityType.SERVICE** template to connect this ability to
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-featureAbility.md#want)| Yes| Information about the **Want** used for starting an ability.| | want | [Want](js-apis-featureAbility.md#Want)| Yes| Information about the **Want** used for starting an ability.|
| options | ConnectOptions | Yes| Connection channel.| | options | ConnectOptions | Yes| Connection channel.|
**Return value** **Return value**
...@@ -324,7 +324,7 @@ Uses the **AbilityInfo.AbilityType.SERVICE** template to connect this ability to ...@@ -324,7 +324,7 @@ Uses the **AbilityInfo.AbilityType.SERVICE** template to connect this ability to
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-featureAbility.md#want)| Yes| Information about the **Want** used for starting an ability.| | want | [Want](js-apis-featureAbility.md#Want)| Yes| Information about the **Want** used for starting an ability.|
| accountId | number | Yes| Account ID.| | accountId | number | Yes| Account ID.|
| options | ConnectOptions | Yes| Connection channel.| | options | ConnectOptions | Yes| Connection channel.|
......
# WantAgent Module # WantAgent
>**NOTE** >**NOTE**
> >
...@@ -916,6 +916,135 @@ WantAgent.equal(wantAgent1, wantAgent2).then((data) => { ...@@ -916,6 +916,135 @@ WantAgent.equal(wantAgent1, wantAgent2).then((data) => {
``` ```
## WantAgent.getOperationType<sup>9+</sup>
getOperationType(agent: WantAgent, callback: AsyncCallback\<number>): void
Obtains the operation type of a **WantAgent** object. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name | Readable | Writable | Type | Mandatory | Description |
| ---------- | --- | ---- | --------- | ---- | ------------- |
| agent | Yes | No | WantAgent | Yes | Target **WantAgent** object. |
| callback | Yes | No | AsyncCallback\<number> | Yes | Callback used to return the operation type. |
**Example**
```js
import WantAgent from '@ohos.wantAgent';
//wantAgent����
var wantAgent;
//WantAgentInfo����
var wantAgentInfo = {
wants: [
{
deviceId: "deviceId",
bundleName: "com.neu.setResultOnAbilityResultTest1",
abilityName: "com.example.test.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
parameters:
{
mykey0: 2222,
mykey1: [1, 2, 3],
mykey2: "[1, 2, 3]",
mykey3: "ssssssssssssssssssssssssss",
mykey4: [false, true, false],
mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"],
mykey6: true,
}
}
],
requestCode: 0,
wantAgentFlags:[WantAgentFlags.UPDATE_PRESENT_FLAG]
}
WantAgent.getWantAgent(wantAgentInfo).then((data) => {
console.info("==========================>getWantAgentCallback=======================>");
wantAgent = data;
});
WantAgent.getOperationType(wantAgent, (OperationType) => {
console.log('----------- getOperationType ----------, OperationType: ' + OperationType);
})
```
## WantAgent.getOperationType<sup>9+</sup>
getOperationType(agent: WantAgent): Promise\<number>
Obtains the operation type of a **WantAgent** object. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name | Readable | Writable | Type | Mandatory | Description |
| ---------- | --- | ---- | --------- | ---- | ------------- |
| agent | Yes | No | WantAgent | Yes | WantAgent���� |
**Return value**
| Type | Description |
| ----------------- | ------------------------------------------ |
| Promise\<number\> | Promise used to return the operation type. |
**Example**
```js
import WantAgent from '@ohos.wantAgent';
//wantAgent����
var wantAgent;
//WantAgentInfo����
var wantAgentInfo = {
wants: [
{
deviceId: "deviceId",
bundleName: "com.neu.setResultOnAbilityResultTest1",
abilityName: "com.example.test.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
parameters:
{
mykey0: 2222,
mykey1: [1, 2, 3],
mykey2: "[1, 2, 3]",
mykey3: "ssssssssssssssssssssssssss",
mykey4: [false, true, false],
mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"],
mykey6: true,
}
}
],
requestCode: 0,
wantAgentFlags:[WantAgentFlags.UPDATE_PRESENT_FLAG]
}
WantAgent.getWantAgent(wantAgentInfo).then((data) => {
console.info("==========================>getWantAgentCallback=======================>");
wantAgent = data;
});
WantAgent.getOperationType(wantAgent).then((OperationType) => {
console.log('getOperationType success, OperationType: ' + OperationType);
}).catch((err) => {
console.log('getOperationType fail, err: ' + err);
})
```
## WantAgentInfo ## WantAgentInfo
......
# Zip Module (JavaScript SDK APIs) # Zip
## Constraints ## Constraints
None None
...@@ -9,7 +9,7 @@ import zlib from '@ohos.zlib'; ...@@ -9,7 +9,7 @@ import zlib from '@ohos.zlib';
``` ```
## zlib.zipFile ## zlib.zipFile
zipFile(inFile:string, outFile:string, options: Options): Promise\<void>; zipFile(inFile:string, outFile:string, options: Options): Promise\<void>
Zips a file. This API uses a promise to return the result. Zips a file. This API uses a promise to return the result.
**System capability**: SystemCapability.BundleManager.Zlib **System capability**: SystemCapability.BundleManager.Zlib
...@@ -78,7 +78,7 @@ zlib.zipFile(inFile , unzipDir, options).then((data) => { ...@@ -78,7 +78,7 @@ zlib.zipFile(inFile , unzipDir, options).then((data) => {
## zlib.unzipFile ## zlib.unzipFile
unzipFile(inFile:string, outFile:string, options: Options): Promise\<void>; unzipFile(inFile:string, outFile:string, options: Options): Promise\<void>
Unzips a file. This API uses a promise to return the result. Unzips a file. This API uses a promise to return the result.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册