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" }