import type { Comparator, Mapper, SortDirection, SortOptions, StringMap } from '../types.js'; declare class Comparators { /** * Good for numbers. */ numericAsc(this: void, a: number, b: number): number; numericDesc(this: void, a: number, b: number): number; localeAsc(this: void, a: string, b: string): number; localeDesc(this: void, a: string, b: string): number; by(this: void, mapper: Mapper, opt?: ComparatorByOptions): Comparator; updatedAsc(this: void, a: { updated: number; }, b: { updated: number; }): number; updatedDesc(this: void, a: { updated: number; }, b: { updated: number; }): number; createdAsc(this: void, a: { created: number; }, b: { created: number; }): number; createdDesc(this: void, a: { created: number; }, b: { created: number; }): number; } export declare const comparators: Comparators; interface ComparatorByOptions { /** * Defaults to 'asc'. */ dir?: SortDirection; } /** * _sortBy([{age: 20}, {age: 10}], 'age') * // => [{age: 10}, {age: 20}] * * Same: * _sortBy([{age: 20}, {age: 10}], o => o.age) */ export declare function _sortBy(items: T[], mapper: Mapper, opt?: SortOptions): T[]; /** * Like _stringMapValues, but values are sorted. */ export declare function _stringMapValuesSorted(map: StringMap, mapper: Mapper, dir?: SortDirection): T[]; export {};