Cast object to class typescript

a mechanism called "type assertion". TypeScript's type assertion is purely you telling the compiler that you know about the types better than it does, and that it should not second guess you.A common use case for type assertion is when you are porting over code from JavaScript to TypeScript. For example consider the following pattern:var foo = ................
................