diff --git a/en/application-dev/reference/apis/js-apis-Context.md b/en/application-dev/reference/apis/js-apis-Context.md index 7a3b34caaa88c446d4e98ba7383176f6a7a374b9..ea18e37651532fb28e6fba36825dcedf2a1a2a43 100644 --- a/en/application-dev/reference/apis/js-apis-Context.md +++ b/en/application-dev/reference/apis/js-apis-Context.md @@ -1,4 +1,4 @@ -# 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 | Yes | No | Capabilities required for module running.| -| deviceTypes | Array | Yes | No | An array of supported device types.| -| abilityInfo | Array\ | Yes | No | Ability information. | +| reqCapabilities | Array\ | Yes | No | Capabilities required for module running.| +| deviceTypes | Array\ | Yes | No | An array of supported device types.| +| abilityInfo | Array\\ | 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. | diff --git a/en/application-dev/reference/apis/js-apis-audio.md b/en/application-dev/reference/apis/js-apis-audio.md index 28de5b5c1a3e6d9df575ea430d69a15b5bce8e23..332f8903b50359b0927e6437355a6492fccabb73 100644 --- a/en/application-dev/reference/apis/js-apis-audio.md +++ b/en/application-dev/reference/apis/js-apis-audio.md @@ -1,6 +1,7 @@ # Audio Management -> **NOTE**
+> **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. diff --git a/en/application-dev/reference/apis/js-apis-media.md b/en/application-dev/reference/apis/js-apis-media.md index 08c95d09acb749be562bbb51f9dfe711026f825f..01194e96351c0987fda676b112d2a3fd759a4d91 100644 --- a/en/application-dev/reference/apis/js-apis-media.md +++ b/en/application-dev/reference/apis/js-apis-media.md @@ -120,7 +120,7 @@ Creates an **AudioRecorder** instance to control audio recording. **Example** ```js -let audiorecorder = media.createAudioRecorder(); +let audioRecorder = media.createAudioRecorder(); ``` ## media.createVideoRecorder9+ diff --git a/en/application-dev/reference/apis/js-apis-medialibrary.md b/en/application-dev/reference/apis/js-apis-medialibrary.md index 99c01b7456afd94b571ad3bb3d7dd1ced3a37953..17a2f3badd90a7e1431d25bd744b518a3c25fea1 100644 --- a/en/application-dev/reference/apis/js-apis-medialibrary.md +++ b/en/application-dev/reference/apis/js-apis-medialibrary.md @@ -1,6 +1,7 @@ -# Media Library Management +# MediaLibrary -> **NOTE**
+> **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 diff --git a/en/application-dev/reference/apis/js-apis-prompt.md b/en/application-dev/reference/apis/js-apis-prompt.md index 23f759d5e556d4bb382b1939f5545a79cfad4b69..ae271f2dca80df5c76b96c0e62e32ad7c8285c7e 100644 --- a/en/application-dev/reference/apis/js-apis-prompt.md +++ b/en/application-dev/reference/apis/js-apis-prompt.md @@ -1,6 +1,7 @@ # 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 diff --git a/en/application-dev/reference/apis/js-apis-serviceExtAbilityContext.md b/en/application-dev/reference/apis/js-apis-serviceExtAbilityContext.md index 6ae73bc916dc23ab08df4ed57bf1c8c7b5b0e164..c45388554dee3107ee10ffcdaa3a5a8c22ad60c6 100644 --- a/en/application-dev/reference/apis/js-apis-serviceExtAbilityContext.md +++ b/en/application-dev/reference/apis/js-apis-serviceExtAbilityContext.md @@ -1,7 +1,7 @@ # ServiceExtAbilityContext -> **NOTE**
+> **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<void> | 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<void> | 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<void> | Yes| Callback used to return the result.| +| callback | AsyncCallback<void> | 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<void> | Promise used to return the result.| +| Promise<void> | 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<void> | 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<void> | 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<void> | Yes| Callback used to return the result.| +| callback | AsyncCallback<void> | 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<void> | Promise used to return the result.| +| Promise<void> | 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<void> | Yes| Callback used to return the result.| +| callback | AsyncCallback<void> | 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<void> | Promise used to return the result.| +| Promise<void> | 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<void> | 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<void> | Promise used to return the result.| +| Promise<void> | Promise used to return the result.| **Example** diff --git a/en/application-dev/reference/apis/js-apis-wantAgent.md b/en/application-dev/reference/apis/js-apis-wantAgent.md index d3d17810360c3ffa6074118413daddcb67fce31f..49cc55c70d32de63dcb415abcf359d93f351253d 100644 --- a/en/application-dev/reference/apis/js-apis-wantAgent.md +++ b/en/application-dev/reference/apis/js-apis-wantAgent.md @@ -1,4 +1,4 @@ -# WantAgent Module +# WantAgent >**NOTE** > @@ -916,6 +916,135 @@ WantAgent.equal(wantAgent1, wantAgent2).then((data) => { ``` +## WantAgent.getOperationType9+ + +getOperationType(agent: WantAgent, callback: AsyncCallback\): 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\ | 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.getOperationType9+ + +getOperationType(agent: WantAgent): Promise\ + +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\ | 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 diff --git a/en/application-dev/reference/apis/js-apis-zlib.md b/en/application-dev/reference/apis/js-apis-zlib.md index 14bb5717368e047abb3c68775799b056071a607e..1192097ac4b6daa8b88331ae09fb98d6c8697384 100644 --- a/en/application-dev/reference/apis/js-apis-zlib.md +++ b/en/application-dev/reference/apis/js-apis-zlib.md @@ -1,4 +1,4 @@ -# 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\; +zipFile(inFile:string, outFile:string, options: Options): Promise\ 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\; +unzipFile(inFile:string, outFile:string, options: Options): Promise\ Unzips a file. This API uses a promise to return the result.