Add types for gulp-clean-dest@0.2

This commit is contained in:
Andrey Lalev
2017-11-11 08:42:24 +02:00
parent 8aac41c1e2
commit a2a63ece84
4 changed files with 63 additions and 0 deletions

View File

@@ -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" });

29
types/gulp-clean-dest/index.d.ts vendored Normal file
View File

@@ -0,0 +1,29 @@
// Type definitions for gulp-clean-dest 0.2
// Project: https://github.com/clark800/gulp-clean-dest
// Definitions by: Andrey Lalev <https://github.com/andypyrope>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
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;

View File

@@ -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"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }