Update index.d.ts

This commit is contained in:
Sindre Sorhus 2019-05-11 15:02:10 +07:00 committed by GitHub
parent bacd8e3960
commit 7d29a15a04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

10
index.d.ts vendored
View file

@ -77,11 +77,13 @@ declare namespace chalk {
@remarks Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341)) @remarks Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341))
@example @example
```
log(chalk` log(chalk`
CPU: {red ${cpu.totalPercent}%} CPU: {red ${cpu.totalPercent}%}
RAM: {green ${ram.used / ram.total * 100}%} RAM: {green ${ram.used / ram.total * 100}%}
DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}
`); `);
```
*/ */
(text: TemplateStringsArray, ...placeholders: unknown[]): string; (text: TemplateStringsArray, ...placeholders: unknown[]): string;
@ -113,9 +115,11 @@ declare namespace chalk {
@param color - Hexadecimal value representing the desired color. @param color - Hexadecimal value representing the desired color.
@example @example
```
import chalk = require('chalk'); import chalk = require('chalk');
chalk.hex('#DEADED'); chalk.hex('#DEADED');
```
*/ */
hex(color: string): Chalk; hex(color: string): Chalk;
@ -125,9 +129,11 @@ declare namespace chalk {
@param color - Keyword value representing the desired color. @param color - Keyword value representing the desired color.
@example @example
```
import chalk = require('chalk'); import chalk = require('chalk');
chalk.keyword('orange'); chalk.keyword('orange');
```
*/ */
keyword(color: string): Chalk; keyword(color: string): Chalk;
@ -157,9 +163,11 @@ declare namespace chalk {
@param color - Hexadecimal value representing the desired color. @param color - Hexadecimal value representing the desired color.
@example @example
```
import chalk = require('chalk'); import chalk = require('chalk');
chalk.bgHex('#DEADED'); chalk.bgHex('#DEADED');
```
*/ */
bgHex(color: string): Chalk; bgHex(color: string): Chalk;
@ -169,9 +177,11 @@ declare namespace chalk {
@param color - Keyword value representing the desired color. @param color - Keyword value representing the desired color.
@example @example
```
import chalk = require('chalk'); import chalk = require('chalk');
chalk.bgKeyword('orange'); chalk.bgKeyword('orange');
```
*/ */
bgKeyword(color: string): Chalk; bgKeyword(color: string): Chalk;