Did anybody manage to make exporting an interface ...
# multiplatform
m
Did anybody manage to make exporting an interface with enums as either Typescript Union or Enum (so that a Kotlin API project can be shared with a Typescript project)? Note that it has to survive serialization and deserialization... For example, given the following JSON:
Copy code
{ 
  "gender": "male"
  "age": 24
}
To be in Typescript:
Copy code
enum Gender {
Male = "male",
Female = "female"
}

interface Person {
gender: Gender
age: number
}
And in Kotlin:
Copy code
enum class Gender {
@SerialName("male")
Male,
@SerialName("female")
Female
}

interface Person {
gender: Gender
age: number
}
a
m
@Adam S thank you! This looks promising. Have you considered packaging it as a plugin so that somebody can generate a TypeScript project and push it to NPM?
a
you could probably use another plugin for publishing a library to NPM, like https://github.com/mpetuska/npm-publish