Skip to content

Commit e4bd527

Browse files
shibulijackshibulijack
shibulijack
authored and
shibulijack
committed
Addressed review comments
1 parent 1aa43a5 commit e4bd527

File tree

2 files changed

+38
-11
lines changed

2 files changed

+38
-11
lines changed

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
],
1010
"author": "Thuzi LLC <[email protected]> (https://github.com/Thuzi)",
1111
"contributors": [
12-
"Daniel Friesen <[email protected]> (http://danf.ca)",
13-
"Shibu Lijack <[email protected]> (https://github.com/shibulijack"
12+
"Daniel Friesen <[email protected]> (http://danf.ca)"
1413
],
1514
"homepage": "https://github.com/node-facebook/facebook-node-sdk",
1615
"license": "Apache-2.0",

src/fb.d.ts

+37-9
Original file line numberDiff line numberDiff line change
@@ -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

1337
export 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

3563
export const version: string;
3664

37-
export function FacebookApiException(res: Response): void;
65+
export function FacebookApiException(res: Response): Error;
3866

3967
export const FB: Facebook;

0 commit comments

Comments
 (0)