diff --git a/types/then-eos/index.d.ts b/types/then-eos/index.d.ts new file mode 100644 index 0000000000..bd44297d51 --- /dev/null +++ b/types/then-eos/index.d.ts @@ -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 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +type Stream = NodeJS.ReadableStream | NodeJS.WritableStream; + +declare function thenEos(stream: Stream): Promise; + +export = thenEos; diff --git a/types/then-eos/then-eos-tests.ts b/types/then-eos/then-eos-tests.ts new file mode 100644 index 0000000000..7715f88009 --- /dev/null +++ b/types/then-eos/then-eos-tests.ts @@ -0,0 +1,10 @@ +import eos = require("then-eos"); + +declare const readable: NodeJS.ReadableStream; +declare const writable: NodeJS.WritableStream; + +// $ExpectType Promise +eos(readable); + +// $ExpectType Promise +eos(writable); diff --git a/types/then-eos/tsconfig.json b/types/then-eos/tsconfig.json new file mode 100644 index 0000000000..4f0567eb78 --- /dev/null +++ b/types/then-eos/tsconfig.json @@ -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" + ] +} diff --git a/types/then-eos/tslint.json b/types/then-eos/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/then-eos/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }