sajad torkamani
type MyReadonly<Type> = {
  readonly [Key in keyof Type]: Type[Key]
}
  • Create a mapped type where you assign the readonly modifier to each property.

TS Playground

Tagged: