Documentation / listr2 / ListrTask
Interface: ListrTask<Ctx, Renderer, FallbackRenderer>
Defined in: packages/listr2/src/interfaces/task.interface.ts:14
Defines the task, conditions and options to run a specific task in the Listr. This defines the external API for the task where TaskWrapper is used internally.
See
https://listr2.kilic.dev/task/task.html
Extends
ListrPrimaryRendererTaskOptions<Renderer>.ListrSecondaryRendererTaskOptions<FallbackRenderer>
Type Parameters
Ctx
Ctx = ListrContext
Renderer
Renderer extends ListrRendererFactory = any
FallbackRenderer
FallbackRenderer extends ListrRendererFactory = any
Properties
rendererOptions?
optionalrendererOptions:ListrGetRendererTaskOptions<Renderer>
Defined in: packages/listr2/src/interfaces/renderer.interface.ts:102
Renderer options depending on the current renderer.
Inherited from
ListrPrimaryRendererTaskOptions.rendererOptions
fallbackRendererOptions?
optionalfallbackRendererOptions:ListrGetRendererTaskOptions<FallbackRenderer>
Defined in: packages/listr2/src/interfaces/renderer.interface.ts:120
Renderer options depending on the fallback renderer.
Inherited from
ListrSecondaryRendererTaskOptions.fallbackRendererOptions
title?
optionaltitle:string|any[]
Defined in: packages/listr2/src/interfaces/task.interface.ts:26
Title of the task.
Give this task a title to enchance it on the preferred renderer.
- Tasks without a title will be hidden from view in renderers and will act as a background task.
See
https://listr2.kilic.dev/task/title.html
task
task:
ListrTaskFn<Ctx,Renderer,FallbackRenderer>
Defined in: packages/listr2/src/interfaces/task.interface.ts:34
The task itself in the form of a Function, Promise, Listr, Observable or Stream.
- Task will be executed, whenever the provided criterion is met with the current state and whenever the time for that specific task has come.
See
https://listr2.kilic.dev/task/task.html
enabled?
optionalenabled:boolean| (ctx) =>boolean|Promise<boolean>
Defined in: packages/listr2/src/interfaces/task.interface.ts:43
Enable a task depending on the context.
- The callback function will be evaluated before all the tasks start to check which tasks has been enabled.
- The callback function will be evaluated again before the task starts.
See
https://listr2.kilic.dev/task/enable.html
skip?
optionalskip:string|boolean| (ctx) =>string|boolean|Promise<string|boolean>
Defined in: packages/listr2/src/interfaces/task.interface.ts:51
Skip this task depending on the context.
- The callback function will be evaluated once before the task starts.
See
https://listr2.kilic.dev/task/skip.html
retry?
optionalretry:number| {tries:number;delay?:number; }
Defined in: packages/listr2/src/interfaces/task.interface.ts:57
Retries a task with the given amounts whenever a task fails.
See
https://listr2.kilic.dev/task/retry.html
rollback?
optionalrollback:ListrTaskFn<Ctx,Renderer,FallbackRenderer>
Defined in: packages/listr2/src/interfaces/task.interface.ts:64
The callback function that you provide will run whenever the attached task fails and give you the ability to revert your changes, before failing.
See
https://listr2.kilic.dev/task/rollback.html
exitOnError?
optionalexitOnError:boolean| (ctx) =>boolean|Promise<boolean>
Defined in: packages/listr2/src/interfaces/task.interface.ts:68
Determine the default behavior of exiting on errors for this attached task.