Typescript Class Async Function Python Syntax If Else Statement