import { OperatorFunction } from '../../interfaces.js'; import { ConcatIterable } from '../concat.js'; /** * Concatenates the second iterable sequence to the first iterable sequence upon successful termination of the first. * * @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 {Iterable} v1 First iterable source. * @param {Iterable} v2 Second iterable source. * @returns {(OperatorFunction)} An iterable sequence that contains the elements of the first sequence, * followed by those of the second the sequence. */ export function concatWith(v2: Iterable): OperatorFunction; /** * Concatenates all iterable sequences in the given sequences, as long as the previous iterable * sequence terminated successfully. * * @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 {Iterable} v1 First iterable source. * @param {Iterable} v2 Second iterable source. * @param {Iterable} v3 Third iterable source. * @returns {(OperatorFunction)} An iterable sequence that contains the elements of each given sequence, * in sequential order. */ export function concatWith( v2: Iterable, v3: Iterable ): OperatorFunction; /** * Concatenates all iterable sequences in the given sequences, as long as the previous iterable * sequence terminated successfully. * * @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 {Iterable} v2 Second iterable source. * @param {Iterable} v3 Third iterable source. * @param {Iterable} v4 Fourth iterable source. * @returns {(OperatorFunction)} An iterable sequence that contains the elements of each * given sequence, in sequential order. */ export function concatWith( v2: Iterable, v3: Iterable, v4: Iterable ): OperatorFunction; /** * Concatenates all iterable sequences in the given sequences, as long as the previous iterable * sequence terminated successfully. * * @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 {Iterable} v2 Second iterable source. * @param {Iterable} v3 Third iterable source. * @param {Iterable} v4 Fourth iterable source. * @param {Iterable} v5 Fifth iterable source. * @returns {(OperatorFunction)} An iterable sequence that contains the elements of each * given sequence, in sequential order. */ export function concatWith( v2: Iterable, v3: Iterable, v4: Iterable, v5: Iterable ): OperatorFunction; /** * Concatenates all iterable sequences in the given sequences, as long as the previous iterable * sequence terminated successfully. * * @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 {Iterable} v2 Second iterable source. * @param {Iterable} v3 Third iterable source. * @param {Iterable} v4 Fourth iterable source. * @param {Iterable} v5 Fifth iterable source. * @param {Iterable} v6 Sixth iterable source. * @returns {(OperatorFunction)} An iterable sequence that contains the elements of each * given sequence, in sequential order. */ export function concatWith( v2: Iterable, v3: Iterable, v4: Iterable, v5: Iterable, v6: Iterable ): OperatorFunction; /** * Concatenates all iterable sequences in the given sequences, as long as the previous iterable * sequence terminated successfully. * * @template T The type of the elements in the sequences. * @param {...Iterable[]} args The iterable sources. * @returns {AsyncIterableX} An iterable sequence that contains the elements of each given sequence, in sequential order. */ export function concatWith(...args: Iterable[]): OperatorFunction { return function concatWithOperatorFunction(source: Iterable) { return new ConcatIterable([source, ...args]); }; }