Since I wasn’t satisfied with the integration of JS api, I wrote my own converter for the electron API: https://github.com/fab1an/kotlin-electron-api
It parses the original markdown source into an xml format like this
<file>
<class title="BrowserWindow">
<constructor>
<param optional="true" name="options" type="Object">
<property optional="true" name="width" type="Integer"/>
<property optional="true" name="height" type="Integer"/>
<property optional="true" name="x" type="Integer"/>
...
From this generic format, it generates kotlin source. It generates builders for object parameters, so the API can be used like this:
val menu = Menu()
menu.append(MenuItem {
type = "normal"
label = "New Idea"
click = { item, window, event ->
println("clicked")
}
})
The transformations are done via XSLT. Use it if you like it, but everything is subject to change.
Fabian