MakeTypes
MakeTypes copied to clipboard
What about a decorator ?
I am not sure typescript do now exports the interfaces, but imagine the following:
@DynamicCast({class: AnInterface})
json : AnInterface;
It would throw an exception if the casting failed, infer the type of json to 'AnInterface' otherwise.