@types/line-reader
TypeScript icon, indicating that this package has built-in type declarations

0.0.37 • Public • Published

Installation

npm install --save @types/line-reader

Summary

This package contains type definitions for line-reader (https://github.com/nickewing/line-reader).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/line-reader.

index.d.ts

/// <reference types="node"/>

interface LineReaderOptions {
    separator?: any;
    encoding?: string | undefined;
    bufferSize?: number | undefined;
}

interface Reader {
    hasNextLine(): boolean;
    nextLine(cb: (err: Error, line?: string) => void): void;
    close(cb: (err: Error) => void): void;
    isOpen(): boolean;
    isClosed(): boolean;
    getReadStream(): NodeJS.ReadableStream;
}

interface LineReader {
    open(): Function;
    open(
        file: string | NodeJS.ReadableStream,
        options: LineReaderOptions,
        cb: (err: Error, reader: Reader) => void,
    ): void;
    open(file: string | NodeJS.ReadableStream, cb: (err: Error, reader: Reader) => void): void;

    eachLine(): Function; // For Promise.promisify;
    eachLine(
        file: string | NodeJS.ReadableStream,
        options: LineReaderOptions,
        cb: (line: string, last: boolean, continueCb?: Function) => void,
        errCb?: (err?: Error) => void,
    ): LineReader;
    eachLine(
        file: string | NodeJS.ReadableStream,
        cb: (line: string, last: boolean, continueCb?: Function) => void,
        errCb?: (err?: Error) => void,
    ): LineReader;
}

declare module "line-reader" {
    var lr: LineReader;
    export = lr;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:38 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Sam Saint-Pettersen.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/line-reader

Weekly Downloads

5,442

Version

0.0.37

License

MIT

Unpacked Size

5.16 kB

Total Files

5

Last publish

Collaborators

  • types