Skip to content

Interface Task

🏷️ Properties

context

ts
context: undefined | TaskContext

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

from

ts
from: undefined | string

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

id

ts
id: number

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

isCancelled

ts
isCancelled: boolean

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

isDone

ts
isDone: boolean

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

isPaused

ts
isPaused: boolean

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

isRunning

ts
isRunning: boolean

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

name

ts
name: string

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

param

ts
param: Record<string, any>

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

parent

ts
parent: undefined | Task<any>

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

path

ts
path: string

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

progress

ts
progress: number

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

state

ts
state: TaskState

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

to

ts
to: undefined | string

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

total

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

Released under the MIT License.