From 771023a793275378e6037f1bae47c6a1d915fa04 Mon Sep 17 00:00:00 2001 From: Gloria Date: Fri, 25 Aug 2023 15:35:10 +0800 Subject: [PATCH] Update docs against 22278+22435 Signed-off-by: wusongqing --- ...-resourceschedule-backgroundTaskManager.md | 4 +- .../reference/apis/js-apis-taskpool.md | 120 +++++++++--------- 2 files changed, 62 insertions(+), 62 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-resourceschedule-backgroundTaskManager.md b/en/application-dev/reference/apis/js-apis-resourceschedule-backgroundTaskManager.md index 4cfaf10fbe..954fa92cf9 100644 --- a/en/application-dev/reference/apis/js-apis-resourceschedule-backgroundTaskManager.md +++ b/en/application-dev/reference/apis/js-apis-resourceschedule-backgroundTaskManager.md @@ -597,8 +597,8 @@ Provides the information about the suspension delay. | LOCATION | 4 | Positioning and navigation. | | BLUETOOTH_INTERACTION | 5 | Bluetooth-related task. | | MULTI_DEVICE_CONNECTION | 6 | Multi-device connection. | -| WIFI_INTERACTION | 7 | WLAN-related (system API).| -| VOIP | 8 | Audio and video calls (system API). | +| WIFI_INTERACTION | 7 | WLAN-related.
**System API**: This is a system API. | +| VOIP | 8 | Audio and video calls.
**System API**: This is a system API. | | TASK_KEEPING | 9 | Computing task (effective only for specific devices). | ## EfficiencyResourcesRequest diff --git a/en/application-dev/reference/apis/js-apis-taskpool.md b/en/application-dev/reference/apis/js-apis-taskpool.md index f347d7e42f..2b0e17b1c8 100644 --- a/en/application-dev/reference/apis/js-apis-taskpool.md +++ b/en/application-dev/reference/apis/js-apis-taskpool.md @@ -17,66 +17,6 @@ The **TaskPool** APIs return error codes in numeric format. For details about th import taskpool from '@ohos.taskpool'; ``` -## Priority - -Enumerates the priorities available for created tasks. (This enum is not supported yet.) - -**System capability**: SystemCapability.Utils.Lang - -| Name| Value| Description| -| -------- | -------- | -------- | -| HIGH | 0 | The task has a high priority.| -| MEDIUM | 1 | The task has a medium priority.| -| LOW | 2 | The task has a low priority.| - -## Task - -Implements a task. Before using any of the following APIs, you must create a **Task** instance. - -### constructor - -constructor(func: Function, ...args: unknown[]) - -A constructor used to create a **Task** instance. - -**System capability**: SystemCapability.Utils.Lang - -**Parameters** - -| Name| Type | Mandatory| Description | -| ------ | --------- | ---- | -------------------------------------------------------------------- | -| func | Function | Yes | Function to be passed in for task execution. For details about the supported return value types of the function, see [Sequenceable Data Types](#sequenceable-data-types). | -| args | unknown[] | No | Arguments of the function. For details about the supported parameter types, see [Sequenceable Data Types](#sequenceable-data-types). The default value is **undefined**.| - -**Error codes** - -For details about the error codes, see [Utils Error Codes](../errorcodes/errorcode-utils.md). - -| ID| Error Message | -| -------- | --------------------------------------- | -| 10200014 | The function is not mark as concurrent. | - -**Example** - -```ts -@Concurrent -function printArgs(args) { - console.log("printArgs: " + args); - return args; -} - -let task = new taskpool.Task(printArgs, "this is my first Task"); -``` - -### Attributes - -**System capability**: SystemCapability.Utils.Lang - -| Name | Type | Readable| Writable| Description | -| --------- | --------- | ---- | ---- | ------------------------------------------------------------------------- | -| function | Function | Yes | Yes | Function to be passed in during task creation. For details about the supported return value types of the function, see [Sequenceable Data Types](#sequenceable-data-types). | -| arguments | unknown[] | Yes | Yes | Arguments of the function. For details about the supported parameter types, see [Sequenceable Data Types](#sequenceable-data-types).| - ## taskpool.execute execute(func: Function, ...args: unknown[]): Promise\ @@ -279,6 +219,66 @@ async function taskpoolCancel() { taskpoolCancel(); ``` +## Priority + +Enumerates the priorities available for created tasks. (This enum is not supported yet.) + +**System capability**: SystemCapability.Utils.Lang + +| Name| Value| Description| +| -------- | -------- | -------- | +| HIGH | 0 | The task has a high priority.| +| MEDIUM | 1 | The task has a medium priority.| +| LOW | 2 | The task has a low priority.| + +## Task + +Implements a task. Before using any of the following APIs, you must create a **Task** instance. + +### constructor + +constructor(func: Function, ...args: unknown[]) + +A constructor used to create a **Task** instance. + +**System capability**: SystemCapability.Utils.Lang + +**Parameters** + +| Name| Type | Mandatory| Description | +| ------ | --------- | ---- | -------------------------------------------------------------------- | +| func | Function | Yes | Function to be passed in for task execution. For details about the supported return value types of the function, see [Sequenceable Data Types](#sequenceable-data-types). | +| args | unknown[] | No | Arguments of the function. For details about the supported parameter types, see [Sequenceable Data Types](#sequenceable-data-types). The default value is **undefined**.| + +**Error codes** + +For details about the error codes, see [Utils Error Codes](../errorcodes/errorcode-utils.md). + +| ID| Error Message | +| -------- | --------------------------------------- | +| 10200014 | The function is not mark as concurrent. | + +**Example** + +```ts +@Concurrent +function printArgs(args) { + console.log("printArgs: " + args); + return args; +} + +let task = new taskpool.Task(printArgs, "this is my first Task"); +``` + +### Attributes + +**System capability**: SystemCapability.Utils.Lang + +| Name | Type | Readable| Writable| Description | +| --------- | --------- | ---- | ---- | ------------------------------------------------------------------------- | +| function | Function | Yes | Yes | Function to be passed in during task creation. For details about the supported return value types of the function, see [Sequenceable Data Types](#sequenceable-data-types). | +| arguments | unknown[] | Yes | Yes | Arguments of the function. For details about the supported parameter types, see [Sequenceable Data Types](#sequenceable-data-types).| + ## Additional Information ### Sequenceable Data Types -- GitLab