Export styles from ansi-styles (#567)
This commit is contained in:
parent
92c55db46f
commit
6e0df055f4
6 changed files with 219 additions and 115 deletions
|
|
@ -1,5 +1,9 @@
|
|||
import {expectType, expectAssignable, expectError} from 'tsd';
|
||||
import chalk, {Chalk, ChalkInstance, Color, ColorInfo, ColorSupport, ColorSupportLevel, chalkStderr, supportsColor, supportsColorStderr} from './index.js';
|
||||
import {expectType, expectAssignable, expectError, expectDeprecated} from 'tsd';
|
||||
import chalk, {
|
||||
Chalk, ChalkInstance, ColorInfo, ColorSupport, ColorSupportLevel, chalkStderr, supportsColor, supportsColorStderr,
|
||||
ModifierName, ForegroundColorName, BackgroundColorName, ColorName,
|
||||
Modifiers,
|
||||
} from './index.js';
|
||||
|
||||
// - supportsColor -
|
||||
expectType<ColorInfo>(supportsColor);
|
||||
|
|
@ -141,6 +145,20 @@ expectType<string>(chalk.underline``);
|
|||
expectType<string>(chalk.red.bgGreen.bold`Hello {italic.blue ${name}}`);
|
||||
expectType<string>(chalk.strikethrough.cyanBright.bgBlack`Works with {reset {bold numbers}} {bold.red ${1}}`);
|
||||
|
||||
// -- Color types ==
|
||||
expectAssignable<Color>('red');
|
||||
expectError<Color>('hotpink');
|
||||
// -- Modifiers types
|
||||
expectAssignable<ModifierName>('strikethrough');
|
||||
expectError<ModifierName>('delete');
|
||||
|
||||
// -- Foreground types
|
||||
expectAssignable<ForegroundColorName>('red');
|
||||
expectError<ForegroundColorName>('pink');
|
||||
|
||||
// -- Background types
|
||||
expectAssignable<BackgroundColorName>('bgRed');
|
||||
expectError<BackgroundColorName>('bgPink');
|
||||
|
||||
// -- Color types --
|
||||
expectAssignable<ColorName>('red');
|
||||
expectAssignable<ColorName>('bgRed');
|
||||
expectError<ColorName>('hotpink');
|
||||
expectError<ColorName>('bgHotpink');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue