Converting d.ts would be pretty hard, I though rec...
# javascript
d
Converting d.ts would be pretty hard, I though recently about how to handle union types and value pattern-matching. Regarding to value pattern-matching: Mostly for createElement and “on” methods which uses strings to determine the event type (most of times there is a first parameter with a string for those cases). That could be handled creating synthetic inline methods like onMousedown that would redirect to on + providing right types. Regarding to union types, having duck typing like scala does would help here, but you can use Any in that case. At least you would benefit from the rest of the typings or try to create method overloads with all the possible combinations of union types which could be a lot in some cases, but most times it would create just a couple of methods. Anyway I don’t think it is possible to create perfect typings automatically without additional working with kotlin. But it is definitely possible to create good starts and improve later with a little work. — It would be great to have .jars with the kotling typings + .js implementations matching the right version and deployed to maven repos even when it is possible to create a build plugin.