UNPKG

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