effect-io-ai

Package: effect
Module: Types

Types.Mutable

Make all properties in T mutable. Supports arrays, tuples, and records as well.

Example

import type { Types } from "effect"

type MutableStruct = Types.Mutable<{ readonly a: string; readonly b: number }> // { a: string; b: number; }

type MutableArray = Types.Mutable<ReadonlyArray<string>> // string[]

type MutableTuple = Types.Mutable<readonly [string, number]> // [string, number]

type MutableRecord = Types.Mutable<{ readonly [_: string]: number }> // { [x: string]: number; }

Signature

type Mutable<T> = {
  -readonly [P in keyof T]: T[P]
}

Source

Since v2.0.0