Skip to content

Latest commit

 

History

History
20 lines (12 loc) · 1.67 KB

File metadata and controls

20 lines (12 loc) · 1.67 KB

Mutable 中等 #readonly #object-keys

by jiangshan @jiangshanmeta

接受挑战    English

实现一个通用的类型 Mutable<T>,使类型 T 的全部属性可变(非只读)。

例如:

interface Todo {
  readonly title: string
  readonly description: string
  readonly completed: boolean
}

type MutableTodo = Mutable<Todo> // { title: string; description: string; completed: boolean; }

返回首页 分享你的解答 查看解答