Skip to content

Documentation / @listr2/manager / Manager

Class: Manager<Ctx, Renderer, FallbackRenderer>

Creates a new Listr2 task manager.

Useful for creating a single instance of Listr2 with pre-set settings.

See

https://listr2.kilic.dev/listr/manager.html

Type parameters

Ctx = ListrContext

Renderer extends ListrRendererValue = ListrPrimaryRendererValue

FallbackRenderer extends ListrRendererValue = ListrSecondaryRendererValue

Constructors

new Manager(options)

new Manager<Ctx, Renderer, FallbackRenderer>(options?): Manager<Ctx, Renderer, FallbackRenderer>

Parameters

options?: ListrBaseClassOptions<Ctx, Renderer, FallbackRenderer>

Returns

Manager<Ctx, Renderer, FallbackRenderer>

Source

manager.ts:29

Properties

errors

errors: ListrError<any>[] = []

Source

manager.ts:26


tasks

tasks: ListrTask<any, ListrGetRendererClassFromValue<Renderer>, ListrGetRendererClassFromValue<FallbackRenderer>>[] = []

Source

manager.ts:27


options?

optional options: ListrBaseClassOptions<Ctx, Renderer, FallbackRenderer>

Source

manager.ts:29

Accessors

ctx

get ctx(): Ctx

set ctx(ctx): void

Parameters

ctx: Ctx

Returns

Ctx

Source

manager.ts:31

Methods

add()

add<InjectCtx>(tasks, options?): void

Type parameters

InjectCtx = Ctx

Parameters

tasks: ListrTask<InjectCtx, ListrGetRendererClassFromValue<Renderer>, ListrGetRendererClassFromValue<FallbackRenderer>>[] | (ctx?) => ListrTask<InjectCtx, ListrGetRendererClassFromValue<Renderer>, ListrGetRendererClassFromValue<FallbackRenderer>>[]

options?: ListrSubClassOptions<InjectCtx, Renderer, FallbackRenderer>

Returns

void

Source

manager.ts:39


runAll()

runAll<InjectCtx>(options?): Promise<InjectCtx>

Type parameters

InjectCtx = Ctx

Parameters

options?: ListrBaseClassOptions<InjectCtx, Renderer, FallbackRenderer>

Returns

Promise<InjectCtx>

Source

manager.ts:50


newListr()

newListr<InjectCtx, InjectRenderer, InjectFallbackRenderer>(tasks, options?): Listr<InjectCtx, InjectRenderer, InjectFallbackRenderer>

Type parameters

InjectCtx = Ctx

InjectRenderer extends ListrRendererValue = Renderer

InjectFallbackRenderer extends ListrRendererValue = FallbackRenderer

Parameters

tasks: ListrTask<InjectCtx, ListrGetRendererClassFromValue<InjectRenderer>, ListrGetRendererClassFromValue<InjectFallbackRenderer>>[]

options?: ListrBaseClassOptions<InjectCtx, InjectRenderer, InjectFallbackRenderer>

Returns

Listr<InjectCtx, InjectRenderer, InjectFallbackRenderer>

Source

manager.ts:63


indent()

indent<InjectCtx>(tasks, options?, taskOptions?): ListrTask<InjectCtx, ListrGetRendererClassFromValue<Renderer>, ListrGetRendererClassFromValue<FallbackRenderer>>

Type parameters

InjectCtx = Ctx

Parameters

tasks: ListrTask<InjectCtx, ListrGetRendererClassFromValue<Renderer>, ListrGetRendererClassFromValue<FallbackRenderer>>[] | (ctx?) => ListrTask<InjectCtx, ListrGetRendererClassFromValue<Renderer>, ListrGetRendererClassFromValue<FallbackRenderer>>[]

options?: ListrBaseClassOptions<InjectCtx, Renderer, FallbackRenderer>

taskOptions?: Omit<ListrTask<InjectCtx, ListrGetRendererClassFromValue<Renderer>, ListrGetRendererClassFromValue<FallbackRenderer>>, "task">

Returns

ListrTask<InjectCtx, ListrGetRendererClassFromValue<Renderer>, ListrGetRendererClassFromValue<FallbackRenderer>>

Source

manager.ts:70


run()

run<InjectCtx>(tasks, options?): Promise<InjectCtx>

Type parameters

InjectCtx = Ctx

Parameters

tasks: ListrTask<InjectCtx, ListrGetRendererClassFromValue<Renderer>, ListrGetRendererClassFromValue<FallbackRenderer>>[]

options?: ListrBaseClassOptions<InjectCtx, Renderer, FallbackRenderer>

Returns

Promise<InjectCtx>

Source

manager.ts:93