import { ReadableOptions } from 'stream'; import { AsyncIterableReadable } from '../tonodestream.js'; import { BufferLike, UnaryFunction } from '../../interfaces.js'; export function toNodeStream(): UnaryFunction< AsyncIterable, AsyncIterableReadable >; export function toNodeStream( options: ReadableOptions & { objectMode: true } ): UnaryFunction, AsyncIterableReadable>; export function toNodeStream( options: ReadableOptions & { objectMode: false } ): UnaryFunction, AsyncIterableReadable>; export function toNodeStream( options?: ReadableOptions ): UnaryFunction, AsyncIterableReadable> { return function toNodeStreamOperatorFunction( source: AsyncIterable ): AsyncIterableReadable { return !options || options.objectMode === true ? new AsyncIterableReadable(source, options) : new AsyncIterableReadable(source, options); }; }