Напишите тип MyReadonly который делает все поля только для чтения.
type User = {
id: number
name: string
}
type MyReadonly<T> = any
const user: MyReadonly<User> = { id: 1, name: "John" }
user.name = "Jane"#домашка #typescript
ВЁ Вёрстка сайтов | HTML, CSS, JS @free_html_lessons · 4.5K subscribers 
type User = {
id: number
name: string
}
type MyReadonly<T> = any
const user: MyReadonly<User> = { id: 1, name: "John" }
user.name = "Jane"