//#region src/Array/mapAt.d.ts /** * # mapAt * * ```ts * function Array.mapAt( * target: readonly T[], * idx: number, * map: ( * value: NoInfer, * index: number, * target: readonly NoInfer[], * ) => T, * ): readonly T[] * ``` * * Applies the `mapper` function to the element at the specified `index` in `array`, returning a new array with the mapped element. * * ## Example * * ```ts [data-first] * import { Array } from "@monstermann/array"; * * Array.mapAt([1, 2, 3, 4], 1, (x) => x * 10); // [1, 20, 3, 4] * ``` * * ```ts [data-last] * import { Array } from "@monstermann/array"; * * pipe( * [1, 2, 3, 4], * Array.mapAt(1, (x) => x * 10), * ); // [1, 20, 3, 4] * ``` * */ declare const mapAt: { (idx: number, map: (value: NoInfer, index: number, target: readonly NoInfer[]) => T): (target: T[]) => T[]; (idx: number, map: (value: NoInfer, index: number, target: readonly NoInfer[]) => T): (target: readonly T[]) => readonly T[]; (target: T[], idx: number, map: (value: NoInfer, index: number, target: readonly NoInfer[]) => T): T[]; (target: readonly T[], idx: number, map: (value: NoInfer, index: number, target: readonly NoInfer[]) => T): readonly T[]; }; //#endregion export { mapAt };