I'm trying to use the "mixins" design pattern in typescript. The problem is that webpack will not transpile the source code because I'm using methods declared in the mixins and not in the main class.
For exemple if my i Have the mixin
class TestMixin {
test(): void {
console.log('test');
}
}
Apply on the "Main" class and trying to use it:
const main = new Main();
main.test();
After applying the mixins, webpacks stop with the error: "Property 'test' does not exist on type "
I know that in PHP you use use the phpdoc blocks to define porperties or methods that don't really exists (and magic methods will be called) and I thought maybe it could be done in TYpescript too using JSdoc.
I found somewhere, a few days ago, something link that, if I remember right
/**
* @function Main~test
*/
and at that time it seemed to work (for my IDE at least, I did not try to build the code at the moment), but when I try know it does not work (neither for webpack nor my IDE) and I can't recall where I found it the first time.
Does anybody know how to tell the IDE & transpilers that a dynamically defined property exists on a class ?