import type { Ary } from "."; import type { Args, GenericFn, GenericResolver } from "../HKT"; /** * Mutate the element type of an {@link Ary} (i.e., `Array` or `ReadonlyArray`). * * Sig: `(y: U, a: Ary) => Ary` * * @example * ```typescript * type R1 = Mutate; * // ^?: number[] * type R2 = Mutate<"foo", readonly number[]>; * // ^?: readonly "foo"[] * ``` */ export type Mutate = A extends unknown[] ? U[] : readonly U[]; interface Resolver extends GenericResolver<[unknown, Ary], Ary> { on1_: ([y]: Args) => [[Ary], Ary]; on_1: ([, a]: Args) => [[unknown], Ary]; on11: ([y, a]: Args) => [[], Mutate]; } /** * [Fn] Mutate the element type of an {@link Ary} (i.e., `Array` or `ReadonlyArray`). * * Sig: `(y: U, a: Ary) => Ary` */ export default interface MutateFn extends GenericFn { def: ([y, a]: Args) => Mutate; }