@@ -7,33 +7,61 @@ interface FBOptions {
77 timeout ?: number ;
88 scope ?: string ;
99 redirectUri ?: string ;
10- Promise ?: Promise ;
10+ Promise ?: Promise < any > ;
11+ }
12+
13+ interface FBAPIInterface {
14+ path : string ;
15+ method ?: string ;
16+ params ?: object ;
17+ callback ?: Function ;
18+ }
19+
20+ interface FBKeyOrOptions {
21+ key : string ;
22+ options : FBOptions ;
23+ }
24+
25+ interface SignedRequestResponse {
26+ oauthToken : string ;
27+ userId : string ;
28+ userCountry : string ;
29+ }
30+
31+ interface UsageInterface {
32+ callCount : number ;
33+ totalTime : number ;
34+ totalCPUTime : number ;
1135}
1236
1337export class Facebook {
14- constructor ( options : FBOptions ) ;
38+ constructor ( options ? : FBOptions ) ;
1539
16- api ( ... args ) : Promise < any > ;
40+ api ( arguments : FBAPIInterface ) : Promise < any > ;
1741
1842 extend ( options : FBOptions ) : Facebook ;
1943
2044 getAccessToken ( ) : string ;
2145
22- getLoginUrl ( ) : string ;
46+ getAppUsage ( ) : UsageInterface ;
47+
48+ getPageUsage ( ) : UsageInterface ;
49+
50+ getLoginUrl ( options : FBOptions ) : string ;
2351
24- napi ( ... args ) : Promise < any > ;
52+ napi ( arguments : FBAPIInterface ) : void ;
2553
26- options ( keyOrOptions : FBOptions ) : FBOptions ;
54+ options ( keyOrOptions : keyof FBKeyOrOptions ) : any ;
2755
28- parseSignedRequest ( signedRequest : string , ... args ) : Object ;
56+ parseSignedRequest ( signedRequest : string , appSecret : string ) : SignedRequestResponse ;
2957
3058 setAccessToken ( accessToken : string ) : void ;
3159
32- withAccessToken ( accessToken : string ) : any ;
60+ withAccessToken ( accessToken : string ) : Facebook ;
3361}
3462
3563export const version : string ;
3664
37- export function FacebookApiException ( res : Response ) : void ;
65+ export function FacebookApiException ( res : Response ) : Error ;
3866
3967export const FB : Facebook ;
0 commit comments