Can typescript's discriminated union work with conditional types?

前端 未结 0 1808
误落风尘
误落风尘 2021-02-13 15:11

Suppose I have the following 3 types:

type Apple = {
   type: "apple"
}

type Banana = {
  type: "banana"
}

type Fruit

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