-
-
Notifications
You must be signed in to change notification settings - Fork 73
/
index.test-d.ts
144 lines (123 loc) · 4.98 KB
/
index.test-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
import {expectAssignable, expectError, expectType} from 'tsd';
import ansiStyles, {
type BackgroundColorName,
type ColorName,
type CSPair,
type ForegroundColorName,
type ModifierName,
} from './index.js';
expectType<ReadonlyMap<number, number>>(ansiStyles.codes);
// - Static colors -
// -- Namespaced --
// --- Foreground color ---
expectType<CSPair>(ansiStyles.color.black);
expectType<CSPair>(ansiStyles.color.red);
expectType<CSPair>(ansiStyles.color.green);
expectType<CSPair>(ansiStyles.color.yellow);
expectType<CSPair>(ansiStyles.color.blue);
expectType<CSPair>(ansiStyles.color.cyan);
expectType<CSPair>(ansiStyles.color.magenta);
expectType<CSPair>(ansiStyles.color.white);
expectType<CSPair>(ansiStyles.color.gray);
expectType<CSPair>(ansiStyles.color.grey);
expectType<CSPair>(ansiStyles.color.blackBright);
expectType<CSPair>(ansiStyles.color.redBright);
expectType<CSPair>(ansiStyles.color.greenBright);
expectType<CSPair>(ansiStyles.color.yellowBright);
expectType<CSPair>(ansiStyles.color.blueBright);
expectType<CSPair>(ansiStyles.color.cyanBright);
expectType<CSPair>(ansiStyles.color.magentaBright);
expectType<CSPair>(ansiStyles.color.whiteBright);
expectType<string>(ansiStyles.color.close);
// --- Background color ---
expectType<CSPair>(ansiStyles.bgColor.bgBlack);
expectType<CSPair>(ansiStyles.bgColor.bgRed);
expectType<CSPair>(ansiStyles.bgColor.bgGreen);
expectType<CSPair>(ansiStyles.bgColor.bgYellow);
expectType<CSPair>(ansiStyles.bgColor.bgBlue);
expectType<CSPair>(ansiStyles.bgColor.bgCyan);
expectType<CSPair>(ansiStyles.bgColor.bgMagenta);
expectType<CSPair>(ansiStyles.bgColor.bgWhite);
expectType<CSPair>(ansiStyles.bgColor.bgGray);
expectType<CSPair>(ansiStyles.bgColor.bgGrey);
expectType<CSPair>(ansiStyles.bgColor.bgBlackBright);
expectType<CSPair>(ansiStyles.bgColor.bgRedBright);
expectType<CSPair>(ansiStyles.bgColor.bgGreenBright);
expectType<CSPair>(ansiStyles.bgColor.bgYellowBright);
expectType<CSPair>(ansiStyles.bgColor.bgBlueBright);
expectType<CSPair>(ansiStyles.bgColor.bgCyanBright);
expectType<CSPair>(ansiStyles.bgColor.bgMagentaBright);
expectType<CSPair>(ansiStyles.bgColor.bgWhiteBright);
expectType<string>(ansiStyles.bgColor.close);
// --- Modifiers ---
expectType<CSPair>(ansiStyles.modifier.bold);
expectType<CSPair>(ansiStyles.modifier.dim);
expectType<CSPair>(ansiStyles.modifier.hidden);
expectType<CSPair>(ansiStyles.modifier.inverse);
expectType<CSPair>(ansiStyles.modifier.italic);
expectType<CSPair>(ansiStyles.modifier.reset);
expectType<CSPair>(ansiStyles.modifier.strikethrough);
expectType<CSPair>(ansiStyles.modifier.underline);
expectType<CSPair>(ansiStyles.modifier.overline);
// -- Top level --
// --- Foreground color ---
expectType<CSPair>(ansiStyles.black);
expectType<CSPair>(ansiStyles.red);
expectType<CSPair>(ansiStyles.green);
expectType<CSPair>(ansiStyles.yellow);
expectType<CSPair>(ansiStyles.blue);
expectType<CSPair>(ansiStyles.cyan);
expectType<CSPair>(ansiStyles.magenta);
expectType<CSPair>(ansiStyles.white);
expectType<CSPair>(ansiStyles.gray);
expectType<CSPair>(ansiStyles.grey);
expectType<CSPair>(ansiStyles.blackBright);
expectType<CSPair>(ansiStyles.redBright);
expectType<CSPair>(ansiStyles.greenBright);
expectType<CSPair>(ansiStyles.yellowBright);
expectType<CSPair>(ansiStyles.blueBright);
expectType<CSPair>(ansiStyles.cyanBright);
expectType<CSPair>(ansiStyles.magentaBright);
expectType<CSPair>(ansiStyles.whiteBright);
// --- Background color ---
expectType<CSPair>(ansiStyles.bgBlack);
expectType<CSPair>(ansiStyles.bgRed);
expectType<CSPair>(ansiStyles.bgGreen);
expectType<CSPair>(ansiStyles.bgYellow);
expectType<CSPair>(ansiStyles.bgBlue);
expectType<CSPair>(ansiStyles.bgCyan);
expectType<CSPair>(ansiStyles.bgMagenta);
expectType<CSPair>(ansiStyles.bgWhite);
expectType<CSPair>(ansiStyles.bgGray);
expectType<CSPair>(ansiStyles.bgGrey);
expectType<CSPair>(ansiStyles.bgBlackBright);
expectType<CSPair>(ansiStyles.bgRedBright);
expectType<CSPair>(ansiStyles.bgGreenBright);
expectType<CSPair>(ansiStyles.bgYellowBright);
expectType<CSPair>(ansiStyles.bgBlueBright);
expectType<CSPair>(ansiStyles.bgCyanBright);
expectType<CSPair>(ansiStyles.bgMagentaBright);
expectType<CSPair>(ansiStyles.bgWhiteBright);
// --- Modifiers ---
expectType<CSPair>(ansiStyles.bold);
expectType<CSPair>(ansiStyles.dim);
expectType<CSPair>(ansiStyles.hidden);
expectType<CSPair>(ansiStyles.inverse);
expectType<CSPair>(ansiStyles.italic);
expectType<CSPair>(ansiStyles.reset);
expectType<CSPair>(ansiStyles.strikethrough);
expectType<CSPair>(ansiStyles.underline);
// --- ModifierName ---
expectAssignable<ModifierName>('strikethrough');
expectError<ModifierName>('delete');
// --- ForegroundColorName ---
expectAssignable<ForegroundColorName>('blue');
expectError<ForegroundColorName>('pink');
// --- ForegroundColorName ---
expectAssignable<BackgroundColorName>('bgBlue');
expectError<BackgroundColorName>('bgPink');
// --- ColorName ---
expectAssignable<ColorName>('blue');
expectAssignable<ColorName>('bgBlue');
expectError<ColorName>('pink');
expectError<ColorName>('bgPink');