import { OperatorAsyncFunction } from '../../interfaces.js'; import { MergeAsyncIterable } from '../merge.js'; /** * Merges elements from all of the specified async-iterable sequences into a single async-iterable sequence. * * @template T The type of the first async-iterable sequence. * @template T2 The type of the second async-iterable sequence. * @param {AsyncIterable} source The first async-iterable source to merge. * @param {AsyncIterable} v2 The second async-iterable source to merge. * @returns {(OperatorAsyncFunction)} The merged elements from all of the specified async-iterable sequences * into a single async-iterable sequence. */ export function mergeWith(v2: AsyncIterable): OperatorAsyncFunction; /** * Merges elements from all of the specified async-iterable sequences into a single async-iterable sequence. * * @template T The type of the first async-iterable sequence. * @template T2 The type of the second async-iterable sequence. * @template T3 The type of the third async-iterable sequence. * @param {AsyncIterable} v2 The second async-iterable source to merge. * @param {AsyncIterable} v3 The third async-iterable source to merge. * @returns {(OperatorAsyncFunction)} The merged elements from all of the specified async-iterable sequences * into a single async-iterable sequence. */ export function mergeWith( v2: AsyncIterable, v3: AsyncIterable ): OperatorAsyncFunction; /** * Merges elements from all of the specified async-iterable sequences into a single async-iterable sequence. * * @template T The type of the first async-iterable sequence. * @template T2 The type of the second async-iterable sequence. * @template T3 The type of the third async-iterable sequence. * @template T4 The type of the fourth async-iterable sequence. * @param {AsyncIterable} v2 The second async-iterable source to merge. * @param {AsyncIterable} v3 The third async-iterable source to merge. * @param {AsyncIterable} v4 The fourth async-iterable source to merge. * @returns {(OperatorAsyncFunction)} The merged elements from all of the specified async-iterable sequences * into a single async-iterable sequence. */ export function mergeWith( source: AsyncIterable, v2: AsyncIterable, v3: AsyncIterable, v4: AsyncIterable ): OperatorAsyncFunction; /** * Merges elements from all of the specified async-iterable sequences into a single async-iterable sequence. * * @template T The type of the first async-iterable sequence. * @template T2 The type of the second async-iterable sequence. * @template T3 The type of the third async-iterable sequence. * @template T4 The type of the fourth async-iterable sequence. * @template T5 The type of the fifth async-iterable sequence. * @param {AsyncIterable} v2 The second async-iterable source to merge. * @param {AsyncIterable} v3 The third async-iterable source to merge. * @param {AsyncIterable} v4 The fourth async-iterable source to merge. * @param {AsyncIterable} v5 The fifth async-iterable source to merge. * @returns {(OperatorAsyncFunction)} The merged elements from all of the specified async-iterable sequences * into a single async-iterable sequence. */ export function mergeWith( v2: AsyncIterable, v3: AsyncIterable, v4: AsyncIterable, v5: AsyncIterable ): OperatorAsyncFunction; /** * Merges elements from all of the specified async-iterable sequences into a single async-iterable sequence. * * @template T The type of the first async-iterable sequence. * @template T2 The type of the second async-iterable sequence. * @template T3 The type of the third async-iterable sequence. * @template T4 The type of the fourth async-iterable sequence. * @template T5 The type of the fifth async-iterable sequence. * @template T6 The type of the sixth async-iterable sequence. * @param {AsyncIterable} v2 The second async-iterable source to merge. * @param {AsyncIterable} v3 The third async-iterable source to merge. * @param {AsyncIterable} v4 The fourth async-iterable source to merge. * @param {AsyncIterable} v5 The fifth async-iterable source to merge. * @param {AsyncIterable} v6 The sixth async-iterable source to merge. * @returns {(AsyncIterable)} The merged elements from all of the specified async-iterable sequences * into a single async-iterable sequence. */ export function mergeWith( v2: AsyncIterable, v3: AsyncIterable, v4: AsyncIterable, v5: AsyncIterable, v6: AsyncIterable ): OperatorAsyncFunction; /** * Merges elements from all of the specified async-iterable sequences into a single async-iterable sequence. * * @template T The type of the elements in the sequence to merge. * @param {...AsyncIterable[]} args The async-iterable sources to merge. * @returns {AsyncIterableX} The merged elements from all of the specified async-iterable sequences into a single async-iterable sequence. */ export function mergeWith( source: AsyncIterable, ...args: AsyncIterable[] ): OperatorAsyncFunction; export function mergeWith(...args: AsyncIterable[]): OperatorAsyncFunction { return function mergeWithOperatorFunction(source: AsyncIterable) { return new MergeAsyncIterable([source, ...args]); }; }