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()

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

Parameters

options?: ListrBaseClassOptions<Ctx, Renderer, FallbackRenderer>

Returns

Manager<Ctx, Renderer, FallbackRenderer>

Defined in

manager.ts:29

Properties

errors

errors: ListrError<any>[] = []

Defined in

manager.ts:26


tasks

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

Defined in

manager.ts:27


options?

optional options: ListrBaseClassOptions<Ctx, Renderer, FallbackRenderer>

Defined in

manager.ts:29

Accessors

ctx

get ctx(): Ctx

set ctx(ctx): void

Parameters

ctx: Ctx

Returns

Ctx

Defined in

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

Defined in

manager.ts:39


runAll()

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

Type Parameters

InjectCtx = Ctx

Parameters

options?: ListrBaseClassOptions<InjectCtx, Renderer, FallbackRenderer>

Returns

Promise<InjectCtx>

Defined in

manager.ts:48


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>

Defined in

manager.ts:61


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>>

Defined in

manager.ts:68


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>

Defined in

manager.ts:91