当前位置 : 主页 > 网络编程 > 其它编程 >

[Typescript]Extendsandoverrideanexistinginterface

来源:互联网 收集:自由互联 发布时间:2023-07-02
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' | '
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}

 

上一篇:CROSSAPPLY与OUTERAPPLY关联查询
下一篇:没有了
网友评论