///
import {Readable, ReadableOptions} from 'node:stream';
import {TypedReadable} from 'stream-chain/typed-streams.js';
/**
* Concatenates N object-mode Readable streams into a single Readable, sequentially.
* Stream 0 is fully drained, then stream 1, …, then stream N-1.
*
* Pullers are created lazily — one stream at a time — so streams that haven't started
* yet don't buffer data in the meantime.
*
* The output's element type is the union of the input streams' value types.
*
* Throws `TypeError` if `streams` is missing, not an array, or empty.
*
* @typeParam S — the tuple type of input streams.
* @param streams — non-empty array of object-mode Readable streams. Drained left-to-right.
* @param options — optional. Standard `ReadableOptions` (the output Readable is forced to
* `objectMode: true` regardless of any value passed here).
* @returns a `TypedReadable>` that emits stream 0's values, then stream 1's,
* etc. Propagates `'error'` events from whichever input stream is currently being drained;
* ends when every input stream has ended.
*/
declare function concat(
streams: S,
options?: concat.ConcatOptions
): TypedReadable>;
declare namespace concat {
/**
* Resolves to the value type of a `Readable` — `R` for `TypedReadable`, otherwise `unknown`.
*
* @typeParam R — a `Readable` (or `TypedReadable`) whose value type to extract.
*/
export type StreamValue = R extends TypedReadable ? V : unknown;
/**
* Union of value types across the input streams.
*
* @typeParam S — the tuple type of input streams.
*/
export type ConcatItemType = StreamValue;
/**
* Options accepted by `concat()`. Extends `ReadableOptions`; `concat()` adds no options of its
* own. The output Readable is always created with `objectMode: true`.
*/
export interface ConcatOptions extends ReadableOptions {}
}
type StreamValue = concat.StreamValue;
type ConcatItemType = concat.ConcatItemType;
type ConcatOptions = concat.ConcatOptions;
export default concat;
export {concat};
export type {StreamValue, ConcatItemType, ConcatOptions};