0

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.

David Rawson
  • 20,912
  • 7
  • 88
  • 124
Emekarr
  • 111
  • 2
  • 7

1 Answers1

1

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.

David Rawson
  • 20,912
  • 7
  • 88
  • 124