I came across some code that looks like this:
export function foo(arg: string): arg is MyType { return ... }
I haven\'t been able to se
The only use I know is the one of your example: specifying a "type predicate" (arg is MyType) in an user defined Type Guard
arg is MyType
See User Defined Type Guards in this reference
Here is another reference