Add missing false type to chalk.supportsColor (#347)
This commit is contained in:
parent
4ab4665994
commit
d82b2a6638
2 changed files with 5 additions and 4 deletions
2
index.d.ts
vendored
2
index.d.ts
vendored
|
|
@ -296,7 +296,7 @@ Order doesn't matter, and later styles take precedent in case of a conflict.
|
||||||
This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.
|
This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.
|
||||||
*/
|
*/
|
||||||
declare const chalk: chalk.Chalk & chalk.ChalkFunction & {
|
declare const chalk: chalk.Chalk & chalk.ChalkFunction & {
|
||||||
supportsColor: chalk.ColorSupport;
|
supportsColor: chalk.ColorSupport | false;
|
||||||
Level: typeof LevelEnum;
|
Level: typeof LevelEnum;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,10 @@ expectType<number>(chalk.Level.Ansi256);
|
||||||
expectType<number>(chalk.Level.TrueColor);
|
expectType<number>(chalk.Level.TrueColor);
|
||||||
|
|
||||||
// - supportsColor -
|
// - supportsColor -
|
||||||
expectType<boolean>(chalk.supportsColor.hasBasic);
|
expectType<chalk.ColorSupport | false>(chalk.supportsColor);
|
||||||
expectType<boolean>(chalk.supportsColor.has256);
|
expectType<boolean>((chalk.supportsColor as chalk.ColorSupport).hasBasic);
|
||||||
expectType<boolean>(chalk.supportsColor.has16m);
|
expectType<boolean>((chalk.supportsColor as chalk.ColorSupport).has256);
|
||||||
|
expectType<boolean>((chalk.supportsColor as chalk.ColorSupport).has16m);
|
||||||
|
|
||||||
// -- `supportsColor` is not a member of the Chalk interface --
|
// -- `supportsColor` is not a member of the Chalk interface --
|
||||||
expectError(chalk.reset.supportsColor);
|
expectError(chalk.reset.supportsColor);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue