chalk 2.3.2 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js.flow +95 -0
- package/package.json +8 -3
- package/readme.md +5 -0
package/index.js.flow
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
|
|
3
|
+
type TemplateStringsArray = $ReadOnlyArray<string>;
|
|
4
|
+
|
|
5
|
+
export type Level = $Values<{
|
|
6
|
+
None: 0,
|
|
7
|
+
Basic: 1,
|
|
8
|
+
Ansi256: 2,
|
|
9
|
+
TrueColor: 3
|
|
10
|
+
}>;
|
|
11
|
+
|
|
12
|
+
export type ChalkOptions = {|
|
|
13
|
+
enabled?: boolean,
|
|
14
|
+
level?: Level
|
|
15
|
+
|};
|
|
16
|
+
|
|
17
|
+
export type ColorSupport = {|
|
|
18
|
+
level: Level,
|
|
19
|
+
hasBasic: boolean,
|
|
20
|
+
has256: boolean,
|
|
21
|
+
has16m: boolean
|
|
22
|
+
|};
|
|
23
|
+
|
|
24
|
+
export interface Chalk {
|
|
25
|
+
(...text: string[]): string,
|
|
26
|
+
(text: TemplateStringsArray, ...placeholders: string[]): string,
|
|
27
|
+
constructor(options?: ChalkOptions): Chalk,
|
|
28
|
+
enabled: boolean,
|
|
29
|
+
level: Level,
|
|
30
|
+
rgb(r: number, g: number, b: number): Chalk,
|
|
31
|
+
hsl(h: number, s: number, l: number): Chalk,
|
|
32
|
+
hsv(h: number, s: number, v: number): Chalk,
|
|
33
|
+
hwb(h: number, w: number, b: number): Chalk,
|
|
34
|
+
bgHex(color: string): Chalk,
|
|
35
|
+
bgKeyword(color: string): Chalk,
|
|
36
|
+
bgRgb(r: number, g: number, b: number): Chalk,
|
|
37
|
+
bgHsl(h: number, s: number, l: number): Chalk,
|
|
38
|
+
bgHsv(h: number, s: number, v: number): Chalk,
|
|
39
|
+
bgHwb(h: number, w: number, b: number): Chalk,
|
|
40
|
+
hex(color: string): Chalk,
|
|
41
|
+
keyword(color: string): Chalk,
|
|
42
|
+
|
|
43
|
+
+reset: Chalk,
|
|
44
|
+
+bold: Chalk,
|
|
45
|
+
+dim: Chalk,
|
|
46
|
+
+italic: Chalk,
|
|
47
|
+
+underline: Chalk,
|
|
48
|
+
+inverse: Chalk,
|
|
49
|
+
+hidden: Chalk,
|
|
50
|
+
+strikethrough: Chalk,
|
|
51
|
+
|
|
52
|
+
+visible: Chalk,
|
|
53
|
+
|
|
54
|
+
+black: Chalk,
|
|
55
|
+
+red: Chalk,
|
|
56
|
+
+green: Chalk,
|
|
57
|
+
+yellow: Chalk,
|
|
58
|
+
+blue: Chalk,
|
|
59
|
+
+magenta: Chalk,
|
|
60
|
+
+cyan: Chalk,
|
|
61
|
+
+white: Chalk,
|
|
62
|
+
+gray: Chalk,
|
|
63
|
+
+grey: Chalk,
|
|
64
|
+
+blackBright: Chalk,
|
|
65
|
+
+redBright: Chalk,
|
|
66
|
+
+greenBright: Chalk,
|
|
67
|
+
+yellowBright: Chalk,
|
|
68
|
+
+blueBright: Chalk,
|
|
69
|
+
+magentaBright: Chalk,
|
|
70
|
+
+cyanBright: Chalk,
|
|
71
|
+
+whiteBright: Chalk,
|
|
72
|
+
|
|
73
|
+
+bgBlack: Chalk,
|
|
74
|
+
+bgRed: Chalk,
|
|
75
|
+
+bgGreen: Chalk,
|
|
76
|
+
+bgYellow: Chalk,
|
|
77
|
+
+bgBlue: Chalk,
|
|
78
|
+
+bgMagenta: Chalk,
|
|
79
|
+
+bgCyan: Chalk,
|
|
80
|
+
+bgWhite: Chalk,
|
|
81
|
+
+bgBlackBright: Chalk,
|
|
82
|
+
+bgRedBright: Chalk,
|
|
83
|
+
+bgGreenBright: Chalk,
|
|
84
|
+
+bgYellowBright: Chalk,
|
|
85
|
+
+bgBlueBright: Chalk,
|
|
86
|
+
+bgMagentaBright: Chalk,
|
|
87
|
+
+bgCyanBright: Chalk,
|
|
88
|
+
+bgWhiteBrigh: Chalk,
|
|
89
|
+
|
|
90
|
+
supportsColor: ColorSupport
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
declare var chalk: Chalk;
|
|
94
|
+
|
|
95
|
+
export default chalk;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chalk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Terminal string styling done right",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "chalk/chalk",
|
|
@@ -8,14 +8,15 @@
|
|
|
8
8
|
"node": ">=4"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"test": "xo && tsc --project types && nyc ava",
|
|
11
|
+
"test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava",
|
|
12
12
|
"bench": "matcha benchmark.js",
|
|
13
13
|
"coveralls": "nyc report --reporter=text-lcov | coveralls"
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"index.js",
|
|
17
17
|
"templates.js",
|
|
18
|
-
"types/index.d.ts"
|
|
18
|
+
"types/index.d.ts",
|
|
19
|
+
"index.js.flow"
|
|
19
20
|
],
|
|
20
21
|
"keywords": [
|
|
21
22
|
"color",
|
|
@@ -49,6 +50,7 @@
|
|
|
49
50
|
"ava": "*",
|
|
50
51
|
"coveralls": "^3.0.0",
|
|
51
52
|
"execa": "^0.9.0",
|
|
53
|
+
"flow-bin": "^0.68.0",
|
|
52
54
|
"import-fresh": "^2.0.0",
|
|
53
55
|
"matcha": "^0.7.0",
|
|
54
56
|
"nyc": "^11.0.2",
|
|
@@ -61,6 +63,9 @@
|
|
|
61
63
|
"envs": [
|
|
62
64
|
"node",
|
|
63
65
|
"mocha"
|
|
66
|
+
],
|
|
67
|
+
"ignores": [
|
|
68
|
+
"test/_flow.js"
|
|
64
69
|
]
|
|
65
70
|
}
|
|
66
71
|
}
|
package/readme.md
CHANGED
|
@@ -35,6 +35,10 @@
|
|
|
35
35
|
$ npm install chalk
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
+
<a href="https://www.patreon.com/sindresorhus">
|
|
39
|
+
<img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="160">
|
|
40
|
+
</a>
|
|
41
|
+
|
|
38
42
|
|
|
39
43
|
## Usage
|
|
40
44
|
|
|
@@ -296,6 +300,7 @@ If you're on Windows, do yourself a favor and use [`cmder`](http://cmder.net/) i
|
|
|
296
300
|
- [chalk-animation](https://github.com/bokub/chalk-animation) - Animate strings in the terminal
|
|
297
301
|
- [gradient-string](https://github.com/bokub/gradient-string) - Apply color gradients to strings
|
|
298
302
|
- [chalk-pipe](https://github.com/LitoMore/chalk-pipe) - Create chalk style schemes with simpler style strings
|
|
303
|
+
- [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal
|
|
299
304
|
|
|
300
305
|
|
|
301
306
|
## Maintainers
|