ayedo / ktsgenerator

Gradle plugin to generate Typescript defintions from Kotlin classes
Apache License 2.0
7 stars 0 forks source link

Sharing constants #3

Closed Vlad8161 closed 4 years ago

Vlad8161 commented 4 years ago

Hello. Is there any way to share constants between kotlin and typescript?

For example:

object ApiConstants {
    const val SOME_VAL_1 = 1234
    const val SOME_VAL_2 = "hello world"
}

UPD: Expected TS output:

let ApiConstants = {
    SOME_VAL_1: 1234,
    SOME_VAL_2: "hello world"
}
ayedo commented 4 years ago

Hello, I'm not sure if it can do that. The plugin uses ts-generator underneath, and probably supports whatever this plugin does. Maybe you can check out their site, and report back if it does, and you can't configure it in the plugin?