Path: blob/master/node_modules/ansi-styles/index.d.ts
2591 views
declare type CSSColor =1| 'aliceblue'2| 'antiquewhite'3| 'aqua'4| 'aquamarine'5| 'azure'6| 'beige'7| 'bisque'8| 'black'9| 'blanchedalmond'10| 'blue'11| 'blueviolet'12| 'brown'13| 'burlywood'14| 'cadetblue'15| 'chartreuse'16| 'chocolate'17| 'coral'18| 'cornflowerblue'19| 'cornsilk'20| 'crimson'21| 'cyan'22| 'darkblue'23| 'darkcyan'24| 'darkgoldenrod'25| 'darkgray'26| 'darkgreen'27| 'darkgrey'28| 'darkkhaki'29| 'darkmagenta'30| 'darkolivegreen'31| 'darkorange'32| 'darkorchid'33| 'darkred'34| 'darksalmon'35| 'darkseagreen'36| 'darkslateblue'37| 'darkslategray'38| 'darkslategrey'39| 'darkturquoise'40| 'darkviolet'41| 'deeppink'42| 'deepskyblue'43| 'dimgray'44| 'dimgrey'45| 'dodgerblue'46| 'firebrick'47| 'floralwhite'48| 'forestgreen'49| 'fuchsia'50| 'gainsboro'51| 'ghostwhite'52| 'gold'53| 'goldenrod'54| 'gray'55| 'green'56| 'greenyellow'57| 'grey'58| 'honeydew'59| 'hotpink'60| 'indianred'61| 'indigo'62| 'ivory'63| 'khaki'64| 'lavender'65| 'lavenderblush'66| 'lawngreen'67| 'lemonchiffon'68| 'lightblue'69| 'lightcoral'70| 'lightcyan'71| 'lightgoldenrodyellow'72| 'lightgray'73| 'lightgreen'74| 'lightgrey'75| 'lightpink'76| 'lightsalmon'77| 'lightseagreen'78| 'lightskyblue'79| 'lightslategray'80| 'lightslategrey'81| 'lightsteelblue'82| 'lightyellow'83| 'lime'84| 'limegreen'85| 'linen'86| 'magenta'87| 'maroon'88| 'mediumaquamarine'89| 'mediumblue'90| 'mediumorchid'91| 'mediumpurple'92| 'mediumseagreen'93| 'mediumslateblue'94| 'mediumspringgreen'95| 'mediumturquoise'96| 'mediumvioletred'97| 'midnightblue'98| 'mintcream'99| 'mistyrose'100| 'moccasin'101| 'navajowhite'102| 'navy'103| 'oldlace'104| 'olive'105| 'olivedrab'106| 'orange'107| 'orangered'108| 'orchid'109| 'palegoldenrod'110| 'palegreen'111| 'paleturquoise'112| 'palevioletred'113| 'papayawhip'114| 'peachpuff'115| 'peru'116| 'pink'117| 'plum'118| 'powderblue'119| 'purple'120| 'rebeccapurple'121| 'red'122| 'rosybrown'123| 'royalblue'124| 'saddlebrown'125| 'salmon'126| 'sandybrown'127| 'seagreen'128| 'seashell'129| 'sienna'130| 'silver'131| 'skyblue'132| 'slateblue'133| 'slategray'134| 'slategrey'135| 'snow'136| 'springgreen'137| 'steelblue'138| 'tan'139| 'teal'140| 'thistle'141| 'tomato'142| 'turquoise'143| 'violet'144| 'wheat'145| 'white'146| 'whitesmoke'147| 'yellow'148| 'yellowgreen';149150declare namespace ansiStyles {151interface ColorConvert {152/**153The RGB color space.154155@param red - (`0`-`255`)156@param green - (`0`-`255`)157@param blue - (`0`-`255`)158*/159rgb(red: number, green: number, blue: number): string;160161/**162The RGB HEX color space.163164@param hex - A hexadecimal string containing RGB data.165*/166hex(hex: string): string;167168/**169@param keyword - A CSS color name.170*/171keyword(keyword: CSSColor): string;172173/**174The HSL color space.175176@param hue - (`0`-`360`)177@param saturation - (`0`-`100`)178@param lightness - (`0`-`100`)179*/180hsl(hue: number, saturation: number, lightness: number): string;181182/**183The HSV color space.184185@param hue - (`0`-`360`)186@param saturation - (`0`-`100`)187@param value - (`0`-`100`)188*/189hsv(hue: number, saturation: number, value: number): string;190191/**192The HSV color space.193194@param hue - (`0`-`360`)195@param whiteness - (`0`-`100`)196@param blackness - (`0`-`100`)197*/198hwb(hue: number, whiteness: number, blackness: number): string;199200/**201Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color.202*/203ansi(ansi: number): string;204205/**206Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color.207*/208ansi256(ansi: number): string;209}210211interface CSPair {212/**213The ANSI terminal control sequence for starting this style.214*/215readonly open: string;216217/**218The ANSI terminal control sequence for ending this style.219*/220readonly close: string;221}222223interface ColorBase {224readonly ansi: ColorConvert;225readonly ansi256: ColorConvert;226readonly ansi16m: ColorConvert;227228/**229The ANSI terminal control sequence for ending this color.230*/231readonly close: string;232}233234interface Modifier {235/**236Resets the current color chain.237*/238readonly reset: CSPair;239240/**241Make text bold.242*/243readonly bold: CSPair;244245/**246Emitting only a small amount of light.247*/248readonly dim: CSPair;249250/**251Make text italic. (Not widely supported)252*/253readonly italic: CSPair;254255/**256Make text underline. (Not widely supported)257*/258readonly underline: CSPair;259260/**261Inverse background and foreground colors.262*/263readonly inverse: CSPair;264265/**266Prints the text, but makes it invisible.267*/268readonly hidden: CSPair;269270/**271Puts a horizontal line through the center of the text. (Not widely supported)272*/273readonly strikethrough: CSPair;274}275276interface ForegroundColor {277readonly black: CSPair;278readonly red: CSPair;279readonly green: CSPair;280readonly yellow: CSPair;281readonly blue: CSPair;282readonly cyan: CSPair;283readonly magenta: CSPair;284readonly white: CSPair;285286/**287Alias for `blackBright`.288*/289readonly gray: CSPair;290291/**292Alias for `blackBright`.293*/294readonly grey: CSPair;295296readonly blackBright: CSPair;297readonly redBright: CSPair;298readonly greenBright: CSPair;299readonly yellowBright: CSPair;300readonly blueBright: CSPair;301readonly cyanBright: CSPair;302readonly magentaBright: CSPair;303readonly whiteBright: CSPair;304}305306interface BackgroundColor {307readonly bgBlack: CSPair;308readonly bgRed: CSPair;309readonly bgGreen: CSPair;310readonly bgYellow: CSPair;311readonly bgBlue: CSPair;312readonly bgCyan: CSPair;313readonly bgMagenta: CSPair;314readonly bgWhite: CSPair;315316/**317Alias for `bgBlackBright`.318*/319readonly bgGray: CSPair;320321/**322Alias for `bgBlackBright`.323*/324readonly bgGrey: CSPair;325326readonly bgBlackBright: CSPair;327readonly bgRedBright: CSPair;328readonly bgGreenBright: CSPair;329readonly bgYellowBright: CSPair;330readonly bgBlueBright: CSPair;331readonly bgCyanBright: CSPair;332readonly bgMagentaBright: CSPair;333readonly bgWhiteBright: CSPair;334}335}336337declare const ansiStyles: {338readonly modifier: ansiStyles.Modifier;339readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase;340readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase;341readonly codes: ReadonlyMap<number, number>;342} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier;343344export = ansiStyles;345346347