To call JavaScript functions from Kotlin I need to declare everything I want to use.
Just a few days ago I’ve got good idea: instead of writing stubs by hands I can generate them. Then I unpacked .xml files from IDEA’s JavaScript plugin with complete DOM/DHTML/etc functions and wrote XSL-stylesheet to create Kotlin declarations from it. Of course generated code is not VERY GOOD… but it covers huge part of work.
But, I guess these files I’ve used to generate declarations has some proprietary license so I can’t use or public such Kotlin declarations since prorietary files used to get them, isn’t it?
I've no idea, I'll let someone from JetBrains answer that one - but this sounds very interesting! Having automatically created nice Kotiln APIs for DOM / DHTML stuff would be great! :).
FWIW for w3c DOM I figured we could just reuse (or extend) the org.w3c.dom API thats already part of the JDK?
FWIW for w3c DOM I figured we could just reuse (or extend) the org.w3c.dom API thats already part of the JDK?
Yes, it is, but… when the compiler tries to use these classes during JavaScript generation… let’s just say this is not simple to do or I don’t know how. I can see kotlin’s trunk already uses this approach but I’am not sure this is so good as it looks first because of too many hacks (such as Java’s API re-declaration and so on)
What specific files are you asking about? You're asking about files contained in the javascript IDEA plugin? I guess this plugin not open source.. it's only in the ultimate edition? I guess if that's the case someoen at JetBrains would have to answer!