Type narrowing of “one level deep” discriminated union in Typescript

后端 未结 0 1026
忘了有多久
忘了有多久 2021-01-26 13:14

I\'m not able to get the following to typecheck:

type Apple = {
  variety: {type: \'fuji\'} | {type: \'gala\'}
}

type FujiApple = {
  [P in keyof Apple]: P exten         


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