import { AsyncIterableX } from '../../asynciterable/asynciterablex.js'; import { orderBy, orderByDescending, OrderedAsyncIterableX, } from '../../asynciterable/operators/orderby.js'; import { thenBy as _thenBy, thenByDescending as _thenByDescending, } from '../../asynciterable/operators/orderby.js'; /** * @ignore */ export function orderByProto( this: AsyncIterableX, keySelector: (item: TSource) => TKey, comparer?: (fst: TKey, snd: TKey) => number ): OrderedAsyncIterableX { return orderBy(keySelector, comparer)(this); } /** * @ignore */ export function orderByDescendingProto( this: AsyncIterableX, keySelector: (item: TSource) => TKey, comparer?: (fst: TKey, snd: TKey) => number ): OrderedAsyncIterableX { return orderByDescending(keySelector, comparer)(this); } AsyncIterableX.prototype.orderBy = orderByProto; AsyncIterableX.prototype.orderByDescending = orderByDescendingProto; export declare namespace asynciterable { let thenBy: typeof _thenBy; let thenByDescending: typeof _thenByDescending; } declare module '../../asynciterable/asynciterablex' { interface AsyncIterableX { orderBy: typeof orderByProto; orderByDescending: typeof orderByDescendingProto; } }