@@ -7,33 +7,61 @@ interface FBOptions {
7
7
timeout ?: number ;
8
8
scope ?: string ;
9
9
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 ;
11
35
}
12
36
13
37
export class Facebook {
14
- constructor ( options : FBOptions ) ;
38
+ constructor ( options ? : FBOptions ) ;
15
39
16
- api ( ... args ) : Promise < any > ;
40
+ api ( arguments : FBAPIInterface ) : Promise < any > ;
17
41
18
42
extend ( options : FBOptions ) : Facebook ;
19
43
20
44
getAccessToken ( ) : string ;
21
45
22
- getLoginUrl ( ) : string ;
46
+ getAppUsage ( ) : UsageInterface ;
47
+
48
+ getPageUsage ( ) : UsageInterface ;
49
+
50
+ getLoginUrl ( options : FBOptions ) : string ;
23
51
24
- napi ( ... args ) : Promise < any > ;
52
+ napi ( arguments : FBAPIInterface ) : void ;
25
53
26
- options ( keyOrOptions : FBOptions ) : FBOptions ;
54
+ options ( keyOrOptions : keyof FBKeyOrOptions ) : any ;
27
55
28
- parseSignedRequest ( signedRequest : string , ... args ) : Object ;
56
+ parseSignedRequest ( signedRequest : string , appSecret : string ) : SignedRequestResponse ;
29
57
30
58
setAccessToken ( accessToken : string ) : void ;
31
59
32
- withAccessToken ( accessToken : string ) : any ;
60
+ withAccessToken ( accessToken : string ) : Facebook ;
33
61
}
34
62
35
63
export const version : string ;
36
64
37
- export function FacebookApiException ( res : Response ) : void ;
65
+ export function FacebookApiException ( res : Response ) : Error ;
38
66
39
67
export const FB : Facebook ;
0 commit comments