import { SwappedIndices } from "../node_modules/.pnpm/remeda@2.39.0_patch_hash_e9e98c19bf4c5844450bf78de4493bf242de2fdb7c7ecf7ee2313945578d9b68/node_modules/remeda/dist/index.mjs"; //#region src/array/array-swap-indexes.d.ts /** * Returns a copy of `array` with the elements at `index1` and `index2` * swapped. The return type is **tuple-preserving**, so swapping two literal * indices of a fixed-length tuple yields a tuple whose element *types* are * swapped at those positions. * * Negative indices count from the end (like `Array#at`). A `NaN` or * out-of-bounds index leaves the copy unchanged. * @param array - The array (or tuple) to copy and swap within. Not mutated. * @param index1 - The first index. Negative counts from the end. * @param index2 - The second index. Negative counts from the end. * @returns A new array with the two elements swapped. * @example * // Swap two elements * arraySwapIndexes([1, 2, 3, 4], 0, 2); * // [3, 2, 1, 4] * @example * // Tuple input — element types are swapped at those positions in the type * arraySwapIndexes(['a', 1, true] as const, 0, 2); * // [true, 1, 'a'] * @example * // Negative indices count from the end * arraySwapIndexes([1, 2, 3, 4], 0, -1); * // [4, 2, 3, 1] * @example * // An out-of-bounds index leaves the copy unchanged * arraySwapIndexes([1, 2, 3], 0, 10); * // [1, 2, 3] */ declare const arraySwapIndexes: (array: T, index1: Index1, index2: Index2) => SwappedIndices; //#endregion export { arraySwapIndexes };