DefinitelyTyped/types/gen-readlines/index.d.ts
CodeAnimal 8e9a312d8d Correct function return type (#20946)
Update generator function to return Buffer instead of string.
2017-10-24 11:12:29 -07:00

19 lines
753 B
TypeScript

// Type definitions for gen-readlines 0.1
// Project: https://github.com/neurosnap/gen-readlines#readme
// Definitions by: Peter Harris <https://github.com/CodeAnimal>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Generator based line reader
*
* @param fd The file descriptor
* @param filesize The size of the file in bytes
* @param bufferSize The size of the buffer in bytes, default: 64*1024
* @param position The position where to start reading the file in bytes, default: 0
*
* @returns The generator object, yeilding each line as a string
*/
declare function readlines(fd: number, filesize: number, bufferSize?: number, position?: number): IterableIterator<Buffer>;
export = readlines;