In Typescript, suppose I want to call a function with following signature-
function foo(param: "TRUE"|"FALSE"|"NONE")
How can I do something like-
var str = runtimeString()
if(str === "TRUE" | str === "FALSE" | str === "NONE")
foo(str)
Or, the explicit values are the only way-
var str = runtimeString()
if(str === "TRUE")
foo("TRUE")
else if(str === "FALSE" )
foo("FALSE")
else if(str === "NONE")
foo("NONE")