Right now I have to use ts2kt if I want strict typ...
# javascript
s
Right now I have to use ts2kt if I want strict types
t
does this answer your question? https://youtrack.jetbrains.com/issue/KT-16604
s
I would like to see TS and Kotlin interoping seamlessly like Java and Kotlin
Without so much explicit conversion
t
well i dont think thats possibl
well it IS possible, but only with much effort
the reason why integration between kotlin and java is so seamlessly is, that the API of kotlin was design to match java's API - that way jetbrains can make broad use of
typealias
OTOH jetbrains already implemened many javascript APIs so targeting the browser is already pretty easy and that way integration with TS, too. the missing link is, that there are no
d.ts
files yet, but they will come in future
s
Seamless TypeScript interoperability would be a great feature to have! But it's a very challenging one. Unlike Java's, TypeScript type system is a lot more different: https://www.typescriptlang.org/docs/handbook/advanced-types.html. We want to improve ts2kt to reduce manual intervention and experiment with embedding it to other tools. In the meantime we'd love to see community contribute and maintain quality Kotlin typings and wrappers for their favourite JavaScript libraries. This would provide a nice interop experience and bypass TypesScript altogether.
s
That sounds like another
@types/
😂
s
We have a place for it: https://github.com/Kotlin/js-externals. PRs are welcome!