Y
Hacker News
new
|
ask
|
show
|
jobs
by
scns
1743 days ago
In TypeScript you can define your discriminated union with strings, they call it literal types:
type Foo = "bar" | "baz" | "qux"