From d8363bca714879b8dd6042fa6f45c24510c6efe2 Mon Sep 17 00:00:00 2001 From: wusongqing Date: Wed, 22 Jun 2022 17:53:28 +0800 Subject: [PATCH] update docs Signed-off-by: wusongqing --- en/application-dev/ability/ability-delegator.md | 2 +- en/application-dev/ability/stage-ability.md | 16 ++++++++-------- .../ability/stage-serviceextension.md | 9 +++++---- en/application-dev/media/audio-playback.md | 7 ++++--- en/application-dev/media/audio-recorder.md | 7 ++++--- .../reference/apis/js-apis-Bundle.md | 14 +++++++------- .../reference/apis/js-apis-ability-context.md | 10 +++++----- .../reference/apis/js-apis-bundle-BundleInfo.md | 2 +- .../reference/apis/js-apis-dataAbilityHelper.md | 2 +- .../reference/apis/js-apis-wantAgent.md | 4 ++-- 10 files changed, 38 insertions(+), 35 deletions(-) diff --git a/en/application-dev/ability/ability-delegator.md b/en/application-dev/ability/ability-delegator.md index 86b8bdf7f2..5fd0293efd 100644 --- a/en/application-dev/ability/ability-delegator.md +++ b/en/application-dev/ability/ability-delegator.md @@ -46,7 +46,7 @@ For details about how to use DevEco Studio to start the test framework, see [Ope ## Introduction to TestRunner -**TestRunner** is the entry class of the test framework test process. When the test process is started, the system calls related APIs in **TestRunner**. You need to inherit this class and overwrite the **onPrepare** and **onRun** APIs. When creating an application template, DevEco Studio initializes the default **TestRunner** and starts the default **TestAbility** in the **onRun** API. You can modify the test code of **TestAbility** or override **onPrepare** and **onRun** in **TestRunner** to implement your own test code. For details, see [TestRunner](../reference/apis/js-apis-testRunner.md). +**TestRunner** is the entry class of the test framework test process. When the test process is started, the system calls related APIs in **TestRunner**. You need to inherit this class and override the **onPrepare** and **onRun** APIs. When creating an application template, DevEco Studio initializes the default **TestRunner** and starts the default **TestAbility** in the **onRun** API. You can modify the test code of **TestAbility** or override **onPrepare** and **onRun** in **TestRunner** to implement your own test code. For details, see [TestRunner](../reference/apis/js-apis-testRunner.md). ## Introduction to AbilityDelegatorRegistry diff --git a/en/application-dev/ability/stage-ability.md b/en/application-dev/ability/stage-ability.md index 8429b0ae59..91e7d1132a 100644 --- a/en/application-dev/ability/stage-ability.md +++ b/en/application-dev/ability/stage-ability.md @@ -210,14 +210,14 @@ The `Ability` class has the `context` attribute, which belongs to the `AbilityCo **Table 3** AbilityContext APIs |API|Description| |:------|:------| -|startAbility(want: Want, callback: AsyncCallback): void|Starts an ability.| -|startAbility(want: Want, options?: StartOptions): Promise|Starts an ability.| -|startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void|Starts an ability with the account ID.| -|startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise|Starts an ability with the account ID.| -|startAbilityForResult(want: Want, callback: AsyncCallback): void|Starts an ability with the returned result.| -|startAbilityForResult(want: Want, options?: StartOptions): Promise|Starts an ability with the returned result.| -|startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void|Starts an ability with the execution result and account ID.| -|startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise|Starts an ability with the execution result and account ID.| +|startAbility(want: Want, callback: AsyncCallback\): void|Starts an ability.| +|startAbility(want: Want, options?: StartOptions): Promise\|Starts an ability.| +|startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\): void|Starts an ability with the account ID.| +|startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\|Starts an ability with the account ID.| +|startAbilityForResult(want: Want, callback: AsyncCallback\): void|Starts an ability with the returned result.| +|startAbilityForResult(want: Want, options?: StartOptions): Promise\|Starts an ability with the returned result.| +|startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback\): void|Starts an ability with the execution result and account ID.| +|startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\|Starts an ability with the execution result and account ID.| ### Starting an Ability on the Same Device An application can obtain the context of an `Ability` instance through `this.context` and then use the `startAbility` API in the `AbilityContext` class to start the ability. The ability can be started by specifying `Want`, `StartOptions`, and `accountId`, and the operation result can be returned using a callback or `Promise` instance. The sample code is as follows: ```ts diff --git a/en/application-dev/ability/stage-serviceextension.md b/en/application-dev/ability/stage-serviceextension.md index fd91ba285e..90448c5242 100644 --- a/en/application-dev/ability/stage-serviceextension.md +++ b/en/application-dev/ability/stage-serviceextension.md @@ -1,9 +1,9 @@ # Service Extension Ability Development ## When to Use -**ExtensionAbility** is the base class of new **Extension** components in the stage model. It is used to process jobs without UIs. The lifecycle of **ExtensionAbility** is simple and does not involve foreground or background. **ServiceExtensionAbility** is extended from **ExtensionAbility**. +**ExtensionAbility** is the base class of the new Extension component in the stage model. It is used to process missions without UIs. The lifecycle of an Extension ability is simple, and it does not involve foreground or background. **ServiceExtensionAbility** is extended from **ExtensionAbility**. -You can customize a class that inherits from **ServiceExtensionAbility** and override the lifecycle callbacks of **ExtensionAbility** to perform service logic operations during the initialization, connection, and disconnection processes. +You can customize a class that inherits from **ServiceExtensionAbility** and override the lifecycle callbacks in the base class to perform service logic operations during the initialization, connection, and disconnection processes. ## Available APIs @@ -19,7 +19,7 @@ You can customize a class that inherits from **ServiceExtensionAbility** and ove ## Constraints -- Currently, OpenHarmony does not support creation of a **ServiceExtensionAbility** for third-party applications. +- Currently, OpenHarmony does not support creation of a Service Extension ability for third-party applications. ## How to Develop @@ -82,4 +82,5 @@ The following sample is provided to help you better understand how to develop a - [ServiceExtensionAbility](https://gitee.com/openharmony/app_samples/tree/master/ability/ServiceExtAbility) -This sample will guide you through creating a Service Extension ability in the **ServiceExtAbility.ts** file in the **ServiceExtensionAbility** directory. \ No newline at end of file +This sample shows how to create a Service Extension ability in the **ServiceExtAbility.ts** file in the **ServiceExtensionAbility** directory. + diff --git a/en/application-dev/media/audio-playback.md b/en/application-dev/media/audio-playback.md index c8dabdf0be..cabf6a85c3 100644 --- a/en/application-dev/media/audio-playback.md +++ b/en/application-dev/media/audio-playback.md @@ -256,7 +256,8 @@ export class AudioDemo { The following samples are provided to help you better understand how to develop audio playback: -- [JsDistributedMusicPlayer: Distributed Music Player (JS, API version 7)](https://gitee.com/openharmony/app_samples/tree/master/ability/JsDistributedMusicPlayer) -- [JsAudioPlayer: Audio Playback and Management (JS, API version 7)](https://gitee.com/openharmony/app_samples/tree/master/media/JsAudioPlayer) -- [eTsAudioPlayer: Audio Player (eTS)](https://gitee.com/openharmony/app_samples/blob/master/media/Recorder/entry/src/main/ets/MainAbility/pages/Play.ets) +- [`JsDistributedMusicPlayer`: Distributed Music Player (JS, API version 7)](https://gitee.com/openharmony/app_samples/tree/master/ability/JsDistributedMusicPlayer) +- [`JsAudioPlayer`: Audio Playback and Management (JS, API version 7)](https://gitee.com/openharmony/app_samples/tree/master/media/JsAudioPlayer) +- [`eTsAudioPlayer`: Audio Player (eTS)](https://gitee.com/openharmony/app_samples/blob/master/media/Recorder/entry/src/main/ets/MainAbility/pages/Play.ets) - [Audio Player](https://gitee.com/openharmony/codelabs/tree/master/Media/Audio_OH_ETS) + diff --git a/en/application-dev/media/audio-recorder.md b/en/application-dev/media/audio-recorder.md index d24ee72f4a..fa43dff19c 100644 --- a/en/application-dev/media/audio-recorder.md +++ b/en/application-dev/media/audio-recorder.md @@ -190,7 +190,8 @@ export class AudioRecorderDemo { The following samples are provided to help you better understand how to develop audio recording: -- [Recorder: Recorder (eTS, API version 8)](https://gitee.com/openharmony/app_samples/tree/master/media/Recorder) -- [JsRecorder: Recorder (JS, API version 8)](https://gitee.com/openharmony/app_samples/tree/master/media/JSRecorder) -- [eTsAudioPlayer: Audio Player (eTS)](https://gitee.com/openharmony/app_samples/blob/master/media/Recorder/entry/src/main/ets/MainAbility/pages/Play.ets) +- [`Recorder`: Recorder (eTS, API version 8)](https://gitee.com/openharmony/app_samples/tree/master/media/Recorder) +- [`JsRecorder`: Recorder (JS, API version 8)](https://gitee.com/openharmony/app_samples/tree/master/media/JSRecorder) +- [`eTsAudioPlayer`: Audio Player (eTS)](https://gitee.com/openharmony/app_samples/blob/master/media/Recorder/entry/src/main/ets/MainAbility/pages/Play.ets) - [Audio Player](https://gitee.com/openharmony/codelabs/tree/master/Media/Audio_OH_ETS) + diff --git a/en/application-dev/reference/apis/js-apis-Bundle.md b/en/application-dev/reference/apis/js-apis-Bundle.md index 8c6a8aebe0..9a037c0128 100644 --- a/en/application-dev/reference/apis/js-apis-Bundle.md +++ b/en/application-dev/reference/apis/js-apis-Bundle.md @@ -143,7 +143,7 @@ bundle.getApplicationInfo(bundleName, bundleFlags, (err, data) => { ## bundle.getAllBundleInfo -getAllBundleInfo(bundleFlag: BundleFlag, userId?: number): Promise> +getAllBundleInfo(bundleFlag: BundleFlag, userId?: number): Promise\> Obtains the information of all available bundles of a specified user in the system. This API uses a promise to return the result. @@ -166,7 +166,7 @@ SystemCapability.BundleManager.BundleFramework | Type | Description | | --------------------------- | -------------------------- | -| Promise> | Promise used to return the information of all available bundles.| +| Promise\> | Promise used to return the information of all available bundles.| **Example** @@ -185,7 +185,7 @@ bundle.getAllBundleInfo(bundleFlag, userId) ## bundle.getAllBundleInfo -getAllBundleInfo(bundleFlag: BundleFlag, callback: AsyncCallback>): void +getAllBundleInfo(bundleFlag: BundleFlag, callback: AsyncCallback\>): void Obtains the information of all available bundles in the system. This API uses an asynchronous callback to return the result. @@ -220,7 +220,7 @@ bundle.getAllBundleInfo(bundleFlag, (err, data) => { ## bundle.getAllBundleInfo -getAllBundleInfo(bundleFlag: BundleFlag, userId: number, callback: AsyncCallback>): void +getAllBundleInfo(bundleFlag: BundleFlag, userId: number, callback: AsyncCallback\>): void Obtains the information of all available bundles in the system. This API uses an asynchronous callback to return the result. @@ -238,7 +238,7 @@ SystemCapability.BundleManager.BundleFramework | ---------- | --------------------------------- | ---- | --------------------------------------- | | bundleFlag | BundleFlag | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | -| callback | AsyncCallback> | Yes | Callback used to return the information of all available bundles. | +| callback | AsyncCallback\> | Yes | Callback used to return the information of all available bundles. | **Example** @@ -495,7 +495,7 @@ bundle.getAllApplicationInfo(bundleFlags, (err, data) => { ## bundle.getBundleArchiveInfo -getBundleArchiveInfo(hapFilePath: string, bundleFlags: number) : Promise +getBundleArchiveInfo(hapFilePath: string, bundleFlags: number) : Promise\ Obtains information about the bundles contained in a HAP file. This API uses a promise to return the result. @@ -530,7 +530,7 @@ bundle.getBundleArchiveInfo(hapFilePath, bundleFlags) ## bundle.getBundleArchiveInfo -getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback) : void +getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback\) : void Obtains information about the bundles contained in a HAP file. This API uses an asynchronous callback to return the result. diff --git a/en/application-dev/reference/apis/js-apis-ability-context.md b/en/application-dev/reference/apis/js-apis-ability-context.md index 88a0908ab1..2b1fdce8a9 100644 --- a/en/application-dev/reference/apis/js-apis-ability-context.md +++ b/en/application-dev/reference/apis/js-apis-ability-context.md @@ -143,7 +143,7 @@ Starts an ability. This API uses a promise to return the result. startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>): void; -Starts an ability. This API uses a callback to return the execution result when the ability is terminated. +Starts an ability. This API uses a callback to return the result when the ability is terminated. **System capability**: SystemCapability.Ability.AbilityRuntime.Core @@ -171,7 +171,7 @@ Starts an ability. This API uses a callback to return the execution result when startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback<AbilityResult>): void; -Starts an ability. This API uses a callback to return the execution result when the ability is terminated. +Starts an ability. This API uses a callback to return the result when the ability is terminated. **System capability**: SystemCapability.Ability.AbilityRuntime.Core @@ -204,7 +204,7 @@ Starts an ability. This API uses a callback to return the execution result when startAbilityForResult(want: Want, options?: StartOptions): Promise<AbilityResult>; -Starts an ability. This API uses a promise to return the execution result when the ability is terminated. +Starts an ability. This API uses a promise to return the result when the ability is terminated. **System capability**: SystemCapability.Ability.AbilityRuntime.Core @@ -452,7 +452,7 @@ Requests permissions from the user by displaying a pop-up window. This API uses setMissionLabel(label: string, callback:AsyncCallback<void>): void; -Sets the label of the ability displayed in the task. This API uses a callback to return the result. +Sets the label of the ability in the mission. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Core @@ -476,7 +476,7 @@ Sets the label of the ability displayed in the task. This API uses a callback to setMissionLabel(label: string): Promise<void> -Sets the label of the ability displayed in the task. This API uses a promise to return the result. +Sets the label of the ability in the mission. This API uses a promise to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Core diff --git a/en/application-dev/reference/apis/js-apis-bundle-BundleInfo.md b/en/application-dev/reference/apis/js-apis-bundle-BundleInfo.md index 4b5437ad37..38a93fd67c 100644 --- a/en/application-dev/reference/apis/js-apis-bundle-BundleInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundle-BundleInfo.md @@ -53,7 +53,7 @@ Provides the detailed information of the permissions to request from the system. | name | string | Yes | Yes | Name of the permission to request. | | reason | string | Yes | Yes | Reason for requesting the permission. | | reasonId9+ | number | Yes | Yes | ID of the reason for requesting the permission.| -| usedScene | [UsedScene](#UsedScene) | Yes | Yes | Application scenario and timing for using the permission.| +| usedScene | [UsedScene](#usedscene) | Yes | Yes | Application scenario and timing for using the permission.| diff --git a/en/application-dev/reference/apis/js-apis-dataAbilityHelper.md b/en/application-dev/reference/apis/js-apis-dataAbilityHelper.md index 029e169fd2..df69b38be7 100644 --- a/en/application-dev/reference/apis/js-apis-dataAbilityHelper.md +++ b/en/application-dev/reference/apis/js-apis-dataAbilityHelper.md @@ -573,7 +573,7 @@ Inserts multiple data records into the database. This API uses an asynchronous c | Name | Type | Mandatory| Description | | ------------ | ----------------------- | ---- | -------------------------------- | | uri | string | Yes | URI of the data to insert. | -| valuesBucket | Array | Yes | Data records to insert. | +| valuesBucket | Array\ | Yes | Data records to insert. | | callback | AsyncCallback\ | Yes | Callback used to return the number of inserted data records.| **Example** diff --git a/en/application-dev/reference/apis/js-apis-wantAgent.md b/en/application-dev/reference/apis/js-apis-wantAgent.md index 3977fbfe5b..c6a89b7871 100644 --- a/en/application-dev/reference/apis/js-apis-wantAgent.md +++ b/en/application-dev/reference/apis/js-apis-wantAgent.md @@ -782,7 +782,7 @@ Checks whether two **WantAgent** objects are equal. This API uses an asynchronou | Name | Readable| Writable| Type | Mandatory| Description | | ---------- | --- | ---- | ------------------------ | ---- | --------------------------------------- | | agent | Yes | No | WantAgent | Yes | The first **WantAgent** object. | -| otherAgent | Yes | No | WantAgent | Yes | Target **WantAgent** object. | +| otherAgent | Yes | No | WantAgent | Yes | The second **WantAgent** object. | | callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -857,7 +857,7 @@ Checks whether two **WantAgent** objects are equal. This API uses a promise to r | Name | Readable| Writable| Type | Mandatory| Description | | ---------- | --- | ---- | --------- | ---- | ------------- | | agent | Yes | No | WantAgent | Yes | The first **WantAgent** object.| -| otherAgent | Yes | No | WantAgent | Yes | Target **WantAgent** object.| +| otherAgent | Yes | No | WantAgent | Yes | The second **WantAgent** object.| **Return value** -- GitLab