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

enum support #54

Open
Miamoto-Musashi opened this issue Aug 23, 2021 · 9 comments
Open

enum support #54

Miamoto-Musashi opened this issue Aug 23, 2021 · 9 comments
Labels
enhancement New feature or request

Comments

@Miamoto-Musashi
Copy link

would be nice to have enums support

@iamarnas
Copy link
Collaborator

iamarnas commented Aug 23, 2021

@Miamoto-Musashi I thought about it a long time ago to implement it. String list convert to enum. Example:

{
    "e@user_status": ["online", "offline" ]
}

@Miamoto-Musashi
Copy link
Author

rather than

{
    "e@user_status": ["online", "offline" ]
}

I think is more consistent with rest of notation

{
    "user_status.enum": ["online", "offline" ]
}

@iamarnas iamarnas added the enhancement New feature or request label Nov 30, 2021
@Prn-Ice
Copy link

Prn-Ice commented Apr 25, 2022

Would this be a simple task, I dont use typescript, but I would like to help add this.

@iamarnas
Copy link
Collaborator

@Prn-Ice It may be a little tricky, but anything is possible. This source code should be good rewrite to make it easy to implement :)

@Prn-Ice
Copy link

Prn-Ice commented Apr 25, 2022

I'll play around with it, I'll let you know if I give up.

@iamarnas
Copy link
Collaborator

iamarnas commented Apr 25, 2022

I'll play around with it, I'll let you know if I give up.

Then your tour will be begin in the constructor.ts file, class TypeDefinition ;)

I think it will be enough to include the enum checker annotation and the generator do the rest. Then just add syntax.

I will join to when I will finish one project.

@Prn-Ice

@globalwebforce
Copy link

Any Update on this one?

@Prn-Ice
Copy link

Prn-Ice commented Aug 28, 2022

Sadly I haven't gotten up to this till now. And after finding this package, I'm not sure I'll need to.

@iamarnas
Copy link
Collaborator

Sadly I haven't gotten up to this till now. And after finding this package, I'm not sure I'll need to.

If you want to generate enum only with any generator it easy implement. Just need generate a type and generator do the rest. I will look at that. For now I working on another extension as Data Class Generator. It will generate data equal to Freezed by one click, and even regenerate by one click or update automatically on save. Also will be possible make functionality enums. Will be more fun 😁

@Prn-Ice

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

No branches or pull requests

4 participants