我想从类型中排除一个属性.我怎样才能做到这一点?
比如我有
interface XYZ {
x: number;
y: number;
z: number;
}
Run Code Online (Sandbox Code Playgroud)
我想排除属性z得到
type XY = { x: number, y: number };
Run Code Online (Sandbox Code Playgroud) 有没有办法将联合类型转换为交集类型:
type FunctionUnion = () => void | (p: string) => void
type FunctionIntersection = () => void & (p: string) => void
Run Code Online (Sandbox Code Playgroud)
我想应用转换FunctionUnion来获取FunctionIntersection
typescript ×2