Recursively make all properties readonly.
Object type to transform
Applies readonly modifiers deeply to all properties. Function types are preserved unchanged.
readonly
type User = { id: number; profile: { name: string; address: { city: string } } };type Readonly = DeepReadonly< User >;// { readonly id: number; readonly profile: { readonly name: string; readonly address: { readonly city: string } } } Copy
type User = { id: number; profile: { name: string; address: { city: string } } };type Readonly = DeepReadonly< User >;// { readonly id: number; readonly profile: { readonly name: string; readonly address: { readonly city: string } } }
Recursively make all properties readonly.