Projects T to an object containing only its readonly properties.
T
Explicit readonly modifiers, getter-only accessors, optional modifiers, and property value types are preserved.
Object type to project.
interface Example{ value: number; readonly id: string; readonly created?: Date;}type Result = ReadonlyProperties<Example>;// {// readonly id: string;// readonly created?: Date;// } Copy
interface Example{ value: number; readonly id: string; readonly created?: Date;}type Result = ReadonlyProperties<Example>;// {// readonly id: string;// readonly created?: Date;// }
Projects
Tto an object containing only its readonly properties.Explicit readonly modifiers, getter-only accessors, optional modifiers, and property value types are preserved.