Closed
Description
say we have
type Fish = "one" | "two" | "red" | "blue";
or
enum Fish
{
one,
two,
red,
blue
}
It would be useful to have a way to refer to the possible values at runtime:
something like __valuesof(Fish)
would transpile to
["one" , "two" , "red", "blue"]
in both cases.
Also consider __enummap(Fish) that would transpile to
{
"one":1,
"two":2,
"red":3,
"blue":4
}
or explicit enum values if specified. This would allow C#'s Enum.Parse functionality