Add option for NodeJS.ReadableStream type. (#45624)

You can see that this type is also acceptable 8b06b2b80d/lib/line_reader.js (L203)
This commit is contained in:
Mark Lalor 2020-06-25 16:32:15 -04:00 committed by GitHub
parent d1013f6013
commit bee26e75c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,8 @@
// Definitions by: Sam Saint-Pettersen <https://github.com/stpettersens>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node"/>
interface LineReaderOptions {
separator?: any;
encoding?: string;
@ -12,10 +14,10 @@ interface LineReaderOptions {
interface LineReader {
eachLine(): Function; // For Promise.promisify;
open(): Function;
eachLine(file: string, cb: (line: string, last?: boolean, cb?: Function) => void): LineReader;
eachLine(file: string, options: LineReaderOptions, cb: (line: string, last?: boolean, cb?: Function) => void): LineReader;
open(file: string, cb: (err: Error, reader: LineReader) => void): void;
open(file: string, options: LineReaderOptions, cb: (err: Error, reader: LineReader) => void): void;
eachLine(file: string | NodeJS.ReadableStream, cb: (line: string, last?: boolean, cb?: Function) => void): LineReader;
eachLine(file: string | NodeJS.ReadableStream, options: LineReaderOptions, cb: (line: string, last?: boolean, cb?: Function) => void): LineReader;
open(file: string | NodeJS.ReadableStream, cb: (err: Error, reader: LineReader) => void): void;
open(file: string | NodeJS.ReadableStream, options: LineReaderOptions, cb: (err: Error, reader: LineReader) => void): void;
hasNextLine(): boolean;
nextLine(cb: (err: Error, line: string) => void): void;
close(cb: (err: Error) => void): void;