I have a json file which looks like these:
{
"ui": "Header"
}
while "ui" is an enum. I load this part with JSON.Parse in my typescript webpack envoriment with node.js and ts-loader, so my error is:
"Type 'string' is not assignable to type 'UiDescriptionTypeEnum'."
and my interface I am trying to cast into is:
interface UI
{
ui: UiDescriptionTypeEnum
}
while having the enum like this:
enum UiDescriptionTypeEnum
{
Header = "Header"
}
Here is a working typescript play with the error: