mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
Create line-reader.d.ts
This commit is contained in:
parent
c560ba6f0f
commit
ad5d418705
27
line-reader/line-reader.d.ts
vendored
Normal file
27
line-reader/line-reader.d.ts
vendored
Normal file
@ -0,0 +1,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/borisyankov/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;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user