Add missing false type to chalk.supportsColor
This commit is contained in:
parent
4ab4665994
commit
531e791e0d
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`.
|
||||
*/
|
||||
declare const chalk: chalk.Chalk & chalk.ChalkFunction & {
|
||||
supportsColor: chalk.ColorSupport;
|
||||
supportsColor: chalk.ColorSupport | false;
|
||||
Level: typeof LevelEnum;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -11,9 +11,10 @@ expectType<number>(chalk.Level.Ansi256);
|
|||
expectType<number>(chalk.Level.TrueColor);
|
||||
|
||||
// - supportsColor -
|
||||
expectType<boolean>(chalk.supportsColor.hasBasic);
|
||||
expectType<boolean>(chalk.supportsColor.has256);
|
||||
expectType<boolean>(chalk.supportsColor.has16m);
|
||||
expectType<chalk.ColorSupport | false>(chalk.supportsColor);
|
||||
expectType<boolean>((chalk.supportsColor as chalk.ColorSupport).hasBasic);
|
||||
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 --
|
||||
expectError(chalk.reset.supportsColor);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue