Options
All
  • Public
  • Public/Protected
  • All
Menu

Default updating renderer for Listr2

Hierarchy

  • DefaultRenderer

Implements

Index

Constructors

  • new DefaultRenderer(tasks: Task<any, typeof DefaultRenderer>[], options: { clearOutput?: boolean; collapse?: boolean; collapseErrors?: boolean; collapseSkips?: boolean; formatOutput?: "truncate" | "wrap"; indentation?: number; lazy?: boolean; removeEmptyLines?: boolean; showErrorMessage?: boolean; showSkipMessage?: boolean; showSubtasks?: boolean; showTimer?: boolean; suffixRetries?: boolean; suffixSkips?: boolean }, renderHook$?: Subject<void>): DefaultRenderer
  • Parameters

    • tasks: Task<any, typeof DefaultRenderer>[]
    • options: { clearOutput?: boolean; collapse?: boolean; collapseErrors?: boolean; collapseSkips?: boolean; formatOutput?: "truncate" | "wrap"; indentation?: number; lazy?: boolean; removeEmptyLines?: boolean; showErrorMessage?: boolean; showSkipMessage?: boolean; showSubtasks?: boolean; showTimer?: boolean; suffixRetries?: boolean; suffixSkips?: boolean }
      • Optional clearOutput?: boolean

        clear all the output generated by the renderer when the task finishes its execution

        default

        false

        global

        global option that can not be temperated with subtasks

      • Optional collapse?: boolean

        collapse subtasks after current task completes its execution

        default

        true

      • Optional collapseErrors?: boolean

        collapse error messages into a single message and overwrite the task title

        default

        true

      • Optional collapseSkips?: boolean

        collapse skip messages into a single message and overwrite the task title

        default

        true

      • Optional formatOutput?: "truncate" | "wrap"

        formats data output depending on your requirements.

        default

        'truncate'

        global

        global option that can not be temperated with subtasks

      • Optional indentation?: number

        indentation per level of subtask

        default

        2

      • Optional lazy?: boolean

        only update through triggers from renderhook

        useful for tests and stuff. this will disable showing spinner and only update the screen if something else has happened in the task worthy to show

        default

        false

        global

        global option that can not be temperated with subtasks

      • Optional removeEmptyLines?: boolean

        removes empty lines from the data output

        default

        true

      • Optional showErrorMessage?: boolean

        shows the thrown error message or show the original title of the task, this will also disable collapseErrors mode You can disable showing the error messages, even though you passed in a message by settings this option, if you want to keep the original task title intact.

        default

        true

      • Optional showSkipMessage?: boolean

        show skip messages or show the original title of the task, this will also disable collapseSkips mode

        You can disable showing the skip messages, even though you passed in a message by settings this option, if you want to keep the original task title intact.

        default

        true

      • Optional showSubtasks?: boolean

        show the subtasks of the current task

        default

        true

      • Optional showTimer?: boolean

        show duration for all tasks

        default

        false

        global

        global option that can not be temperated with subtasks

      • Optional suffixRetries?: boolean

        suffix retry messages with [RETRY-${COUNT}] when retry is enabled for a task

        default

        true

      • Optional suffixSkips?: boolean

        suffix skip messages with [SKIPPED] when in collapseSkips mode

        default

        true

    • Optional renderHook$: Subject<void>

    Returns DefaultRenderer

Properties

options: { clearOutput?: boolean; collapse?: boolean; collapseErrors?: boolean; collapseSkips?: boolean; formatOutput?: "truncate" | "wrap"; indentation?: number; lazy?: boolean; removeEmptyLines?: boolean; showErrorMessage?: boolean; showSkipMessage?: boolean; showSubtasks?: boolean; showTimer?: boolean; suffixRetries?: boolean; suffixSkips?: boolean }

