From 8c5f9860a49defcaad100aed4c599e57b404f8aa Mon Sep 17 00:00:00 2001 From: Keita Kagurazaka Date: Wed, 4 Mar 2015 04:40:03 +0000 Subject: [PATCH] Add definitions and tests for gulp-flatten --- gulp-flatten/gulp-flatten-tests.ts | 17 +++++++++++++++++ gulp-flatten/gulp-flatten.d.ts | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 gulp-flatten/gulp-flatten-tests.ts create mode 100644 gulp-flatten/gulp-flatten.d.ts diff --git a/gulp-flatten/gulp-flatten-tests.ts b/gulp-flatten/gulp-flatten-tests.ts new file mode 100644 index 000000000..ee5622564 --- /dev/null +++ b/gulp-flatten/gulp-flatten-tests.ts @@ -0,0 +1,17 @@ +/// +/// + +import gulp = require("gulp"); +import flatten = require("gulp-flatten"); + +gulp.task("flatten:simple", () => { + gulp.src(["files/**/*.txt"]) + .pipe(flatten()) + .pipe(gulp.dest("build")); +}); + +gulp.task("flatten:newPath", () => { + gulp.src(["files/**/*.txt"]) + .pipe(flatten({ newPath: "new/path" })) + .pipe(gulp.dest("build")); +}); diff --git a/gulp-flatten/gulp-flatten.d.ts b/gulp-flatten/gulp-flatten.d.ts new file mode 100644 index 000000000..ccd9cedf1 --- /dev/null +++ b/gulp-flatten/gulp-flatten.d.ts @@ -0,0 +1,17 @@ +// Type definitions for gulp-flatten +// Project: https://github.com/armed/gulp-flatten +// Definitions by: Keita Kagurazaka +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "gulp-flatten" { + + interface IOptions { + newPath: string; + } + + function flatten(options?: IOptions): NodeJS.ReadWriteStream; + + export = flatten; +}