diff --git a/chalk/chalk-tests.ts b/chalk/chalk-tests.ts index 208709e5b..e159d3476 100644 --- a/chalk/chalk-tests.ts +++ b/chalk/chalk-tests.ts @@ -4,6 +4,7 @@ import chalk = require('chalk'); var str: string; var bool: boolean; +var chain: chalk.ChalkChain; chalk.enabled = bool; str = chalk.stripColor(str); @@ -28,3 +29,9 @@ console.log( chalk.red('Hello', chalk.underline.bgBlue('world') + '!') ); // nest styles of the same type even (color, underline, background) console.log( chalk.green('I am a green line ' + chalk.blue('with a blue substring') + ' that becomes green again!') ); + +chain = chalk.green; +chain = chain.underline; +str = chain('someString'); + +chalk.enabled = chalk.supportsColor = bool; diff --git a/chalk/chalk.d.ts b/chalk/chalk.d.ts index ede294775..387ab3f5c 100644 --- a/chalk/chalk.d.ts +++ b/chalk/chalk.d.ts @@ -1,93 +1,122 @@ // Type definitions for chalk v0.4.0 // Project: https://github.com/sindresorhus/chalk -// Definitions by: Diullei Gomes , Bart van der Schoor +// Definitions by: Diullei Gomes , Bart van der Schoor , Nico Jansen