mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add supports-color typings
This commit is contained in:
parent
4c4aeebb1e
commit
fbd681b0b8
15
supports-color/index.d.ts
vendored
Normal file
15
supports-color/index.d.ts
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
// Type definitions for supports-color 3.1.2
|
||||
// Project: https://github.com/chalk/supports-color
|
||||
// Definitions by: Melvin Groenhoff <https://github.com/mgroenhoff>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare interface SupportsColor {
|
||||
level: number;
|
||||
hasBasic: boolean;
|
||||
has256: boolean;
|
||||
has16m: boolean;
|
||||
}
|
||||
|
||||
declare const supportsColor: boolean & SupportsColor;
|
||||
|
||||
export = supportsColor;
|
||||
17
supports-color/supports-color-tests.ts
Normal file
17
supports-color/supports-color-tests.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import supportsColor = require("supports-color");
|
||||
|
||||
if (supportsColor) {
|
||||
// Terminal supports color
|
||||
}
|
||||
|
||||
if (supportsColor.hasBasic) {
|
||||
// Terminal supports color
|
||||
}
|
||||
|
||||
if (supportsColor.has256) {
|
||||
// Terminal supports 256 colors
|
||||
}
|
||||
|
||||
if (supportsColor.has16m) {
|
||||
// Terminal supports 16 million colors (truecolor)
|
||||
}
|
||||
19
supports-color/tsconfig.json
Normal file
19
supports-color/tsconfig.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"supports-color-tests.ts"
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user