mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-19 08:31:17 +08:00
Cleanup orchestrator types
This commit is contained in:
@@ -1,26 +1,22 @@
|
||||
import gulp = require("gulp");
|
||||
import browserSync = require("browser-sync");
|
||||
|
||||
var typescript: gulp.GulpPlugin = null; // this would be the TypeScript compiler
|
||||
var jasmine: gulp.GulpPlugin = null; // this would be the jasmine test runner
|
||||
|
||||
gulp.task('compile', function()
|
||||
{
|
||||
gulp.task('compile', function() {
|
||||
gulp.src("**/*.ts")
|
||||
.pipe(typescript())
|
||||
.pipe(gulp.dest('out'))
|
||||
});
|
||||
|
||||
gulp.task('compile2', function(callback: (err?: any) => void)
|
||||
{
|
||||
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.task('test', ['compile', 'compile2'], function() {
|
||||
gulp.src("out/test/**/*.js")
|
||||
.pipe(jasmine());
|
||||
});
|
||||
@@ -64,8 +60,7 @@ var watcher = gulp.watch('*.html', event => {
|
||||
});
|
||||
|
||||
gulp.task('serve', ['compile'], () => {
|
||||
var browser = browserSync.create();
|
||||
gulp.watch(['*.html', '*.ts'], ['compile', browser.reload]);
|
||||
gulp.watch(['*.html', '*.ts'], ['compile', () => { return "data"; }]);
|
||||
});
|
||||
|
||||
gulp.start('test', 'compile');
|
||||
|
||||
20
types/orchestrator/index.d.ts
vendored
20
types/orchestrator/index.d.ts
vendored
@@ -9,12 +9,6 @@ import * as events from "events";
|
||||
import * as stream from "stream";
|
||||
import * as Q from "q";
|
||||
|
||||
type _Sequencify = (tasks: Array<{ dep: string[]; }>, names: string[]) => { sequence: string[]; missingTasks: string[]; recursiveDependencies: string[]; };
|
||||
|
||||
type _runTask = (task: Orchestrator.TaskFunc, done: (err: any, meta: Orchestrator.Meta) => void) => void;
|
||||
|
||||
type Strings = string|string[];
|
||||
|
||||
/** A module for sequencing and executing tasks and dependencies in maximum concurrency
|
||||
*/
|
||||
declare class Orchestrator extends events.EventEmitter {
|
||||
@@ -54,7 +48,7 @@ declare class Orchestrator extends events.EventEmitter {
|
||||
|
||||
stop(err?: any, successfulFinish?: boolean): void;
|
||||
|
||||
sequence: _Sequencify;
|
||||
sequence: Orchestrator.Sequencify;
|
||||
|
||||
allDone(): boolean;
|
||||
|
||||
@@ -96,9 +90,17 @@ declare class Orchestrator extends events.EventEmitter {
|
||||
}
|
||||
|
||||
declare namespace Orchestrator {
|
||||
type runTask = _runTask;
|
||||
type Strings = string | string[];
|
||||
|
||||
type Sequencify = _Sequencify;
|
||||
/** The method export generated by orchestrator/lib/runTask.js */
|
||||
type RunTask = (task: Orchestrator.TaskFunc, done: (err: any, meta: Orchestrator.Meta) => void) => void;
|
||||
|
||||
/** The module export of the sequencify package: https://www.npmjs.com/package/sequencify */
|
||||
type Sequencify = (tasks: Array<{ dep: string[]; }>, names: string[]) => {
|
||||
sequence: string[];
|
||||
missingTasks: string[];
|
||||
recursiveDependencies: string[];
|
||||
};
|
||||
|
||||
/** A task, can either call a callback to indicate task completion or return a promise or a stream: (task is marked complete when promise.then() resolves/fails or stream ends)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user