Type declaration

  • Optional clearOutput?: boolean

    clear all the output generated by the renderer when the task finishes its execution

    default

    false

    global

    global option that can not be temperated with subtasks

  • Optional collapse?: boolean

    collapse subtasks after current task completes its execution

    default

    true

  • Optional collapseErrors?: boolean

    collapse error messages into a single message and overwrite the task title

    default

    true

  • Optional collapseSkips?: boolean

    collapse skip messages into a single message and overwrite the task title

    default

    true

  • Optional formatOutput?: "truncate" | "wrap"

    formats data output depending on your requirements.

    default

    'truncate'

    global

    global option that can not be temperated with subtasks

  • Optional indentation?: number

    indentation per level of subtask

    default

    2

  • Optional lazy?: boolean

    only update through triggers from renderhook

    useful for tests and stuff. this will disable showing spinner and only update the screen if something else has happened in the task worthy to show

    default

    false

    global

    global option that can not be temperated with subtasks

  • Optional removeEmptyLines?: boolean

    removes empty lines from the data output

    default

    true

  • Optional showErrorMessage?: boolean

    shows the thrown error message or show the original title of the task, this will also disable collapseErrors mode You can disable showing the error messages, even though you passed in a message by settings this option, if you want to keep the original task title intact.

    default

    true

  • Optional showSkipMessage?: boolean

    show skip messages or show the original title of the task, this will also disable collapseSkips mode

    You can disable showing the skip messages, even though you passed in a message by settings this option, if you want to keep the original task title intact.

    default

    true

  • Optional showSubtasks?: boolean

    show the subtasks of the current task

    default

    true

  • Optional showTimer?: boolean

    show duration for all tasks

    default

    false

    global

    global option that can not be temperated with subtasks

  • Optional suffixRetries?: boolean

    suffix retry messages with [RETRY-${COUNT}] when retry is enabled for a task

    default

    true

  • Optional suffixSkips?: boolean

    suffix skip messages with [SKIPPED] when in collapseSkips mode

    default

    true

renderHook$?: Subject<void>
tasks: Task<any, typeof DefaultRenderer>[]
nonTTY: boolean

designates whether this renderer can output to a non-tty console

rendererOptions: { clearOutput?: boolean; collapse?: boolean; collapseErrors?: boolean; collapseSkips?: boolean; formatOutput?: "truncate" | "wrap"; indentation?: number; lazy?: boolean; removeEmptyLines?: boolean; showErrorMessage?: boolean; showSkipMessage?: boolean; showSubtasks?: boolean; showTimer?: boolean; suffixRetries?: boolean; suffixSkips?: boolean }

renderer options for the defauult renderer

Type declaration

  • Optional clearOutput?: boolean

    clear all the output generated by the renderer when the task finishes its execution

    default

    false

    global

    global option that can not be temperated with subtasks

  • Optional collapse?: boolean

    collapse subtasks after current task completes its execution

    default

    true

  • Optional collapseErrors?: boolean

    collapse error messages into a single message and overwrite the task title

    default

    true

  • Optional collapseSkips?: boolean

    collapse skip messages into a single message and overwrite the task title

    default

    true

  • Optional formatOutput?: "truncate" | "wrap"

    formats data output depending on your requirements.

    default

    'truncate'

    global

    global option that can not be temperated with subtasks

  • Optional indentation?: number

    indentation per level of subtask

    default

    2

  • Optional lazy?: boolean

    only update through triggers from renderhook

    useful for tests and stuff. this will disable showing spinner and only update the screen if something else has happened in the task worthy to show

    default

    false

    global

    global option that can not be temperated with subtasks

  • Optional removeEmptyLines?: boolean

    removes empty lines from the data output

    default

    true

  • Optional showErrorMessage?: boolean

    shows the thrown error message or show the original title of the task, this will also disable collapseErrors mode You can disable showing the error messages, even though you passed in a message by settings this option, if you want to keep the original task title intact.

    default

    true

  • Optional showSkipMessage?: boolean

    show skip messages or show the original title of the task, this will also disable collapseSkips mode

    You can disable showing the skip messages, even though you passed in a message by settings this option, if you want to keep the original task title intact.

    default

    true

  • Optional showSubtasks?: boolean

    show the subtasks of the current task

    default

    true

  • Optional showTimer?: boolean

    show duration for all tasks

    default

    false

    global

    global option that can not be temperated with subtasks

  • Optional suffixRetries?: boolean

    suffix retry messages with [RETRY-${COUNT}] when retry is enabled for a task

    default

    true

  • Optional suffixSkips?: boolean

    suffix skip messages with [SKIPPED] when in collapseSkips mode

    default

    true

