// From DefinitelyTyped by Emily Marigold Klassen <https://github.com/forivall>

/**
 * Sort an object's keys, including an optional key list.
 *
 * @param object - An object.
 * @param sortWith - An ordered keys array or a sort function.
 * @returns Sorted object.
 */
declare function sortObjectByKeyNameList<T>(
  object: T,
  sortWith?: ReadonlyArray<keyof T> | ((a: keyof T, b: keyof T) => number),
): T

export default sortObjectByKeyNameList
