import { IOrderedEnumerable } from '../types'; import { Comparer } from '../types'; /** * Sorts the elements of a sequence in ascending order. * @example * ```typescript * const items = [1, 3, 2]; * const ordered = order(items).toArray(); // Will be [1, 2, 3] * ``` * @typeparam TSource The type of the source iterable. * @param src The source iterable. * @returns An IOrderedEnumerable whose elements are sorted. */ export declare function order(src: Iterable): IOrderedEnumerable; /** * Sorts the elements of a sequence in ascending order. * @example * ```typescript * const items = [1, 3, 2]; * const ordered = order(items).toArray(); // Will be [1, 2, 3] * ``` * @typeparam TSource The type of the source iterable. * @param src The source iterable. * @param comparer An Comparer to compare keys. * @returns An IOrderedEnumerable whose elements are sorted. */ export declare function order(src: Iterable, comparer: Comparer): IOrderedEnumerable; /** * Sorts the elements of a sequence in descending order. * @example * ```typescript * const items = [1, 3, 2]; * const ordered = orderDescending(items).toArray(); // Will be [3, 2, 1] * ``` * @typeparam TSource The type of the source iterable. * @param src The source iterable. * @returns An IOrderedEnumerable whose elements are sorted. */ export declare function orderDescending(src: Iterable): IOrderedEnumerable; /** * Sorts the elements of a sequence in descending order. * @example * ```typescript * const items = [1, 3, 2]; * const ordered = orderDescending(items).toArray(); // Will be [3, 2, 1] * ``` * @typeparam TSource The type of the source iterable. * @param src The source iterable. * @param comparer An Comparer to compare keys. * @returns An IOrderedEnumerable whose elements are sorted. */ export declare function orderDescending(src: Iterable, comparer: Comparer): IOrderedEnumerable; /** * Sorts the elements of a sequence in ascending order. * @example * ```typescript * const items = [{ id: 1 }, { id: 3 }, { id: 2 }]; * const ordered = orderBy(items, x => x.id).toArray(); // Will be [{ id: 1 }, { id: 2 }, { id: 3 }] * ``` * @typeparam TSource The type of the source iterable. * @typeparam TKey The type of the key returned by keySelector. * @param src The source iterable. * @param keySelector A function to extract the key for each element. * @returns An IOrderedEnumerable whose elements are sorted according to a key. */ export declare function orderBy(src: Iterable, keySelector: (item: TSource) => TKey): IOrderedEnumerable; /** * Sorts the elements of a sequence in ascending order. * @example * ```typescript * const items = [{ id: 1 }, { id: 3 }, { id: 2 }]; * const ordered = orderBy(items, x => x.id).toArray(); // Will be [{ id: 1 }, { id: 2 }, { id: 3 }] * ``` * @typeparam TSource The type of the source iterable. * @typeparam TKey The type of the key returned by keySelector. * @param src The source iterable. * @param keySelector A function to extract the key for each element. * @param comparer An Comparer to compare keys. * @returns An IOrderedEnumerable whose elements are sorted according to a key. */ export declare function orderBy(src: Iterable, keySelector: (item: TSource) => TKey, comparer: Comparer): IOrderedEnumerable; /** * Sorts the elements of a sequence in descending order. * @example * ```typescript * const items = [{ id: 1 }, { id: 3 }, { id: 2 }]; * const ordered = orderByDescending(items, x => x.id).toArray(); // Will be [{ id: 3 }, { id: 2 }, { id: 1 }] * ``` * @typeparam TSource The type of the source iterable. * @typeparam TKey The type of the key returned by keySelector. * @param src The source iterable. * @param keySelector A function to extract the key for each element. * @returns An IOrderedEnumerable whose elements are sorted according to a key. */ export declare function orderByDescending(src: Iterable, keySelector: (item: TSource) => TKey): IOrderedEnumerable; /** * Sorts the elements of a sequence in descending order. * @example * ```typescript * const items = [{ id: 1 }, { id: 3 }, { id: 2 }]; * const ordered = orderByDescending(items, x => x.id).toArray(); // Will be [{ id: 3 }, { id: 2 }, { id: 1 }] * ``` * @typeparam TSource The type of the source iterable. * @typeparam TKey The type of the key returned by keySelector. * @param src The source iterable. * @param keySelector A function to extract the key for each element. * @param comparer An Comparer to compare keys. * @returns An IOrderedEnumerable whose elements are sorted according to a key. */ export declare function orderByDescending(src: Iterable, keySelector: (item: TSource) => TKey, comparer: Comparer): IOrderedEnumerable; //# sourceMappingURL=orderBy.d.ts.map