MakeTypes
MakeTypes copied to clipboard
Is there a way to convert string type as strict type?
e.g. before
[
{
"ScriptId": "1",
"ScriptCode": "NWRESTRN",
},
{
"ScriptId": "2",
"ScriptCode": "REPHSRESHP",
}
]
after
Interface Script {
ScriptId: '1' | '2',
ScriptCode: 'NWRESTRN' | 'REPHSRESHP'
}
Wouldn't that call for the need for an additional argument? ie: enums=ScriptCode,ScriptId