Merge pull request #19177 from BendingBender/destroy

[destroy] add typings
This commit is contained in:
Daniel Rosenwasser
2017-08-21 11:16:59 -07:00
committed by GitHub
4 changed files with 43 additions and 0 deletions
+9
View File
@@ -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);
+11
View File
@@ -0,0 +1,11 @@
// Type definitions for destroy 1.0
// Project: https://github.com/stream-utils/destroy
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import { Stream } from 'stream';
export = destroy;
declare function destroy<T extends Stream>(stream: T): T;
+22
View File
@@ -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"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }