import { AsyncIterableX } from '../asynciterablex.js'; import { UnaryFunction } from '../../interfaces.js'; /** @ignore */ export declare abstract class OrderedAsyncIterableBaseX extends AsyncIterableX { _source: AsyncIterable; constructor(source: AsyncIterable); [Symbol.asyncIterator](signal?: AbortSignal): AsyncGenerator, void, unknown>; thenBy(keySelector: (item: TSource) => TKey, comparer?: (fst: TKey, snd: TKey) => number): OrderedAsyncIterableBaseX; thenByDescending(keySelector: (item: TSource) => TKey, comparer?: (fst: TKey, snd: TKey) => number): OrderedAsyncIterableBaseX; abstract _getSorter(elements: TSource[], next?: (x: number, y: number) => number): (x: number, y: number) => number; } /** @ignore */ /** @ignore */ export declare class OrderedAsyncIterableX extends OrderedAsyncIterableBaseX { private _keySelector; private _comparer; private _descending; private _parent?; constructor(source: AsyncIterable, keySelector: (item: TSource) => TKey, comparer: (fst: TKey, snd: TKey) => number, descending: boolean, parent?: OrderedAsyncIterableBaseX); _getSorter(elements: TSource[], next?: (x: number, y: number) => number): (x: number, y: number) => number; } /** /** * Sorts the elements of a sequence in ascending order according to a key by using a specified comparer. * * @template TKey The type of the elements of source. * @template TSource The type of the key returned by keySelector. * @param {(item: TSource) => TKey} keySelector A function to extract a key from an element. * @param {(fst: TKey, snd: TKey) => number} [comparer=defaultSorter] A comparer to compare keys. * @returns {UnaryFunction, OrderedAsyncIterableX>} An ordered async-iterable sequence whose * elements are sorted according to a key and comparer. */ export declare function orderBy(keySelector: (item: TSource) => TKey, comparer?: (fst: TKey, snd: TKey) => number): UnaryFunction, OrderedAsyncIterableX>; /** * Sorts the elements of a sequence in descending order according to a key by using a specified comparer. * * @template TKey The type of the elements of source. * @template TSource The type of the key returned by keySelector. * @param {(item: TSource) => TKey} keySelector A function to extract a key from an element. * @param {(fst: TKey, snd: TKey) => number} [comparer=defaultSorter] A comparer to compare keys. * @returns {UnaryFunction, OrderedAsyncIterableX>} An ordered async-iterable sequence whose * elements are sorted in descending order according to a key and comparer. */ export declare function orderByDescending(keySelector: (item: TSource) => TKey, comparer?: (fst: TKey, snd: TKey) => number): UnaryFunction, OrderedAsyncIterableX>; /** * Performs a subsequent ordering of the elements in a sequence in ascending order according to a key using a specified comparer. * * @template TKey The type of the elements of source. * @template TSource The type of the key returned by keySelector. * @param {(item: TSource) => TKey} keySelector A function to extract a key from an element. * @param {(fst: TKey, snd: TKey) => number} [comparer=defaultSorter] A comparer to compare keys. * @returns {UnaryFunction, OrderedAsyncIterableX>} An ordered async-iterable whose elements are * sorted according to a key and comparer. */ export declare function thenBy(keySelector: (item: TSource) => TKey, comparer?: (fst: TKey, snd: TKey) => number): UnaryFunction, OrderedAsyncIterableX>; /** * Performs a subsequent ordering of the elements in a sequence in descending order according to a key using a specified comparer. * * @template TKey The type of the elements of source. * @template TSource The type of the key returned by keySelector. * @param {(item: TSource) => TKey} keySelector A function to extract a key from an element. * @param {(fst: TKey, snd: TKey) => number} [comparer=defaultSorter] A comparer to compare keys. * @returns {UnaryFunction, OrderedAsyncIterableX>} An ordered async-iterable whose elements are * sorted in descending order according to a key and comparer. */ export declare function thenByDescending(keySelector: (item: TSource) => TKey, comparer?: (fst: TKey, snd: TKey) => number): UnaryFunction, OrderedAsyncIterableX>;