Option to generate enum definition
See original GitHub issueSince https://github.com/Azure/autorest.typescript/issues/357 was merged it would be useful to optionally output the enum definitions as well as the union type.
e.g.
//current
type SomeEnum = 'one' | 'two' | 'three';
//proposed addition (with a better name)
enum SomeEnumOptions = {
one = 'one',
two = 'two',
three = 'three'
}
Is this something that you would consider (pending some decisions about names etc)? If so I will look into what changes are needed.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Handbook - Enums - TypeScript
Enums allow a developer to define a set of named constants. Using enums can make it easier to document intent, or create a...
Read more >How can I define an enum in JavaScript? - 30 seconds of code
The easiest way to define an enum would be to use Object.freeze() in combination with a plain object. This will ensure that the...
Read more >Enum Types - Java™ Tutorials
An enum type is a special data type that enables for a variable to be a set of predefined constants. The variable must...
Read more >Enums - Swagger
You can use the enum keyword to specify possible values of a request parameter or a model property. For example, the sort parameter...
Read more >Enumeration types - C# reference - Microsoft Learn
If you want an enumeration type to represent a combination of choices, define enum members for those choices such that an individual choice ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://github.com/Azure/autorest.typescript/pull/413 adds the ability to output enum types again by using the
--enum-types
command line argument.@daschult We need enum type for Azure Storage SDKs to avoid breaking changes, please bring back this.