diff --git a/types/destroy/destroy-tests.ts b/types/destroy/destroy-tests.ts new file mode 100644 index 0000000000..15dbe62e32 --- /dev/null +++ b/types/destroy/destroy-tests.ts @@ -0,0 +1,9 @@ +import destroy = require('destroy'); +import * as fs from 'fs'; + +const stream = fs.createReadStream('package.json'); + +// $ExpectType ReadStream +destroy(stream); +// $ExpectType WriteStream +destroy(process.stderr); diff --git a/types/destroy/index.d.ts b/types/destroy/index.d.ts new file mode 100644 index 0000000000..7427655ace --- /dev/null +++ b/types/destroy/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for destroy 1.0 +// Project: https://github.com/stream-utils/destroy +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +import { Stream } from 'stream'; + +export = destroy; + +declare function destroy(stream: T): T; diff --git a/types/destroy/tsconfig.json b/types/destroy/tsconfig.json new file mode 100644 index 0000000000..197ac0c669 --- /dev/null +++ b/types/destroy/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "destroy-tests.ts" + ] +} diff --git a/types/destroy/tslint.json b/types/destroy/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/destroy/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }