mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Added tests for facebook-js-sdk definitions
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
/// <reference path="facebook-js-sdk.d.ts" />
|
||||
|
||||
FB.init({
|
||||
appId: '***********',
|
||||
version: 'v2.5',
|
||||
status: true,
|
||||
cookie: true,
|
||||
xfbml: true
|
||||
});
|
||||
|
||||
FB.getLoginStatus(function(response: fb.ILoginStatusResp) {
|
||||
console.log(response);
|
||||
console.log(response.status);
|
||||
console.log(response.authResponse.accessToken);
|
||||
});
|
||||
|
||||
FB.getAuthResponse(function(response: fb.ILoginStatusResp) {
|
||||
console.log(response);
|
||||
console.log(response.status);
|
||||
console.log(response.authResponse.accessToken);
|
||||
});
|
||||
|
||||
FB.login(function(response: fb.ILoginStatusResp) {
|
||||
console.log(response);
|
||||
console.log(response.status);
|
||||
console.log(response.authResponse.accessToken);
|
||||
}, {
|
||||
scope: 'public_profile'
|
||||
});
|
||||
|
||||
FB.logout(function(response: fb.ILoginStatusResp) {
|
||||
console.log(response);
|
||||
console.log(response.status);
|
||||
console.log(response.authResponse.accessToken);
|
||||
});
|
||||
Vendored
+7
-2
@@ -12,8 +12,13 @@ declare module facebook {
|
||||
// AppEvents: any;
|
||||
// Canvas: any;
|
||||
// Event: any;
|
||||
// getAccessToken: any;
|
||||
// getAuthResponse: any;
|
||||
/**
|
||||
* The method FB.getAuthResponse() is a synchronous accessor for the current authResponse.
|
||||
* The synchronous nature of this method is what sets it apart from the other login methods.
|
||||
*
|
||||
* @param callback function to handle the response.
|
||||
*/
|
||||
getAuthResponse(callback: (response: ILoginStatusResp) => void): void;
|
||||
/**
|
||||
* FB.getLoginStatus() allows you to determine if a user is
|
||||
* logged in to Facebook and has authenticated your app.
|
||||
|
||||
Reference in New Issue
Block a user