作者:合约100年 | 来源:互联网 | 2023-07-01 18:42
Forexample,youhaveanobject`A`,youwanttoextenditandmodifysomeprop;thencreateanewinterfaceB:
For example, you have an object `A`, you want to extend it and modify some prop; then create a new interface B:
export interface B extends Omit'x' | 'y'> {
x: string; // override x
y: number; // override y
newProp?: string; // add new prop
}