Use array of string literals to discriminate union #290
Unanswered
florianbepunkt
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a distinct set of operations, represented as a a string literal
Operation
. Some operations require additional data/props, so I would like to create a type, that based on whether the array contains a certain operation, includes these additional properties.I'm not sure if this is even possible to express in Typescript.
What I have so far (not working pseudo-code):
Beta Was this translation helpful? Give feedback.
All reactions