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

!5618 翻译完成:5273 文档规范修改

Merge pull request !5618 from wusongqing/OpenHarmony-3.1-Release
# Context Module
# Context
## Modules to Import
......@@ -925,9 +925,9 @@ Describes the HAP module information.
| iconId | number | Yes | No | Module icon ID. |
| backgroundImg | string | Yes | No | Module background image. |
| supportedModes | number | Yes | No | Modes supported by the module. |
| reqCapabilities | Array<string> | Yes | No | Capabilities required for module running.|
| deviceTypes | Array<string> | Yes | No | An array of supported device types.|
| abilityInfo | Array\<AbilityInfo> | Yes | No | Ability information. |
| reqCapabilities | Array\<string> | Yes | No | Capabilities required for module running.|
| deviceTypes | Array\<string> | Yes | No | An array of supported device types.|
| abilityInfo | Array\\<AbilityInfo> | Yes | No | Ability information. |
| moduleName | string | Yes | No | Module name. |
| mainAbilityName | string | Yes | No | Name of the entrance ability. |
| installationFree | boolean | Yes | No | When installation-free is supported. |
......
# 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.
>
> 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.
**Example**
```js
let audiorecorder = media.createAudioRecorder();
let audioRecorder = media.createAudioRecorder();
```
## 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.
## Modules to Import
......
# 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.
## Modules to Import
......
# 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.
......@@ -10,9 +10,9 @@
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name| Type| Readable| Writable| Description|
| Name| Type| Readable| Writable| Description|
| -------- | -------- | -------- | -------- | -------- |
| extensionAbilityInfo | ExtensionAbilityInfo | Yes| No| Extension ability information. |
| extensionAbilityInfo | ExtensionAbilityInfo | Yes| No| Extension ability information. |
## startAbility
......@@ -25,10 +25,10 @@ Starts an ability. This API uses an asynchronous callback to return the result.
**Parameters**
| 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.|
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
| 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.|
**Example**
......@@ -53,11 +53,11 @@ Starts an ability with **options** specified. This API uses an asynchronous call
**Parameters**
| 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.|
| 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**
......@@ -86,16 +86,16 @@ Starts an ability with **options** specified. This API uses a promise to return
**Parameters**
| 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.|
**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.|
**Example**
```js
......@@ -125,11 +125,11 @@ Starts an ability based on an account. This API uses an asynchronous callback to
**Parameters**
| 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.|
| accountId | number | Yes| Account ID. |
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
| want | [Want](js-apis-featureAbility.md#Want)| Yes| Information about the **Want** used for starting an ability.|
| accountId | number | Yes| Account ID. |
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
**Example**
......@@ -155,12 +155,12 @@ Starts an ability based on an account and **options**. This API uses an asynchro
**Parameters**
| 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.|
| accountId | number | Yes| Account ID. |
| want | [Want](js-apis-featureAbility.md#Want) | Yes| Information about the **Want** used for starting an ability.|
| accountId | number | Yes| Account ID. |
| 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.|
**Example**
......@@ -190,17 +190,17 @@ Starts an ability based on an account and **options**. This API uses a promise t
**Parameters**
| 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. |
| options | StartOptions | No| Parameters used for starting the ability.|
**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.|
**Example**
```js
......@@ -231,9 +231,9 @@ Terminates this ability. This API uses an asynchronous callback to return the re
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
**Example**
......@@ -253,9 +253,9 @@ Terminates this ability. This API uses a promise to return the result.
**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.|
**Example**
......@@ -278,14 +278,14 @@ Uses the **AbilityInfo.AbilityType.SERVICE** template to connect this ability to
**Parameters**
| 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.|
**Return value**
| Type| Description|
| Type| Description|
| -------- | -------- |
| number | ID of the connection between the two abilities.|
......@@ -322,15 +322,15 @@ Uses the **AbilityInfo.AbilityType.SERVICE** template to connect this ability to
**Parameters**
| 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.|
| options | ConnectOptions | Yes| Connection channel.|
**Return value**
| Type| Description|
| Type| Description|
| -------- | -------- |
| number | ID of the connection between the two abilities.|
......@@ -368,7 +368,7 @@ Disconnects this ability from another ability. This API uses an asynchronous cal
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| connection | number | Yes| ID of the connection to be disconnected.|
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
......@@ -392,15 +392,15 @@ Disconnects this ability from another ability. This API uses a promise to return
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| connection | number | Yes| ID of the connection to be disconnected.|
**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.|
**Example**
......
# WantAgent Module
# WantAgent
>**NOTE**
>
......@@ -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
......
# Zip Module (JavaScript SDK APIs)
# Zip
## Constraints
None
......@@ -9,7 +9,7 @@ import zlib from '@ohos.zlib';
```
## 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.
**System capability**: SystemCapability.BundleManager.Zlib
......@@ -78,7 +78,7 @@ zlib.zipFile(inFile , unzipDir, options).then((data) => {
## 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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册