import { OperatorAsyncFunction } from '../../interfaces.js'; import { CombineLatestAsyncIterable } from '../combinelatest.js'; /** * Merges multiple async-iterable sequences into one async-iterable sequence as an array whenever * one of the async-iterable sequences produces an element. * * @template T The type of the elements in the first source sequence. * @template T2 The type of the elements in the second source sequence. * @param {AsyncIterable} source First async-iterable source. * @param {AsyncIterable} source2 Second async-iterable source. * @returns {OperatorAsyncFunction} An async-iterable sequence containing an array of all sources. */ export function combineLatestWith( source2: AsyncIterable ): OperatorAsyncFunction; /** * Merges multiple async-iterable sequences into one async-iterable sequence as an array whenever * one of the async-iterable sequences produces an element. * * @template T The type of the elements in the first source sequence. * @template T2 The type of the elements in the second source sequence. * @template T3 The type of the elements in the third source sequence. * @param {AsyncIterable} source2 Second async-iterable source. * @param {AsyncIterable} source3 Third async-iterable source. * @returns {OperatorAsyncFunction} An async-iterable sequence containing an array of all sources. */ export function combineLatestWith( source2: AsyncIterable, source3: AsyncIterable ): OperatorAsyncFunction; /** * Merges multiple async-iterable sequences into one async-iterable sequence as an array whenever * one of the async-iterable sequences produces an element. * * @template T The type of the elements in the first source sequence. * @template T2 The type of the elements in the second source sequence. * @template T3 The type of the elements in the third source sequence. * @template T4 The type of the elements in the fourth source sequence. * @param {AsyncIterable} source2 Second async-iterable source. * @param {AsyncIterable} source3 Third async-iterable source. * @param {AsyncIterable} source4 Fourth async-iterable source. * @returns {OperatorAsyncFunction} An async-iterable sequence containing an array of all sources. */ export function combineLatestWith( source2: AsyncIterable, source3: AsyncIterable, source4: AsyncIterable ): OperatorAsyncFunction; /** * Merges multiple async-iterable sequences into one async-iterable sequence as an array whenever * one of the async-iterable sequences produces an element. * * @template T The type of the elements in the first source sequence. * @template T2 The type of the elements in the second source sequence. * @template T3 The type of the elements in the third source sequence. * @template T4 The type of the elements in the fourth source sequence. * @template T5 The type of the elements in the fifth source sequence. * @param {AsyncIterable} source2 Second async-iterable source. * @param {AsyncIterable} source3 Third async-iterable source. * @param {AsyncIterable} source4 Fourth async-iterable source. * @param {AsyncIterable} source5 Fifth async-iterable source. * @returns {OperatorAsyncFunction} An async-iterable sequence containing an array of all sources. */ export function combineLatestWith( source2: AsyncIterable, source3: AsyncIterable, source4: AsyncIterable, source5: AsyncIterable ): OperatorAsyncFunction; /** * Merges multiple async-iterable sequences into one async-iterable sequence as an array whenever * one of the async-iterable sequences produces an element. * * @template T The type of the elements in the first source sequence. * @template T2 The type of the elements in the second source sequence. * @template T3 The type of the elements in the third source sequence. * @template T4 The type of the elements in the fourth source sequence. * @template T5 The type of the elements in the fifth source sequence. * @template T6 The type of the elements in the sixth source sequence. * @param {AsyncIterable} source2 Second async-iterable source. * @param {AsyncIterable} source3 Third async-iterable source. * @param {AsyncIterable} source4 Fourth async-iterable source. * @param {AsyncIterable} source5 Fifth async-iterable source. * @param {AsyncIterable} source6 Sixth async-iterable source. * @returns {OperatorAsyncFunction} An async-iterable sequence containing an array of all sources. */ export function combineLatestWith( source2: AsyncIterable, source3: AsyncIterable, source4: AsyncIterable, source5: AsyncIterable, source6: AsyncIterable ): OperatorAsyncFunction; /** * Merges multiple async-iterable sequences into one async-iterable sequence as an array whenever * one of the async-iterable sequences produces an element. * * @template T The of the elements in the source sequences. * @param {...AsyncIterable[]} sources The async-iterable sources. * @returns {OperatorAsyncFunction} An async-iterable sequence containing an array of all sources. */ export function combineLatestWith(...sources: AsyncIterable[]): OperatorAsyncFunction; export function combineLatestWith(...sources: any[]): OperatorAsyncFunction { return function combineLatestOperatorFunction(source: AsyncIterable) { return new CombineLatestAsyncIterable([source, ...sources]); }; }