Details
-
Task
-
Resolution: Done
-
P2: Important
-
None
-
None
-
5851195c4f8ea56d4641b5f1b68c7b79c4eca0fd (qt/qtdeclarative/dev)
Description
In order for tools to know about the JavaScript root object it should be described in a machine-readable format.
Right now, Qt Creator has its own hard-coded description in the qmljs library. That description is chronically outdated and only available to QtCreator itself.
We might use the qmltypes format to describe the JS root objects. I can envision a jsroot.qmltypes file, generated from a live QJSEngine by querying all internal classes. The qmltypes format neeeds to be adapted for that to work, though. In particular it needs:
- A way to mark methods as untyped, which means that all the parameters and return types are just hints.
- A way to mark a type as member of the JS root object.
- A way to mark a type as JS builtin type, rather than QML type. Those would be "undefined", "boolean", "object", "number", "string", "symbol", "function", and therefore quite distinct from the QML builtins.
Once we have that in place, we can properly talk about JavaScript in qmltypes. We might then add more cross-linking that tells us which JS builtin types or root object members can be converted to which QML types and vice versa.