1 declare type CSSColor =
72 | 'lightgoldenrodyellow'
151 declare namespace ansiStyles {
152 interface ColorConvert {
156 @param red - (`0`-`255`)
157 @param green - (`0`-`255`)
158 @param blue - (`0`-`255`)
160 rgb(red: number, green: number, blue: number): string;
163 The RGB HEX color space.
165 @param hex - A hexadecimal string containing RGB data.
167 hex(hex: string): string;
170 @param keyword - A CSS color name.
172 keyword(keyword: CSSColor): string;
177 @param hue - (`0`-`360`)
178 @param saturation - (`0`-`100`)
179 @param lightness - (`0`-`100`)
181 hsl(hue: number, saturation: number, lightness: number): string;
186 @param hue - (`0`-`360`)
187 @param saturation - (`0`-`100`)
188 @param value - (`0`-`100`)
190 hsv(hue: number, saturation: number, value: number): string;
195 @param hue - (`0`-`360`)
196 @param whiteness - (`0`-`100`)
197 @param blackness - (`0`-`100`)
199 hwb(hue: number, whiteness: number, blackness: number): string;
202 Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color.
204 ansi(ansi: number): string;
207 Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color.
209 ansi256(ansi: number): string;
214 The ANSI terminal control sequence for starting this style.
216 readonly open: string;
219 The ANSI terminal control sequence for ending this style.
221 readonly close: string;
224 interface ColorBase {
225 readonly ansi: ColorConvert;
226 readonly ansi256: ColorConvert;
227 readonly ansi16m: ColorConvert;
230 The ANSI terminal control sequence for ending this color.
232 readonly close: string;
237 Resets the current color chain.
239 readonly reset: CSPair;
244 readonly bold: CSPair;
247 Emitting only a small amount of light.
249 readonly dim: CSPair;
252 Make text italic. (Not widely supported)
254 readonly italic: CSPair;
257 Make text underline. (Not widely supported)
259 readonly underline: CSPair;
262 Inverse background and foreground colors.
264 readonly inverse: CSPair;
267 Prints the text, but makes it invisible.
269 readonly hidden: CSPair;
272 Puts a horizontal line through the center of the text. (Not widely supported)
274 readonly strikethrough: CSPair;
277 interface ForegroundColor {
278 readonly black: CSPair;
279 readonly red: CSPair;
280 readonly green: CSPair;
281 readonly yellow: CSPair;
282 readonly blue: CSPair;
283 readonly cyan: CSPair;
284 readonly magenta: CSPair;
285 readonly white: CSPair;
288 Alias for `blackBright`.
290 readonly gray: CSPair;
293 Alias for `blackBright`.
295 readonly grey: CSPair;
297 readonly blackBright: CSPair;
298 readonly redBright: CSPair;
299 readonly greenBright: CSPair;
300 readonly yellowBright: CSPair;
301 readonly blueBright: CSPair;
302 readonly cyanBright: CSPair;
303 readonly magentaBright: CSPair;
304 readonly whiteBright: CSPair;
307 interface BackgroundColor {
308 readonly bgBlack: CSPair;
309 readonly bgRed: CSPair;
310 readonly bgGreen: CSPair;
311 readonly bgYellow: CSPair;
312 readonly bgBlue: CSPair;
313 readonly bgCyan: CSPair;
314 readonly bgMagenta: CSPair;
315 readonly bgWhite: CSPair;
318 Alias for `bgBlackBright`.
320 readonly bgGray: CSPair;
323 Alias for `bgBlackBright`.
325 readonly bgGrey: CSPair;
327 readonly bgBlackBright: CSPair;
328 readonly bgRedBright: CSPair;
329 readonly bgGreenBright: CSPair;
330 readonly bgYellowBright: CSPair;
331 readonly bgBlueBright: CSPair;
332 readonly bgCyanBright: CSPair;
333 readonly bgMagentaBright: CSPair;
334 readonly bgWhiteBright: CSPair;
338 declare const ansiStyles: {
339 readonly modifier: ansiStyles.Modifier;
340 readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase;
341 readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase;
342 readonly codes: ReadonlyMap<number, number>;
343 } & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier;