I am attempting to have class A
inherit properties from class B
without using the extends
keyword. To achieve this, I am utilizing a mixin in the following manner:
class A{
someProp: String
someMethod(){}
}
class B implements classA{
someProp: String
someMethod: () => void;
}
However, I want to avoid having to redeclare all the properties and methods in classA
, so I am experimenting with the Partial
keyword like so:
class B implements Partial<classA>{}
Unfortunately, when I try this approach, the TypeScript compiler throws an error:
A class may only implement another class or interface
Does anyone have suggestions on how I can resolve this issue?