[英]Using Facebook SDK from typescript
在我的網絡應用程序中,我使用的是Typescript,並希望使用FB sdk函數示例:來自Typescript的api
, login
等。
在編譯使用FB.init()的typescript腳本代碼時,出現以下錯誤:
Supplied parameters do not match any signature of call target.
Cannot find name 'FB'.
您可以使用現有的類型定義: https : //github.com/borisyankov/DefinitelyTyped/blob/master/fbsdk/fbsdk.d.ts
有關使用示例,請查看測試: https : //github.com/borisyankov/DefinitelyTyped/blob/master/fbsdk/fbsdk-tests.ts
api
和login
定義: https : //github.com/borisyankov/DefinitelyTyped/blob/master/fbsdk/fbsdk.d.ts#L103-L114
更新(2016年12月)
新的存儲庫是:
https://github.com/retyped/fbsdk-tsd-ambient
更新(2018年4月)
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/facebook-js-sdk/index.d.ts
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.