An errors blows up when using the typings for the the Google Auth2 API - @types/gapi.auth2. The compiler throws an error 1062 if I create a promise
It is dangerous to use Promise with any objects with it's own then() method. See @gwilz answer. You will be trapped in an infinite loop!
One way to workaround is to actually remove then() method:
async function getGapi() {
return new Promise>(resolve => {
...get auth object...
delete auth.then;
resolve(auth);
});
}