-
Notifications
You must be signed in to change notification settings - Fork 60
Description
Is your feature request related to a problem? Please describe.
The current VSCode allowedValues
outputs a string literal union type in Typescript:
export type LambdaRuntime = 'dotnetcore2.1' | 'nodejs12.x'
The other implementations for Kotlin and C# output an enum type. The Typescript code standard in PR's keep asking for Enums as the preferred implementation, so we are converting the String literal Union types output from this package to hardcoded Enums... This process seems backwards.
Describe the solution you'd like
I would like the Typescript allowedValues
to ouput an Enum type
export enum LambdaRuntime{
Dotnetcore21 = 'dotnetcore2.1',
Nodejs12x = 'nodejs12.x'
}
Describe alternatives you've considered
I have not
Additional context
Kotlin output for enum
/**
* The lambda runtime
*/
public enum class LambdaRuntime(
private val `value`: String,
) {
Dotnetcore21("dotnetcore2.1"),
Nodejs12x("nodejs12.x"),
Unknown("unknown"),
;
public override fun toString(): String = value
public companion object {
public fun from(type: String): LambdaRuntime = values().firstOrNull { it.value == type }
?: Unknown
}
}
All code snippets referenced from test files generatorOutput.ts
and testGeneratorOutput
for Kotlin and Typescript within this package.