|
1 | 1 | import gulp = require('gulp'); |
| 2 | +import Orchestrator = require('orchestrator'); |
2 | 3 |
|
3 | 4 | /* tslint:disable:max-line-length */ |
4 | | -export class GulpProxy { |
| 5 | +export class GulpProxy extends Orchestrator implements gulp.Gulp { |
| 6 | + public src: gulp.SrcMethod; |
| 7 | + public dest: gulp.DestMethod; |
| 8 | + public watch: gulp.WatchMethod; |
| 9 | + |
5 | 10 | private _gulp: gulp.Gulp; |
6 | 11 |
|
7 | 12 | constructor(gulpInstance: gulp.Gulp) { |
| 13 | + super(); |
8 | 14 | this._gulp = gulpInstance; |
| 15 | + this.src = gulpInstance.src; |
| 16 | + this.dest = gulpInstance.dest; |
| 17 | + this.watch = gulpInstance.watch; |
9 | 18 | } |
10 | 19 |
|
11 | | - public task(): void { |
| 20 | + /* tslint:disable-next-line:no-any */ |
| 21 | + public task(): any { |
12 | 22 | throw new Error( |
13 | 23 | 'You should not define gulp tasks, but instead subclass the GulpTask and override the executeTask method.' |
14 | 24 | ); |
15 | 25 | } |
16 | | - |
17 | | - public src(glob: string | string[], opt?: gulp.SrcOptions): NodeJS.ReadWriteStream { |
18 | | - return this._gulp.src(glob, opt); |
19 | | - } |
20 | | - |
21 | | - public dest(outFolder: string | ((file: string) => string), |
22 | | - opt?: gulp.DestOptions): NodeJS.ReadWriteStream { |
23 | | - return this._gulp.dest(outFolder, opt); |
24 | | - } |
25 | | - |
26 | | - public watch(glob: string | string[], fn: (gulp.WatchCallback | string)): NodeJS.EventEmitter { |
27 | | - return this._gulp.watch(glob, fn); |
28 | | - } |
29 | 26 | } |
0 commit comments