|
export interface CSPair { |
|
|
|
|
|
|
|
readonly open: string; |
|
|
|
|
|
|
|
|
|
readonly close: string; |
|
} |
|
|
|
export interface ColorBase { |
|
|
|
|
|
|
|
readonly close: string; |
|
|
|
ansi(code: number): string; |
|
|
|
ansi256(code: number): string; |
|
|
|
ansi16m(red: number, green: number, blue: number): string; |
|
} |
|
|
|
export interface Modifier { |
|
|
|
|
|
|
|
readonly reset: CSPair; |
|
|
|
|
|
|
|
|
|
readonly bold: CSPair; |
|
|
|
|
|
|
|
|
|
readonly dim: CSPair; |
|
|
|
|
|
|
|
|
|
readonly italic: CSPair; |
|
|
|
|
|
|
|
|
|
readonly underline: CSPair; |
|
|
|
|
|
|
|
|
|
|
|
|
|
readonly overline: CSPair; |
|
|
|
|
|
|
|
|
|
readonly inverse: CSPair; |
|
|
|
|
|
|
|
|
|
readonly hidden: CSPair; |
|
|
|
|
|
|
|
|
|
readonly strikethrough: CSPair; |
|
} |
|
|
|
export interface ForegroundColor { |
|
readonly black: CSPair; |
|
readonly red: CSPair; |
|
readonly green: CSPair; |
|
readonly yellow: CSPair; |
|
readonly blue: CSPair; |
|
readonly cyan: CSPair; |
|
readonly magenta: CSPair; |
|
readonly white: CSPair; |
|
|
|
|
|
|
|
|
|
readonly gray: CSPair; |
|
|
|
|
|
|
|
|
|
readonly grey: CSPair; |
|
|
|
readonly blackBright: CSPair; |
|
readonly redBright: CSPair; |
|
readonly greenBright: CSPair; |
|
readonly yellowBright: CSPair; |
|
readonly blueBright: CSPair; |
|
readonly cyanBright: CSPair; |
|
readonly magentaBright: CSPair; |
|
readonly whiteBright: CSPair; |
|
} |
|
|
|
export interface BackgroundColor { |
|
readonly bgBlack: CSPair; |
|
readonly bgRed: CSPair; |
|
readonly bgGreen: CSPair; |
|
readonly bgYellow: CSPair; |
|
readonly bgBlue: CSPair; |
|
readonly bgCyan: CSPair; |
|
readonly bgMagenta: CSPair; |
|
readonly bgWhite: CSPair; |
|
|
|
|
|
|
|
|
|
readonly bgGray: CSPair; |
|
|
|
|
|
|
|
|
|
readonly bgGrey: CSPair; |
|
|
|
readonly bgBlackBright: CSPair; |
|
readonly bgRedBright: CSPair; |
|
readonly bgGreenBright: CSPair; |
|
readonly bgYellowBright: CSPair; |
|
readonly bgBlueBright: CSPair; |
|
readonly bgCyanBright: CSPair; |
|
readonly bgMagentaBright: CSPair; |
|
readonly bgWhiteBright: CSPair; |
|
} |
|
|
|
export interface ConvertColor { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rgbToAnsi256(red: number, green: number, blue: number): number; |
|
|
|
|
|
|
|
|
|
|
|
|
|
hexToRgb(hex: string): [red: number, green: number, blue: number]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
hexToAnsi256(hex: string): number; |
|
|
|
|
|
|
|
|
|
|
|
|
|
ansi256ToAnsi(code: number): number; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rgbToAnsi(red: number, green: number, blue: number): number; |
|
|
|
|
|
|
|
|
|
|
|
|
|
hexToAnsi(hex: string): number; |
|
} |
|
|
|
|
|
|
|
|
|
export type ModifierName = keyof Modifier; |
|
|
|
|
|
|
|
|
|
|
|
|
|
export type ForegroundColorName = keyof ForegroundColor; |
|
|
|
|
|
|
|
|
|
|
|
|
|
export type BackgroundColorName = keyof BackgroundColor; |
|
|
|
|
|
|
|
|
|
|
|
|
|
export type ColorName = ForegroundColorName | BackgroundColorName; |
|
|
|
|
|
|
|
|
|
export const modifierNames: readonly ModifierName[]; |
|
|
|
|
|
|
|
|
|
export const foregroundColorNames: readonly ForegroundColorName[]; |
|
|
|
|
|
|
|
|
|
export const backgroundColorNames: readonly BackgroundColorName[]; |
|
|
|
|
|
|
|
|
|
export const colorNames: readonly ColorName[]; |
|
|
|
declare const ansiStyles: { |
|
readonly modifier: Modifier; |
|
readonly color: ColorBase & ForegroundColor; |
|
readonly bgColor: ColorBase & BackgroundColor; |
|
readonly codes: ReadonlyMap<number, number>; |
|
} & ForegroundColor & BackgroundColor & Modifier & ConvertColor; |
|
|
|
export default ansiStyles; |
|
|