mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #2882 from progre/feature/gulp-fix
fix gulp typings and tests
This commit is contained in:
+14
-6
@@ -2,20 +2,28 @@
|
||||
|
||||
import gulp = require("gulp");
|
||||
|
||||
var typescript: any = null; // this would be the TypeScript compiler
|
||||
var jasmine: any = null; // this would be the jasmine test runner
|
||||
var typescript: IGulpPlugin = null; // this would be the TypeScript compiler
|
||||
var jasmine: IGulpPlugin = null; // this would be the jasmine test runner
|
||||
|
||||
gulp.task('compile', function()
|
||||
{
|
||||
gulp.src("**/*.ts")
|
||||
.pipe(typescript)
|
||||
.dest('out')
|
||||
.pipe(typescript())
|
||||
.pipe(gulp.dest('out'))
|
||||
});
|
||||
|
||||
gulp.task('test', ['compile'], function()
|
||||
gulp.task('compile2', function(callback: (err?: any) => void)
|
||||
{
|
||||
gulp.src("**/*.ts")
|
||||
.pipe(typescript())
|
||||
.pipe(gulp.dest('out'))
|
||||
.on('end', callback);
|
||||
});
|
||||
|
||||
gulp.task('test', ['compile', 'compile2'], function()
|
||||
{
|
||||
gulp.src("out/test/**/*.js")
|
||||
.pipe(jasmine);
|
||||
.pipe(jasmine());
|
||||
});
|
||||
|
||||
gulp.task('default', ['compile', 'test']);
|
||||
|
||||
Vendored
+6
-7
@@ -173,15 +173,10 @@ declare module gulp {
|
||||
interface ITaskCallback {
|
||||
/**
|
||||
* Defines a task.
|
||||
* Tasks may be made asynchronous if they return a promise or a stream.
|
||||
*/
|
||||
(): any;
|
||||
|
||||
/**
|
||||
* Defines an asynchronous task.
|
||||
* Tasks may be made asynchronous if they are passing a callback or return a promise or a stream.
|
||||
* @param cb callback used to signal asynchronous completion. Caller includes <code>err</code> in case of error.
|
||||
*/
|
||||
(cb:(err?:any)=>void): void;
|
||||
(cb?:(err?:any)=>void): any;
|
||||
}
|
||||
|
||||
interface EventEmitter {
|
||||
@@ -287,3 +282,7 @@ declare module "gulp" {
|
||||
var _tmp:gulp.Gulp;
|
||||
export = _tmp;
|
||||
}
|
||||
|
||||
interface IGulpPlugin {
|
||||
(...args: any[]): NodeJS.ReadWriteStream;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user