import OrderedIterable from "./helpers/OrderedIterable"; /** * Sorts the source iterable in ascending order based on a key selector. * * @typeParam T - Element type produced by the source iterable. * @typeParam TCmp - Key type produced by the selector. * @param src - Source iterable to order. * @param selector - Selector receiving each element and returning the key used for ordering. * @returns An {@link OrderedIterable} representing the ascending order and supporting chained `thenBy` calls. * @throws Error Rethrows any error thrown by `selector`. * * @example * ```ts * const words = ["pear", "banana", "fig", "apple"]; * const byLength = [..._orderBy(words, (word) => word.length)]; * console.log(byLength); // ["fig", "pear", "apple", "banana"] * ``` * * or using the curried version: * ```ts * const byLength = [ * ...pipeInto( * ["pear", "banana", "fig", "apple"], * orderBy((word) => word.length) * ), * ]; * console.log(byLength); // ["fig", "pear", "apple", "banana"] * ``` */ export declare function _orderBy(src: Iterable, selector: (x: T) => TCmp): OrderedIterable; /** * Curried version of {@link _orderBy}. */ export declare const orderBy: (selector: (x: T) => TCmp) => (src: Iterable) => OrderedIterable;