A Gradle Plugin which converts Kotlin data models into Typescript. It uses Alicia Boya García's TypeScript definition generator for that.
Plugin is built with TDD approach demonstrated by Stefan May's in his Gloc Gradle Plugin.
One is able to use/apply the plugin with build.gradle.kts
:
plugins {
id("kotlin2ts.kt2ts") version "1.0.0"
}
kt2ts {
packs = arrayOf("org.fidget.models")
}
or build.gradle
:
plugins {
id("kotlin2ts.kt2ts").version("1.0.0")
}
kt2ts {
packs = ["org.fidget.models"]
}
The extension provides only one property:
- packs - a array of packages where data models to be converted into TypeScript are situated
The plugin provides the task called kt2ts.