DefinitelyTyped/types/merge-stream/index.d.ts
Daniel Cassidy 270885d33a [merge-stream] Apply standard lint rules, fix common mistakes (#27286)
* Apply standard lint rules to merge-stream.

 * Format version number as MAJOR.MINOR, patch is not allowed.
 * Delete consecutive blank lines.
 * Cut down author list into multiple lines.
 * Replace author's website with their github page.
 * Remove I prefix from MergedStream interface.
 * Use Array<...> for complex array type.
 * Delete blank line at start of file.
 * Replace all uses of 'var' with 'let' or 'const'.
 * Combine overloads into one signature.

* Apply strict null checks to merge-stream.

* Use ReadonlyArray in preference to Array where appropriate.

merge() and add() do not modify the arrays passed to them,
so they can be typed as ReadonlyArray.

* Add self to authors list.
2018-07-15 12:29:43 -07:00

18 lines
758 B
TypeScript

// Type definitions for merge-stream 1.1
// Project: https://github.com/grncdr/merge-stream
// Definitions by: Keita Kagurazaka <https://github.com/k-kagurazaka>
// Tom X. Tobin <https://github.com/tomxtobin>
// Daniel Zazula <https://github.com/daniel-zazula>
// Daniel Cassidy <https://github.com/djcsdy>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node"/>
interface MergedStream extends NodeJS.ReadWriteStream {
add(source: NodeJS.ReadableStream | ReadonlyArray<NodeJS.ReadableStream>): MergedStream;
isEmpty(): boolean;
}
declare function merge<T extends NodeJS.ReadableStream>(...streams: Array<T | ReadonlyArray<T>>): MergedStream;
export = merge;