type TYPE1 {...}
type TYPE2 {...}
type TYPE3 {...}
type TYPE4 {...}
type ALL = TYPE1 | TYPE2 | TYPE3 | TYPE4
问: task 是 TYPE1 | TYPE2 | TYPE3 类型应该怎么表示?(排除 TYPE2 ),这里 ALL 可能有很多种类型,所以不想重新写一遍
1
bi531334444 2023-11-06 13:53:17 +08:00
Exclude
|
2
Zhuzhuchenyan 2023-11-06 22:04:19 +08:00
type A = {a: string};
type B = {b: string}; type C = {c: string}; type D = {d: string}; type All = A | B | C | D; type AllButD = Exclude<All, D>; |