Hello everyone, as a newcomer to Kotlin/JS, I'm thrilled to have the opportunity to exchange ideas with all of you. I have a question at the moment and would appreciate your help. Thank you!
In a similar scenario, both DSLCommonLibrary and TemplateDemo are Kotlin/JS projects, and TemplateDemo depends on DSLCommonLibrary. In DSLCommonLibrary, there's a class named JSApplication. However, in TemplateDemo, I'm unable to correctly obtain the type of this JSApplication, and I'm unable to perform type-related operations like typeOf or casting (as).
🧵 1
a
Ayfri
01/17/2024, 8:29 AM
Pretty sure you have to call
require("the-module")
u
小荷才露
01/17/2024, 8:47 AM
how do it,in kotlin
a
Artem Kobzar
01/17/2024, 10:44 AM
When you say "I'm unable" it means that you've gotten an compiler error?
Artem Kobzar
01/17/2024, 10:46 AM
You also can try to make smth like this:
Copy code
external val jsApplication: JSApplication
fun main() = console.log("Version is: ${jsApplication.version}")