UNPKG

575 BTypeScriptView Raw
1/**
2 * Converts an existing async-iterable to a promise containing the array of values.
3 *
4 * @export
5 * @template TSource The type of elements in the source sequence.
6 * @param {AsyncIterable<TSource>} source The source sequence to convert to an array.
7 * @param {AbortSignal} [signal] An optional abort signal to cancel the operation at any time.
8 * @returns {Promise<TSource[]>} A promise containing all the items from the source sequence as an array.
9 */
10export declare function toArray<TSource>(source: AsyncIterable<TSource>, signal?: AbortSignal): Promise<TSource[]>;