Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript 2.4 Enums #166

Closed
rgevrek opened this issue Sep 5, 2017 · 2 comments
Closed

TypeScript 2.4 Enums #166

rgevrek opened this issue Sep 5, 2017 · 2 comments

Comments

@rgevrek
Copy link

rgevrek commented Sep 5, 2017

TypeScript 2.4 now allows enum members to contain string initializers.

enum Colors {
    Red = "RED",
    Green = "GREEN",
    Blue = "BLUE",
}

Now, those Java enums
public enum { A, B, C }
could be
enum { A="A", B="B", C="C" }
so that on boths sides - backend and frontend - the enums could be used against the web services.

@vojtechhabarta
Copy link
Owner

It is already implemented, see Generate TypeScript 2.4 string enums from Java enums .

Maven sample:

<configuration>
    ...
    <mapEnum>asEnum</mapEnum>
</configuration>

@vojtechhabarta
Copy link
Owner

Closing the issue, we can reopen it if you need more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants