1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | interface SymbolsType {
|
7 | |
8 |
|
9 |
|
10 | ballotCross?: "✘";
|
11 | ballotDisabled: "☒";
|
12 | ballotOff: "☐";
|
13 | ballotOn: "☑";
|
14 | bullet: "•";
|
15 | bulletWhite: "◦";
|
16 | |
17 |
|
18 |
|
19 | check: "√" | "✔";
|
20 | |
21 |
|
22 |
|
23 | cross: "×" | "✖";
|
24 | |
25 |
|
26 |
|
27 | ellipsisLarge: "..." | "⋯";
|
28 | |
29 |
|
30 |
|
31 | ellipsis: "..." | "…";
|
32 | fullBlock: "█";
|
33 | heart: "❤";
|
34 | identicalTo: "≡";
|
35 | info: "i" | "ℹ";
|
36 | line: "─";
|
37 | mark: "※";
|
38 | middot: "·";
|
39 | minus: "-";
|
40 | multiplication: "×";
|
41 | obelus: "÷";
|
42 | pencilDownRight: "✎";
|
43 | pencilRight: "✏";
|
44 | pencilUpRight: "✐";
|
45 | percent: "%";
|
46 | pilcrow2: "❡";
|
47 | pilcrow: "¶";
|
48 | plusMinus: "±";
|
49 | |
50 |
|
51 |
|
52 | pointer: ">" | "▸" | "❯";
|
53 | |
54 |
|
55 |
|
56 | pointerSmall: "»" | "‣" | "›";
|
57 | question: "?";
|
58 | |
59 |
|
60 |
|
61 | questionFull?: "?";
|
62 | |
63 |
|
64 |
|
65 | questionSmall: "?" | "﹖";
|
66 | |
67 |
|
68 |
|
69 | radioOff: "( )" | "◯";
|
70 | |
71 |
|
72 |
|
73 | radioOn: "(*)" | "◉";
|
74 | section: "§";
|
75 | starsOff: "☆";
|
76 | starsOn: "★";
|
77 | upDownArrow: "↕";
|
78 | |
79 |
|
80 |
|
81 | warning: "‼" | "⚠";
|
82 | }
|
83 |
|
84 | type StyleArrayStructure = [number, number];
|
85 | interface StyleArrayProperties {
|
86 | open: string;
|
87 | close: string;
|
88 | closeRe: string;
|
89 | }
|
90 |
|
91 | type StyleType = StyleArrayStructure & StyleArrayProperties;
|
92 |
|
93 |
|
94 | interface StylesType<T> {
|
95 |
|
96 | reset: T;
|
97 | bold: T;
|
98 | dim: T;
|
99 | italic: T;
|
100 | underline: T;
|
101 | inverse: T;
|
102 | hidden: T;
|
103 | strikethrough: T;
|
104 |
|
105 |
|
106 | black: T;
|
107 | red: T;
|
108 | green: T;
|
109 | yellow: T;
|
110 | blue: T;
|
111 | magenta: T;
|
112 | cyan: T;
|
113 | white: T;
|
114 | gray: T;
|
115 | grey: T;
|
116 |
|
117 |
|
118 | blackBright: T;
|
119 | redBright: T;
|
120 | greenBright: T;
|
121 | yellowBright: T;
|
122 | blueBright: T;
|
123 | magentaBright: T;
|
124 | cyanBright: T;
|
125 | whiteBright: T;
|
126 |
|
127 |
|
128 | bgBlack: T;
|
129 | bgRed: T;
|
130 | bgGreen: T;
|
131 | bgYellow: T;
|
132 | bgBlue: T;
|
133 | bgMagenta: T;
|
134 | bgCyan: T;
|
135 | bgWhite: T;
|
136 |
|
137 |
|
138 | bgBlackBright: T;
|
139 | bgRedBright: T;
|
140 | bgGreenBright: T;
|
141 | bgYellowBright: T;
|
142 | bgBlueBright: T;
|
143 | bgMagentaBright: T;
|
144 | bgCyanBright: T;
|
145 | bgWhiteBright: T;
|
146 | }
|
147 |
|
148 | declare namespace ansiColors {
|
149 | interface StyleFunction extends StylesType<StyleFunction> {
|
150 | (s: string): string;
|
151 | }
|
152 |
|
153 |
|
154 | const reset: StyleFunction;
|
155 | const bold: StyleFunction;
|
156 | const dim: StyleFunction;
|
157 | const italic: StyleFunction;
|
158 | const underline: StyleFunction;
|
159 | const inverse: StyleFunction;
|
160 | const hidden: StyleFunction;
|
161 | const strikethrough: StyleFunction;
|
162 |
|
163 |
|
164 | const black: StyleFunction;
|
165 | const red: StyleFunction;
|
166 | const green: StyleFunction;
|
167 | const yellow: StyleFunction;
|
168 | const blue: StyleFunction;
|
169 | const magenta: StyleFunction;
|
170 | const cyan: StyleFunction;
|
171 | const white: StyleFunction;
|
172 | const gray: StyleFunction;
|
173 | const grey: StyleFunction;
|
174 |
|
175 |
|
176 | const blackBright: StyleFunction;
|
177 | const redBright: StyleFunction;
|
178 | const greenBright: StyleFunction;
|
179 | const yellowBright: StyleFunction;
|
180 | const blueBright: StyleFunction;
|
181 | const magentaBright: StyleFunction;
|
182 | const cyanBright: StyleFunction;
|
183 | const whiteBright: StyleFunction;
|
184 |
|
185 |
|
186 | const bgBlack: StyleFunction;
|
187 | const bgRed: StyleFunction;
|
188 | const bgGreen: StyleFunction;
|
189 | const bgYellow: StyleFunction;
|
190 | const bgBlue: StyleFunction;
|
191 | const bgMagenta: StyleFunction;
|
192 | const bgCyan: StyleFunction;
|
193 | const bgWhite: StyleFunction;
|
194 |
|
195 |
|
196 | const bgBlackBright: StyleFunction;
|
197 | const bgRedBright: StyleFunction;
|
198 | const bgGreenBright: StyleFunction;
|
199 | const bgYellowBright: StyleFunction;
|
200 | const bgBlueBright: StyleFunction;
|
201 | const bgMagentaBright: StyleFunction;
|
202 | const bgCyanBright: StyleFunction;
|
203 | const bgWhiteBright: StyleFunction;
|
204 |
|
205 | let enabled: boolean;
|
206 | let visible: boolean;
|
207 | const ansiRegex: RegExp;
|
208 |
|
209 | |
210 |
|
211 |
|
212 | function stripColor(s: string): string;
|
213 |
|
214 | |
215 |
|
216 |
|
217 | function strip(s: string): string;
|
218 |
|
219 | |
220 |
|
221 |
|
222 | function unstyle(s: string): string;
|
223 |
|
224 | const styles: StylesType<StyleType>;
|
225 | const symbols: SymbolsType;
|
226 |
|
227 | |
228 |
|
229 |
|
230 | function ok(...args: string[]): string;
|
231 |
|
232 | function create(): typeof ansiColors;
|
233 | }
|
234 |
|
235 | export = ansiColors;
|