Skip to content

Interface Task

🏷️ Properties

context readonly

ts
context: undefined | TaskContext

Defined in: packages/task/index.ts:36

from readonly

ts
from: undefined | string

Defined in: packages/task/index.ts:26

id readonly

ts
id: number

Defined in: packages/task/index.ts:21

isCancelled readonly

ts
isCancelled: boolean

Defined in: packages/task/index.ts:30

isDone readonly

ts
isDone: boolean

Defined in: packages/task/index.ts:32

isPaused readonly

ts
isPaused: boolean

Defined in: packages/task/index.ts:31

isRunning readonly

ts
isRunning: boolean

Defined in: packages/task/index.ts:33

name readonly

ts
name: string

Defined in: packages/task/index.ts:22

param readonly

ts
param: Record<string, any>

Defined in: packages/task/index.ts:23

parent readonly

ts
parent: undefined | Task<any>

Defined in: packages/task/index.ts:37

path readonly

ts
path: string

Defined in: packages/task/index.ts:29

progress readonly

ts
progress: number

Defined in: packages/task/index.ts:24

state readonly

ts
state: TaskState

Defined in: packages/task/index.ts:34

to readonly

ts
to: undefined | string

Defined in: packages/task/index.ts:27

total readonly

ts
total: number

Defined in: packages/task/index.ts:25

🔧 Methods

cancel

ts
cancel(timeout: number): Promise<void>

Parameters

  • timeout: number

Return Type

  • Promise<void>

Defined in: packages/task/index.ts:41

map

ts
map(transform: Transform<Task<T>, N>): Task<N extends Promise<R> ? R : N>

Parameters

  • transform: Transform<Task<T>, N>

Return Type

  • Task<N extends Promise<R> ? R : N>

Defined in: packages/task/index.ts:48

onChildUpdate

ts
onChildUpdate(chunkSize: number): void

Parameters

  • chunkSize: number

Return Type

  • void

Defined in: packages/task/index.ts:46

pause

ts
pause(): Promise<void>

Return Type

  • Promise<void>

Defined in: packages/task/index.ts:39

resume

ts
resume(): Promise<void>

Return Type

  • Promise<void>

Defined in: packages/task/index.ts:40

setName

ts
setName(name: string, param: Record<string, any>): Task<T>

Parameters

  • name: string
  • param: Record<string, any>

Return Type

  • Task<T>

Defined in: packages/task/index.ts:50

start

ts
start(context: TaskContext, parent: Task<any>): void

Parameters

  • context: TaskContext
  • parent: Task<any>

Return Type

  • void

Defined in: packages/task/index.ts:42

startAndWait

ts
startAndWait(context: TaskContext, parent: Task<any>): Promise<T>

Parameters

  • context: TaskContext
  • parent: Task<any>

Return Type

  • Promise<T>

Defined in: packages/task/index.ts:44

wait

ts
wait(): Promise<T>

Return Type

  • Promise<T>

Defined in: packages/task/index.ts:43