webpack-dev-service 0.5.18 → 0.5.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/client/cjs/client.cjs +8 -7
  2. package/client/cjs/events.cjs +1 -1
  3. package/client/cjs/hot.cjs +1 -1
  4. package/client/cjs/index.cjs +1 -1
  5. package/client/cjs/main.cjs +1 -1
  6. package/client/cjs/ui/overlay.cjs +170 -169
  7. package/client/cjs/ui/progress.cjs +43 -43
  8. package/client/cjs/ui/{utils/index.cjs → utils.cjs} +19 -13
  9. package/client/esm/client.js +8 -7
  10. package/client/esm/events.js +1 -1
  11. package/client/esm/hot.js +1 -1
  12. package/client/esm/index.js +1 -1
  13. package/client/esm/main.js +1 -1
  14. package/client/esm/ui/overlay.js +168 -167
  15. package/client/esm/ui/progress.js +41 -41
  16. package/client/esm/ui/{utils/index.js → utils.js} +12 -12
  17. package/package.json +10 -9
  18. package/server/cjs/dev.cjs +1 -1
  19. package/server/cjs/hot.cjs +1 -1
  20. package/server/cjs/index.cjs +1 -1
  21. package/server/esm/dev.js +1 -1
  22. package/server/esm/hot.js +1 -1
  23. package/server/esm/index.js +1 -1
  24. package/types/client/ui/overlay.d.ts +1 -1
  25. package/types/client/ui/{utils/index.d.ts → utils.d.ts} +1 -1
  26. package/client/cjs/ui/utils/ansi/index.cjs +0 -441
  27. package/client/cjs/ui/utils/ansi/regexp.cjs +0 -70
  28. package/client/cjs/ui/utils/ansi/utils.cjs +0 -27
  29. package/client/esm/ui/utils/ansi/index.js +0 -439
  30. package/client/esm/ui/utils/ansi/regexp.js +0 -66
  31. package/client/esm/ui/utils/ansi/utils.js +0 -24
  32. package/types/client/ui/utils/ansi/enum.d.ts +0 -12
  33. package/types/client/ui/utils/ansi/index.d.ts +0 -18
  34. package/types/client/ui/utils/ansi/interface.d.ts +0 -68
  35. package/types/client/ui/utils/ansi/regexp.d.ts +0 -6
  36. package/types/client/ui/utils/ansi/utils.d.ts +0 -6
