Compare commits

..

28 Commits

Author SHA1 Message Date
ac9305c480 1.0.4 2016-02-12 05:41:06 +01:00
a51419f2b0 add npmts.json 2016-02-12 05:41:02 +01:00
4b02d17d6d 1.0.3 2016-02-12 05:36:31 +01:00
57350d6fee add better tests and coverage 2016-02-12 05:36:23 +01:00
dcdf0059cc 1.0.2 2016-02-02 15:21:45 +01:00
9cc9e15b04 update deps 2016-02-02 15:21:27 +01:00
6a19698617 1.0.1 2016-02-01 03:45:38 +01:00
bc53520869 update travis 2016-02-01 03:45:13 +01:00
752dec8fea update npmts 2016-02-01 03:43:29 +01:00
ffc12d3fd5 1.0.0 2016-02-01 03:40:45 +01:00
0c0f0b78e1 update keywords 2016-02-01 03:40:30 +01:00
3d01801df6 0.0.12 2016-02-01 03:35:23 +01:00
5355fd4e83 update package.json 2016-02-01 03:35:09 +01:00
27a97c1bde cleanup 2016-02-01 03:33:33 +01:00
c1f1500ffc 0.0.10 2015-11-30 09:49:58 +01:00
e42c5004c2 updated structure 2015-11-30 09:49:52 +01:00
e0c4a10411 0.0.9 2015-11-24 13:51:07 +01:00
6deab0541f update deps 2015-11-24 13:49:02 +01:00
22e3dc6136 0.0.8 2015-11-24 13:44:38 +01:00
e69e8df875 fix:added callback to function() atEnd 2015-11-24 13:44:32 +01:00
4cb24a4a6d add dev dependency badge 2015-10-26 16:25:08 +01:00
ebac042791 0.0.7 2015-10-26 16:22:29 +01:00
d8fc992ba3 0.0.6 2015-10-26 16:21:33 +01:00
82def89388 0.0.5 2015-10-26 16:20:49 +01:00
4b832bbf95 added automatic version release through travis for npm 2015-10-26 16:20:41 +01:00
cf8182b86a 0.0.4 2015-10-26 16:18:52 +01:00
c708f964ec added test 2015-10-26 16:18:37 +01:00
f9c4fb9887 small fix 2015-10-25 22:46:22 +01:00
23 changed files with 189 additions and 2352 deletions

4
.gitignore vendored
View File