rendererTaskOptions: { bottomBar?: number | boolean; persistentOutput?: boolean; showTimer?: boolean }

per task options for the default renderer

Type declaration

  • Optional bottomBar?: number | boolean

    write task output to the bottom bar instead of the gap under the task title itself. useful for a stream of data.

    default

    false

    true only keep 1 line of the latest data outputted by the task. false only keep 1 line of the latest data outputted by the task. number will keep designated data of the latest data outputted by the task.

  • Optional persistentOutput?: boolean

    keep output after task finishes

    default

    false

    works both for the bottom bar and the default behavior

  • Optional showTimer?: boolean

    show the task time if it was successful

Methods

  • createRender(options?: { bottomBar?: boolean; prompt?: boolean; tasks?: boolean }): string
  • Parameters

    • Optional options: { bottomBar?: boolean; prompt?: boolean; tasks?: boolean }
      • Optional bottomBar?: boolean
      • Optional prompt?: boolean
      • Optional tasks?: boolean

    Returns string

  • end(): void
  • Returns void

  • getSelfOrParentOption<T>(task: Task<any, typeof DefaultRenderer>, key: T): { clearOutput?: boolean; collapse?: boolean; collapseErrors?: boolean; collapseSkips?: boolean; formatOutput?: "truncate" | "wrap"; indentation?: number; lazy?: boolean; removeEmptyLines?: boolean; showErrorMessage?: boolean; showSkipMessage?: boolean; showSubtasks?: boolean; showTimer?: boolean; suffixRetries?: boolean; suffixSkips?: boolean }[T]
  • Type parameters

    • T: "lazy" | "indentation" | "clearOutput" | "showSubtasks" | "collapse" | "showSkipMessage" | "collapseSkips" | "suffixSkips" | "showErrorMessage" | "collapseErrors" | "suffixRetries" | "showTimer" | "removeEmptyLines" | "formatOutput"

    Parameters

    Returns { clearOutput?: boolean; collapse?: boolean; collapseErrors?: boolean; collapseSkips?: boolean; formatOutput?: "truncate" | "wrap"; indentation?: number; lazy?: boolean; removeEmptyLines?: boolean; showErrorMessage?: boolean; showSkipMessage?: boolean; showSubtasks?: boolean; showTimer?: boolean; suffixRetries?: boolean; suffixSkips?: boolean }[T]

  • getTaskOptions(task: Task<any, typeof DefaultRenderer>): { bottomBar?: number | boolean; persistentOutput?: boolean; showTimer?: boolean }
  • Parameters

    Returns { bottomBar?: number | boolean; persistentOutput?: boolean; showTimer?: boolean }

    • Optional bottomBar?: number | boolean

      write task output to the bottom bar instead of the gap under the task title itself. useful for a stream of data.

      default

      false

      true only keep 1 line of the latest data outputted by the task. false only keep 1 line of the latest data outputted by the task. number will keep designated data of the latest data outputted by the task.

    • Optional persistentOutput?: boolean

      keep output after task finishes

      default

      false

      works both for the bottom bar and the default behavior

    • Optional showTimer?: boolean

      show the task time if it was successful

  • Parameters

    Returns string

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • render(): void
  • Returns void