In my web app I am using Typescript and want to use FB sdk functions example: api
, login
etc from Typescript.
When compiling my typescript code that uses FB.init(), I get the following errors:
Supplied parameters do not match any signature of call target.
Cannot find name 'FB'.
The Facebook SDK for JavaScript provides a rich set of client-side functionality that: Enables you to use the Like Button and other Social Plugins on your site. Enables you to use Facebook Login to lower the barrier for people to sign up on your site. Makes it easy to call into Facebook's Graph API.
The Temporal TypeScript SDK lets you write highly scalable and reliable long-running Workflows without being a distributed systems expert. It is designed with TypeScript-first developer experience in mind, but works equally well with JavaScript.
You can use existing type definitions : https://github.com/borisyankov/DefinitelyTyped/blob/master/fbsdk/fbsdk.d.ts
For an example of usage look at the tests: https://github.com/borisyankov/DefinitelyTyped/blob/master/fbsdk/fbsdk-tests.ts
api
and login
are defined: https://github.com/borisyankov/DefinitelyTyped/blob/master/fbsdk/fbsdk.d.ts#L103-L114
UPDATE (Dec 2016)
The new repository is:
https://github.com/retyped/fbsdk-tsd-ambient
UPDATE (Apr 2018)
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/facebook-js-sdk/index.d.ts
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With