diff --git a/types/destroy-on-hwm/destroy-on-hwm-tests.ts b/types/destroy-on-hwm/destroy-on-hwm-tests.ts new file mode 100644 index 0000000000..9c32a27e26 --- /dev/null +++ b/types/destroy-on-hwm/destroy-on-hwm-tests.ts @@ -0,0 +1,10 @@ +import { PassThrough } from 'stream'; +import destroyOnHWM = require('destroy-on-hwm'); + +const stream = new PassThrough(); + +destroyOnHWM(stream); // $ExpectType PassThrough +destroyOnHWM(stream, function(stream) { + this; // $ExpectType PassThrough + stream; // $ExpectType PassThrough +}); diff --git a/types/destroy-on-hwm/index.d.ts b/types/destroy-on-hwm/index.d.ts new file mode 100644 index 0000000000..5c5dcb43e9 --- /dev/null +++ b/types/destroy-on-hwm/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for destroy-on-hwm 1.0 +// Project: https://github.com/stream-utils/destroy-on-hwm +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// +import { Writable } from 'stream'; + +export = destroyOnHwm; + +declare function destroyOnHwm(stream: T, callback?: (this: T, stream: T) => void): T; diff --git a/types/destroy-on-hwm/tsconfig.json b/types/destroy-on-hwm/tsconfig.json new file mode 100644 index 0000000000..9bcad7ee9b --- /dev/null +++ b/types/destroy-on-hwm/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-on-hwm-tests.ts" + ] +} diff --git a/types/destroy-on-hwm/tslint.json b/types/destroy-on-hwm/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/destroy-on-hwm/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }