1 // Imported from DefinitelyTyped project.
2 // TypeScript definitions for ansi-colors
3 // Definitions by: Rogier Schouten <https://github.com/rogierschouten>
4 // Integrated by: Jordan Mele <https://github.com/Silic0nS0ldier>
6 interface SymbolsType {
17 type StyleArrayStructure = [number, number];
18 interface StyleArrayProperties {
24 type StyleType = StyleArrayStructure & StyleArrayProperties;
26 export interface StyleFunction extends StylesType<StyleFunction> {
30 interface StylesType<T> {
73 // bright background colors
85 export const reset: StyleFunction;
86 export const bold: StyleFunction;
87 export const dim: StyleFunction;
88 export const italic: StyleFunction;
89 export const underline: StyleFunction;
90 export const inverse: StyleFunction;
91 export const hidden: StyleFunction;
92 export const strikethrough: StyleFunction;
95 export const black: StyleFunction;
96 export const red: StyleFunction;
97 export const green: StyleFunction;
98 export const yellow: StyleFunction;
99 export const blue: StyleFunction;
100 export const magenta: StyleFunction;
101 export const cyan: StyleFunction;
102 export const white: StyleFunction;
103 export const gray: StyleFunction;
104 export const grey: StyleFunction;
107 export const blackBright: StyleFunction;
108 export const redBright: StyleFunction;
109 export const greenBright: StyleFunction;
110 export const yellowBright: StyleFunction;
111 export const blueBright: StyleFunction;
112 export const magentaBright: StyleFunction;
113 export const cyanBright: StyleFunction;
114 export const whiteBright: StyleFunction;
117 export const bgBlack: StyleFunction;
118 export const bgRed: StyleFunction;
119 export const bgGreen: StyleFunction;
120 export const bgYellow: StyleFunction;
121 export const bgBlue: StyleFunction;
122 export const bgMagenta: StyleFunction;
123 export const bgCyan: StyleFunction;
124 export const bgWhite: StyleFunction;
126 // bright background colors
127 export const bgBlackBright: StyleFunction;
128 export const bgRedBright: StyleFunction;
129 export const bgGreenBright: StyleFunction;
130 export const bgYellowBright: StyleFunction;
131 export const bgBlueBright: StyleFunction;
132 export const bgMagentaBright: StyleFunction;
133 export const bgCyanBright: StyleFunction;
134 export const bgWhiteBright: StyleFunction;
136 export let enabled: boolean;
137 export let visible: boolean;
138 export const ansiRegex: RegExp;
141 * Remove styles from string
143 export function stripColor(s: string): string;
146 * Remove styles from string
148 export function strip(s: string): string;
151 * Remove styles from string
153 export function unstyle(s: string): string;
155 export const styles: StylesType<StyleType>;
156 export const symbols: SymbolsType;
159 * Outputs a string with check-symbol as prefix
161 export function ok(...args: string[]): string;