Transforms a JSON-compatible type T such that it and any nested arrays
or basic objects are read-only.
Warnings:
Instances of most classes could still be modified via methods, aside from
built-in Arrays, which are transformed to ReadonlyArrays with no
mutator methods.
This only affects static type-checking and is not a guarantee of run-time
immutability. Values with this type could still be modified if casted
to any, passed into a function with an any signature, or by untyped
JavaScript.
Use deepCopy(value) to get a fully mutable copy of a ReadonlyDeep.
Transforms a JSON-compatible type
T
such that it and any nested arrays or basic objects are read-only.Warnings:
Array
s, which are transformed toReadonlyArray
s with no mutator methods.any
, passed into a function with anany
signature, or by untyped JavaScript.Use
deepCopy(value)
to get a fully mutable copy of aReadonlyDeep
.