/*! * sort-object * * Copyright (c) 2014-2015, Brian Woodward. * Licensed under the MIT License */ /** * Sort function type - compares two values for ordering. */ export type SortFunction = (a: string, b: string) => number; /** * Options for the sort function. */ export interface SortOptions = Record> { /** Array of keys to include in the result (in order). */ keys?: string[]; /** Custom sort function for keys. */ sort?: SortFunction; /** Sort order: 'asc' or 'desc' (case insensitive). */ sortOrder?: "asc" | "desc" | "ASC" | "DESC" | string; /** Function that returns an array of keys to sort by. */ sortBy?: (obj: T) => string[]; /** Property path to sort by (for objects with nested values). */ prop?: string; /** Custom getter function for extracting sort values. */ get?: (val: unknown, prop?: string) => unknown; /** If true, recursively sort nested objects. */ deep?: boolean; } /** * Sort the keys in an object. * * @param obj - The object to sort. * @param options - Sort options, or an array of keys. * @returns A new object with sorted keys. */ export declare function sort>(obj: T, options?: SortOptions | string[]): Partial; export default sort; //# sourceMappingURL=index.d.ts.map