Remove support for tagged template literals (#524)
This commit is contained in:
parent
f478655c3c
commit
c987c61486
6 changed files with 8 additions and 442 deletions
31
source/index.d.ts
vendored
31
source/index.d.ts
vendored
|
|
@ -121,36 +121,9 @@ export interface ColorSupport {
|
|||
has16m: boolean;
|
||||
}
|
||||
|
||||
interface ChalkFunction {
|
||||
/**
|
||||
Use a template string.
|
||||
|
||||
@remarks Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341))
|
||||
|
||||
@example
|
||||
```
|
||||
import chalk from 'chalk';
|
||||
|
||||
log(chalk`
|
||||
CPU: {red ${cpu.totalPercent}%}
|
||||
RAM: {green ${ram.used / ram.total * 100}%}
|
||||
DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}
|
||||
`);
|
||||
```
|
||||
|
||||
@example
|
||||
```
|
||||
import chalk from 'chalk';
|
||||
|
||||
log(chalk.red.bgBlack`2 + 3 = {bold ${2 + 3}}`)
|
||||
```
|
||||
*/
|
||||
(text: TemplateStringsArray, ...placeholders: unknown[]): string;
|
||||
|
||||
export interface ChalkInstance {
|
||||
(...text: unknown[]): string;
|
||||
}
|
||||
|
||||
export interface ChalkInstance extends ChalkFunction {
|
||||
/**
|
||||
The color support for Chalk.
|
||||
|
||||
|
|
@ -358,7 +331,7 @@ Order doesn't matter, and later styles take precedent in case of a conflict.
|
|||
|
||||
This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.
|
||||
*/
|
||||
declare const chalk: ChalkInstance & ChalkFunction;
|
||||
declare const chalk: ChalkInstance;
|
||||
|
||||
export const supportsColor: ColorSupport | false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue