Sorry if this means adding another language to the mix.
Why not consider using ScalaJS to generate JavaScript and JVM-compatible (Java) routines, so using Java-to-Scala interop and Java- type syntax
Basically, a Scala / ScalaJS code project can be configured to output both Javascript and Java-compatible bytecode / JAR libraries (the latter for integration back into other Java / JVM code).
If learning the Scala language seems like another temporary stream, you can also consider programmatically converting existing Java routines to Scala * , for further conversion to ScalaJS / Javascript, all this as an additional build step:
Finally, with some caveats, you can convert third-party TypeScript defintions to Scala [JS] API code to make calls with TypeScript-enabled libraries of strongly typed Scala code:
* ScalaJS code may depend only on cross-compiling other Scala-extended codes / libraries, but the 'normal' Scala can import any Java-compatible library.
UPDATE: Kotlin , Jetbrains (authors of various excellent IDEs including IntelliJ IDEA) is another JVM-oriented, concise, language, as well as support for cross-compiling Javascript. Theres also a one-click Java-to-Kotlin converter for Intellij and Eclipse.
Kotlin seems to be gaining momentum, is considered less complex than Scala, and is also used to develop Android and IOS applications ( RoboVM Studio ).
You can try Kotlin here .
Big rich
source share