import { IterableX } from '../iterablex.js'; import { UnaryFunction } from '../../interfaces.js'; /** @ignore */ export declare abstract class OrderedIterableBaseX extends IterableX { _source: Iterable; constructor(source: Iterable); [Symbol.iterator](): Generator; thenBy(keySelector: (item: TSource) => TKey, comparer?: (fst: TKey, snd: TKey) => number): OrderedIterableBaseX; thenByDescending(keySelector: (item: TSource) => TKey, comparer?: (fst: TKey, snd: TKey) => number): OrderedIterableBaseX; abstract _getSorter(elements: TSource[], next?: (x: number, y: number) => number): (x: number, y: number) => number; } /** @ignore */ /** @ignore */ export declare class OrderedIterableX extends OrderedIterableBaseX { private _keySelector; private _comparer; private _descending; private _parent?; constructor(source: Iterable, keySelector: (item: TSource) => TKey, comparer: (fst: TKey, snd: TKey) => number, descending: boolean, parent?: OrderedIterableBaseX); _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, OrderedIterableX>} An ordered 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, OrderedIterableX>; /** * 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, OrderedIterableX>} An ordered 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, OrderedIterableX>; /** * 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, OrderedIterableX>} An ordered 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, OrderedIterableX>; /** * 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, OrderedIterableX>} An ordered 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, OrderedIterableX>;