@@ -10,18 +10,6 @@ interface FBOptions {
10
10
Promise ?: Promise < any > ;
11
11
}
12
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
13
interface SignedRequestResponse {
26
14
oauthToken : string ;
27
15
userId : string ;
@@ -34,10 +22,27 @@ interface UsageInterface {
34
22
totalCPUTime : number ;
35
23
}
36
24
25
+ interface FBError {
26
+ name : string ;
27
+ message : string ;
28
+ response : number ;
29
+ }
30
+
31
+ interface FBResponseObject {
32
+ data : any ;
33
+ error : any ;
34
+ }
35
+
37
36
export class Facebook {
38
37
constructor ( options ?: FBOptions ) ;
39
38
40
- api ( arguments : FBAPIInterface ) : Promise < any > ;
39
+ api ( path : string ) : Promise < any > ;
40
+
41
+ api ( path : string , method : string ) : Promise < any > ;
42
+
43
+ api ( path : string , params : any ) : Promise < any > ;
44
+
45
+ api ( path : string , method : string , params : any ) : Promise < any > ;
41
46
42
47
extend ( options : FBOptions ) : Facebook ;
43
48
@@ -49,9 +54,19 @@ export class Facebook {
49
54
50
55
getLoginUrl ( options : FBOptions ) : string ;
51
56
52
- napi ( arguments : FBAPIInterface ) : void ;
57
+ napi ( path : string ) : void ;
58
+
59
+ napi ( path : string , method : string ) : void ;
60
+
61
+ napi ( path : string , params : any ) : void ;
62
+
63
+ napi ( path : string , method : string , params : any ) : void ;
64
+
65
+ options ( ) : FBOptions ;
66
+
67
+ options ( key : string ) : string ;
53
68
54
- options ( keyOrOptions : keyof FBKeyOrOptions ) : any ;
69
+ options ( options : FBOptions ) : void ;
55
70
56
71
parseSignedRequest ( signedRequest : string , appSecret : string ) : SignedRequestResponse ;
57
72
@@ -62,6 +77,6 @@ export class Facebook {
62
77
63
78
export const version : string ;
64
79
65
- export function FacebookApiException ( res : Response ) : Error ;
80
+ export function FacebookApiException ( res : FBResponseObject ) : FBError ;
66
81
67
82
export const FB : Facebook ;
0 commit comments