-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathansicolor.d.ts
203 lines (168 loc) · 6.42 KB
/
ansicolor.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
export declare interface ParsedColor {
name?: string;
bright?: boolean;
dim?: boolean;
}
export declare interface ParsedSpan {
text: string;
css: string;
italic?: boolean;
bold?: boolean;
color?: ParsedColor;
bgColor?: ParsedColor;
}
export declare interface AnsiColored extends Iterator<ParsedSpan> {
readonly spans: ParsedSpan[];
readonly str: string;
readonly asChromeConsoleLogArguments: string[];
}
export declare interface RGBValues {
black: [number, number, number];
darkGray: [number, number, number];
lightGray: [number, number, number];
white: [number, number, number];
red: [number, number, number];
lightRed: [number, number, number];
green: [number, number, number];
lightGreen: [number, number, number];
yellow: [number, number, number];
lightYellow: [number, number, number];
blue: [number, number, number];
lightBlue: [number, number, number];
magenta: [number, number, number];
lightMagenta: [number, number, number];
cyan: [number, number, number];
lightCyan: [number, number, number];
}
export declare interface AnsicolorMethods {
(text: string|number|null|undefined): string; // applies the style to the string
default: AnsicolorMethods;
white: AnsicolorMethods;
black: AnsicolorMethods;
red: AnsicolorMethods;
green: AnsicolorMethods;
yellow: AnsicolorMethods;
blue: AnsicolorMethods;
magenta: AnsicolorMethods;
cyan: AnsicolorMethods;
darkGray: AnsicolorMethods;
lightGray: AnsicolorMethods;
lightRed: AnsicolorMethods;
lightGreen: AnsicolorMethods;
lightYellow: AnsicolorMethods;
lightBlue: AnsicolorMethods;
lightMagenta: AnsicolorMethods;
lightCyan: AnsicolorMethods;
bright: AnsicolorMethods;
dim: AnsicolorMethods;
italic: AnsicolorMethods;
underline: AnsicolorMethods;
inverse: AnsicolorMethods;
bgDefault: AnsicolorMethods;
bgWhite: AnsicolorMethods;
bgBlack: AnsicolorMethods;
bgRed: AnsicolorMethods;
bgGreen: AnsicolorMethods;
bgYellow: AnsicolorMethods;
bgBlue: AnsicolorMethods;
bgMagenta: AnsicolorMethods;
bgCyan: AnsicolorMethods;
bgDarkGray: AnsicolorMethods;
bgLightGray: AnsicolorMethods;
bgLightRed: AnsicolorMethods;
bgLightGreen: AnsicolorMethods;
bgLightYellow: AnsicolorMethods;
bgLightBlue: AnsicolorMethods;
bgLightMagenta: AnsicolorMethods;
bgLightCyan: AnsicolorMethods;
}
export declare class ansicolor {
static get nice (): ansicolor; // installs unsafe String extensions when accessed
static get rgb (): RGBValues;
static set rgb (newSchema: RGBValues);
static parse (text: string): AnsiColored;
static strip (text: string): string;
static isEscaped (x?: any): boolean;
static get default (): AnsicolorMethods;
static get white (): AnsicolorMethods;
static get black (): AnsicolorMethods;
static get red (): AnsicolorMethods;
static get green (): AnsicolorMethods;
static get yellow (): AnsicolorMethods;
static get blue (): AnsicolorMethods;
static get magenta (): AnsicolorMethods;
static get cyan (): AnsicolorMethods;
static get darkGray (): AnsicolorMethods;
static get lightGray (): AnsicolorMethods;
static get lightRed (): AnsicolorMethods;
static get lightGreen (): AnsicolorMethods;
static get lightYellow (): AnsicolorMethods;
static get lightBlue (): AnsicolorMethods;
static get lightMagenta (): AnsicolorMethods;
static get lightCyan (): AnsicolorMethods;
static get bright (): AnsicolorMethods;
static get dim (): AnsicolorMethods;
static get italic (): AnsicolorMethods;
static get underline (): AnsicolorMethods;
static get inverse (): AnsicolorMethods;
static get bgDefault (): AnsicolorMethods;
static get bgWhite (): AnsicolorMethods;
static get bgBlack (): AnsicolorMethods;
static get bgRed (): AnsicolorMethods;
static get bgGreen (): AnsicolorMethods;
static get bgYellow (): AnsicolorMethods;
static get bgBlue (): AnsicolorMethods;
static get bgMagenta (): AnsicolorMethods;
static get bgCyan (): AnsicolorMethods;
static get bgDarkGray (): AnsicolorMethods;
static get bgLightGray (): AnsicolorMethods;
static get bgLightRed (): AnsicolorMethods;
static get bgLightGreen (): AnsicolorMethods;
static get bgLightYellow (): AnsicolorMethods;
static get bgLightBlue (): AnsicolorMethods;
static get bgLightMagenta (): AnsicolorMethods;
static get bgLightCyan (): AnsicolorMethods;
}
export function parse (text: string): AnsiColored;
export function parseIterator (textOrGetText: string | (() => string)): Iterator<ParsedSpan>;
export function strip (text: string): string;
export function isEscaped (x?: any): boolean;
export const white: AnsicolorMethods;
export const black: AnsicolorMethods;
export const red: AnsicolorMethods;
export const green: AnsicolorMethods;
export const yellow: AnsicolorMethods;
export const blue: AnsicolorMethods;
export const magenta: AnsicolorMethods;
export const cyan: AnsicolorMethods;
export const darkGray: AnsicolorMethods;
export const lightGray: AnsicolorMethods;
export const lightRed: AnsicolorMethods;
export const lightGreen: AnsicolorMethods;
export const lightYellow: AnsicolorMethods;
export const lightBlue: AnsicolorMethods;
export const lightMagenta: AnsicolorMethods;
export const lightCyan: AnsicolorMethods;
export const bright: AnsicolorMethods;
export const dim: AnsicolorMethods;
export const italic: AnsicolorMethods;
export const underline: AnsicolorMethods;
export const inverse: AnsicolorMethods;
export const bgDefault: AnsicolorMethods;
export const bgWhite: AnsicolorMethods;
export const bgBlack: AnsicolorMethods;
export const bgRed: AnsicolorMethods;
export const bgGreen: AnsicolorMethods;
export const bgYellow: AnsicolorMethods;
export const bgBlue: AnsicolorMethods;
export const bgMagenta: AnsicolorMethods;
export const bgCyan: AnsicolorMethods;
export const bgDarkGray: AnsicolorMethods;
export const bgLightGray: AnsicolorMethods;
export const bgLightRed: AnsicolorMethods;
export const bgLightGreen: AnsicolorMethods;
export const bgLightYellow: AnsicolorMethods;
export const bgLightBlue: AnsicolorMethods;
export const bgLightMagenta: AnsicolorMethods;
export const bgLightCyan: AnsicolorMethods;
export default ansicolor;