Skip to content

Commit e3d3b89

Browse files
shibulijackshibulijack
shibulijack
authored and
shibulijack
committed
Added type definitions
1 parent 19fc5ae commit e3d3b89

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
],
1010
"author": "Thuzi LLC <[email protected]> (https://github.com/Thuzi)",
1111
"contributors": [
12-
"Daniel Friesen <[email protected]> (http://danf.ca)"
12+
"Daniel Friesen <[email protected]> (http://danf.ca)",
13+
"Shibu Lijack <[email protected]> (https://github.com/shibulijack"
1314
],
1415
"homepage": "https://github.com/node-facebook/facebook-node-sdk",
1516
"license": "Apache-2.0",
@@ -18,6 +19,7 @@
1819
"url": "https://github.com/node-facebook/facebook-node-sdk.git"
1920
},
2021
"main": "./lib/fb.js",
22+
"types": "./lib/fb.d.ts",
2123
"scripts": {
2224
"precommit": "lint-staged",
2325
"lint": "eslint .",

src/fb.d.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
interface FBOptions {
2+
accessToken: string;
3+
appId: string;
4+
appSecret: string;
5+
version?: string;
6+
proxy?: string;
7+
timeout?: number;
8+
scope?: string;
9+
redirectUri?: string;
10+
Promise?: Promise;
11+
}
12+
13+
export class Facebook {
14+
constructor(options: FBOptions);
15+
16+
api(...args): Promise<any>;
17+
18+
extend(options: FBOptions): Facebook;
19+
20+
getAccessToken(): string;
21+
22+
getLoginUrl(): string;
23+
24+
napi(...args): Promise<any>;
25+
26+
options(keyOrOptions: FBOptions): FBOptions;
27+
28+
parseSignedRequest(signedRequest: string, ...args): Object;
29+
30+
setAccessToken(accessToken: string): void;
31+
32+
withAccessToken(accessToken: string): any;
33+
}
34+
35+
export const version: string;
36+
37+
export function FacebookApiException(res: Response): void;
38+
39+
export const FB: Facebook;

0 commit comments

Comments
 (0)