Changed tagged template literal argument type to unknown

This commit is contained in:
Jonathan Van Buren 2018-12-23 11:25:37 +08:00
parent 70bb378e8e
commit eac645be4f
No known key found for this signature in database
GPG key ID: FADD50A7C254E12A
2 changed files with 2 additions and 1 deletions

2
types/index.d.ts vendored
View file

@ -27,7 +27,7 @@ export interface ColorSupport {
export interface Chalk {
(...text: string[]): string;
(text: TemplateStringsArray, ...placeholders: string[]): string;
(text: TemplateStringsArray, ...placeholders: unknown[]): string;
constructor: ChalkConstructor;
enabled: boolean;
level: Level;

View file

@ -21,6 +21,7 @@ const ctx = chalk.constructor({level: Level.TrueColor });
ctx('foo');
ctx.red('foo');
ctx`foo`;
ctx`works with numbers ${1}`;
chalk.enabled = true;
chalk.level = 1;