1 // Type definitions for Chalk
2 // Definitions by: Thomas Sauer <https://github.com/t-sauer>
4 export const enum Level {
11 export interface ChalkOptions {
16 export interface ChalkConstructor {
17 new (options?: ChalkOptions): Chalk;
18 (options?: ChalkOptions): Chalk;
21 export interface ColorSupport {
28 export interface Chalk {
29 (...text: string[]): string;
30 (text: TemplateStringsArray, ...placeholders: string[]): string;
31 constructor: ChalkConstructor;
34 rgb(r: number, g: number, b: number): this;
35 hsl(h: number, s: number, l: number): this;
36 hsv(h: number, s: number, v: number): this;
37 hwb(h: number, w: number, b: number): this;
38 bgHex(color: string): this;
39 bgKeyword(color: string): this;
40 bgRgb(r: number, g: number, b: number): this;
41 bgHsl(h: number, s: number, l: number): this;
42 bgHsv(h: number, s: number, v: number): this;
43 bgHwb(h: number, w: number, b: number): this;
44 hex(color: string): this;
45 keyword(color: string): this;
50 readonly italic: this;
51 readonly underline: this;
52 readonly inverse: this;
53 readonly hidden: this;
54 readonly strikethrough: this;
56 readonly visible: this;
61 readonly yellow: this;
63 readonly magenta: this;
68 readonly blackBright: this;
69 readonly redBright: this;
70 readonly greenBright: this;
71 readonly yellowBright: this;
72 readonly blueBright: this;
73 readonly magentaBright: this;
74 readonly cyanBright: this;
75 readonly whiteBright: this;
77 readonly bgBlack: this;
79 readonly bgGreen: this;
80 readonly bgYellow: this;
81 readonly bgBlue: this;
82 readonly bgMagenta: this;
83 readonly bgCyan: this;
84 readonly bgWhite: this;
85 readonly bgBlackBright: this;
86 readonly bgRedBright: this;
87 readonly bgGreenBright: this;
88 readonly bgYellowBright: this;
89 readonly bgBlueBright: this;
90 readonly bgMagentaBright: this;
91 readonly bgCyanBright: this;
92 readonly bgWhiteBright: this;
95 declare const chalk: Chalk & { supportsColor: ColorSupport };