I have a property that can only be assigned one of four specific strings.
Currently, I am using a simple |
to define these options. However, I want to reuse these types in other parts of my code. How can I create an interface that includes just these 4 values?
selectedState?: "" | "IN_PROGRESS" | "SUCCESS" | "ERROR"
I was thinking of something like:
interface SelectedStates: "" | "IN_PROGRESS" | "SUCCESS" | "ERROR"
and then
selectedState?: SelectedStates
Any suggestions are welcome.