Enforce chalk.constructor to be called with new in TypeScript
This commit is contained in:
parent
cf6615647a
commit
1284415013
2 changed files with 0 additions and 7 deletions
5
index.d.ts
vendored
5
index.d.ts
vendored
|
|
@ -40,11 +40,6 @@ export interface Constructor {
|
||||||
* Return a new Chalk instance.
|
* Return a new Chalk instance.
|
||||||
*/
|
*/
|
||||||
new (options?: Options): Chalk;
|
new (options?: Options): Chalk;
|
||||||
|
|
||||||
/**
|
|
||||||
* Return a new Chalk instance.
|
|
||||||
*/
|
|
||||||
(options?: Options): Chalk;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,6 @@ expectType<boolean>(chalk.supportsColor.has16m);
|
||||||
|
|
||||||
// - Chalk -
|
// - Chalk -
|
||||||
// -- Constructor --
|
// -- Constructor --
|
||||||
expectType<Chalk>(chalk.constructor());
|
|
||||||
expectType<Chalk>(chalk.constructor());
|
|
||||||
expectType<Chalk>(new chalk.constructor({level: 1}));
|
expectType<Chalk>(new chalk.constructor({level: 1}));
|
||||||
|
|
||||||
// -- Properties --
|
// -- Properties --
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue