相关疑难解决方法(0)

将联合类型转换为交集类型

有没有办法将联合类型转换为交集类型:

type FunctionUnion = () => void | (p: string) => void
type FunctionIntersection = () => void & (p: string) => void
Run Code Online (Sandbox Code Playgroud)

我想应用转换FunctionUnion来获取FunctionIntersection

typescript

55
推荐指数
4
解决办法
4645
查看次数

标签 统计

typescript ×1