import { AsyncIterableX } from './asynciterablex' ; import { wrapWithAbort } from './operators/withabort' ; import { throwIfAborted } from '../aborterror' ; export class ConcatAsyncIterable < TSource > extends AsyncIterableX < TSource > { private _source : Iterable < AsyncIterable < TSource > > ; constructor ( source ) { super ( ) ; this . _source = source ; } async * [ Symbol . asyncIterator ] ( signal ? ) { throwIfAborted ( signal ) ; for ( const outer of this . _source ) { for await ( const item of wrapWithAbort ( outer , signal ) ) { yield item ; } } } } export function _concatAll < TSource > ( source ) { return new ConcatAsyncIterable < TSource > ( source ) ; } template T template T2 param { AsyncIterable < T > } v1 param { AsyncIterable < T2 > } v2 returns { ( AsyncIterableX < T | T2 > ) } export function concat < T , T2 > ( v1 , v2 ) ; template T template T2 template T3 param { AsyncIterable < T > } v1 param { AsyncIterable < T2 > } v2 param { AsyncIterable < T3 > } v3 returns { ( AsyncIterableX < T | T2 | T3 > ) } export function concat < T , T2 , T3 > ( v1 , v2 , v3 ) ; template T template T2 template T3 template T4 param { AsyncIterable < T > } v1 param { AsyncIterable < T2 > } v2 param { AsyncIterable < T3 > } v3 param { AsyncIterable < T4 > } v4 returns { ( AsyncIterableX < T | T2 | T3 | T4 > ) } export function concat < T , T2 , T3 , T4 > ( v1 , v2 , v3 , v4 ) ; template T template T2 template T3 template T4 template T5 param { AsyncIterable < T > } v1 param { AsyncIterable < T2 > } v2 param { AsyncIterable < T3 > } v3 param { AsyncIterable < T4 > } v4 param { AsyncIterable < T5 > } v5 returns { ( AsyncIterable < T | T2 | T3 | T4 | T5 > ) } export function concat < T , T2 , T3 , T4 , T5 > ( v1 , v2 , v3 , v4 , v5 ) ; template T template T2 template T3 template T4 template T5 template T6 param { AsyncIterable < T > } v1 param { AsyncIterable < T2 > } v2 param { AsyncIterable < T3 > } v3 param { AsyncIterable < T4 > } v4 param { AsyncIterable < T5 > } v5 param { AsyncIterable < T6 > } v6 returns { ( AsyncIterable < T | T2 | T3 | T4 | T5 | T6 > ) } export function concat < T , T2 , T3 , T4 , T5 , T6 > ( v1 , v2 , v3 , v4 , v5 , v6 ) ; template T param { ... AsyncIterable < T > [ ] } args returns { AsyncIterableX < T > } export function concat < T > ( ... args ) { return new ConcatAsyncIterable < T > ( args ) ; }