Merge type with inheritance

It is possible to merge two types if these ones are an interface or a class, by using extends. Extending an interface with another is an alternative to using the ampersand. In the following code example, the merged interface contains its own member, as well as the member of InterfaceA and InterfaceB:

interface InterfaceA {
m1: string;
}

interface InterfaceB {
m2: string;
}

interface InterfaceMergeAB extends InterfaceA, InterfaceB {
m3: string;
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.111.179