Skip to content

ValentinChirikov/net.akehurst.kotlin.kt2ts

 
 

Repository files navigation

Build Status Bintray Gradle Plugin Portal

net.akehurst.kotlin.kt2ts

Typescript definition file generator for kotlin (js) classes

Kotlin is great. However, if you want to integrate it into an angular application (or other typescript) we need to generate the typescript declaration file and package.json. Neither of these is currently created by the kotlin JS compiler.

This plugin is intended for use in a kotlin multiplatform development. It uses JVM reflection over the kotlin-JVM module to generate the .d.ts file that is intended for use with the kotlin-js module.

The plugin addresses use cases such as:

  1. generating .d.ts file for your own kotlin module
  2. generating .d.ts file for a third-party module
  3. building an angular application and integrating kotlin generated modules.

Minimal documentation is below, for full documentation please register here [https://info.itemis.com/en/kotlin-typescript-integration/]. The company that has kindly sponsored the development of this plugin would like your email address.

A blog post that discusses the issues this plugin tries to solve can be found here [https://medium.com/@dr.david.h.akehurst/building-applications-with-kotlin-and-typescript-8a165e76252c].

Add the plugin

plugins {
    id("net.akehurst.kotlin.kt2ts") version("$version")
}

configure the plugin for your own modules

// configure the kt2ts plugin
kt2ts {
    classPatterns.set(listOf(
            "com.example.my.module.common.*"
    ))
}

About

Typescript definition file generator for kotlin (js) classes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Kotlin 96.8%
  • Handlebars 3.2%