e0ipso / plugnplay

🤖 Plugin system for reusable code in node.js
GNU General Public License v2.0
67 stars 13 forks source link

Suggestion: Add Return-Type to PluginLoaderBase Class #77

Open mxzinke opened 4 years ago

mxzinke commented 4 years ago

I just encountered at trying out the package, that it would be cleaner on my implementation, when I could define explicit Return-Types.

With that each Plugin-Type has a predefined Interface, which is usable at the Plugin-Manager side and it is more clearer what is actually usable. Also the "weird" type-definition is not needed anymore, because it can be done by flow (or even typescript?).

What do you think?

Ah yeah, if you need someone implementing this, I am your men! 😉

e0ipso commented 4 years ago

I would love to switch to TypeScript, if that was in place this would be a no-brainer. The goal with the "weird" type definition is that 3rd parties that define widgets of a predefined type adhere to the definition regardless of the technology used in that 3rd party project.

I have not been able to implement many of the ideas that I have for this project. I am looking for someone with time and energy to help out with this. Would you be interested?