UNPKG

751 BTypeScriptView Raw
1/// <reference types="node" />
2
3export interface Options {
4 text?: string | undefined;
5 stream?: NodeJS.WritableStream | undefined;
6 onTick?(this: Spinner, msg: string): void;
7}
8
9export class Spinner {
10 static setDefaultSpinnerString(spinnerString: string | number): typeof Spinner;
11 static setDefaultSpinnerDelay(spinnerDelay: number): typeof Spinner;
12
13 readonly stream: NodeJS.WritableStream;
14
15 constructor(titleOrOptions?: string | Options);
16
17 start(): this;
18 stop(clear?: boolean): this;
19 isSpinning(): boolean;
20 clearLine(stream: NodeJS.WritableStream): this;
21 setSpinnerString(spinnerString: string | number): this;
22 setSpinnerTitle(title: string): this;
23 setSpinnerDelay(spinnerDelay: number): this;
24}