import type { Writable } from 'node:stream'; /** * Accumulates items from any `Iterable` or `AsyncIterable` (including Node.js readable * streams) into fixed-size batches. The final batch may be smaller than `batchSize`. * * Useful for composing stream consumption with chunked processing — feed each batch * into {@link executeTwoPhaseChunksSequentially} or similar. * * @param source Any sync or async iterable. * @param batchSize Maximum items per yielded batch. Must be an integer >= 1; anything * else throws a `RangeError` synchronously, before iteration starts. */ export declare function batchFromStream(source: Iterable | AsyncIterable, batchSize: number): AsyncGenerator; /** * Writes `data` to a `Writable` stream while respecting backpressure. Resolves when * the chunk has been accepted by the consumer (or after the next `drain` event when * the internal buffer was full). Rejects if the stream errors, is destroyed, or * closes before the write completes. * * Prefer `stream.pipeline()` when your data source can be expressed as a readable * stream or async iterable — `drainAwareWrite` is for the case where you write * imperatively in a loop and can't restructure as a pipeline. */ export declare function drainAwareWrite(stream: Writable, data: string | Buffer): Promise;