/** * @license * Copyright 2026 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ /** * Splits a byte stream into lines with a hard per-line cap. * * `readline.createInterface` accumulates an unterminated line without bound: a * 640 MB newline-free stream threw `RangeError: Invalid string length` from a * stream `'data'` listener, which surfaces as an `uncaughtException` rather * than an iterator rejection — so the caller's try/catch could not see it and * the process died. * * A line reaching `maxLineChars` with no terminator yields its first * `maxLineChars` characters, and the rest of that physical line is discarded up * to the next `\n`. `setEncoding` puts a `StringDecoder` in front, so a * multi-byte character split across two reads is not corrupted. */ export declare function linesFromStream(stream: NodeJS.ReadableStream, maxLineChars: number): AsyncGenerator;