TypeScript bindings for google web signin

人盡茶涼 提交于 2020-01-03 17:51:32

问题


I'm building an angular2/typescript app. I see that google put out platform.js which gives access to the gapi var as shown here on the google signin for websites. That works great, but I am having a lot of trouble getting that into typescript.

TS relies on .d.ts files to import javascript. Are there any typescript bindings for the new gapi that google put out? There is this version of gapi from DefinitelyTyped/gapi, but it is outdated.

I've considered writing my own typings definition for the google js, but I can only find the minified version that google put up.

If there are no tsd bindings for the new google signin, how can I still use this with typescript? I was trying to just save the js file to my local, and do something like var gapi = require('../../js/lib/gapi'); but that wasn't working out for me, no matter how I tried to import using javascript.


回答1:


I was just looking through the wrong typings on DefinitelyTyped. Somehow I missed DefinitelyTyped/gapi.auth2. Cheers!



来源:https://stackoverflow.com/questions/35526281/typescript-bindings-for-google-web-signin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!