import { type SortableTypes } from './comparators.js'; /** * Sort array by a specific property or transformation * * May also provide an array of properties or transformations to provide tiebreakers. * * Follow any property or transformation with a `true` argument if you want a descending sort. * * Comparison algorithm is chosen automatically and supports strings, numbers, and * dates. * * undefined or null will always sort to the bottom. If you want them to sort to the top, you * can .reverse() the output array and invert your descending booleans. * * Examples: * * simple sort by a property * sortby(myarray, 'myproperty') * * simple descending sort * sortby(myarray, 'myproperty', true) * * sort with a tiebreaker property * sortby(myarray, 'myproperty', 'mynextproperty') * * sort descending with a tiebreaker * sortby(myarray, 'myproperty', true, 'mynextproperty') * * sort with a descending tiebreaker * sortby(myarray, 'myproperty', 'mynextproperty', true) * * sort with a transformation * sortby(myarray, itm => itm.count - 100) */ export declare function sortby(collection: T[], ...args: (boolean | keyof T | string | ((obj: T) => SortableTypes | undefined | null))[]): T[];