[Proposal] Add typing for JsonObjectWrapper #15
Replies: 1 comment 1 reply
-
I was thinking about it in the past, the idea was to use kotlin-serialization and return a concrete (annotated) type instead of the wrapper. It would first use JSON because it is easy to implement but for performance reasons we could even use a custom serializer generating QuickJS byte code (would be a lot of effort, though). Of course on the JS side it would still be dynamic but the typescript definitions would be the same as the Java one so it is easy to compare them. I don’t think we should think of generating the typescript types, though :) Do you think that it would cover your use case? I will check next week-end if I can create a prototype for it and submit a first pull request. |
Beta Was this translation helpful? Give feedback.
-
I am thinking about adding generic support to
JsonObjectWrapper
. Now that we have JS codebase in TypeScript, all objects are typed with interfaces. And so we can compare (at least by manually looking at the code) whether object coming from native is what we expect on JS side.@bwalter, what do you think? Is the effort worth it? :)
Beta Was this translation helpful? Give feedback.
All reactions