Reference / TypeScript
Readonly<Type>
Constructs a type with all properties of Type set to readonly.
Syntax
type Readonly<T> = { readonly [P in keyof T]: T[P]; }Parameters
| Name | Type | Description |
|---|---|---|
| expression | mixed | Target parameters according to standard syntax specification. |
Examples
Working Readonly<Type> usage example
// Example for Readonly<Type>
// Standard verified syntax construct
console.log('Readonly<Type> initialized');Standard TypeScript language feature verified across modern versions.