import Enquirer from 'enquirer'; import { Observable } from 'rxjs'; import { Writable, Readable } from 'stream'; import { WriteStream } from 'fs'; import * as colorette from 'colorette'; /** * Give event map a set of indexes to not make it go crazy when some events are missing from it. * They are optional after all. */ declare class BaseEventMap { [k: string]: any; } /** * Parameters for the given event in the {@link EventMap}. */ type EventData> = Event extends keyof Map ? Map[Event] : never; /** * An event map of given events that defined the parameters and return types for firing a certain event. */ type EventMap = Partial>; declare class EventManager> = Partial>> { private readonly emitter; emit(dispatch: E, args?: EventData): void; on(dispatch: E, handler: (data: EventData) => void): void; once(dispatch: E, handler: (data: EventData) => void): void; off(dispatch: E, handler?: (data: EventData) => void): void; complete(): void; } /** * Indicates an UNICODE characters is coming up. */ declare const ANSI_ESCAPE = "\u001B["; /** * Generic ANSI escape characters for terminal based operations. */ declare const ANSI_ESCAPE_CODES: { CURSOR_HIDE: string; CURSOR_SHOW: string; }; /** * Environment variables for Listr. */ declare enum ListrEnvironmentVariables { DISABLE_COLOR = "LISTR_DISABLE_COLOR", FORCE_UNICODE = "LISTR_FORCE_UNICODE", FORCE_COLOR = "FORCE_COLOR" } /** * The actual error type that is collected and to help identify where the error is triggered from. */ declare enum ListrErrorTypes { /** Task has failed and will try to retry. */ WILL_RETRY = "WILL_RETRY", /** Task has failed and will try to rollback. */ WILL_ROLLBACK = "WILL_ROLLBACK", /** Task has failed, ran the rollback action but the rollback action itself has failed. */ HAS_FAILED_TO_ROLLBACK = "HAS_FAILED_TO_ROLLBACK", /** Task has failed. */ HAS_FAILED = "HAS_FAILED", /** Task has failed, but exitOnError is set to false, so will ignore this error. */ HAS_FAILED_WITHOUT_ERROR = "HAS_FAILED_WITHOUT_ERROR" } /** * Events that are triggered by Listr. * * These are stateful and singleton events by being attached to the main Listr class and propagating to the subtasks. * * @see {@link https://listr2.kilic.dev/listr/events.html} */ declare enum ListrEventType { /** Indicates that underlying renderer should refresh the current render. */ SHOULD_REFRESH_RENDER = "SHOUD_REFRESH_RENDER" } /** * Internal events that are fired from the Task. * * @see {@link https://listr2.kilic.dev/task/events.html} */ declare enum ListrTaskEventType { /** Title has changed for the current Task. */ TITLE = "TITLE", /** * State has changed for the current Task. * * @see {@link module:listr2.ListrTaskState} */ STATE = "STATE", /** The current Task has been marked as enabled. */ ENABLED = "ENABLED", /** The current Task is currently processing subtasks. */ SUBTASK = "SUBTASK", /** The current Task is now processing a prompt. */ PROMPT = "PROMPT", /** The current Task is now dumping output. */ OUTPUT = "OUTPUT", /** * The current Task is now dumping a message. * * @see {module:Listr2.ListrTaskMessage} */ MESSAGE = "MESSAGE", /** The current Task is closed and no further action in expected. */ CLOSED = "CLOSED" } /** * Tasks can be in various states during the execution. * * Whenever a state change occurs, the task will emit a {@link module:listr2.ListrTaskEventType.STATE} with the appropriate state. */ declare enum ListrTaskState { /** Task has not started yet, waiting for pick-up. */ WAITING = "WAITING", /** Task has started. */ STARTED = "STARTED", /** Task has been completed. */ COMPLETED = "COMPLETED", /** Task has failed. */ FAILED = "FAILED", /** Task has been skipped. */ SKIPPED = "SKIPPED", /** Task is currently trying to rollback. */ ROLLING_BACK = "ROLLING_BACK", /** Task has rolledback successfully after failing. */ ROLLED_BACK = "ROLLED_BACK", /** Task is currently retrying. */ RETRY = "RETRY", /** Task is currently paused. */ PAUSED = "PAUSED", /** Task is currently trying to process a prompt. */ PROMPT = "PROMPT", /** Task has successfully processed the prompt. */ PROMPT_COMPLETED = "PROMPT_COMPLETED" } /** * Tests to see if the object is an RxJS {@link Observable} * @param obj the object to test */ declare function isObservable(obj: any): obj is { subscribe: T; next: any; error: any; complete: any; }; declare function isUnicodeSupported(): boolean; declare function cleanseAnsi(chunk: string): string; declare const color: colorette.Colorette; declare function indent(string: string, count: number): string; declare const FIGURES_MAIN: { warning: string; cross: string; arrowDown: string; tick: string; arrowRight: string; pointer: string; checkboxOn: string; arrowLeft: string; squareSmallFilled: string; pointerSmall: string; }; type Figures = typeof FIGURES_MAIN; declare const figures: Figures; declare function splat(message: string, ...splat: any[]): string; /** * Creates a new Listr2 logger. * * This logger is used throughout the renderers for consistency. * * @see {@link https://listr2.kilic.dev/renderer/logger.html} */ declare class ListrLogger { options?: ListrLoggerOptions; readonly process: ProcessOutput; constructor(options?: ListrLoggerOptions); log(level: Levels, message: string | any[], options?: LoggerFieldOptions): void; toStdout(message: string | any[], options?: LoggerFieldOptions, eol?: boolean): void; toStderr(message: string | any[], options?: LoggerFieldOptions, eol?: boolean): void; wrap(message: string, options?: LoggerFormatOptions): string; splat(...args: Parameters): ReturnType; suffix(message: string, ...suffixes: LoggerField[]): string; prefix(message: string, ...prefixes: LoggerField[]): string; fields(message: string, options?: LoggerFieldOptions): string; icon(level: Levels, icon?: string | false): string; protected format(level: Levels, message: string | any[], options?: LoggerFieldOptions): string; protected style(level: Levels, message: string): string; protected applyFormat(message: string, options?: LoggerFormatOptions): string; protected spacing(message: string | undefined): string; } /** * Options for the logger */ interface ListrLoggerOptions extends ProcessOutputRendererOptions, ListrLoggerStyleMap { /** * Use icons for the log levels. */ useIcons?: boolean; /** * Apply fields and templates as presets before and after each message. */ fields?: LoggerFieldOptions; /** * Send the designated levels to `process.stderr`. */ toStderr?: (Levels | string)[]; } /** * Inject your custom style map consisting of icons and coloring for the ListrLogger. * * @see {@link https://listr2.kilic.dev/renderer/logger.html} */ interface ListrLoggerStyleMap { /** * Coloring of the levels. * * @see {@link https://listr2.kilic.dev/renderer/logger.html#style} */ color?: Partial>; /** * Icons of the levels. * * @see {@link https://listr2.kilic.dev/renderer/logger.html#style} */ icon?: Partial>; } interface LoggerFieldOptions { /** * Prefix fields for the log entry. */ prefix?: MultipleOnly extends false ? LoggerField | LoggerField[] : LoggerField[]; /** * Suffix fields for the log entry. */ suffix?: MultipleOnly extends false ? LoggerField | LoggerField[] : LoggerField[]; } type LoggerFormat = (message?: string) => string; interface LoggerFieldFn { /** * The value of the given field. */ field: ((...args: Args) => string) | string; /** * Condition to display the given field. */ condition?: ((...args: Args) => boolean) | boolean; /** * Formatting/coloring of the field. */ format?: (...args: Args) => LoggerFormat; /** * Args to pass to other functions whenever this field is triggered. */ args?: Args; } type LoggerField = LoggerFieldFn | string; interface RendererLoggerOptions { /** * Inject your custom implementation of the ListrLogger. * * @see {@link https://listr2.kilic.dev/renderer/logger.html} */ logger?: ListrLogger; } interface LoggerFormatOptions { format?: LoggerFormat; } /** Default ListrLogLevels for the logger */ declare enum ListrLogLevels { STARTED = "STARTED", COMPLETED = "COMPLETED", FAILED = "FAILED", SKIPPED = "SKIPPED", OUTPUT = "OUTPUT", TITLE = "TITLE", ROLLBACK = "ROLLBACK", RETRY = "RETRY", PROMPT = "PROMPT", PAUSED = "PAUSED" } declare const LISTR_LOGGER_STYLE: ListrLoggerStyleMap; declare const LISTR_LOGGER_STDERR_LEVELS: ListrLogLevels[]; interface ProcessOutputBufferEntry { time: number; entry: string; stream?: NodeJS.WriteStream; } interface ProcessOutputBufferOptions { limit?: number; stream?: NodeJS.WriteStream; } declare class ProcessOutputBuffer { private readonly options?; private buffer; private readonly decoder; constructor(options?: ProcessOutputBufferOptions); get all(): ProcessOutputBufferEntry[]; get last(): ProcessOutputBufferEntry; get length(): number; write(data: Uint8Array | string, ...args: [(string | undefined)?, ((err?: Error) => void)?] | [((err?: Error) => void)?]): ReturnType; reset(): void; } declare class ProcessOutputStream { private stream; private readonly method; private readonly buffer; constructor(stream: NodeJS.WriteStream); get out(): NodeJS.WriteStream; hijack(): void; release(): ProcessOutputBufferEntry[]; write(...args: Parameters): ReturnType; } interface ProcessOutputRendererOptions { /** * Pass your implementation of process output class to write to stdout and stderr. * * @default 'ProcessOutput' * @global global option that can not be temperated with subtasks */ processOutput?: ProcessOutput; } /** * Customize the behavior of the ProcessOutput. */ interface ProcessOutputOptions { /** * After the `ProcessOutput.release()` which streams should be dumped. * * @defaultValue `[ 'stdout', 'stderr' ]` */ dump?: (keyof ProcessOutputStreamMap)[]; /** * After the `ProcessOutput.release()` whether to leave empty line or not. * * @defaultValue `true` */ leaveEmptyLine?: boolean; } type ProcessOutputStreamMap = Record<'stdout' | 'stderr', ProcessOutputStream>; /** * Creates a new Listr2 process-output controller. * * This is used to control the flow to `process.stdout` and `process.stderr` for all renderers. * * @see {@link https://listr2.kilic.dev/renderer/process-output.html} */ declare class ProcessOutput { private readonly options?; readonly stream: ProcessOutputStreamMap; protected active: boolean; constructor(stdout?: NodeJS.WriteStream, stderr?: NodeJS.WriteStream, options?: ProcessOutputOptions); get stdout(): NodeJS.WriteStream; get stderr(): NodeJS.WriteStream; hijack(): void; release(): void; toStdout(buffer: string, eol?: boolean): boolean; toStderr(buffer: string, eol?: boolean): boolean; } declare function createWritable(cb: (chunk: string) => void): NodeJS.WritableStream; declare class Spinner { protected readonly spinner: string[]; private id?; private spinnerPosition; spin(): void; fetch(): string; isRunning(): boolean; start(cb?: () => void, interval?: number): void; stop(): void; } interface BasePromptOptions { message: string | (() => string) | (() => Promise); initial?: boolean | number | number[] | string | (() => string) | (() => Promise); required?: boolean; stdin?: NodeJS.ReadStream; stdout?: NodeJS.WriteStream; header?: string; footer?: string; skip?: (value: any) => boolean | Promise; format?: (value: any) => any | Promise; result?: (value: any) => any | Promise; validate?: (value: any, state: any) => boolean | Promise | string | Promise | Promise; onSubmit?: (name: any, value: any, prompt: Enquirer.Prompt) => boolean | Promise; onCancel?: (name: any, value: any, prompt: Enquirer.Prompt) => boolean | Promise; } interface BasePromptOptionsWithName extends BasePromptOptions { name: string | (() => string); } interface ArrayPromptOptions extends BasePromptOptions { choices: string[] | BasePromptOptionsWithName[]; maxChoices?: number; multiple?: boolean; initial?: number | number[]; delay?: number; separator?: boolean; sort?: boolean; linebreak?: boolean; edgeLength?: number; align?: 'left' | 'right'; scroll?: boolean; hint?: string; } interface BooleanPromptOptions extends BasePromptOptions { initial?: boolean | (() => string) | (() => Promise); } interface StringPromptOptions extends BasePromptOptions { initial?: string; multiline?: boolean; } interface ScalePromptOptions extends ArrayPromptOptions { scale: StringPromptOptions[]; margin?: [number, number, number, number]; } interface NumberPromptOptions extends BasePromptOptions { min?: number; max?: number; delay?: number; float?: boolean; round?: boolean; major?: number; minor?: number; initial?: number; } interface SnippetPromptOptions extends BasePromptOptions { newline?: string; fields: Partial[]; template: string; } interface SortPromptOptions extends BasePromptOptions { hint?: string; drag?: boolean; numbered?: boolean; } interface SurveyPromptOptions extends ArrayPromptOptions { scale: BasePromptOptionsWithName[]; margin: [number, number, number, number]; } interface QuizPromptOptions extends ArrayPromptOptions { correctChoice: number; } interface TogglePromptOptions extends BasePromptOptions { enabled?: string; disabled?: string; } interface PromptCancelOptions { throw?: boolean; } /** Returns all the prompt options depending on the type selected. */ type PromptOptions = Unionize<{ [K in PromptTypes]-?: T extends true ? { type: K; } & PromptOptionsType & { name: string | (() => string); } : { type: K; } & PromptOptionsType; }> | ({ type: string; } & T extends true ? PromptOptionsType & { name: string | (() => string); } : PromptOptionsType); type Unionize> = { [P in keyof T]: T[P]; }[keyof T]; type PromptTypes = 'AutoComplete' | 'BasicAuth' | 'Confirm' | 'Editable' | 'Form' | 'Input' | 'Invisible' | 'List' | 'MultiSelect' | 'Numeral' | 'Password' | 'Quiz' | 'Scale' | 'Select' | 'Snippet' | 'Sort' | 'Survey' | 'Text' | 'Toggle'; type PromptOptionsType = T extends keyof PromptOptionsMap ? PromptOptionsMap[T] : T extends string ? BasePromptOptions & Record : any; declare class PromptOptionsMap implements Record> { AutoComplete: ArrayPromptOptions; BasicAuth: StringPromptOptions; Confirm: BooleanPromptOptions; Editable: ArrayPromptOptions; Form: ArrayPromptOptions; Input: StringPromptOptions; Invisible: StringPromptOptions; List: ArrayPromptOptions; MultiSelect: ArrayPromptOptions; Numeral: NumberPromptOptions; Password: StringPromptOptions; Quiz: QuizPromptOptions; Scale: ScalePromptOptions; Select: ArrayPromptOptions; Snippet: SnippetPromptOptions; Sort: SortPromptOptions; Survey: SurveyPromptOptions; Text: StringPromptOptions; Toggle: TogglePromptOptions; } interface PromptSettings { error?: boolean; stdout?: WriteStream | Writable; enquirer?: Enquirer; } interface PromptInstance extends Omit { submit: () => void; cancel: (err?: string) => void; } /** * Create a new prompt with Enquirer externally. * This extends enquirer so you dont have to give a name to single prompts and such so it is also * useful to use externally. * @param this * @param options * @param settings */ declare function createPrompt(this: any, options: PromptOptions | PromptOptions[], settings?: PromptSettings): Promise; declare function getRendererClass(renderer: ListrRendererValue): ListrRendererFactory; declare function getRenderer(options: { renderer: Renderer; rendererOptions: ListrGetRendererOptions; fallbackRenderer: FallbackRenderer; fallbackRendererOptions: ListrGetRendererOptions; fallbackRendererCondition?: ListrOptions['fallbackRendererCondition']; silentRendererCondition?: ListrOptions['silentRendererCondition']; }): SupportedRenderer; /** * This function asserts the given value as a function or itself. * If the value itself is a function it will evaluate it with the passed in arguments, * elsewise it will directly return itself. */ declare function assertFunctionOrSelf(functionOrSelf: T, ...args: T extends (...args: any[]) => any ? Parameters : never): T extends (...args: any[]) => any ? ReturnType : T; /** * Deep clones a object in the easiest manner. */ declare function cloneObject>(obj: T): T; declare class Concurrency { private concurrency; private count; private queue; constructor(options: { concurrency: number; }); add(fn: () => Promise): Promise; private flush; private run; } declare function delay(time: number): Promise; /** * The original Task that is defined by the user is wrapped with the TaskWrapper to provide additional functionality. * * @see {@link https://listr2.kilic.dev/task/task.html} */ declare class TaskWrapper { task: Task; private options; constructor(task: Task, options: ListrBaseClassOptions); get title(): string; /** * Title of the current task. * * @see {@link https://listr2.kilic.dev/task/title.html} */ set title(title: string | any[]); get output(): string; /** * Send output from the current task to the renderer. * * @see {@link https://listr2.kilic.dev/task/output.html} */ set output(output: string | any[]); /** Send an output to the output channel as prompt. */ private set promptOutput(value); /** * Creates a new set of Listr subtasks. * * @see {@link https://listr2.kilic.dev/task/subtasks.html} */ newListr(task: ListrTask | ListrTask[] | ((parent: Omit) => ListrTask | ListrTask[]), options?: ListrSubClassOptions): Listr; /** * Report an error that has to be collected and handled. * * @see {@link https://listr2.kilic.dev/task/error-handling.html} */ report(error: Error, type: ListrErrorTypes): void; /** * Skip the current task. * * @see {@link https://listr2.kilic.dev/task/skip.html} */ skip(message?: string, ...metadata: any[]): void; /** * Check whether this task is currently in a retry state. * * @see {@link https://listr2.kilic.dev/task/retry.html} */ isRetrying(): Task['retry']; /** * Create a new prompt for getting user input through `enquirer`. * * - `enquirer` is a optional peer dependency and has to be already installed separately. * * @see {@link https://listr2.kilic.dev/task/prompt.html} */ prompt(options: PromptOptions | PromptOptions[]): Promise; /** * Cancel the current active prompt, if there is any. * * @see {@link https://listr2.kilic.dev/task/prompt.html} */ cancelPrompt(options?: PromptCancelOptions): void; /** * Generates a fake stdout for your use case, where it will be tunnelled through Listr to handle the rendering process. * * @see {@link https://listr2.kilic.dev/renderer/process-output.html} */ stdout(type?: ListrTaskEventType.OUTPUT | ListrTaskEventType.PROMPT): NodeJS.WritableStream; /** Run this task. */ run(ctx: Ctx): Promise; } declare class ListrTaskEventManager extends EventManager { } /** * Creates and handles a runnable instance of the Task. */ declare class Task extends ListrTaskEventManager { listr: Listr; task: ListrTask; options: ListrOptions; rendererOptions: ListrGetRendererOptions; /** Unique id per task, can be used for identifying a Task. */ id: string; /** The current state of the task. */ state: ListrTaskState; /** Subtasks of the current task. */ subtasks: Task[]; /** Title of the task. */ title?: string; /** Initial/Untouched version of the title for using whenever task has a reset. */ readonly initialTitle?: string; /** Output channel for the task. */ output?: string; /** Current state of the retry process whenever the task is retrying. */ retry?: ListrTaskRetry; /** * A channel for messages. * * This requires a separate channel for messages like error, skip or runtime messages to further utilize in the renderers. */ message: ListrTaskMessage; /** Per-task options for the current renderer of the task. */ rendererTaskOptions: ListrGetRendererTaskOptions; /** Current prompt instance or prompt error whenever the task is prompting. */ prompt: ListrTaskPrompt; /** Parent task of the current task. */ parent?: Task; /** Enable flag of this task. */ private enabled; /** User provided Task callback function to run. */ private taskFn; /** Marks the task as closed. This is different from finalized since this is not really related to task itself. */ private closed; constructor(listr: Listr, task: ListrTask, options: ListrOptions, rendererOptions: ListrGetRendererOptions); /** * Update the current state of the Task and emit the neccassary events. */ set state$(state: ListrTaskState); /** * Update the current output of the Task and emit the neccassary events. */ set output$(data: string); /** * Update the current prompt output of the Task and emit the neccassary events. */ set promptOutput$(data: string); /** * Update or extend the current message of the Task and emit the neccassary events. */ set message$(data: Task['message']); /** * Update the current title of the Task and emit the neccassary events. */ set title$(title: string); /** * Current task path in the hierarchy. */ get path(): string[]; /** * Checks whether the current task with the given context should be set as enabled. */ check(ctx: Ctx): Promise; /** Returns whether this task has subtasks. */ hasSubtasks(): boolean; /** Returns whether this task is finalized in someform. */ hasFinalized(): boolean; /** Returns whether this task is in progress. */ isPending(): boolean; /** Returns whether this task has started. */ isStarted(): boolean; /** Returns whether this task is skipped. */ isSkipped(): boolean; /** Returns whether this task has been completed. */ isCompleted(): boolean; /** Returns whether this task has been failed. */ hasFailed(): boolean; /** Returns whether this task has an active rollback task going on. */ isRollingBack(): boolean; /** Returns whether the rollback action was successful. */ hasRolledBack(): boolean; /** Returns whether this task has an actively retrying task going on. */ isRetrying(): boolean; /** Returns whether this task has some kind of reset like retry and rollback going on. */ hasReset(): boolean; /** Returns whether enabled function resolves to true. */ isEnabled(): boolean; /** Returns whether this task actually has a title. */ hasTitle(): boolean; /** Returns whether this task has a prompt inside. */ isPrompt(): boolean; /** Returns whether this task is currently paused. */ isPaused(): boolean; /** Returns whether this task is closed. */ isClosed(): boolean; /** Pause the given task for certain time. */ pause(time: number): Promise; /** Run the current task. */ run(context: Ctx, wrapper: TaskWrapper): Promise; private close; } declare class ListrEventManager extends EventManager { } declare enum ListrDefaultRendererLogLevels { SKIPPED_WITH_COLLAPSE = "SKIPPED_WITH_COLLAPSE", SKIPPED_WITHOUT_COLLAPSE = "SKIPPED_WITHOUT_COLLAPSE", OUTPUT = "OUTPUT", OUTPUT_WITH_BOTTOMBAR = "OUTPUT_WITH_BOTTOMBAR", PENDING = "PENDING", COMPLETED = "COMPLETED", COMPLETED_WITH_FAILED_SUBTASKS = "COMPLETED_WITH_FAILED_SUBTASKS", COMPLETED_WITH_FAILED_SISTER_TASKS = "COMPLETED_WITH_SISTER_TASKS_FAILED", RETRY = "RETRY", ROLLING_BACK = "ROLLING_BACK", ROLLED_BACK = "ROLLED_BACK", FAILED = "FAILED", FAILED_WITH_FAILED_SUBTASKS = "FAILED_WITH_SUBTASKS", WAITING = "WAITING", PAUSED = "PAUSED" } declare const LISTR_DEFAULT_RENDERER_STYLE: ListrLoggerStyleMap; declare class DefaultRenderer implements ListrRenderer { private readonly tasks; private readonly options; private readonly events; static nonTTY: boolean; static rendererOptions: ListrDefaultRendererOptions; static rendererTaskOptions: ListrDefaultRendererTaskOptions; private bottom; private prompt; private activePrompt; private readonly spinner; private readonly logger; private updater; private truncate; private wrap; private readonly cache; constructor(tasks: ListrDefaultRendererTask[], options: ListrDefaultRendererOptions, events: ListrEventManager); isBottomBar(task: ListrDefaultRendererTask): boolean; render(): Promise; update(): void; end(): void; create(options?: { tasks?: boolean; bottomBar?: boolean; prompt?: boolean; }): string; protected style(task: ListrDefaultRendererTask, output?: boolean): string; protected format(message: string, icon: string, level: number): string[]; private renderer; private renderBottomBar; private renderPrompt; private calculate; private reset; private dump; private indent; } type PresetTimer = LoggerFieldFn<[number]>; interface RendererPresetTimer { /** * Show duration for the tasks. */ timer?: PresetTimer; } declare const PRESET_TIMER: PresetTimer; /** * A basic function to parse minutes and tasks passed given a duration. * Useful for renderers to show the task time. */ declare function parseTimer(duration: number): string; type PresetTimestamp = LoggerFieldFn; interface RendererPresetTimestamp { /** * Show timestamp for each event that has been logged. */ timestamp?: PresetTimestamp; } declare const PRESET_TIMESTAMP: PresetTimestamp; declare function parseTimestamp(): string; type ListrDefaultRendererOptionsStyle = ListrLoggerStyleMap; type ListrDefaultRendererTask = Task; interface ListrDefaultRendererOptions extends RendererPresetTimer, RendererLoggerOptions, ListrLoggerStyleMap { /** * Indentation per-level. * * - This is a global option that can only be changed through the main Listr class. * * @defaultValue `2` */ indentation?: number; /** * Formats the output in to the given lines of `process.stdout.columns`. * * - This is a global option that can only be changed through the main Listr class. * * @defaultValue `'wrap'` */ formatOutput?: 'truncate' | 'wrap'; /** * Clear all the output generated by the renderer when the Listr completes the execution successfully. * * - This is a global option that can only be changed through the main Listr class. * * @defaultValue `false` */ clearOutput?: boolean; /** * Only update the render whenever there is a incoming request through the hook. * * - This is a global option that can only be changed through the main Listr class. * - Useful for snapshot tests, where this will disable showing spinner and only update the screen if something else has happened in the task worthy to show. * * @defaultValue `false` */ lazy?: boolean; /** * Remove empty lines from the output section for decluterring multiple line output. * * @defaultValue `true` */ removeEmptyLines?: boolean; /** * Spinner visually indicates that a task is running. * * - You can always implement your own spinner, if the current one does not please you visually. */ spinner?: Spinner; /** * Show the subtasks of the current task. * * @defaultValue `true` */ showSubtasks?: boolean; /** * Collapse subtasks after current task completes its execution. * * @defaultValue `true` */ collapseSubtasks?: boolean; /** * Show skip messages or show the original title of the task. * * - `true` will output the given skip message if there is any. * - `false` will keep the current task title intact. This will also disable `collapseSkips`. * * @defaultValue `true` */ showSkipMessage?: boolean; /** * Collapse skip messages into a single message and overwrite the task title. * * - `true` will collapse skiped tasks. * - `false` will show the skip message as a data output under the current task title. * * @defaultValue `true` */ collapseSkips?: boolean; /** * Suffix skip messages to clearly indicate the task has been skipped with in `collapseSkips` mode. * * - `true` will add `[SKIPPED]` as a suffix. * - `false` will not add a suffix. * * @defaultValue `false` */ suffixSkips?: boolean; /** * Show the error message or show the original title of the task. * * - `true` will output the current error encountered with the task if there is any. * - `false` will keep the current task title intact. This will also disable `collapseErrors`. * * @defaultValue `true` */ showErrorMessage?: boolean; /** * Collapse error messages into a single message and overwrite the task title. * * - `true` will collapse the error message. * - `false` will show the error message as a data output under the current task title. * * @defaultValue `true` */ collapseErrors?: boolean; /** * Suffix retry messages to clearly indicate the task is currently retrying. * * - `true` will add `[RETRY:COUNT]` as a suffix. * - `false` will not add a suffix. * * @defaultValue `false` */ suffixRetries?: boolean; /** * Show duration for the pauses. * * @defaultValue `PRESET_TIMER` */ pausedTimer?: PresetTimer; } interface ListrDefaultRendererTaskOptions extends RendererPresetTimer { /** * Write task output to the bottom bar instead of the gap under the task title itself. * This can be useful for stream of data coming in and is the default mode for tasks without a title. * * - `true` only keep 1 line of the latest data outputted by the task. * - `number` will keep the defined amount of data as the last lines. * - `false` will not use bottom bar if task has a title. * * @defaultValue `false` */ bottomBar?: boolean | number; /** * Keep output of the task after task finishes. * * - This can be enabled for both normal task output under the title and bottom bar. * * @defaultValue false */ persistentOutput?: boolean; } interface ListrDefaultRendererCache { output: ListrRendererCacheMap; rendererOptions: ListrRendererCacheMap; rendererTaskOptions: ListrRendererCacheMap; } declare class SilentRenderer implements ListrRenderer { tasks: ListrSilentRendererTask[]; options: ListrSilentRendererOptions; static nonTTY: boolean; static rendererOptions: ListrSilentRendererOptions; static rendererTaskOptions: ListrSilentRendererTaskOptions; constructor(tasks: ListrSilentRendererTask[], options: ListrSilentRendererOptions); render(): void; end(): void; } type ListrSilentRendererTask = Task; type ListrSilentRendererOptions = never; type ListrSilentRendererTaskOptions = never; declare class SimpleRenderer implements ListrRenderer { private readonly tasks; private options; static nonTTY: boolean; static rendererOptions: ListrSimpleRendererOptions; static rendererTaskOptions: ListrSimpleRendererTaskOptions; private readonly logger; private readonly cache; constructor(tasks: ListrSimpleRendererTask[], options: ListrSimpleRendererOptions); end(): void; render(): void; private renderer; private calculate; private reset; } type ListrSimpleRendererTask = Task; interface ListrSimpleRendererOptions extends RendererPresetTimer, RendererPresetTimestamp, RendererLoggerOptions, ListrLoggerStyleMap { /** * Show duration for the pauses. * * @defaultValue `PRESET_TIMER` */ pausedTimer?: PresetTimer; } interface ListrSimpleRendererTaskOptions extends RendererPresetTimer { } interface ListrSimpleRendererCache { rendererOptions: ListrRendererCacheMap; rendererTaskOptions: ListrRendererCacheMap; } declare class TestRenderer implements ListrRenderer { private readonly tasks; private readonly options; static nonTTY: boolean; static rendererOptions: ListrTestRendererOptions; static rendererTaskOptions: ListrTestRendererTaskOptions; private readonly logger; private serializer; constructor(tasks: ListrTestRendererTask[], options: ListrTestRendererOptions); render(): void; end(): void; private renderer; } interface TestRendererSerializerOutput { event: T; data: ListrTaskEventMap[T]; task?: Partial>; } type TestRendererSerializerTaskKeys = Extract, 'hasSubtasks' | 'hasFinalized' | 'isPending' | 'isStarted' | 'isSkipped' | 'isCompleted' | 'hasFailed' | 'isRollingBack' | 'hasRolledBack' | 'isRetrying' | 'hasReset' | 'isEnabled' | 'hasTitle' | 'isPrompt' | 'isPaused' | 'title' | 'path'>; type ListrTestRendererTask = Task; interface ListrTestRendererOptions extends RendererLoggerOptions { /** * Log subtasks. * * @defaultValue `true` */ subtasks?: boolean; /** * Log given task states. */ state?: ListrTaskState[]; /** * Log output. */ output?: boolean; /** * Log prompt. */ prompt?: boolean; /** * Log title changes. */ title?: boolean; /** * Log given messages. */ messages?: (keyof ListrTaskMessage)[]; /** * Log given messages to stderr instead of stdout. */ messagesToStderr?: (keyof ListrTaskMessage)[]; /** * Serialize the given properties of the task inside the logs. */ task?: false | TestRendererSerializerTaskKeys[]; } type ListrTestRendererTaskOptions = never; declare class TestRendererSerializer { options?: ListrTestRendererOptions; constructor(options?: ListrTestRendererOptions); serialize(event: T, data: ListrTaskEventMap[T], task?: ListrTestRendererTask): string; generate(event: T, data: ListrTaskEventMap[T], task?: ListrTestRendererTask): TestRendererSerializerOutput; } declare class VerboseRenderer implements ListrRenderer { private readonly tasks; private readonly options; static nonTTY: boolean; static rendererOptions: ListrVerboseRendererOptions; static rendererTaskOptions: ListrVerboseRendererTaskOptions; private logger; private readonly cache; constructor(tasks: ListrVerboseRendererTask[], options: ListrVerboseRendererOptions); render(): void; end(): void; private renderer; private calculate; private reset; } type ListrVerboseRendererTask = Task; interface ListrVerboseRendererOptions extends RendererPresetTimer, RendererPresetTimestamp, RendererLoggerOptions, ListrLoggerStyleMap { /** * Log the title changes of the task. * * @default `false` */ logTitleChange?: boolean; /** * Show duration for the pauses. * * @defaultValue `PRESET_TIMER` */ pausedTimer?: PresetTimer; } interface ListrVerboseRendererTaskOptions extends RendererPresetTimer { } interface ListrVerboseRendererCache { rendererOptions: ListrRendererCacheMap; rendererTaskOptions: ListrRendererCacheMap; } /** Name of the default renderer. */ type ListrDefaultRendererValue = 'default'; /** Type of default renderer. */ type ListrDefaultRenderer = typeof DefaultRenderer; /** Name of simple renderer. */ type ListrSimpleRendererValue = 'simple'; /** Type of simple renderer. */ type ListrSimpleRenderer = typeof SimpleRenderer; /** Name of verbose renderer. */ type ListrVerboseRendererValue = 'verbose'; /** Type of verbose renderer. */ type ListrVerboseRenderer = typeof VerboseRenderer; /** Name of test renderer. */ type ListrTestRendererValue = 'test'; /** Type of test renderer. */ type ListrTestRenderer = typeof TestRenderer; /** Name of silent renderer. */ type ListrSilentRendererValue = 'silent'; /** Type of silent renderer. */ type ListrSilentRenderer = typeof SilentRenderer; /** The default prefered renderer. */ type ListrPrimaryRendererValue = ListrDefaultRendererValue; /** The default fallback renderer. */ type ListrSecondaryRendererValue = ListrSimpleRendererValue; /** * Listr2 can process either the integrated renderers as string aliases, * or utilize a compatible style renderer that extends the ListrRenderer abstract class. */ type ListrRendererValue = ListrSilentRendererValue | ListrDefaultRendererValue | ListrSimpleRendererValue | ListrVerboseRendererValue | ListrTestRendererValue | ListrRendererFactory; /** * Returns the class type from friendly names of the renderers. */ type ListrGetRendererClassFromValue = T extends ListrDefaultRendererValue ? ListrDefaultRenderer : T extends ListrSimpleRendererValue ? ListrSimpleRenderer : T extends ListrVerboseRendererValue ? ListrVerboseRenderer : T extends ListrTestRendererValue ? ListrTestRenderer : T extends ListrSilentRenderer ? ListrSilentRenderer : T extends ListrRendererFactory ? T : never; /** * Returns the friendly names from the type of renderer classes. */ type ListrGetRendererValueFromClass = T extends DefaultRenderer ? ListrDefaultRendererValue : T extends SimpleRenderer ? ListrSimpleRendererValue : T extends VerboseRenderer ? ListrVerboseRendererValue : T extends TestRenderer ? ListrTestRendererValue : T extends SilentRenderer ? ListrSilentRenderer : T extends ListrRendererFactory ? T : never; /** * Returns renderer global options depending on the renderer type. */ type ListrGetRendererOptions = T extends ListrRendererValue ? ListrGetRendererClassFromValue['rendererOptions'] : never; /** * Returns renderer per-task options depending on the renderer type. */ type ListrGetRendererTaskOptions = T extends ListrRendererValue ? ListrGetRendererClassFromValue['rendererTaskOptions'] : never; /** Selection and options of the primary preferred renderer. */ interface ListrPrimaryRendererOptions { /** Default renderer preferred. */ renderer?: T; /** Renderer options depending on the current renderer. */ rendererOptions?: ListrGetRendererOptions; } /** Selection and options of the preferred fallback renderer. */ interface ListrSecondaryRendererOptions { /** Fallback renderer preferred. */ fallbackRenderer?: T; /** Renderer options depending on the fallback renderer. */ fallbackRendererOptions?: ListrGetRendererOptions; } /** Renderer options for the parent Listr class, including setup for selecting default and fallback renderers. */ type ListrRendererOptions = ListrPrimaryRendererOptions & ListrSecondaryRendererOptions; /** * The definition of a ListrRenderer. * * @see {@link https://listr2.kilic.dev/renderer/renderer.html} */ declare class ListrRenderer { /** designate renderer global options that is specific to the current renderer */ static rendererOptions: Record; /** designate renderer per task options that is specific to the current renderer */ static rendererTaskOptions: Record; /** designate whether this renderer can work in non-tty environments */ static nonTTY: boolean; /** A function to what to do on render */ render: () => void | Promise; /** A function to what to do on end of the render */ end: (err?: Error) => void; /** create a new renderer */ constructor(tasks: readonly Task[], options: typeof ListrRenderer.rendererOptions, events?: ListrEventManager); } /** Factory of compatible Listr renderers. */ type ListrRendererFactory = typeof ListrRenderer; /** Renderer selection for current Listr. */ interface SupportedRenderer { renderer: Renderer; options?: ListrGetRendererOptions; } type ListrRendererCacheMap = Map['id'], T>; /** Listr context. */ type ListrContext = any | undefined; /** * Options to set the behavior of Listr. */ interface ListrOptions { /** * Inject a context through this options wrapper. * * @defaultValue `{}` * @see {@link https://listr2.kilic.dev/listr/context.html} */ ctx?: Ctx; /** * Concurrency limits how many tasks will be running in parallel. * * - `false` will only run a single task at a time. * - `true` will set it to `Infinity` to run all the tasks in parallel. * - Given a `number` it will limit the concurrency to that number. * * @defaultValue `false` */ concurrent?: boolean | number; /** * Determine the default behavior of exiting on errors. * * - `true` will exit the current Listr whenever it encounters an error. * - `false` will continue the execution of current Listr if it encounters an error. * * @defaultValue `true` */ exitOnError?: boolean; /** * Determine the behavior of exiting after rollback actions. * * This is independent of `exitOnError`, since failure of a rollback can be a more critical operation comparing to * failing a single task. * * - `true` will stop the execution whenever a rollback happens. * - `false` will continue after successfully recovering from a rollback. * * @defaultValue `true` */ exitAfterRollback?: boolean; /** * Collects errors inside the `Listr.errors`. * * - `false` will collect no errors. * - `minimal` will only collect the error message and the location. * - `full` will clone the current context and task in to the error instance. * * @defaultValue `false` * @see {@link https://listr2.kilic.dev/task/error-handling.html#collected-errors} */ collectErrors?: false | 'minimal' | 'full'; /** * Listr will track SIGINIT signal to update the renderer one last time before failing, therefore it needs to * register exit listeners. * * @defaultValue true */ registerSignalListeners?: boolean; /** * Determine the certain condition required to use the fallback renderer. * * @defaultValue handled internally */ fallbackRendererCondition?: boolean | (() => boolean); /** * Determine the certain condition required to use the silent renderer. * * @defaultValue handled internally */ silentRendererCondition?: boolean | (() => boolean); /** * Disable the color output coming from Listr for all renderers. * * @defaultValue `false` */ disableColor?: boolean; /** * Force use color, even though the underlying library detects your current output may not be compatible. * * @defaultValue `false` */ forceColor?: boolean; /** * Forces TTY stdout even though your current output may not be compatible. * * @defaultValue `false` */ forceTTY?: boolean; /** * Forces unicode icons even though your current output may not be compatible. * * @defaultValue `false` */ forceUnicode?: boolean; /** * Inject data directly to TaskWrapper. */ injectWrapper?: { /** * Inject an `enquirer` instance for using with prompts. */ enquirer?: Enquirer; }; } /** * Parent Listr has more options where you can also change global settings. * * Any subtasks will respect those options so they will be stripped of that properties. */ interface ListrBaseClassOptions extends ListrOptions, ListrPrimaryRendererOptions, ListrSecondaryRendererOptions { } /** * Subtasks has reduced set options where the missing ones are explicitly set by the base class. */ interface ListrSubClassOptions extends Omit, 'registerSignalListeners' | 'fallbackRendererCondition' | 'silentRendererCondition' | 'disableColor' | 'forceColor' | 'forceTTY' | 'forceUnicode'>, Omit, 'renderer'> { } /** * Internal error handling mechanism for Listr collects the errors and details for a failed task. * * @see {@link https://listr2.kilic.dev/task/error-handling.html} */ declare class ListrError extends Error { error: Error; type: ListrErrorTypes; task: Task; path: string[]; ctx: Ctx; constructor(error: Error, type: ListrErrorTypes, task: Task); } /** * Event map for Listr. * * @see {@link https://listr2.kilic.dev/listr/events.html} * @see {@link module:listr2.ListrEventType} */ declare class ListrEventMap extends BaseEventMap implements EventMap { [ListrEventType.SHOULD_REFRESH_RENDER]: never; } /** * Internal error coming from renderer. */ declare class ListrRendererError extends Error { } /** * Internal error handling mechanism for Listr prompts to identify the failing cause is coming from a prompt. * * @see {@link https://listr2.kilic.dev/task/prompts.html} */ declare class PromptError extends Error { } /** * Defines the task, conditions and options to run a specific task in the Listr. * This defines the external API for the task where {@link TaskWrapper} is used internally. * * @see {@link https://listr2.kilic.dev/task/task.html} */ interface ListrTask { /** * 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 {@link https://listr2.kilic.dev/task/title.html} */ title?: string | any[]; /** * 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 {@link https://listr2.kilic.dev/task/task.html} */ task: ListrTaskFn; /** * 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 {@link https://listr2.kilic.dev/task/enable.html} */ enabled?: boolean | ((ctx: Ctx) => boolean | Promise); /** * Skip this task depending on the context. * * - The callback function will be evaluated once before the task starts. * * @see {@link https://listr2.kilic.dev/task/skip.html} */ skip?: boolean | string | ((ctx: Ctx) => boolean | string | Promise); /** * Retries a task with the given amounts whenever a task fails. * * @see {@link https://listr2.kilic.dev/task/retry.html} */ retry?: number | { tries: number; delay?: number; }; /** * 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 {@link https://listr2.kilic.dev/task/rollback.html} */ rollback?: ListrTaskFn; /** * Determine the default behavior of exiting on errors for this attached task. */ exitOnError?: boolean | ((ctx: Ctx) => boolean | Promise); /** * Per-task options, that depends on the selected renderer. * * - Options of the current preferred renderer can be changed on task level. * - These options depend on the implementation of the preferred renderer. * - Whenever the preferred renderer has no options it will be displayed as never. * * **This option will be deprecated in a future major release in favor of having options for both the default and the fallback renderer.** */ options?: ListrGetRendererTaskOptions; } /** * Result of the processed task can be any of the supported types. */ type ListrTaskResult = string | Promise | Listr | Readable | NodeJS.ReadableStream | Observable; /** * The callback function from the user that defines the task. */ type ListrTaskFn = (ctx: Ctx, task: TaskWrapper) => void | ListrTaskResult; /** * Tasks can have attached prompts to them. * * - Whenever the prompt is running this should be with full with the instance of current prompt. * - Whenever the prompt fails/cancelled it is tracked here as well due to some internal complication with `enquirer`. */ type ListrTaskPrompt = PromptInstance | PromptError; /** * Tasks can retry themselves when defined. * * - This holds the value of the current error and the current retry attempt. */ interface ListrTaskRetry { count: number; error?: Error; } /** * Task can provide additional information depending on the current state of the Task. * * TaskMessage is used to propagate these messages to the renderers for displaying them to the end-user. */ interface ListrTaskMessage { /** Elapsed time of the current task, whenever the Task completes. */ duration?: number; /** Error message from the current task, whenever the Task fails. */ error?: string; /** Skip message from the current task, whenever the Task skips. */ skip?: string; /** Rollback message from the current task, whenever the Task finishes rollback. */ rollback?: string; /** Retry message from the current task, whenever the Task tries to retry. */ retry?: ListrTaskRetry; /** Holds the time as epoch time of when will this task continue to execute. */ paused?: number; } /** * Event map for Task. * * @see {@link https://listr2.kilic.dev/task/events.html} * @see {@link module:listr2.ListrTaskEventType} */ declare class ListrTaskEventMap extends BaseEventMap implements EventMap { [ListrTaskEventType.STATE]: ListrTaskState; [ListrTaskEventType.ENABLED]: boolean; [ListrTaskEventType.SUBTASK]: Task[]; [ListrTaskEventType.TITLE]: string; [ListrTaskEventType.OUTPUT]: string; [ListrTaskEventType.MESSAGE]: ListrTaskMessage; [ListrTaskEventType.PROMPT]: string; [ListrTaskEventType.CLOSED]: never; } /** * Create a new task list with Listr. * * @see {@link https://listr2.kilic.dev/listr/listr.html} */ declare class Listr { task: ListrTask> | ListrTask>[]; options?: ListrBaseClassOptions; parentTask?: Task; tasks: Task>[]; errors: ListrError[]; ctx: Ctx; events: ListrEventManager; path: string[]; rendererClass: ListrRendererFactory; rendererClassOptions: ListrGetRendererOptions; private concurrency; private renderer; constructor(task: ListrTask> | ListrTask>[], options?: ListrBaseClassOptions, parentTask?: Task); add(tasks: ListrTask> | ListrTask>[]): void; run(context?: Ctx): Promise; private generate; private runTask; } /** * Creates a new Listr2 task manager. * * Useful for creating a single instance of Listr2 with pre-set settings. * * @see {@link https://listr2.kilic.dev/listr/manager.html} */ declare class Manager { options?: ListrBaseClassOptions; errors: ListrError[]; tasks: ListrTask>[]; constructor(options?: ListrBaseClassOptions); get ctx(): Ctx; set ctx(ctx: Ctx); add(tasks: ListrTask>[] | ((ctx?: InjectCtx) => ListrTask>[]), options?: ListrSubClassOptions): void; runAll(options?: ListrBaseClassOptions): Promise; newListr(tasks: ListrTask>[], options?: ListrBaseClassOptions): Listr; indent(tasks: ListrTask>[] | ((ctx?: InjectCtx) => ListrTask>[]), options?: ListrBaseClassOptions, taskOptions?: Omit>, 'task'>): ListrTask>; run(tasks: ListrTask>[], options?: ListrBaseClassOptions): Promise; } export { ANSI_ESCAPE, ANSI_ESCAPE_CODES, BaseEventMap, Concurrency, DefaultRenderer, EventData, EventManager, EventMap, Figures, LISTR_DEFAULT_RENDERER_STYLE, LISTR_LOGGER_STDERR_LEVELS, LISTR_LOGGER_STYLE, Listr, ListrBaseClassOptions, ListrContext, ListrDefaultRenderer, ListrDefaultRendererCache, ListrDefaultRendererLogLevels, ListrDefaultRendererOptions, ListrDefaultRendererOptionsStyle, ListrDefaultRendererTask, ListrDefaultRendererTaskOptions, ListrDefaultRendererValue, ListrEnvironmentVariables, ListrError, ListrErrorTypes, ListrEventManager, ListrEventMap, ListrEventType, ListrGetRendererClassFromValue, ListrGetRendererOptions, ListrGetRendererTaskOptions, ListrGetRendererValueFromClass, ListrLogLevels, ListrLogger, ListrLoggerOptions, ListrLoggerStyleMap, ListrOptions, ListrPrimaryRendererOptions, ListrPrimaryRendererValue, ListrRenderer, ListrRendererCacheMap, ListrRendererError, ListrRendererFactory, ListrRendererOptions, ListrRendererValue, ListrSecondaryRendererOptions, ListrSecondaryRendererValue, ListrSilentRenderer, ListrSilentRendererOptions, ListrSilentRendererTask, ListrSilentRendererTaskOptions, ListrSilentRendererValue, ListrSimpleRenderer, ListrSimpleRendererCache, ListrSimpleRendererOptions, ListrSimpleRendererTask, ListrSimpleRendererTaskOptions, ListrSimpleRendererValue, ListrSubClassOptions, ListrTask, ListrTaskEventManager, ListrTaskEventMap, ListrTaskEventType, ListrTaskFn, ListrTaskMessage, Task as ListrTaskObject, ListrTaskPrompt, ListrTaskResult, ListrTaskRetry, ListrTaskState, TaskWrapper as ListrTaskWrapper, ListrTestRenderer, ListrTestRendererOptions, ListrTestRendererTask, ListrTestRendererTaskOptions, ListrTestRendererValue, ListrVerboseRenderer, ListrVerboseRendererCache, ListrVerboseRendererOptions, ListrVerboseRendererTask, ListrVerboseRendererTaskOptions, ListrVerboseRendererValue, LoggerField, LoggerFieldFn, LoggerFieldOptions, LoggerFormat, LoggerFormatOptions, Manager, PRESET_TIMER, PRESET_TIMESTAMP, PresetTimer, PresetTimestamp, ProcessOutput, ProcessOutputBuffer, ProcessOutputBufferEntry, ProcessOutputBufferOptions, ProcessOutputOptions, ProcessOutputRendererOptions, ProcessOutputStream, ProcessOutputStreamMap, PromptCancelOptions, PromptError, PromptInstance, PromptOptions, PromptOptionsMap, PromptOptionsType, PromptSettings, PromptTypes, RendererLoggerOptions, RendererPresetTimer, RendererPresetTimestamp, SilentRenderer, SimpleRenderer, Spinner, SupportedRenderer, TestRenderer, TestRendererSerializer, TestRendererSerializerOutput, TestRendererSerializerTaskKeys, Unionize, VerboseRenderer, assertFunctionOrSelf, cleanseAnsi, cloneObject, color, createPrompt, createWritable, delay, figures, getRenderer, getRendererClass, indent, isObservable, isUnicodeSupported, parseTimer, parseTimestamp, splat };