This repository contains sources of external declarations for Kotlin/JS. The repository is no longer supported and signatures are no longer updated.
All libraries are available in the maven repositoryhttps://jcenter.bintray /
with group idkotlin.js.externals
and artifact idkotlin-js-<library-name>
.
To use declarations from a libraryfoo
,you need to add
this repository to your repository list for your build tool, and then add a dependency tokotlin-js-foo
.
Gradle:
repositories{
jcenter()
}
dependencies{
compile"kotlin.js.externals:kotlin-js-foo:$foo_version"
}
Maven:
<repositories>
<repository>
<id>kotlin-js-externals</id>
<name>Kotlin/JS externals</name>
<url>https://jcenter.bintray </url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>kotlin.js.externals</groupId>
<artifactId>kotlin-js-foo</artifactId>
<version>$foo_version</version>
</dependency>
</dependencies>
All libraries are available on npmjs under@kotlin-externals
scope with the original name.
To install declarations for the libraryfoo
you must use@kotlin-externals/foo
:
npm install --save-dev @kotlin-externals/foo
For a JavaScript library of versionX.Y.Z
,use an external declarations library with latestX.Y
version.
Sidenote:
This version scheme is required in order to:
- Obtain simple mapping to/from original library version.
- Have the ability to update external declarations (a version of external declarations library must have some part independent of a version of the original library).
- Not use pre-release versions by default (seehttps://docs.npmjs /misc/semver#prerelease-tags).
- Follow the three number Semver/NPM restriction.
- Reportany issues you find in existing declarations.
- Or fix them and send a Pull Request.
- Requestdeclarations that are missing.
- Or create them yourself and send a Pull Request.
Please feel free to ask any questions in#javascriptchannel ofkotl.in/slack
To write declarations from scratch or to improve existing declarations you have to read aboutexternal modifierandJS interop annotations.
The simplest way to get external declarations is converting TypeScript declarations (d.ts) to Kotlinusing Dukat.