|
|
|
|
|
by int_19h
478 days ago
|
|
TS does have sum types, so you can already do something like: type Color = "red" | "green";
What GP is doing is some scaffolding on top to make the values more discoverable and allow associating arbitrary Color-specific metadata with them. |
|
[1] https://github.com/microsoft/TypeScript/issues/18758