-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.d.ts
80 lines (73 loc) · 1.91 KB
/
index.d.ts
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/// <reference types="node"/>
declare namespace loading {
interface Options {
text?: string;
color?: string;
interval?: number;
stream?: NodeJS.WritableStream;
frames?: string[];
}
interface Loading {
/**
* Change the text after the spinner.
*/
text: string;
/**
* Change the spinner color.
*/
color: string;
/**
* Start the spinner.
* @param text - Set the current text.
*/
start(text?: string): Loading;
/**
* Stop and clear the spinner.
* @returns The spinner instance.
*/
stop(): Loading;
/**
* Clear the spinner.
* @returns The spinner instance.
*/
clear(): Loading;
/**
* Stop the spinner, change it to a green `✔` and persist the current text, or `text` if provided.
* @param text - Will persist text if provided.
* @returns The spinner instance.
*/
succeed(text?: string): Loading;
/**
* Stop the spinner, change it to a red `✖` and persist the current text, or `text` if provided.
* @param text - Will persist text if provided.
* @returns The spinner instance.
*/
fail(text?: string): Loading;
/**
* Stop the spinner, change it to a yellow `⚠` and persist the current text, or `text` if provided.
* @param text - Will persist text if provided.
* @returns The spinner instance.
*/
warn(text?: string): Loading;
/**
* Stop the spinner, change it to a blue `ℹ` and persist the current text, or `text` if provided.
* @param text - Will persist text if provided.
* @returns The spinner instance.
*/
info(text?: string): Loading;
/**
* Manually render a new frame.
* @returns The spinner instance.
*/
render(): Loading;
/**
* Get a new frame.
* @returns The spinner instance text.
*/
frame(): string;
}
}
declare const loading: {
(options?: loading.Options | string): loading.Loading;
}
export = loading;