Use CommonJS-compatible export in TypeScript definition (#344)
This commit is contained in:
parent
7b9211be50
commit
98628d9f08
5 changed files with 284 additions and 274 deletions
|
|
@ -1,14 +1,14 @@
|
|||
import {expectType} from 'tsd-check';
|
||||
import chalk, {Level, Chalk, ColorSupport} from '.';
|
||||
import {expectType} from 'tsd';
|
||||
import chalk = require('.');
|
||||
|
||||
// - Helpers -
|
||||
type colorReturn = Chalk & {supportsColor: ColorSupport};
|
||||
type colorReturn = chalk.Chalk & {supportsColor: chalk.ColorSupport};
|
||||
|
||||
// - Level -
|
||||
expectType<number>(Level.None);
|
||||
expectType<number>(Level.Basic);
|
||||
expectType<number>(Level.Ansi256);
|
||||
expectType<number>(Level.TrueColor);
|
||||
expectType<number>(chalk.Level.None);
|
||||
expectType<number>(chalk.Level.Basic);
|
||||
expectType<number>(chalk.Level.Ansi256);
|
||||
expectType<number>(chalk.Level.TrueColor);
|
||||
|
||||
// - supportsColor -
|
||||
expectType<boolean>(chalk.supportsColor.hasBasic);
|
||||
|
|
@ -17,11 +17,11 @@ expectType<boolean>(chalk.supportsColor.has16m);
|
|||
|
||||
// - Chalk -
|
||||
// -- Instance --
|
||||
expectType<Chalk>(new chalk.Instance({level: 1}));
|
||||
expectType<chalk.Chalk>(new chalk.Instance({level: 1}));
|
||||
|
||||
// -- Properties --
|
||||
expectType<boolean>(chalk.enabled);
|
||||
expectType<Level>(chalk.level);
|
||||
expectType<chalk.Level>(chalk.level);
|
||||
|
||||
// -- Template literal --
|
||||
expectType<string>(chalk``);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue