UNPKG

1.43 kBTypeScriptView Raw
1import { AsyncIterableX } from './asynciterablex';
2export declare class CatchAllAsyncIterable<TSource> extends AsyncIterableX<TSource> {
3 private _source;
4 constructor(source: Iterable<AsyncIterable<TSource>>);
5 [Symbol.asyncIterator](signal?: AbortSignal): AsyncGenerator<TSource, void, unknown>;
6}
7/**
8 * Continues an async-iterable sequence that is terminated by an exception with the next async-iterable sequence.
9 *
10 * @export
11 * @template T The type of the elements in the source and handler sequences.
12 * @param {Iterable<AsyncIterable<T>>} source async-iterable sequences to catch exceptions for.
13 * @returns {AsyncIterableX<T>} An async-iterable sequence containing elements from consecutive source
14 * sequences until a source sequence terminates successfully.
15 */
16export declare function catchAll<T>(source: Iterable<AsyncIterable<T>>): AsyncIterableX<T>;
17/**
18 * Continues an async-iterable sequence that is terminated by an exception with the next async-iterable sequence.
19 *
20 * @export
21 * @template T The type of the elements in the source and handler sequences.
22 * @param {...AsyncIterable<T>[]} args async-iterable sequences to catch exceptions for.
23 * @returns {AsyncIterableX<T>} An async-iterable sequence containing elements from consecutive source
24 * sequences until a source sequence terminates successfully.
25 */
26export declare function catchError<T>(...args: AsyncIterable<T>[]): AsyncIterableX<T>;