Since there now exists official TypeScript-types from Enonic , I have changed the purpose of “my” enonic-types package, to provide types for the libraries that doesn’t have official types yet.
Examples of these libraries are:
- [and many more…]
These types are completely compatible with the new official types, and they are published under the npm organization @item-enonic-types.
To use them you can just npm-install them individually (from this list), or install the good-old enonic-types to pull in all of them (as well as the official types).
You will also need to update your tsconfig.json like this (to include libraries under @item-enonic-types).
"types": ["node", "@item-enonic-types/global"],
Good job Enonic
I think @mta (and others) has done a fantastic job with the new official TypeScript-types , and I’m really looking forward to using them in my new project.
I would recommend everyone to migrate/upgrade to the official types, and I have created a small migration guide here for some of the changes you need to be aware of. (If you find something particularly challanging in the upgrade, please do a PR to that migration guide to give tips to others).
Good luck TypeScripters! The future is looking good for us!
– Tom Arild