UNPKG

1.32 kBTypeScriptView Raw
1export interface ITask {
2 action: string;
3 status: string | undefined;
4 active: boolean;
5}
6export declare type ActionType = 'spinner' | 'simple' | 'debug';
7export interface Options {
8 stdout?: boolean;
9}
10export declare class ActionBase {
11 type: ActionType;
12 std: 'stdout' | 'stderr';
13 protected stdmocks?: ['stdout' | 'stderr', string[]][];
14 private stdmockOrigs;
15 start(action: string, status?: string, opts?: Options): void;
16 stop(msg?: string): void;
17 private readonly globals;
18 task: ITask | undefined;
19 protected output: string | undefined;
20 readonly running: boolean;
21 status: string | undefined;
22 pauseAsync(fn: () => Promise<any>, icon?: string): Promise<any>;
23 pause(fn: () => any, icon?: string): any;
24 protected _start(): void;
25 protected _stop(_: string): void;
26 protected _resume(): void;
27 protected _pause(_?: string): void;
28 protected _updateStatus(_: string | undefined, __?: string): void;
29 /**
30 * mock out stdout/stderr so it doesn't screw up the rendering
31 */
32 protected _stdout(toggle: boolean): void;
33 /**
34 * flush mocked stdout/stderr
35 */
36 protected _flushStdout(): void;
37 /**
38 * write to the real stdout/stderr
39 */
40 protected _write(std: 'stdout' | 'stderr', s: string | string[]): void;
41}