forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
line-reader.d.ts
27 lines (24 loc) · 1001 Bytes
/
line-reader.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Type definitions for line-reader
// Project: https://github.com/nickewing/line-reader
// Definitions by: Sam Saint-Pettersen <https://github.com/stpettersens>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface LineReaderOptions {
separator?: any;
encoding?: string;
bufferSize?: number;
}
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;
hasNextLine(): boolean;
nextLine(cb: (err: Error, line: string) => void): void;
close(cb: (err: Error) => void): void;
}
declare module "line-reader" {
var lr: LineReader;
export = lr;
}