From a2a63ece84e7c823ad3a548cda56557ef020a602 Mon Sep 17 00:00:00 2001 From: Andrey Lalev Date: Sat, 11 Nov 2017 08:42:24 +0200 Subject: [PATCH] Add types for gulp-clean-dest@0.2 --- .../gulp-clean-dest/gulp-clean-dest-tests.ts | 10 +++++++ types/gulp-clean-dest/index.d.ts | 29 +++++++++++++++++++ types/gulp-clean-dest/tsconfig.json | 23 +++++++++++++++ types/gulp-clean-dest/tslint.json | 1 + 4 files changed, 63 insertions(+) create mode 100644 types/gulp-clean-dest/gulp-clean-dest-tests.ts create mode 100644 types/gulp-clean-dest/index.d.ts create mode 100644 types/gulp-clean-dest/tsconfig.json create mode 100644 types/gulp-clean-dest/tslint.json diff --git a/types/gulp-clean-dest/gulp-clean-dest-tests.ts b/types/gulp-clean-dest/gulp-clean-dest-tests.ts new file mode 100644 index 0000000000..22a14f7487 --- /dev/null +++ b/types/gulp-clean-dest/gulp-clean-dest-tests.ts @@ -0,0 +1,10 @@ +import cleanDest = require("gulp-clean-dest"); + +const someDir = "."; + +// $ExpectType ReadWriteStream +cleanDest(someDir); +cleanDest(someDir, {}); +cleanDest(someDir, { cwd: someDir }); +cleanDest(someDir, { extension: ".ts" }); +cleanDest(someDir, { cwd: someDir, extension: ".ts" }); diff --git a/types/gulp-clean-dest/index.d.ts b/types/gulp-clean-dest/index.d.ts new file mode 100644 index 0000000000..bbb33abad0 --- /dev/null +++ b/types/gulp-clean-dest/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for gulp-clean-dest 0.2 +// Project: https://github.com/clark800/gulp-clean-dest +// Definitions by: Andrey Lalev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace gulpCleanDest { + interface Options { + /** + * The working directory the folder is relative to. + */ + cwd?: string; + + /** + * Extension of the destination files. Useful if it differs from the original. + */ + extension?: string; + } +} + +/** + * Removes files from the dest directory prior to building. + * @param destination The name of the dest directory + * @param options Options for the cleaning process + */ +declare function gulpCleanDest(destination: string, options?: gulpCleanDest.Options): NodeJS.ReadWriteStream; + +export = gulpCleanDest; diff --git a/types/gulp-clean-dest/tsconfig.json b/types/gulp-clean-dest/tsconfig.json new file mode 100644 index 0000000000..777c860568 --- /dev/null +++ b/types/gulp-clean-dest/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "gulp-clean-dest-tests.ts" + ] +} diff --git a/types/gulp-clean-dest/tslint.json b/types/gulp-clean-dest/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/gulp-clean-dest/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }