If we have 2 different classes A and B that share 77 property-type declarations, but not the methods (including the constructor):
class A {
public p1:number
public p2: string
//...
public p77:"hello";
constructor(){
this.p1 = 5
//...
}
}
class B {
public p1:number;
public p2:string;
//...
public p77:"hello";
public p78: number
//... more properties
constructor(){
// they set properties in a different way
this.p1=879;
//...
this.p78=8;
}
}
Is there any way to use the first 77 properties type declarations from class A in class B? Is there any way for B to extend A type declaration?
I searched everywhere and couldn't come up with a solution.
How can I avoid declaring properties twice here?