Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change tagged template literal argument type to accept unknown instead of just string #316

Merged
merged 4 commits into from Dec 28, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion types/index.d.ts
Expand Up @@ -27,7 +27,7 @@ export interface ColorSupport {

export interface Chalk {
(...text: string[]): string;
vanbujm marked this conversation as resolved.
Show resolved Hide resolved
(text: TemplateStringsArray, ...placeholders: string[]): string;
(text: TemplateStringsArray, ...placeholders: unknown[]): string;
constructor: ChalkConstructor;
enabled: boolean;
level: Level;
Expand Down
1 change: 1 addition & 0 deletions types/test.ts
Expand Up @@ -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;
Expand Down