import { AsyncIterableX } from '../../asynciterable/asynciterablex' ; import { GroupByAsyncIterable , GroupedAsyncIterable } from '../../asynciterable/operators/groupby' ; import { identityAsync } from '../../util/identity' ; export function groupByProto < TSource , TKey > ( this , keySelector ) ; export function groupByProto < TSource , TKey , TValue > ( this , keySelector , elementSelector ? ) ; export function groupByProto < TSource , TKey , TValue > ( this , keySelector , elementSelector = identityAsync ) { return new GroupByAsyncIterable < TSource , TKey , TValue > ( this , keySelector , elementSelector ) ; } AsyncIterableX . prototype . groupBy = groupByProto ; declare module '../../asynciterable/asynciterablex' { interface AsyncIterableX < T > { groupBy : typeof groupByProto ; } }