mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add streamify-array typings (#45484)
This commit is contained in:
parent
1c238d7dd5
commit
bc5b7623cd
16
types/streamify-array/index.d.ts
vendored
Normal file
16
types/streamify-array/index.d.ts
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
// Type definitions for streamify-array 1.0
|
||||
// Project: https://github.com/rubensworks/streamify-array.js#readme
|
||||
// Definitions by: Joachim Van Herwegen <https://github.com/joachimvh>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import { Readable } from 'stream';
|
||||
|
||||
/**
|
||||
* Converts an array into a Node readable stream.
|
||||
* Elements get removed from the array when they are read from the stream.
|
||||
*/
|
||||
declare function streamifyArray(input: any[]): Readable;
|
||||
|
||||
export = streamifyArray;
|
||||
9
types/streamify-array/streamify-array-tests.ts
Normal file
9
types/streamify-array/streamify-array-tests.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import streamifyArray from 'streamify-array';
|
||||
import { Readable } from 'stream';
|
||||
|
||||
const stream: Readable = streamifyArray([1, 2, 3]);
|
||||
stream.on('data', (d) => console.log('Data: ' + d));
|
||||
stream.on('end', () => console.log('Done!'));
|
||||
|
||||
// $ExpectError
|
||||
streamifyArray();
|
||||
24
types/streamify-array/tsconfig.json
Normal file
24
types/streamify-array/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"esModuleInterop": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"streamify-array-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/streamify-array/tslint.json
Normal file
1
types/streamify-array/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user