I'm current learning how to use KotlinJS for web design and I can't figure out how to use a library like AnimeJS in my projects.
Please advise me on how I can do this.
I'm current learning how to use KotlinJS for web design and I can't figure out how to use a library like AnimeJS in my projects.
Please advise me on how I can do this.
There is some advice on how to do this in the Kotlin documentation here:
To summarize, inside your build.gradle
you can do:
dependencies {
// ...
implementation(npm("is-sorted"))
}
You will also need to declare the types for the library (e.g., inside is-sorted.kt
)
@JsModule("is-sorted")
@JsNonModule
external fun <T> sorted(a: Array<T>): Boolean
Apart from the docs referenced above, these slides have a good explanation.