From 6c558c983d502117d2fb41a20aefbdf978b823e3 Mon Sep 17 00:00:00 2001 From: huangfeijie Date: Wed, 19 Mar 2025 17:14:28 +0800 Subject: [PATCH] add canceledResult for taskpool Issue: [Bug]: add CanceledResult for taskpool https://gitee.com/openharmony/interface_sdk-js/issues/IBUPEA Signed-off-by: huangfeijie --- api/@ohos.taskpool.d.ts | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/api/@ohos.taskpool.d.ts b/api/@ohos.taskpool.d.ts index f7307bffad..af67687209 100644 --- a/api/@ohos.taskpool.d.ts +++ b/api/@ohos.taskpool.d.ts @@ -1838,6 +1838,39 @@ declare namespace taskpool { */ execute(task: Task, priority?: Priority): Promise; } + + /** + * Defines the task result interface + * + * @interface TaskResult + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 20 + */ + interface TaskResult { + /** + * the result returned by the task + * + * @type { ?Object } + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 20 + */ + result?: Object; + + /** + * the error thrown by the task + * + * @type { ?(Error | Object) } + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 20 + */ + error?: Error | Object; + } } export default taskpool; -- Gitee