From ec8e6f7e5934335e597cfc3e7f450fa31742d21a Mon Sep 17 00:00:00 2001 From: Sean Genabe Date: Wed, 20 Mar 2019 04:10:15 +0800 Subject: [PATCH] add type definitions for then-eos --- types/then-eos/index.d.ts | 12 ++++++++++++ types/then-eos/then-eos-tests.ts | 10 ++++++++++ types/then-eos/tsconfig.json | 23 +++++++++++++++++++++++ types/then-eos/tslint.json | 1 + 4 files changed, 46 insertions(+) create mode 100644 types/then-eos/index.d.ts create mode 100644 types/then-eos/then-eos-tests.ts create mode 100644 types/then-eos/tsconfig.json create mode 100644 types/then-eos/tslint.json 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" }