From b17c41af1e2850fb28b30e7e057692f54dc1c07c Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Tue, 9 Oct 2018 11:43:39 -0400 Subject: [PATCH] Adds types for stream-array. (#29569) --- types/stream-array/index.d.ts | 11 +++++++++++ types/stream-array/stream-array-tests.ts | 6 ++++++ types/stream-array/tsconfig.json | 23 +++++++++++++++++++++++ types/stream-array/tslint.json | 1 + 4 files changed, 41 insertions(+) create mode 100644 types/stream-array/index.d.ts create mode 100644 types/stream-array/stream-array-tests.ts create mode 100644 types/stream-array/tsconfig.json create mode 100644 types/stream-array/tslint.json diff --git a/types/stream-array/index.d.ts b/types/stream-array/index.d.ts new file mode 100644 index 0000000000..4e115ea8ac --- /dev/null +++ b/types/stream-array/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for stream-array 1.1 +// Project: https://github.com/mimetnet/node-stream-array +// Definitions by: Tyler Murphy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +import { Readable } from 'stream'; + +declare function streamify(array: ReadonlyArray): Readable; + +export = streamify; diff --git a/types/stream-array/stream-array-tests.ts b/types/stream-array/stream-array-tests.ts new file mode 100644 index 0000000000..fcdd640485 --- /dev/null +++ b/types/stream-array/stream-array-tests.ts @@ -0,0 +1,6 @@ +import streamify = require('stream-array'); + +streamify(); // $ExpectError +streamify('abc'); // $ExpectError +streamify([]); // $ExpectType Readable +streamify([1, '2', { 3: 4 }]); // $ExpectType Readable diff --git a/types/stream-array/tsconfig.json b/types/stream-array/tsconfig.json new file mode 100644 index 0000000000..9e374e3d07 --- /dev/null +++ b/types/stream-array/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", + "stream-array-tests.ts" + ] +} diff --git a/types/stream-array/tslint.json b/types/stream-array/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/stream-array/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }