Add Support for Typescript Enum & Union Generation#91
Conversation
|
Not a maintainer, but thankful for this work. |
|
I haven't used Typescript unions much, but it doesn't seem like that would be too bad |
|
Thank you for this PR, it's really great :) One comment on the generated code in the Basic enum generation with enum_style: "union"enum_style: "union"type UserRole = string
const (
UserRoleDefault UserRole = "viewer"
UserRoleEditor UserRole = "editor"
)export type UserRole = typeof UserRoleDefault | typeof UserRoleEditor;
export const UserRoleDefault: UserRole = "viewer"
export const UserRoleEditor: UserRole = "editor"(Or this can be another variant.. But I would say it has benefits over only having |
Yeah, that makes sense. I just pushed 10d4c17 to address this change |
|
Would be nice to see a review here. |
gzuidhof
left a comment
There was a problem hiding this comment.
Looks great :) Thank you!
Sorry for not merging earlier (I somehow forgot about it after going away on holiday..)
Original:
With config
enum_style: "enum":With config
enum_style:"union"