@types/listr

  • Version 0.14.9
  • Published
  • 6.04 kB
  • 2 dependencies
  • MIT license

Install

npm i @types/listr
yarn add @types/listr
pnpm add @types/listr

Overview

TypeScript definitions for listr

Index

Classes

class Listr

class Listr<Ctx = Listr.ListrContext> {}

    constructor

    constructor(
    tasks?: readonly Listr.ListrTask<Ctx>[],
    options?: Listr.ListrOptions<Ctx>
    );

      constructor

      constructor(options?: Listr.ListrOptions<Ctx>);

        property tasks

        tasks: readonly Listr.ListrTaskWrapper<Ctx>[];

          method add

          add: (tasks: Listr.ListrTask<Ctx> | ReadonlyArray<Listr.ListrTask<Ctx>>) => void;

            method render

            render: () => void;

              method run

              run: (ctx?: Ctx) => Promise<Ctx>;

                method setRenderer

                setRenderer: (value: Listr.ListrRendererValue<Ctx>) => void;

                  Interfaces

                  interface ListrError

                  interface ListrError<Ctx> extends Error {}

                    property context

                    context: Ctx;

                      interface ListrEvent

                      interface ListrEvent {}

                        property data

                        data?: string | boolean | undefined;

                          property type

                          type: string;

                            interface ListrOptions

                            interface ListrOptions<Ctx = ListrContext> {}

                              property concurrent

                              concurrent?: boolean | number | undefined;

                                property exitOnError

                                exitOnError?: boolean | undefined;

                                  property nonTTYRenderer

                                  nonTTYRenderer?: ListrRendererValue<Ctx> | undefined;

                                    property renderer

                                    renderer?: ListrRendererValue<Ctx> | undefined;

                                      interface ListrRenderer

                                      interface ListrRenderer {}

                                        method end

                                        end: (err: Error) => void;

                                          method render

                                          render: () => void;

                                            interface ListrRendererClass

                                            interface ListrRendererClass<Ctx> {}

                                              property nonTTY

                                              nonTTY: boolean;

                                                construct signature

                                                new (
                                                tasks: ReadonlyArray<ListrTaskObject<Ctx>>,
                                                options: ListrOptions<Ctx>
                                                ): ListrRenderer;

                                                  interface ListrTask

                                                  interface ListrTask<Ctx = ListrContext> {}

                                                    property enabled

                                                    enabled?:
                                                    | ((ctx: Ctx) => boolean | Promise<boolean> | Observable<boolean>)
                                                    | undefined;

                                                      property skip

                                                      skip?:
                                                      | ((
                                                      ctx: Ctx
                                                      ) => void | boolean | string | Promise<undefined | boolean | string>)
                                                      | undefined;

                                                        property task

                                                        task: (ctx: Ctx, task: ListrTaskWrapper<Ctx>) => void | ListrTaskResult<Ctx>;

                                                          property title

                                                          title: string;

                                                            interface ListrTaskObject

                                                            interface ListrTaskObject<Ctx> extends Observable<ListrEvent> {}

                                                              property check

                                                              check: (ctx: Ctx) => void;

                                                                property output

                                                                output?: string | undefined;

                                                                  property run

                                                                  run: (ctx: Ctx, wrapper: ListrTaskWrapper<Ctx>) => Promise<void>;

                                                                    property skip

                                                                    skip: (
                                                                    ctx: Ctx
                                                                    ) => void | boolean | string | Promise<undefined | boolean | string>;

                                                                      property state

                                                                      state: string;

                                                                        property subtasks

                                                                        subtasks: ReadonlyArray<ListrTaskWrapper<Ctx>>;

                                                                          property task

                                                                          task: (ctx: Ctx, task: ListrTaskWrapper<Ctx>) => void | ListrTaskResult<Ctx>;

                                                                            property title

                                                                            title: string;

                                                                              method hasFailed

                                                                              hasFailed: () => boolean;

                                                                                method hasSubtasks

                                                                                hasSubtasks: () => boolean;

                                                                                  method isCompleted

                                                                                  isCompleted: () => boolean;

                                                                                    method isEnabled

                                                                                    isEnabled: () => boolean;

                                                                                      method isPending

                                                                                      isPending: () => boolean;

                                                                                        method isSkipped

                                                                                        isSkipped: () => boolean;

                                                                                          interface ListrTaskWrapper

                                                                                          interface ListrTaskWrapper<Ctx = ListrContext> {}

                                                                                            property output

                                                                                            output: string;

                                                                                              property title

                                                                                              title: string;

                                                                                                method report

                                                                                                report: (error: Error) => void;

                                                                                                  method run

                                                                                                  run: (ctx?: Ctx) => Promise<void>;

                                                                                                    method skip

                                                                                                    skip: (message: string) => void;

                                                                                                      Type Aliases

                                                                                                      type ListrContext

                                                                                                      type ListrContext = any;

                                                                                                        type ListrRendererValue

                                                                                                        type ListrRendererValue<Ctx> =
                                                                                                        | 'silent'
                                                                                                        | 'default'
                                                                                                        | 'verbose'
                                                                                                        | ListrRendererClass<Ctx>;

                                                                                                          type ListrTaskResult

                                                                                                          type ListrTaskResult<Ctx> =
                                                                                                          | string
                                                                                                          | Promise<any>
                                                                                                          | Listr<Ctx>
                                                                                                          | stream.Readable
                                                                                                          | Observable<any>;

                                                                                                            Package Files (1)

                                                                                                            Dependencies (2)

                                                                                                            Dev Dependencies (0)

                                                                                                            No dev dependencies.

                                                                                                            Peer Dependencies (0)

                                                                                                            No peer dependencies.

                                                                                                            Badge

                                                                                                            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/listr.

                                                                                                            • Markdown
                                                                                                              [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/listr)
                                                                                                            • HTML
                                                                                                              <a href="https://www.jsdocs.io/package/@types/listr"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>