@@ -1,439 +0,0 @@
1
- /**
2
- * @package webpack-dev-service
3
- * @license MIT
4
- * @version 0.5.18
5
- * @author nuintun <nuintun@qq.com>
6
- * @description A koa 2 middleware for webpack development and hot reloading.
7
- * @see https://github.com/nuintun/webpack-dev-service#readme
8
- */
9
-
10
- import { getThemeColor, toUint8 } from './utils.js';
11
- import { CSI_RE, OSC_ST_RE, OSC_RE } from './regexp.js';
12
-
13
- /**
14
- * @module index
15
- */
16
- class Ansi {
17
- constructor(theme = {}) {
18
- this.buffer = '';
19
- this.style = {
20
- dim: false,
21
- bold: false,
22
- color: null,
23
- blink: false,
24
- hidden: false,
25
- italic: false,
26
- inverse: false,
27
- overline: false,
28
- background: null,
29
- underline: false,
30
- strikethrough: false
31
- };
32
- const colors16 = [
33
- // Colors 16 bit
34
- [
35
- // Black
36
- getThemeColor([0, 0, 0], theme.black),
37
- // Red
38
- getThemeColor([187, 0, 0], theme.red),
39
- // Green
40
- getThemeColor([0, 187, 0], theme.green),
41
- // Yellow
42
- getThemeColor([187, 187, 0], theme.yellow),
43
- // Blue
44
- getThemeColor([0, 0, 187], theme.blue),
45
- // Magenta
46
- getThemeColor([187, 0, 187], theme.magenta),
47
- // Cyan
48
- getThemeColor([0, 187, 187], theme.cyan),
49
- // White
50
- getThemeColor([255, 255, 255], theme.white)
51
- ],
52
- // Bright colors
53
- [
54
- // Bright Black
55
- getThemeColor([85, 85, 85], theme.brightBlack),
56
- // Bright Red
57
- getThemeColor([255, 85, 85], theme.brightRed),
58
- // Bright Green
59
- getThemeColor([0, 255, 0], theme.brightGreen),
60
- // Bright Yellow
61
- getThemeColor([255, 255, 85], theme.brightYellow),
62
- // Bright Blue
63
- getThemeColor([85, 85, 255], theme.brightBlue),
64
- // Bright Magenta
65
- getThemeColor([255, 85, 255], theme.brightMagenta),
66
- // Bright Cyan
67
- getThemeColor([85, 255, 255], theme.brightCyan),
68
- // Bright White
69
- getThemeColor([255, 255, 255], theme.brightWhite)
70
- ]
71
- ];
72
- // Colors 256 bit
73
- const colors256 = [];
74
- // Index 0..15 : Ansi-Colors
75
- for (const palette of colors16) {
76
- for (const color of palette) {
77
- colors256.push(color);
78
- }
79
- }
80
- // Index 16..231 : RGB 6x6x6
81
- // https://gist.github.com/jasonm23/2868981#file-xterm-256color-yaml
82
- const levels = [0, 95, 135, 175, 215, 255];
83
- for (let r = 0; r < 6; ++r) {
84
- for (let g = 0; g < 6; ++g) {
85
- for (let b = 0; b < 6; ++b) {
86
- colors256.push([levels[r], levels[g], levels[b]]);
87
- }
88
- }
89
- }
90
- // Index 232..255 : Grayscale
91
- let grayscale = 8;
92
- for (let i = 0; i < 24; ++i, grayscale += 10) {
93
- colors256.push([grayscale, grayscale, grayscale]);
94
- }
95
- // Init ANSI colors
96
- this.colors16 = colors16;
97
- this.colors256 = colors256;
98
- }
99
- read() {
100
- const { buffer } = this;
101
- const { length } = buffer;
102
- const pos = buffer.indexOf('\x1B');
103
- // The most common case, no ESC codes
104
- if (pos < 0) {
105
- this.buffer = '';
106
- return {
107
- value: buffer,
108
- type: 4 /* TokenType.TEXT */
109
- };
110
- }
111
- if (pos > 0) {
112
- this.buffer = buffer.slice(pos);
113
- return {
114
- type: 4 /* TokenType.TEXT */,
115
- value: buffer.slice(0, pos)
116
- };
117
- }
118
- if (length === 1) {
119
- // Lone ESC in Buffer, We don't know yet
120
- return {
121
- type: 5 /* TokenType.INCESC */
122
- };
123
- }
124
- const peek = buffer.charAt(1);
125
- // We treat this as a single ESC
126
- // Which effecitvely shows
127
- if (peek !== '[' && peek !== ']') {
128
- this.buffer = buffer.slice(1);
129
- // DeMorgan
130
- return {
131
- type: 1 /* TokenType.ESC */
132
- };
133
- }
134
- // OK is this an SGR or OSC that we handle
135
- // SGR CHECK
136
- if (peek === '[') {
137
- // We do this regex initialization here so
138
- // we can keep the regex close to its use (Readability)
139
- // All ansi codes are typically in the following format.
140
- // We parse it and focus specifically on the
141
- // graphics commands (SGR)
142
- //
143
- // CONTROL-SEQUENCE-INTRODUCER CSI (ESC, '[')
144
- // PRIVATE-MODE-CHAR (!, <, >, ?)
145
- // Numeric parameters separated by semicolons ('0' - '9', ';')
146
- // Intermediate-modifiers (0x20 - 0x2f)
147
- // COMMAND-CHAR (0x40 - 0x7e)
148
- const match = buffer.match(CSI_RE);
149
- // This match is guaranteed to terminate (even on
150
- // invalid input). The key is to match on legal and
151
- // illegal sequences.
152
- // The first alternate matches everything legal and
153
- // the second matches everything illegal.
154
- //
155
- // If it doesn't match, then we have not received
156
- // either the full sequence or an illegal sequence.
157
- // If it does match, the presence of field 4 tells
158
- // us whether it was legal or illegal.
159
- if (match === null) {
160
- return {
161
- type: 5 /* TokenType.INCESC */
162
- };
163
- }
164
- // match is an array
165
- // 0 - total match
166
- // 1 - private mode chars group
167
- // 2 - digits and semicolons group
168
- // 3 - command
169
- // 4 - illegal char
170
- if (match[4]) {
171
- this.buffer = buffer.slice(1);
172
- // Illegal sequence, just remove the ESC
173
- return {
174
- type: 1 /* TokenType.ESC */
175
- };
176
- }
177
- this.buffer = buffer.slice(match[0].length);
178
- // If not a valid SGR, we don't handle
179
- if (match[1] !== '' || match[3] !== 'm') {
180
- return {
181
- type: 6 /* TokenType.UNKNOWN */
182
- };
183
- } else {
184
- return {
185
- signal: match[2],
186
- type: 3 /* TokenType.SGR */
187
- };
188
- }
189
- }
190
- // OSC CHECK
191
- if (peek === ']') {
192
- if (length < 4) {
193
- return {
194
- type: 5 /* TokenType.INCESC */
195
- };
196
- }
197
- if (buffer.charAt(2) !== '8' || buffer.charAt(3) !== ';') {
198
- this.buffer = buffer.slice(1);
199
- // This is not a match, so we'll just treat it as ESC
200
- return {
201
- type: 1 /* TokenType.ESC */
202
- };
203
- }
204
- // We do this regex initialization here so
205
- // we can keep the regex close to its use (Readability)
206
- // Matching a Hyperlink OSC with a regex is difficult
207
- // because Javascript's regex engine doesn't support
208
- // 'partial match' support.
209
- //
210
- // Therefore, we require the system to match the
211
- // string-terminator(ST) before attempting a match.
212
- // Once we find it, we attempt the Hyperlink-Begin
213
- // match.
214
- // If that goes ok, we scan forward for the next
215
- // ST.
216
- // Finally, we try to match it all and return
217
- // the sequence.
218
- // Also, it is important to note that we consider
219
- // certain control characters as an invalidation of
220
- // the entire sequence.
221
- // We do regex initializations here so
222
- // we can keep the regex close to its use (Readability)
223
- // STRING-TERMINATOR
224
- // This is likely to terminate in most scenarios
225
- // because it will terminate on a newline
226
- // VERY IMPORTANT
227
- // We do a stateful regex match with exec.
228
- // If the regex is global, and it used with 'exec',
229
- // then it will search starting at the 'lastIndex'
230
- // If it matches, the regex can be used again to
231
- // find the next match.
232
- OSC_ST_RE.lastIndex = 0;
233
- // We might have the prefix and URI
234
- // Lets start our search for the ST twice
235
- for (let count = 0; count < 2; count++) {
236
- const match = OSC_ST_RE.exec(buffer);
237
- if (match === null) {
238
- return {
239
- type: 5 /* TokenType.INCESC */
240
- };
241
- }
242
- // If an illegal character was found, bail on the match
243
- if (match[3]) {
244
- this.buffer = buffer.slice(1);
245
- // Illegal sequence, just remove the ESC
246
- return {
247
- type: 1 /* TokenType.ESC */
248
- };
249
- }
250
- }
251
- // OK, at this point we should have a FULL match!
252
- // Lets try to match that now
253
- const match = buffer.match(OSC_RE);
254
- if (match === null) {
255
- this.buffer = buffer.slice(1);
256
- // Illegal sequence, just remove the ESC
257
- return {
258
- type: 1 /* TokenType.ESC */
259
- };
260
- }
261
- this.buffer = buffer.slice(match[0].length);
262
- // If a valid SGR
263
- // match is an array
264
- // 0 - total match
265
- // 1 - URL
266
- // 2 - Text
267
- return {
268
- url: match[1],
269
- value: match[2],
270
- type: 2 /* TokenType.OSC */
271
- };
272
- }
273
- return {
274
- type: 0 /* TokenType.EOS */
275
- };
276
- }
277
- reset() {
278
- const { style } = this;
279
- style.dim = false;
280
- style.bold = false;
281
- style.color = null;
282
- style.blink = false;
283
- style.hidden = false;
284
- style.italic = false;
285
- style.inverse = false;
286
- style.background = null;
287
- style.underline = false;
288
- style.strikethrough = false;
289
- }
290
- process(signal) {
291
- let index = 0;
292
- // Ok - we have a valid "SGR" (Select Graphic Rendition)
293
- const sequences = signal.split(';');
294
- const maxIndex = sequences.length - 1;
295
- // ANSI style and colors
296
- const { style, colors16, colors256 } = this;
297
- // Read cmd by index
298
- const read = () => parseInt(sequences[index++], 10);
299
- // Each of these params affects the SGR state
300
- // Why do we shift through the array instead of a forEach??
301
- // ... because some commands consume the params that follow !
302
- for (; index <= maxIndex; index++) {
303
- const code = read();
304
- if (code === 1) {
305
- style.bold = true;
306
- } else if (code === 2) {
307
- style.dim = true;
308
- } else if (code === 3) {
309
- style.italic = true;
310
- } else if (code === 4) {
311
- style.underline = true;
312
- } else if (code === 5) {
313
- style.blink = true;
314
- } else if (code === 7) {
315
- style.inverse = true;
316
- } else if (code === 8) {
317
- style.hidden = true;
318
- } else if (code === 9) {
319
- style.strikethrough = true;
320
- } else if (code === 53) {
321
- style.overline = true;
322
- } else if (code === 21) {
323
- style.bold = false;
324
- } else if (code === 22) {
325
- style.dim = false;
326
- style.bold = false;
327
- } else if (code === 23) {
328
- style.italic = false;
329
- } else if (code === 24) {
330
- style.underline = false;
331
- } else if (code === 25) {
332
- style.blink = false;
333
- } else if (code === 27) {
334
- style.inverse = false;
335
- } else if (code === 28) {
336
- style.hidden = false;
337
- } else if (code === 29) {
338
- style.strikethrough = false;
339
- } else if (code === 29) {
340
- style.strikethrough = false;
341
- } else if (code === 55) {
342
- style.overline = false;
343
- } else if (code === 49) {
344
- style.background = null;
345
- } else if (code >= 30 && code < 38) {
346
- style.color = colors16[0][code - 30];
347
- } else if (code >= 40 && code < 48) {
348
- style.background = colors16[0][code - 40];
349
- } else if (code >= 90 && code < 98) {
350
- style.color = colors16[1][code - 90];
351
- } else if (code >= 100 && code < 108) {
352
- style.background = colors16[1][code - 100];
353
- } else if (code === 38 || code === 48) {
354
- // Extended set foreground/background color
355
- // validate that param exists
356
- if (index < maxIndex) {
357
- const mode = read();
358
- // Extend color (38=fg, 48=bg)
359
- const isForeground = code === 38;
360
- // MODE 5 - 256 color palette
361
- if (mode === 5 && index <= maxIndex) {
362
- const index = toUint8(read());
363
- if (isForeground) {
364
- style.color = colors256[index];
365
- } else {
366
- style.background = colors256[index];
367
- }
368
- }
369
- // MODE 2 - True Color
370
- if (mode === 2 && index + 2 <= maxIndex) {
371
- const r = toUint8(read());
372
- const g = toUint8(read());
373
- const b = toUint8(read());
374
- // True Color
375
- const color = [r, g, b];
376
- if (isForeground) {
377
- style.color = color;
378
- } else {
379
- style.background = color;
380
- }
381
- }
382
- }
383
- } else {
384
- this.reset();
385
- }
386
- }
387
- }
388
- block(token) {
389
- const block = {
390
- value: token.value,
391
- style: { ...this.style }
392
- };
393
- if ('url' in token) {
394
- block.url = token.url;
395
- }
396
- return block;
397
- }
398
- write(text, callback) {
399
- this.buffer += text;
400
- while (this.buffer) {
401
- const token = this.read();
402
- switch (token.type) {
403
- case 0 /* TokenType.EOS */:
404
- case 5 /* TokenType.INCESC */:
405
- break;
406
- case 1 /* TokenType.ESC */:
407
- case 6 /* TokenType.UNKNOWN */:
408
- continue;
409
- case 3 /* TokenType.SGR */:
410
- this.process(token.signal);
411
- continue;
412
- case 2 /* TokenType.OSC */:
413
- case 4 /* TokenType.TEXT */:
414
- callback(this.block(token));
415
- continue;
416
- default:
417
- continue;
418
- }
419
- }
420
- }
421
- flush(callback) {
422
- const { buffer } = this;
423
- // Get flush block
424
- if (buffer !== '') {
425
- callback(
426
- this.block({
427
- value: buffer,
428
- type: 4 /* TokenType.TEXT */
429
- })
430
- );
431
- }
432
- // Reset
433
- this.reset();
434
- // Flush buffer
435
- this.buffer = '';
436
- }
437
- }
438
-
439
- export { Ansi as default };
@@ -1,66 +0,0 @@
1
- /**
2
- * @package webpack-dev-service
3
- * @license MIT
4
- * @version 0.5.18
5
- * @author nuintun <nuintun@qq.com>
6
- * @description A koa 2 middleware for webpack development and hot reloading.
7
- * @see https://github.com/nuintun/webpack-dev-service#readme
8
- */
9
-
10
- /**
11
- * @module regx
12
- */
13
- // prettier-ignore
14
- // (?: # legal sequence
15
- // (\x1b\\) # ESC \
16
- // | # alternate
17
- // (\x07) # BEL (what xterm did)
18
- // ) # legal sequence end
19
- // | # alternate (second attempt)
20
- // ( # illegal sequence
21
- // [\x00-\x06] # anything illegal
22
- // | # alternate
23
- // [\x08-\x1a] # anything illegal
24
- // | # alternate
25
- // [\x1c-\x1f] # anything illegal
26
- // ) # illegal sequence end
27
- const OSC_ST_RE = /(?:(\x1b\\)|(\x07))|([\x00-\x06]|[\x08-\x1a]|[\x1c-\x1f])/g;
28
- // prettier-ignore
29
- // ^ # beginning of line
30
- // (?: # legal sequence
31
- // \x1b\[ # CSI
32
- // ([\x3c-\x3f]?) # private-mode char
33
- // ([\d;]*) # any digits or semicolons
34
- // ( # modifier command sequence
35
- // [\x20-\x2f]? # an intermediate modifier
36
- // [\x40-\x7e] # the command
37
- // ) # modifier command sequence end
38
- // ) # legal sequence end
39
- // | # alternate (second attempt)
40
- // (?: # illegal sequence
41
- // \x1b\[ # CSI
42
- // [\x20-\x7e]* # anything legal
43
- // ([\x00-\x1f:]) # anything illegal
44
- // ) # illegal sequence end
45
- const CSI_RE = /^(?:\x1b\[([\x3c-\x3f]?)([\d;]*)([\x20-\x2f]?[\x40-\x7e]))|(?:\x1b\[[\x20-\x7e]*([\x00-\x1f:]))/;
46
- // prettier-ignore
47
- // ^ # beginning of line
48
- // \x1b\]8; # OSC Hyperlink
49
- // [\x20-\x3a\x3c-\x7e]* # params (excluding ;)
50
- // ; # end of params
51
- // ([\x21-\x7e]{0,512}) # URL capture
52
- // (?: # ST sequence
53
- // (?:\x1b\\) # ESC \
54
- // | # alternate
55
- // (?:\x07) # BEL (what xterm did)
56
- // ) # ST sequence end
57
- // ([\x20-\x7e]+) # TEXT capture
58
- // \x1b\]8;; # OSC Hyperlink End
59
- // (?: # ST sequence
60
- // (?:\x1b\\) # ESC \
61
- // | # alternate
62
- // (?:\x07) # BEL (what xterm did)
63
- // ) # ST sequence end
64
- const OSC_RE = /^\x1b\]8;[\x20-\x3a\x3c-\x7e]*;([\x21-\x7e]{0,512})(?:(?:\x1b\\)|(?:\x07))([\x20-\x7e]+)\x1b\]8;;(?:(?:\x1b\\)|(?:\x07))/;
65
-
66
- export { CSI_RE, OSC_RE, OSC_ST_RE };
@@ -1,24 +0,0 @@
1
- /**
2
- * @package webpack-dev-service
3
- * @license MIT
4
- * @version 0.5.18
5
- * @author nuintun <nuintun@qq.com>
6
- * @description A koa 2 middleware for webpack development and hot reloading.
7
- * @see https://github.com/nuintun/webpack-dev-service#readme
8
- */
9
-
10
- /**
11
- * @module utils
12
- */
13
- function toUint8(uint8) {
14
- return uint8 & 0xff;
15
- }
16
- function getThemeColor(defaultColor, color) {
17
- if (color) {
18
- const [r, g, b] = color;
19
- return [toUint8(r), toUint8(g), toUint8(b)];
20
- }
21
- return defaultColor;
22
- }
23
-
24
- export { getThemeColor, toUint8 };
@@ -1,12 +0,0 @@
1
- /**
2
- * @module enum
3
- */
4
- export declare const enum TokenType {
5
- EOS = 0, // End Operating System
6
- ESC = 1, // A single ESC char - random
7
- OSC = 2, // Operating System Command
8
- SGR = 3, // Select Graphic Rendition
9
- TEXT = 4, // ANSI normal text group
10
- INCESC = 5, // An Incomplete ESC sequence
11
- UNKNOWN = 6
12
- }
@@ -1,18 +0,0 @@
1
- /**
2
- * @module index
3
- */
4
- import { AnsiBlock, AnsiColor, AnsiStyle, Theme } from './interface';
5
- export type { AnsiBlock, AnsiStyle };
6
- export default class Ansi {
7
- protected buffer: string;
8
- protected style: AnsiStyle;
9
- protected colors256: AnsiColor[];
10
- protected colors16: AnsiColor[][];
11
- constructor(theme?: Theme);
12
- private read;
13
- private reset;
14
- private process;
15
- private block;
16
- write(text: string, callback: (block: AnsiBlock) => void): void;
17
- flush(callback: (block: AnsiBlock) => void): void;
18
- }
@@ -1,68 +0,0 @@
1
- /**
2
- * @module interface
3
- */
4
- import { TokenType } from './enum';
5
- export type AnsiColor = [R: number, G: number, B: number];
6
- export interface AnsiStyle {
7
- dim: boolean;
8
- bold: boolean;
9
- blink: boolean;
10
- hidden: boolean;
11
- italic: boolean;
12
- inverse: boolean;
13
- overline: boolean;
14
- underline: boolean;
15
- strikethrough: boolean;
16
- color: AnsiColor | null;
17
- background: AnsiColor | null;
18
- }
19
- export interface AnsiBlock {
20
- url?: string;
21
- value: string;
22
- style: AnsiStyle;
23
- }
24
- export interface EOSToken {
25
- type: TokenType.EOS;
26
- }
27
- export interface ESCToken {
28
- type: TokenType.ESC;
29
- }
30
- export interface OSCToken {
31
- url: string;
32
- value: string;
33
- type: TokenType.OSC;
34
- }
35
- export interface SGRToken {
36
- signal: string;
37
- type: TokenType.SGR;
38
- }
39
- export interface TEXTToken {
40
- value: string;
41
- type: TokenType.TEXT;
42
- }
43
- export interface INCESCToken {
44
- type: TokenType.INCESC;
45
- }
46
- export interface UNKNOWNToken {
47
- type: TokenType.UNKNOWN;
48
- }
49
- export type BlockToken = OSCToken | TEXTToken;
50
- export type AnsiToken = EOSToken | ESCToken | OSCToken | SGRToken | TEXTToken | INCESCToken | UNKNOWNToken;
51
- export interface Theme {
52
- red?: AnsiColor;
53
- blue?: AnsiColor;
54
- cyan?: AnsiColor;
55
- black?: AnsiColor;
56
- green?: AnsiColor;
57
- white?: AnsiColor;
58
- yellow?: AnsiColor;
59
- magenta?: AnsiColor;
60
- brightRed?: AnsiColor;
61
- brightBlue?: AnsiColor;
62
- brightCyan?: AnsiColor;
63
- brightBlack?: AnsiColor;
64
- brightGreen?: AnsiColor;
65
- brightWhite?: AnsiColor;
66
- brightYellow?: AnsiColor;
67
- brightMagenta?: AnsiColor;
68
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * @module regx
3
- */
4
- export declare const OSC_ST_RE: RegExp;
5
- export declare const CSI_RE: RegExp;
6
- export declare const OSC_RE: RegExp;
@@ -1,6 +0,0 @@
1
- /**
2
- * @module utils
3
- */
4
- import { AnsiColor } from './interface';
5
- export declare function toUint8(uint8: number): number;
6
- export declare function getThemeColor(defaultColor: AnsiColor, color?: AnsiColor): AnsiColor;