zhangjian
2023-05-30 dabbcc356af21f9f2f88ac69ff07994e6e32e4fc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { ListrEventType } from '../constants/event.constants';
import { ListrEventFromType } from '../interfaces/listr.interface';
import { ListrRenderer } from '../interfaces/renderer.interface';
import { Task } from '../lib/task';
/**
 * This is the default renderer which is neither verbose or updating.
 * It provides short output like update renderer, but does not disturb
 * stdin during execution of listr tasks
 */
export declare class SimpleRenderer implements ListrRenderer {
    readonly tasks: Task<any, typeof SimpleRenderer>[];
    options: typeof SimpleRenderer['rendererOptions'];
    static nonTTY: boolean;
    static rendererOptions: {
        /**
         * if true this will add
         * timestamp at the begin of the rendered line
         *
         * @example
         *
         * ```bash
         * [12:33:44] ✔ Do something important
         * ```
         *
         * @default false
         */
        prefixWithTimestamp?: boolean;
        /**
         * choose between process.stdout and process.stderr
         *
         * @default stdout
         */
        output?: 'stdout' | 'stderr';
    };
    static rendererTaskOptions: never;
    /**
     * Event type renderer map contains functions to process different task events
     */
    eventTypeRendererMap: Partial<{
        [P in ListrEventType]: (t: Task<any, typeof SimpleRenderer>, event: ListrEventFromType<P>) => void;
    }>;
    constructor(tasks: Task<any, typeof SimpleRenderer>[], options: typeof SimpleRenderer['rendererOptions']);
    static now(): Date;
    static formatTitle(task?: Task<any, typeof SimpleRenderer>): string;
    log(output?: string): void;
    end(): void;
    render(tasks?: Task<any, typeof SimpleRenderer>[]): void;
}