decorate<T>(classProto): (new (inner) => InstanceType<T> & Decorator<T>)
Extend a class with a decorate(ClassName) to create a decorator class that accepts any original target of T and returns
a decorated class that by default redirects all calls to the target of the decorator (called inner) and allows the decorator itself to
extend the original class overriding any function.
The benefit of this is that you don't need ot manually redirect all calls not decorated to the decorator and that you don't need to define an
interface.
This class is fully TS compatible and will provided valid TypeScript type hinting about the decorated class, the inner class property as well as
Extend a class with a decorate(ClassName) to create a decorator class that accepts any original target of T and returns a decorated class that by default redirects all calls to the target of the decorator (called inner) and allows the decorator itself to extend the original class overriding any function.
The benefit of this is that you don't need ot manually redirect all calls not decorated to the decorator and that you don't need to define an interface.
This class is fully TS compatible and will provided valid TypeScript type hinting about the decorated class, the inner class property as well as
Sample: