How to tell TypeScript that the type of object[foo] is a subset of all the possible object.prop types

后端 未结 0 906
春和景丽
春和景丽 2020-12-18 03:57

For example, imagine I have this interface

interface Measurement {
  date: Date
  width: number
  height: number
  depth: number
  comment: string
}


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题