/// /// import { Transform } from 'stream'; import type * as stream from 'stream'; declare type GetPropValue = K extends (keyof T) ? T[K] : undefined; declare type IfNeverThenUnknown = [T] extends [never] ? unknown : T; /** * If the `objectMode` and `writableObjectMode` options is not `true`, * the chunk value is always an instance of Buffer. */ export declare type InputChunkType = (true extends GetPropValue ? unknown : Buffer); /** * If the `objectMode` and `readableObjectMode` options is not `true`, * the chunk value must be of type string or an instance of Buffer or Uint8Array. * @see https://github.com/nodejs/node/blob/v12.17.0/lib/_stream_readable.js#L226-L244 */ export declare type OutputChunkType = IfNeverThenUnknown; export declare type SourceIterator = (AsyncIterableIterator<{ chunk: InputChunkType; encoding: BufferEncoding; }>); export declare type TransformFunction = ((source: SourceIterator) => Iterable> | AsyncIterable>); export declare class TransformFromAsyncIterable> extends Transform { private transformCallback; private isFinished; private receiveData?; private readonly receivedDataList; constructor(transformFn: TransformFunction, opts?: TOpts); _transform(chunk: InputChunkType, encoding: BufferEncoding, callback: stream.TransformCallback): void; _flush(callback: stream.TransformCallback): void; private finish; private callTransformCallback; private createSource; private emitToSource; private emitFinishEventAfterCallback; } export declare function transformFrom>(transformFn: TransformFunction, options?: TOpts): stream.Transform; export {};