///
///
import { Readable, Transform } from 'node:stream';
import { DeferredPromise } from '@naturalcycles/js-lib';
type AnyStream = NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream;
export interface PipelineOptions {
/**
* Set to true to allow ERR_STREAM_PREMATURE_CLOSE.
* Required to support graceful close when using transformLimit
*/
allowClose?: boolean;
}
/**
* Promisified `stream.pipeline`.
*
* Supports opt.allowClose, which allows transformLimit to work (to actually stop source Readable)
* without throwing an error (ERR_STREAM_PREMATURE_CLOSE).
*/
export declare function _pipeline(streams: AnyStream[], opt?: PipelineOptions): Promise;
/**
* Convenience function to make _pipeline collect all items at the end of the stream (should be Transform, not Writeable!)
* and return.
*/
export declare function _pipelineToArray(streams: AnyStream[], opt?: PipelineOptions): Promise;
export declare class AbortableTransform extends Transform {
sourceReadable?: Readable;
streamDone?: DeferredPromise;
}
export {};