mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
line-by-line: enable all encodings supported by Node (#41342)
This commit is contained in:
parent
eea68f0134
commit
77b0d0fd9a
12
types/line-by-line/index.d.ts
vendored
12
types/line-by-line/index.d.ts
vendored
@ -5,12 +5,12 @@
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import { EventEmitter } from "events";
|
||||
import { Readable } from "stream";
|
||||
import { EventEmitter } from 'events';
|
||||
import { Readable } from 'stream';
|
||||
|
||||
interface LineByLineReaderOptions {
|
||||
/** The encoding to use. */
|
||||
encoding?: "ascii" | "base64" | "utf8";
|
||||
encoding?: 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'base64' | 'latin1' | 'binary' | 'hex';
|
||||
/** If set to true, empty lines do not emit the "line" event. */
|
||||
skipEmptyLines?: boolean;
|
||||
}
|
||||
@ -46,19 +46,19 @@ declare class LineByLineReader extends EventEmitter {
|
||||
* @param event
|
||||
* @param listener
|
||||
*/
|
||||
on(event: "end", listener: () => void): this;
|
||||
on(event: 'end', listener: () => void): this;
|
||||
/**
|
||||
* Emitted if an error occured.
|
||||
* @param event
|
||||
* @param listener A listener that receives the error object.
|
||||
*/
|
||||
on(event: "error", listener: (err: any) => void): this;
|
||||
on(event: 'error', listener: (err: any) => void): this;
|
||||
/**
|
||||
* Emitted on every line read.
|
||||
* @param event
|
||||
* @param listener A listener that receives the line without the line terminator.
|
||||
*/
|
||||
on(event: "line", listener: (line: string) => void): this;
|
||||
on(event: 'line', listener: (line: string) => void): this;
|
||||
|
||||
/**
|
||||
* Call this method to stop emitting "line" events.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user