Merge pull request #34007 from seangenabe/then-eos-1

Add type definitions for then-eos
This commit is contained in:
Sheetal Nandi
2019-03-19 16:00:23 -07:00
committed by GitHub
4 changed files with 46 additions and 0 deletions

12
types/then-eos/index.d.ts vendored Normal file
View File

@@ -0,0 +1,12 @@
// Type definitions for then-eos 1.0
// Project: https://github.com/meoguru/node-then-eos
// Definitions by: Sean Marvi Oliver Genabe <https://github.com/seangenabe>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node"/>
type Stream = NodeJS.ReadableStream | NodeJS.WritableStream;
declare function thenEos(stream: Stream): Promise<void>;
export = thenEos;

View File

@@ -0,0 +1,10 @@
import eos = require("then-eos");
declare const readable: NodeJS.ReadableStream;
declare const writable: NodeJS.WritableStream;
// $ExpectType Promise<void>
eos(readable);
// $ExpectType Promise<void>
eos(writable);

View File

@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"strictFunctionTypes": true
},
"files": [
"index.d.ts",
"then-eos-tests.ts"
]
}

View File

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