From 73f83f41fec6f8d39b5f18eefc6e8c962c6d1c09 Mon Sep 17 00:00:00 2001 From: Arun Aravind Date: Fri, 7 Oct 2016 02:47:42 +0530 Subject: [PATCH] Gulp copy (#11804) * Added type definitions for terminal-menu * Added type definitions for gulp-copy package * Fixed typos in file header --- gulp-copy/gulp-copy-tests.ts | 10 +++++++++ gulp-copy/gulp-copy.d.ts | 39 ++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 gulp-copy/gulp-copy-tests.ts create mode 100644 gulp-copy/gulp-copy.d.ts diff --git a/gulp-copy/gulp-copy-tests.ts b/gulp-copy/gulp-copy-tests.ts new file mode 100644 index 0000000000..acb225bbe5 --- /dev/null +++ b/gulp-copy/gulp-copy-tests.ts @@ -0,0 +1,10 @@ +/// +/// + +import * as gulp from "gulp"; +import * as gulpCopy from "gulp-copy"; + +gulp.task("copy-files", () => { + gulp.src("*.nonexistent") + .pipe(gulpCopy("remove/target/some/non/existent/path", { prefix: 2 })); +}); diff --git a/gulp-copy/gulp-copy.d.ts b/gulp-copy/gulp-copy.d.ts new file mode 100644 index 0000000000..68f652ed9a --- /dev/null +++ b/gulp-copy/gulp-copy.d.ts @@ -0,0 +1,39 @@ +// Type definitions for gulp-copy v0.0.2 +// Project: https://github.com/klaascuvelier/gulp-copy +// Definitions by: Arun Aravind +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "gulp-copy" { + import through = require("through"); + + /** + * Copy files to destination and expose those files as source streams for the gulp pipeline. + * + * @param outDirectory The name of the destination directory. If this directory + * does not exist, it will be created atomatically. + */ + function gulpCopy(outDirectory: string): through.ThroughStream; + + /** + * Copy files to destination and expose those files as source streams for the gulp pipeline. + * + * @param outDirectory The name of the destination directory. If this directory + * does not exist, it will be created atomatically. + * @param options Override values for available settings. + */ + function gulpCopy(outDirectory: string, options: gulpCopy.GulpCopyOptions): through.ThroughStream; + + namespace gulpCopy { + + export interface GulpCopyOptions { + /** + * Specifies the number of parts of the path to be ignored as path prefixes. + */ + prefix: number; + } + } + + export = gulpCopy; +}