From 9876bb3445af51432d93b092f19fda469371362b Mon Sep 17 00:00:00 2001 From: nicojs Date: Sun, 21 Feb 2016 23:20:43 +0100 Subject: [PATCH 1/2] Made Chalk interfaces public and fixed wrong return type of ChalkChain --- chalk/chalk-tests.ts | 7 ++ chalk/chalk.d.ts | 177 +++++++++++++++++++++++++------------------ 2 files changed, 110 insertions(+), 74 deletions(-) diff --git a/chalk/chalk-tests.ts b/chalk/chalk-tests.ts index 208709e5b1..e159d34765 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 ede2947754..387ab3f5c4 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 Date: Mon, 22 Feb 2016 07:51:44 +0100 Subject: [PATCH 2/2] Fixed parse issue in the author names --- chalk/chalk.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chalk/chalk.d.ts b/chalk/chalk.d.ts index 387ab3f5c4..3a00a5c939 100644 --- a/chalk/chalk.d.ts +++ b/chalk/chalk.d.ts @@ -1,6 +1,6 @@ // Type definitions for chalk v0.4.0 // Project: https://github.com/sindresorhus/chalk -// Definitions by: Diullei Gomes , Bart van der Schoor , Nico Jansen , Bart van der Schoor , Nico Jansen // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module Chalk {