import { IsNumericLiteral } from "../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/is-literal.mjs"; import { ArrayRequiredPrefix } from "../node_modules/.pnpm/remeda@2.39.0_patch_hash_e9e98c19bf4c5844450bf78de4493bf242de2fdb7c7ecf7ee2313945578d9b68/node_modules/remeda/dist/index.mjs"; //#region src/array/array-has-min-elements.d.ts /** * Checks whether `array` contains at least `minimum` elements. When `minimum` * is a literal number, this acts as a **type guard** that narrows the array to * one with that many guaranteed (required) leading elements — so indexing the * first `minimum` positions afterwards is type-safe. A non-literal `minimum` * simply returns a `boolean`. * @param array - The array (or tuple) to check. Not mutated. * @param minimum - The minimum number of elements. Pass a literal for the type-guard narrowing. * @returns `true` when `array.length >= minimum`; narrows the array type when `minimum` is a literal. * @example * // Type guard — narrows to a known-minimum tuple * const values: number[] = [1, 2, 3]; * if (arrayHasMinElements(values, 2)) { * values[0].toFixed(); // `values` is now `[number, number, ...number[]]` * } * @example * // Plain boolean for a non-literal minimum * arrayHasMinElements([1, 2, 3], someCount); */ declare function arrayHasMinElements(array: T | readonly unknown[], minimum: IsNumericLiteral extends true ? N : never): array is ArrayRequiredPrefix; declare function arrayHasMinElements(array: readonly unknown[], minimum: number): boolean; //#endregion export { arrayHasMinElements };