import { OrderRule } from "../node_modules/.pnpm/remeda@2.39.0_patch_hash_e9e98c19bf4c5844450bf78de4493bf242de2fdb7c7ecf7ee2313945578d9b68/node_modules/remeda/dist/index.mjs"; //#region src/array/array-take-first-by.d.ts /** * Returns the `count` "smallest" elements of `array` by the given ordering * `rules`, computed in O(n) **without** fully sorting (a partial selection). * Because no full sort happens, **the order of the returned elements is not * guaranteed** — only their set is. * * Each rule is either a projection `(item) => comparable` (ascending) or a * `[projection, 'asc' | 'desc']` pair; later rules break ties. * @param array - The array to select from. Not mutated. * @param count - How many of the "smallest" elements (by the ordering) to take. * @param rules - One or more ordering rules; later rules break ties of earlier ones. * @returns A new array of the `count` smallest elements (in unspecified order). * @example * // The 2 smallest values * arrayTakeFirstBy([3, 1, 4, 1, 5], 2, (value) => value); * // [1, 1] * @example * // The 2 largest values (set — order not guaranteed) * arrayTakeFirstBy([3, 1, 4, 1, 5], 2, [(value) => value, 'desc']); * // [4, 5] */ declare const arrayTakeFirstBy: (array: readonly T[], count: number, ...rules: [OrderRule, ...OrderRule[]]) => T[]; //#endregion export { arrayTakeFirstBy };