diff --git a/api/@ohos.taskpool.d.ts b/api/@ohos.taskpool.d.ts index f7307bffad368c53632879260382b5a6d43c902e..af67687209da4b874515153c695914e0ee5b7e9a 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;