实现高级工具类型 UnionToIntersection<U> 用于将联合类型转化为交叉类型。
UnionToIntersection<U>
例如:
type I = UnionToIntersection<'foo' | 42 | true> // expected to be 'foo' & 42 & true
TypeScript