Skip to content

Commit 91ea36b

Browse files
vzaidmanfacebook-github-bot
authored andcommitted
fix type on the flow types for "chalk"
Summary: X-link: facebook/react-native#49814 `bgWhiteBrigh + t = bgWhiteBright` seems like no one was using `chalk.bgWhiteBright` before me :) Changelog: [General][Internal] fix type on the flow types for "chalk" Reviewed By: huntie, hoxyq Differential Revision: D70403987 fbshipit-source-id: 34f65e57fbb2eeadd6030557e0499db0b2603b38
1 parent c890ad5 commit 91ea36b

File tree

1 file changed

+127
-4
lines changed

1 file changed

+127
-4
lines changed

packages/flow-dev-tools/flow-typed/npm/chalk_v4.x.x.js

Lines changed: 127 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,62 @@
1-
// flow-typed signature: 5096c316b7092ffc5ddc487d26c0d6a4
2-
// flow-typed version: f2e3dcf9e8/chalk_v4.x.x/flow_>=v0.104.x
1+
// flow-typed signature: 79cfa6bcaa67fdb60f10d320da0470fc
2+
// flow-typed version: 6cecea2e51/chalk_v4.x.x/flow_>=v0.104.x
33

44
// From: https://github.com/chalk/chalk/blob/master/index.d.ts
55

66
declare module "chalk" {
7+
declare type ForegroundColor =
8+
| 'black'
9+
| 'red'
10+
| 'green'
11+
| 'yellow'
12+
| 'blue'
13+
| 'magenta'
14+
| 'cyan'
15+
| 'white'
16+
| 'gray'
17+
| 'grey'
18+
| 'blackBright'
19+
| 'redBright'
20+
| 'greenBright'
21+
| 'yellowBright'
22+
| 'blueBright'
23+
| 'magentaBright'
24+
| 'cyanBright'
25+
| 'whiteBright';
26+
27+
declare type BackgroundColor =
28+
| 'bgBlack'
29+
| 'bgRed'
30+
| 'bgGreen'
31+
| 'bgYellow'
32+
| 'bgBlue'
33+
| 'bgMagenta'
34+
| 'bgCyan'
35+
| 'bgWhite'
36+
| 'bgGray'
37+
| 'bgGrey'
38+
| 'bgBlackBright'
39+
| 'bgRedBright'
40+
| 'bgGreenBright'
41+
| 'bgYellowBright'
42+
| 'bgBlueBright'
43+
| 'bgMagentaBright'
44+
| 'bgCyanBright'
45+
| 'bgWhiteBright';
46+
47+
declare type Color = ForegroundColor | BackgroundColor;
48+
49+
declare type Modifiers =
50+
| 'reset'
51+
| 'bold'
52+
| 'dim'
53+
| 'italic'
54+
| 'underline'
55+
| 'inverse'
56+
| 'hidden'
57+
| 'strikethrough'
58+
| 'visible';
59+
760
declare type TemplateStringsArray = $ReadOnlyArray<string>;
861

962
declare type Level = $Values<{
@@ -25,10 +78,80 @@ declare module "chalk" {
2578
has16m: boolean
2679
|};
2780

81+
declare class Instance implements Chalk {
82+
constructor(options?: ChalkOptions): this;
83+
84+
(...text: string[]): string,
85+
(text: TemplateStringsArray, ...placeholders: string[]): string,
86+
Instance: typeof Instance,
87+
level: Level,
88+
rgb(r: number, g: number, b: number): Chalk,
89+
hsl(h: number, s: number, l: number): Chalk,
90+
hsv(h: number, s: number, v: number): Chalk,
91+
hwb(h: number, w: number, b: number): Chalk,
92+
bgHex(color: string): Chalk,
93+
bgKeyword(color: string): Chalk,
94+
bgRgb(r: number, g: number, b: number): Chalk,
95+
bgHsl(h: number, s: number, l: number): Chalk,
96+
bgHsv(h: number, s: number, v: number): Chalk,
97+
bgHwb(h: number, w: number, b: number): Chalk,
98+
hex(color: string): Chalk,
99+
keyword(color: string): Chalk,
100+
101+
+reset: Chalk,
102+
+bold: Chalk,
103+
+dim: Chalk,
104+
+italic: Chalk,
105+
+underline: Chalk,
106+
+inverse: Chalk,
107+
+hidden: Chalk,
108+
+strikethrough: Chalk,
109+
110+
+visible: Chalk,
111+
112+
+black: Chalk,
113+
+red: Chalk,
114+
+green: Chalk,
115+
+yellow: Chalk,
116+
+blue: Chalk,
117+
+magenta: Chalk,
118+
+cyan: Chalk,
119+
+white: Chalk,
120+
+gray: Chalk,
121+
+grey: Chalk,
122+
+blackBright: Chalk,
123+
+redBright: Chalk,
124+
+greenBright: Chalk,
125+
+yellowBright: Chalk,
126+
+blueBright: Chalk,
127+
+magentaBright: Chalk,
128+
+cyanBright: Chalk,
129+
+whiteBright: Chalk,
130+
131+
+bgBlack: Chalk,
132+
+bgRed: Chalk,
133+
+bgGreen: Chalk,
134+
+bgYellow: Chalk,
135+
+bgBlue: Chalk,
136+
+bgMagenta: Chalk,
137+
+bgCyan: Chalk,
138+
+bgWhite: Chalk,
139+
+bgBlackBright: Chalk,
140+
+bgRedBright: Chalk,
141+
+bgGreenBright: Chalk,
142+
+bgYellowBright: Chalk,
143+
+bgBlueBright: Chalk,
144+
+bgMagentaBright: Chalk,
145+
+bgCyanBright: Chalk,
146+
+bgWhiteBright: Chalk,
147+
148+
supportsColor: ColorSupport
149+
}
150+
28151
declare interface Chalk {
29152
(...text: string[]): string,
30153
(text: TemplateStringsArray, ...placeholders: string[]): string,
31-
Instance(options?: ChalkOptions): Chalk,
154+
Instance: typeof Instance,
32155
level: Level,
33156
rgb(r: number, g: number, b: number): Chalk,
34157
hsl(h: number, s: number, l: number): Chalk,
@@ -88,7 +211,7 @@ declare module "chalk" {
88211
+bgBlueBright: Chalk,
89212
+bgMagentaBright: Chalk,
90213
+bgCyanBright: Chalk,
91-
+bgWhiteBrigh: Chalk,
214+
+bgWhiteBright: Chalk,
92215

93216
supportsColor: ColorSupport
94217
}

0 commit comments

Comments
 (0)