Typescript Wait For Async Function Javascript