import type { ReadableStream } from 'node:stream/web';
/**
 * A fan-in multiplexer that merges multiple {@link ReadableStream} inputs into
 * a single output {@link ReadableStream}. Inputs can be dynamically added and
 * removed at any time while the stream is open.
 *
 * Unlike {@link DeferredReadableStream} which supports a single readable source,
 * `MultiInputStream` allows N concurrent input streams to pump data into one output.
 *
 * Key behaviors:
 * - An error in one input removes that input but does **not** kill the output.
 * - When all inputs end or are removed, the output stays open (waiting for new inputs).
 * - The output only closes when {@link close} is called explicitly.
 * - {@link removeInputStream} releases the reader lock so the source can be reused.
 */
export declare class MultiInputStream<T> {
    private transform;
    private writer;
    private inputs;
    private pumpPromises;
    private nextId;
    private _closed;
    private logger;
    constructor();
    /** The single output stream that consumers read from. */
    get stream(): ReadableStream<T>;
    /** Number of currently active input streams. */
    get inputCount(): number;
    /** Whether {@link close} has been called. */
    get isClosed(): boolean;
    /**
     * Add an input {@link ReadableStream} that will be pumped into the output.
     *
     * @returns A unique identifier that can be passed to {@link removeInputStream}.
     * @throws If the stream has already been closed.
     */
    addInputStream(source: ReadableStream<T>): string;
    /**
     * Detach an input stream by its ID and release the reader lock so the
     * source stream can be reused elsewhere.
     *
     * No-op if the ID does not exist (e.g. the input already ended or was removed).
     */
    removeInputStream(id: string): Promise<void>;
    /**
     * Close the output stream and detach all inputs.
     *
     * Idempotent — calling more than once is a no-op.
     */
    close(): Promise<void>;
    private shouldStopPumping;
    private pumpInput;
}
//# sourceMappingURL=multi_input_stream.d.ts.map