@ -1,6 +1,10 @@
node_modules/ node_modules/
.settings/ .settings/
.idea/ .idea/
coverage/
ts/*.js ts/*.js
ts/*.js.map ts/*.js.map
ts/typings/
test/result/

3
.npmignore Normal file
View File

@ -0,0 +1,3 @@
ts/
test/
node_modules/

View File

@ -1,19 +1,14 @@
language: node_js language: node_js
before_install: node_js:
- nvm install stable - 4.2.4
- node -v
- npm -v
- npm install -g gulp
- npm install gulp
- npm install gulp-typescript
deploy: deploy:
provider: npm provider: npm
email: npm@smart-coordination.com email: npm@lossless.digital
api_key: api_key:
secure: AcM6ooFjEIaWOC84QMxxugV3GtkMEoMI6zxy4oB9u9xihLopVZnm6c8FxIr+Wl2Ykjwj2deOuC7Q7QLtfH8/n4cVj1x7c32DJ21XJsE6uGm2opT7bSMm/NgcIvbkzWdPSyG8OpJEu8l///+YTceLdLV2Tn4lPobZRgu0KIF3Pg0Fo2V/0kSH/gSjlbLBgMBx1QrO2y52VHMdqWs3VwMIv1lEEicUsbnBg1z03I/Ka+JZQPCDYGgHu7y62zgB36mdkNVg8pyvGrrTSWeMVyHc8SSvBoqszVUeXfs4d4tcw0+vPsIJD5hDzAGOtH+3KO2Bgi87UB/Dgd5xw92+zQxhKnKewFiyTvANFXoag5UooPupWKhu5DljZ27CkgLX/N/AF6eTuQR0ffW92Bvz2YWis5JC75+HGFV2tBI7hRinScc00J0vOAqqVpp81PD6BXQDX2y5y77arArJVQTC5irOYL20x3UMBB7fOpTkYV9T2NxzR6OBv4P6MLWPbnmFr+zpjkzBxHeJMOosb+9W6TAbVmouM5SfnFU5bBYh2gF52Yz2FnfpDzclVZW/OI0YcAtIdozbHRcJ1s6pVkPqZIqKcCM+jVhzvt8NTnehSOqjFyIV9rcbsYQplLs8b9ntmcuRLCPatXMGFQM/y9Sjw4is0gHhRMjxQo32bfIiX1CTqVo= secure: TWN/oiICeNbAhGTbwf75FnKhXnIvyA66FhNF7C0jpjn2SChSgTANai87r0f9oU9ZP3307XdGHB+fTTCJnk3upNiBoWZnkV8skkAlseOY4mVzF9mS0ZEkxVR32FjJDWfqzv6hC+Y9qNDsGs2+Avsm6fQUOispLXYAk6VzSQC1HgIfyOJtIWT5LqEyXyT6oJIZ7xwt1CYcIeEpHUiAaPYsMEpwF5OBDFByVmNV38VdRGIBsoQd3lixso7/zOOgYvjR4b/onz5WzeWYlhzAuyzOnRGr1r/9eXAzzkYydvgFx3ix5OlrreKVFB6OtMpz4jmHdu9YDGT5bcvL2bSU2SGVQM5Bx8zZXkAxACQR8ZvWmPaWYAWCu9wrW5oovjqFUV0iR26z/sTABJqz4GaXf/vFcll2EdTfUT6xj2kCodfxljaudjPUF27FSt1UJBC7jQky08wHb6+onrE8WoQXteIE2oxtHWEGOlV/GAz0+q4ih0bdOSKfThmux0iEFmeF16sWH9UdL2jBBKuus+fBPdhA3V6uwYQtsCAurhquQLISkf7kT3KujdLS302bEbkut+D1Kd22IYA1J0wYd87th88TZHx7wgQyC+8lVHG+B1R20xGLxyHVEOfyZtChfBRdn53EcUiA2XriJbfiIym4dAMUtOg2iRJamHAL7jebQEUu7oA=
on: on:
tags: true tags: true
repo: pushrocks/gulp-callfunction repo: pushrocks/gulp-function
notifications: notifications:
slack: slack:
secure: Bb8P3fboL52CugSsp0RhOkGCeWVbgjb+QDpnMHdSOa0Nequj8V4kvrzBLZOBOjaSB0/gMvdoB4Slv2bls1dAxXW1IX1DdRb3RLMKj/Owje7eTd4IoUuSs49y6/yEkVK+E1wicdwjlMmvsk8fQE/owDRMRXYoXxhN2ZOVSQvAQ3iBO0eokFvWO7yj/VSxKoITymCXA3LfyzXXUuhvxuQd3BPZCe25xa6GWuHtaa5fbJg17pp8jJX6VZYLSRcSYyJxMU8SLdkrOsQZKj0+/Yfpu7XTmPbqxjNapuE7Zm70mi+aB26IQCnmwkdcEQNJVxQOKoP2+/ZnDfcTLQROwH1PJVzol0hneH6DdOlWt9bvBJcUvFRwaDgIb5xXQV8bGsRe5ayE/4MgCgfvdBTvevu6n12fmPx74prIv4pOPMwlALjjP8XavGL4A6amOuV7fJiSyGAku8aUe1rlUXyfoHJswMyOfkIsvnGDE3eEfq1WUIjn8tW1ZozJyoCTAIh6IHPI3Nsg3LkTRvDHPYq25/xCKWxGb2OaJc3JeqVREqm0auDqj6HoVAi/mW/uyvwX9jEVX8fNoQ69ac5VUMFfn2Mx3sU6aHKgZe/tdrtql6NYtIA+g5/ZDnHE1mnbl6MfrYiKwRbrICH5v/u1xK+4+yh09BUqazi3PzOhyTRfba/gRUg= secure: Bb8P3fboL52CugSsp0RhOkGCeWVbgjb+QDpnMHdSOa0Nequj8V4kvrzBLZOBOjaSB0/gMvdoB4Slv2bls1dAxXW1IX1DdRb3RLMKj/Owje7eTd4IoUuSs49y6/yEkVK+E1wicdwjlMmvsk8fQE/owDRMRXYoXxhN2ZOVSQvAQ3iBO0eokFvWO7yj/VSxKoITymCXA3LfyzXXUuhvxuQd3BPZCe25xa6GWuHtaa5fbJg17pp8jJX6VZYLSRcSYyJxMU8SLdkrOsQZKj0+/Yfpu7XTmPbqxjNapuE7Zm70mi+aB26IQCnmwkdcEQNJVxQOKoP2+/ZnDfcTLQROwH1PJVzol0hneH6DdOlWt9bvBJcUvFRwaDgIb5xXQV8bGsRe5ayE/4MgCgfvdBTvevu6n12fmPx74prIv4pOPMwlALjjP8XavGL4A6amOuV7fJiSyGAku8aUe1rlUXyfoHJswMyOfkIsvnGDE3eEfq1WUIjn8tW1ZozJyoCTAIh6IHPI3Nsg3LkTRvDHPYq25/xCKWxGb2OaJc3JeqVREqm0auDqj6HoVAi/mW/uyvwX9jEVX8fNoQ69ac5VUMFfn2Mx3sU6aHKgZe/tdrtql6NYtIA+g5/ZDnHE1mnbl6MfrYiKwRbrICH5v/u1xK+4+yh09BUqazi3PzOhyTRfba/gRUg=

View File

@ -1,14 +1,17 @@
# gulp-callfunction # gulp-function
accepts call to execute in gulp pipeline. accepts call to execute in gulp pipeline.
### build status/Dependencies ### Status
[![Build Status](https://travis-ci.org/pushrocks/gulp-callfunction.svg?branch=v0.0.2)](https://travis-ci.org/pushrocks/gulp-callfunction) [![Build Status](https://travis-ci.org/pushrocks/gulp-function.svg?branch=v0.0.2)](https://travis-ci.org/pushrocks/gulp-function)
[![Dependency Status](https://david-dm.org/pushrocks/gulp-callfunction.svg)](https://david-dm.org/pushrocks/gulp-callfunction) [![Dependency Status](https://david-dm.org/pushrocks/gulp-function.svg)](https://david-dm.org/pushrocks/gulp-function)
[![devDependency Status](https://david-dm.org/pushrocks/gulp-function/dev-status.svg)](https://david-dm.org/pushrocks/gulp-function#info=devDependencies)
[![bitHound Code](https://www.bithound.io/github/pushrocks/gulp-function/badges/code.svg)](https://www.bithound.io/github/pushrocks/gulp-function)
[![Coverage Status](https://coveralls.io/repos/github/pushrocks/gulp-function/badge.svg?branch=master)](https://coveralls.io/github/pushrocks/gulp-function?branch=master)
### Usage ### Usage
```javascript ```javascript
var gulp = require("gulp"); var gulp = require("gulp");
var gulpCallFunction = require("gulp-callfunction"); var gulpFunction = require("gulp-function");
var myFunction = function () { var myFunction = function () {
console.log("Hello World!") console.log("Hello World!")
@ -16,10 +19,10 @@ var myFunction = function () {
gulp.task('gulpTest',function() { gulp.task('gulpTest',function() {
gulp.src('./mydir/*.something') gulp.src('./mydir/*.something')
.pipe(gulpCallFunction(myFunction,'forEach')) .pipe(gulpFunction(myFunction,'forEach')) //read the notes below
.pipe(gulp.dest(./build/)) .pipe(gulp.dest("./build/"))
}); });
``` ```
>Note: The first argument of gulpCallFunction can also be an array of multiple functionnames. >Note: The first argument of gulpFunction can also be an array of multiple functionnames.
>Note: the second argument can be empty (defaults to 'forEach') or 'atEnd' >Note: the second argument can be empty (defaults to 'forEach') or 'atEnd'

4
index.d.ts vendored Normal file
View File

@ -0,0 +1,4 @@
/// <reference path="ts/typings/main.d.ts" />
declare var through: any;
declare var path: any;
declare var beautylog: any;

View File

@ -1,38 +1,41 @@
/// <reference path="typings/tsd.d.ts" /> #!/usr/bin/env node
/// <reference path="typings/main.d.ts" />
var through = require("through2"); var through = require("through2");
var path = require("path"); var path = require("path");
var beautylog = require("beautylog"); var beautylog = require("beautylog");
//important vars module.exports = function (functionsToExecuteArg, executionModeArg) {
var executionMode; //can be forEach or atEnd if (executionModeArg === void 0) { executionModeArg = 'forEach'; }
var functionsToExecute; //important vars
var runFunctionNames = function () { var gulpFunction = {
if (typeof functionsToExecute === "function") { executionMode: executionModeArg,
functionsToExecute(); functionsToExecute: functionsToExecuteArg
} };
else if (Array.isArray(functionsToExecute)) { var runFunctionNames = function () {
for (var anyFunction in functionsToExecute) { if (typeof gulpFunction.functionsToExecute === "function") {
anyFunction(); gulpFunction.functionsToExecute();
} }
} else if (Array.isArray(gulpFunction.functionsToExecute)) {
else { for (var anyFunction in gulpFunction.functionsToExecute) {
beautylog.error('gulp-callfunction: something is strange with the given arguments'); gulpFunction.functionsToExecute[anyFunction]();
} }
}; }
var forEach = function (file, enc, cb) { else {
if (executionMode === 'forEach') { beautylog.error('gulp-callfunction: something is strange with the given arguments');
runFunctionNames(); }
} };
//tell gulp that we are complete var forEach = function (file, enc, cb) {
return cb(null, file); if (gulpFunction.executionMode === 'forEach') {
}; runFunctionNames();
var atEnd = function () { }
if (executionMode === "atEnd") { //tell gulp that we are complete
runFunctionNames(); return cb(null, file);
} };
}; var atEnd = function (cb) {
module.exports = function (functionsToExecute, executionMode) { if (gulpFunction.executionMode === "atEnd") {
if (executionMode === void 0) { executionMode = 'forEach'; } runFunctionNames();
this.functionsToExecute = functionsToExecute; }
this.executionMode = executionMode; cb();
};
return through.obj(forEach, atEnd); return through.obj(forEach, atEnd);
}; };

View File

@ -1,41 +0,0 @@
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/4.1.0/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'version',
1 verbose cli 'patch' ]
2 info using npm@2.14.4
3 info using node@v4.1.0
4 info git [ 'status', '--porcelain' ]
5 verbose stack Error: Git working directory not clean.
5 verbose stack M README.md
5 verbose stack M index.js
5 verbose stack M package.json
5 verbose stack M ts/index.ts
5 verbose stack M ts/tsd.json
5 verbose stack A ts/typings/colors/colors.d.ts
5 verbose stack M ts/typings/tsd.d.ts
5 verbose stack at /usr/local/lib/node_modules/npm/lib/version.js:171:21
5 verbose stack at ChildProcess.exithandler (child_process.js:194:7)
5 verbose stack at emitTwo (events.js:87:13)
5 verbose stack at ChildProcess.emit (events.js:172:7)
5 verbose stack at maybeClose (internal/child_process.js:817:16)
5 verbose stack at Socket.<anonymous> (internal/child_process.js:319:11)
5 verbose stack at emitOne (events.js:77:13)
5 verbose stack at Socket.emit (events.js:169:7)
5 verbose stack at Pipe._onclose (net.js:469:12)
6 verbose cwd /Users/philippkunz/GitHub/pushrocks/gulp-callfunction
7 error Darwin 15.0.0
8 error argv "/usr/local/Cellar/node/4.1.0/bin/node" "/usr/local/bin/npm" "version" "patch"
9 error node v4.1.0
10 error npm v2.14.4
11 error Git working directory not clean.
11 error M README.md
11 error M index.js
11 error M package.json
11 error M ts/index.ts
11 error M ts/tsd.json
11 error A ts/typings/colors/colors.d.ts
11 error M ts/typings/tsd.d.ts
12 error If you need help, you may report this error at:
12 error <https://github.com/npm/npm/issues>
13 verbose exit [ 1, true ]

4
npmts.json Normal file
View File

@ -0,0 +1,4 @@
{
"mode":"default",
"coveralls":true
}

View File

@ -1,34 +1,35 @@
{ {
"name": "gulp-callfunction", "name": "gulp-function",
"version": "0.0.3", "version": "1.0.4",
"description": "accepts a function call as parameter to execute in gulp pipeline", "description": "accepts a function call as parameter to execute in gulp pipeline",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "(cd ts/compile && gulp)", "test": "(npmts)",
"reinstall": "(rm -r node_modules && npm install)", "reinstall": "(rm -r node_modules && npm install)",
"release": "(git pull origin master && npm version patch && git push origin master && git checkout release && git merge master && git push origin release && git checkout master)", "release": "(git pull origin master && npm version patch && git push origin master && git checkout release && git merge master && git push origin release && git checkout master)",
"startdev": "(git checkout master && git pull origin master)" "startdev": "(git checkout master && git pull origin master)"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/pushrocks/gulp-callfunction.git" "url": "https://github.com/pushrocks/gulp-function.git"
}, },
"keywords": [ "keywords": [
"json", "gulpplugin",
"jade", "gulp",
"template" "function"
], ],
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)", "author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)",
"license": "MIT", "license": "MIT",
"bugs": { "bugs": {
"url": "https://github.com/pushrocks/gulp-callfunction/issues" "url": "https://github.com/pushrocks/gulp-function/issues"
},
"homepage": "https://github.com/pushrocks/gulp-callfunction",
"devDependencies": {
"gulp": "^3.9.0",
"gulp-typescript": "^2.9.2"
}, },
"homepage": "https://github.com/pushrocks/gulp-function",
"dependencies": { "dependencies": {
"beautylog": "0.0.15" "beautylog": "2.1.1",
"through2": "2.0.1"
},
"devDependencies": {
"gulp": "^3.9.1",
"npmts": "^2.2.3"
} }
} }

2
test/README.md Normal file
View File

@ -0,0 +1,2 @@
#Test
This directory contains files for testing

6
test/test.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
/// <reference path="ts/typings/main.d.ts" />
declare var gulp: any;
declare var gulpFunction: any;
declare var beautylog: any;
declare var myFunction: () => void;
declare var myFunction2: () => void;

30
test/test.js Normal file
View File

@ -0,0 +1,30 @@
#!/usr/bin/env node
/// <reference path="typings/main.d.ts" />
var gulp = require("gulp");
var gulpFunction = require("../index.js");
var beautylog = require("beautylog");
var myFunction = function () {
beautylog.log("Function executed");
};
var myFunction2 = function () {
beautylog.log("Function2 executed");
};
describe("gulpFunction", function () {
it("should run through smoothly with " + "'forEach'".blue, function () {
gulp.src('./test/*.md')
.pipe(gulpFunction(myFunction, 'forEach'))
.pipe(gulp.dest("./test/result/"));
gulp.src('./test/*.md')
.pipe(gulpFunction([myFunction, myFunction2], 'forEach'))
.pipe(gulp.dest("./test/result/"));
});
it("should run through smoothly with " + "'atEnd'".blue, function () {
gulp.src('./test/*.md')
.pipe(gulpFunction(myFunction, 'atEnd'))
.pipe(gulp.dest("./test/result/"));
gulp.src('./test/*.md')
.pipe(gulpFunction([myFunction, myFunction2], 'atEnd'))
.pipe(gulp.dest("./test/result/"));
});
});

2
test/test01.md Normal file
View File

@ -0,0 +1,2 @@
# Test.md
This is a test file for the test.js gulp pipeline

2
test/test02.md Normal file
View File

@ -0,0 +1,2 @@
# Test.md
This is another test file for the test.js gulp pipeline

View File

@ -1,2 +0,0 @@
nvm use v0.12.7
gulp

View File

@ -1,16 +0,0 @@
// import gulp
var gulp = require("gulp"),
gulpTypescript = require("gulp-typescript");
gulp.task('compileTS', function() {
var stream = gulp.src('../index.ts')
.pipe(gulpTypescript({
out: "index.js"
}))
.pipe(gulp.dest("../../"));
return stream;
});
gulp.task('default',['compileTS'], function() {
console.log('Typescript compiled');
});

View File

@ -1,2 +0,0 @@
# How to compile.
Make sure gulp and gulp-taypescript from npm are available. Then run the gulpfile in this directory.

View File

@ -1,39 +1,42 @@
/// <reference path="typings/tsd.d.ts" /> /// <reference path="typings/main.d.ts" />
var through = require("through2"); var through = require("through2");
var path = require("path"); var path = require("path");
var beautylog = require("beautylog"); var beautylog = require("beautylog");
//important vars
var executionMode:string; //can be forEach or atEnd module.exports = function (functionsToExecuteArg:any|any[],executionModeArg:string = 'forEach') {
var functionsToExecute; //important vars
var runFunctionNames = function () { var gulpFunction = {
if (typeof functionsToExecute === "function" ) { executionMode: executionModeArg, //can be forEach or atEnd
functionsToExecute(); functionsToExecute: functionsToExecuteArg
} else if (Array.isArray(functionsToExecute)) { };
for (var anyFunction in functionsToExecute) {
anyFunction(); var runFunctionNames = function () {
if (typeof gulpFunction.functionsToExecute === "function" ) {
gulpFunction.functionsToExecute();
} else if (Array.isArray(gulpFunction.functionsToExecute)) {
for (var anyFunction in gulpFunction.functionsToExecute) {
gulpFunction.functionsToExecute[anyFunction]();
}
} else {
beautylog.error('gulp-callfunction: something is strange with the given arguments');
} }
} else { };
beautylog.error('gulp-callfunction: something is strange with the given arguments');
}
};
var forEach = function (file, enc, cb) { var forEach = function (file, enc, cb) {
if (executionMode === 'forEach') { if (gulpFunction.executionMode === 'forEach') {
runFunctionNames(); runFunctionNames();
} }
//tell gulp that we are complete //tell gulp that we are complete
return cb(null, file); return cb(null, file);
}; };
var atEnd = function() { var atEnd = function(cb) {
if (executionMode === "atEnd") { if (gulpFunction.executionMode === "atEnd") {
runFunctionNames(); runFunctionNames();
} }
}; cb();
module.exports = function (functionsToExecute:any|any[],executionMode:string = 'forEach') { };
this.functionsToExecute = functionsToExecute;
this.executionMode = executionMode;
return through.obj(forEach,atEnd); return through.obj(forEach,atEnd);
}; };

33
ts/test.ts Normal file
View File

@ -0,0 +1,33 @@
/// <reference path="typings/main.d.ts" />
var gulp = require("gulp");
var gulpFunction = require("../index.js");
var beautylog = require("beautylog");
var myFunction = function () {
beautylog.log("Function executed");
};
var myFunction2 = function () {
beautylog.log("Function2 executed");
};
describe("gulpFunction",function(){
it("should run through smoothly with " + "'forEach'".blue,function(){
gulp.src('./test/*.md')
.pipe(gulpFunction(myFunction,'forEach'))
.pipe(gulp.dest("./test/result/"));
gulp.src('./test/*.md')
.pipe(gulpFunction([myFunction,myFunction2],'forEach'))
.pipe(gulp.dest("./test/result/"));
});
it("should run through smoothly with " + "'atEnd'".blue,function(){
gulp.src('./test/*.md')
.pipe(gulpFunction(myFunction,'atEnd'))
.pipe(gulp.dest("./test/result/"));
gulp.src('./test/*.md')
.pipe(gulpFunction([myFunction,myFunction2],'atEnd'))
.pipe(gulp.dest("./test/result/"));
});
});

7
ts/typings.json Normal file
View File

@ -0,0 +1,7 @@
{
"ambientDependencies": {
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts",
"mocha": "github:Bartvds/tsd-deftools/typings/DefinitelyTyped/mocha/mocha.d.ts",
"colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts"
}
}

View File

@ -1,123 +0,0 @@
// Type definitions for Colors.js 0.6.0-1
// Project: https://github.com/Marak/colors.js
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "colors" {
interface Color {
(text: string): string;
black: Color;
red: Color;
green: Color;
yellow: Color;
blue: Color;
magenta: Color;
cyan: Color;
white: Color;
gray: Color;
grey: Color;
bgBlack: Color;
bgRed: Color;
bgGreen: Color;
bgYellow: Color;
bgBlue: Color;
bgMagenta: Color;
bgCyan: Color;
bgWhite: Color;
reset: Color;
bold: Color;
dim: Color;
italic: Color;
underline: Color;
inverse: Color;
hidden: Color;
strikethrough: Color;
rainbow: Color;
zebra: Color;
america: Color;
trap: Color;
random: Color;
}
module e {
export function setTheme(theme:any): void;
export var black: Color;
export var red: Color;
export var green: Color;
export var yellow: Color;
export var blue: Color;
export var magenta: Color;
export var cyan: Color;
export var white: Color;
export var gray: Color;
export var grey: Color;
export var bgBlack: Color;
export var bgRed: Color;
export var bgGreen: Color;
export var bgYellow: Color;
export var bgBlue: Color;
export var bgMagenta: Color;
export var bgCyan: Color;
export var bgWhite: Color;
export var reset: Color;
export var bold: Color;
export var dim: Color;
export var italic: Color;
export var underline: Color;
export var inverse: Color;
export var hidden: Color;
export var strikethrough: Color;
export var rainbow: Color;
export var zebra: Color;
export var america: Color;
export var trap: Color;
export var random: Color;
}
export = e;
}
interface String {
black: string;
red: string;
green: string;
yellow: string;
blue: string;
magenta: string;
cyan: string;
white: string;
gray: string;
grey: string;
bgBlack: string;
bgRed: string;
bgGreen: string;
bgYellow: string;
bgBlue: string;
bgMagenta: string;
bgCyan: string;
bgWhite: string;
reset: string;
bold: string;
dim: string;
italic: string;
underline: string;
inverse: string;
hidden: string;
strikethrough: string;
rainbow: string;
zebra: string;
america: string;
trap: string;
random: string;
}

File diff suppressed because it is too large Load Diff

2
ts/typings/tsd.d.ts vendored
View File

@ -1,2 +0,0 @@
/// <reference path="node/node.d.ts" />
/// <reference path="colors/colors.d.ts" />