mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
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:
parent
d1013f6013
commit
bee26e75c3
10
types/line-reader/index.d.ts
vendored
10
types/line-reader/index.d.ts
vendored
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user