UNPKG

@visulima/colorize

Version:

Terminal and Console string styling done right.

74 lines (69 loc) 2.81 kB
type ColorValueHex = `#${string}`; interface ColorizeType { (string: number | string): string; (string: TemplateStringsArray, ...parameters: string[]): string; ansi256: (code: number) => this; bg: (code: number) => this; bgAnsi256: (code: number) => this; readonly bgBlack: this; readonly bgBlackBright: this; readonly bgBlue: this; readonly bgBlueBright: this; readonly bgCyan: this; readonly bgCyanBright: this; readonly bgGray: this; readonly bgGreen: this; readonly bgGreenBright: this; readonly bgGrey: this; bgHex: (color: ColorValueHex) => this; readonly bgMagenta: this; readonly bgMagentaBright: this; readonly bgRed: this; readonly bgRedBright: this; bgRgb: (red: number, green: number, blue: number) => this; readonly bgWhite: this; readonly bgWhiteBright: this; readonly bgYellow: this; readonly bgYellowBright: this; readonly black: this; readonly blackBright: this; readonly blue: this; readonly blueBright: this; readonly bold: this; readonly close: string; readonly cyan: this; readonly cyanBright: this; readonly dim: this; fg: (code: number) => this; readonly gray: this; readonly green: this; readonly greenBright: this; readonly grey: this; hex: (color: ColorValueHex) => this; readonly hidden: this; readonly inverse: this; readonly italic: this; readonly magenta: this; readonly magentaBright: this; readonly open: string; readonly overline: this; readonly red: this; readonly redBright: this; readonly reset: this; rgb: (red: number, green: number, blue: number) => this; readonly strike: this; readonly strikethrough: this; strip: (string: string) => string; readonly underline: this; readonly visible: this; readonly white: this; readonly whiteBright: this; readonly yellow: this; readonly yellowBright: this; } type AnsiStyles = "bold" | "dim" | "hidden" | "inverse" | "italic" | "overline" | "reset" | "strike" | "strikethrough" | "underline" | "visible"; type AnsiColors = "bgBlack" | "bgBlackBright" | "bgBlue" | "bgBlueBright" | "bgCyan" | "bgCyanBright" | "bgGray" | "bgGreen" | "bgGreenBright" | "bgGrey" | "bgMagenta" | "bgMagentaBright" | "bgRed" | "bgRedBright" | "bgWhite" | "bgWhiteBright" | "bgYellow" | "bgYellowBright" | "black" | "blackBright" | "blue" | "blueBright" | "cyan" | "cyanBright" | "gray" | "green" | "greenBright" | "grey" | "magenta" | "magentaBright" | "red" | "redBright" | "white" | "whiteBright" | "yellow" | "yellowBright"; declare const _default: ColorizeType; declare const Colorize: new () => ColorizeType; export { type AnsiColors, type AnsiStyles, Colorize, type ColorizeType, }; export = _default;