Typescript Run Async Function Synchronously