Update editor-client type definitions

I am currently updating the editor's types (@types/node-red__editor-client).
This is a very huge update, and I hope this PR can be merged quickly :crossed_fingers:

Two important points:

  • The types are based on v5, but I cannot guarantee their accuracy or completeness. Let's not ask me for miracles just yet :sweat_smile:
  • The internal types have also been documented.This is intentional. While these types are not intended for use by third-party developers, there may be specific use cases where using them is justified.

I hope this update will be useful to as many people as possible. Please feel free to comment if you spot any inconsistencies or missing types!

PS: It would be good if the NR documentation encouraged developers to use types to help them to code.

Enjoy!

Not sure I fully understand @types - is @types/node-red__editor-client an integral part of @types/node-red?

I use that in uibuilder but I've always found that its definitions are not complete by quite a long way. So much so that I've created my own manual typedefs.js file with JSDoc definitions for key Node-RED core types.

And used like this (example from the uibuilder node runtime)

It certainly would be great to have complete and official, maintained types.

Yes, it's one dependency of @types/node-red.