UNPKG

625 BTypeScriptView Raw
1declare namespace setupThrobber {
2 export interface Throbber {
3 start(): void;
4 stop(): void;
5 restart(): void;
6 }
7
8 export class Iterator {
9 readonly index: number;
10 readonly running: boolean;
11 next(): string;
12 reset(): string;
13 }
14}
15/**
16 * Writes throbber string to *write* function at given *interval*. Optionally throbber output can be formatted with given *format* function
17 */
18declare function setupThrobber(
19 write: (str: string) => void,
20 interval: number,
21 format?: (throbber: string) => string,
22): setupThrobber.Throbber;
23export = setupThrobber;