Module Development in TypeScript
some time ago I switched all my modules to TypeScript (feel free to check out MMM-Jast as a reference implementations).
Especially for more complex modules, TypeScript brings huge advantages from my point of view.
Since the MagicMirror platform doesn’t provide its own TypeDefinitions, I made them available via the DefinitelyTyped library.
For interested developers I also plan to provide some kind of TypeScript template module soon.
. ├── src │ └── backend │ ├── Backend.ts │ ├── BackendUtils.ts │ └── ... │ └── frontend │ ├── Frontend.ts │ ├── FrontendUtils.ts │ └── ... │ └── types │ ├── ABC.ts │ └── ... └── templates │ ├── main.njk │ └── ... └── translations │ ├── de.json │ ├── en.json │ └── ... └── MMM-XYZ.js (generated) └── node_helper.js (generated) └── MMM-XYZ.css └── tsconfig.json └── rollup.config.json └── README.md └── package.json
Question: Are there any other developers among you who are interested in joining my “TypeScript” initiative? A little support from another developer in maintaining the type definitions would be helpful.
@jalibu there is a simple version of types in the main repo https://github.com/MichMich/MagicMirror/blob/master/module-types.ts
as you say, it is a very simple and incomplete version. And you can not install them as a package or use them in your modules, except if you copy the file.
In fact, that’s the real reason I created the typings on DefinitelyTyped.
You can find the sources here and the npm module here.
@Jalibu That is really cool, I was thinking about how typescript could be used when developing modules. Like you say, it has huge advantages.
What is the current state of the “TypeScript initiative”? Did it get under way?