Enforce chalk.constructor to be called with new in TypeScript

This commit is contained in:
Sindre Sorhus 2018-12-26 02:27:57 +01:00
parent cf6615647a
commit 1284415013
2 changed files with 0 additions and 7 deletions

5
index.d.ts vendored
View file

@ -40,11 +40,6 @@ export interface Constructor {
* Return a new Chalk instance.
*/
new (options?: Options): Chalk;
/**
* Return a new Chalk instance.
*/
(options?: Options): Chalk;
}
/**

View file

@ -17,8 +17,6 @@ expectType<boolean>(chalk.supportsColor.has16m);
// - Chalk -
// -- Constructor --
expectType<Chalk>(chalk.constructor());
expectType<Chalk>(chalk.constructor());
expectType<Chalk>(new chalk.constructor({level: 1}));
// -- Properties --