From 98f0e4b428b547ebd397efee8ec07c2f911c772b Mon Sep 17 00:00:00 2001 From: TeamworkGuy2 Date: Wed, 17 May 2017 21:56:13 +0000 Subject: [PATCH] Cleanup orchestrator types --- types/gulp/gulp-tests.ts | 13 ++++--------- types/orchestrator/index.d.ts | 20 +++++++++++--------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/types/gulp/gulp-tests.ts b/types/gulp/gulp-tests.ts index 809ffed350..09aad27a7a 100644 --- a/types/gulp/gulp-tests.ts +++ b/types/gulp/gulp-tests.ts @@ -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'); diff --git a/types/orchestrator/index.d.ts b/types/orchestrator/index.d.ts index 52ceacf429..fcb1a16120 100644 --- a/types/orchestrator/index.d.ts +++ b/types/orchestrator/index.d.ts @@ -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) */