The Readonly<T[K]> for primitives is unnecessary because those types don't have any mutable structure - you can't edit what is stored inside a number, string or symbol object. (Also you missed out boolean.) For all primitives you can just map to T[K].
You're already making the properties (that hold these values) read-only by wrapping the whole type in Readonly on the first line, so that's enough.
(If you wrap them with Readonly unnecessarily then TS can generate spurious type errors.)
The
Readonly<T[K]>for primitives is unnecessary because those types don't have any mutable structure - you can't edit what is stored inside a number, string or symbol object. (Also you missed outboolean.) For all primitives you can just map toT[K].You're already making the properties (that hold these values) read-only by wrapping the whole type in
Readonlyon the first line, so that's enough.(If you wrap them with
Readonlyunnecessarily then TS can generate spurious type errors.)Excellent point, thanks Daniel! 😁