diff --git a/api/@ohos.taskpool.d.ts b/api/@ohos.taskpool.d.ts index 282a405a8..b1e2aed40 100644 --- a/api/@ohos.taskpool.d.ts +++ b/api/@ohos.taskpool.d.ts @@ -559,6 +559,18 @@ declare namespace taskpool { execute(task: Task): Promise; } + /** + * The LongTask class provides an interface to create a task that has no upper limit on execution time. + * + * @extends Task + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + class LongTask extends Task { + } + /** * The State defines the task state. * @@ -1043,6 +1055,18 @@ declare namespace taskpool { * @since 11 */ function getTaskPoolInfo(): TaskPoolInfo; + + /** + * Terminate a long task. + * + * @param { LongTask } longTask - The long task want to terminate. + * @throws { BusinessError } 401 - The input parameters are invalid. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + function terminateTask(longTask: LongTask): void; } export default taskpool;