-
Notifications
You must be signed in to change notification settings - Fork 116
Added type definitions to make it Typescript compatible #176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| interface FBOptions { | ||
| accessToken: string; | ||
| appId: string; | ||
| appSecret: string; | ||
| version?: string; | ||
| proxy?: string; | ||
| timeout?: number; | ||
| scope?: string; | ||
| redirectUri?: string; | ||
| Promise?: Promise<any>; | ||
| } | ||
|
|
||
| interface FBAPIInterface { | ||
| path: string; | ||
| method?: string; | ||
| params?: object; | ||
| callback?: Function; | ||
| } | ||
|
|
||
| interface FBKeyOrOptions { | ||
| key: string; | ||
| options: FBOptions; | ||
| } | ||
|
|
||
| interface SignedRequestResponse { | ||
| oauthToken: string; | ||
| userId: string; | ||
| userCountry: string; | ||
| } | ||
|
|
||
| interface UsageInterface { | ||
| callCount: number; | ||
| totalTime: number; | ||
| totalCPUTime: number; | ||
| } | ||
|
|
||
| export class Facebook { | ||
shibulijack marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| constructor(options?: FBOptions); | ||
|
|
||
| api(arguments: FBAPIInterface): Promise<any>; | ||
|
||
|
|
||
| extend(options: FBOptions): Facebook; | ||
|
|
||
| getAccessToken(): string; | ||
|
|
||
| getAppUsage(): UsageInterface; | ||
|
|
||
| getPageUsage(): UsageInterface; | ||
|
|
||
| getLoginUrl(options: FBOptions): string; | ||
|
|
||
| napi(arguments: FBAPIInterface): void; | ||
|
|
||
| options(keyOrOptions: keyof FBKeyOrOptions): any; | ||
|
||
|
|
||
| parseSignedRequest(signedRequest: string, appSecret: string): SignedRequestResponse; | ||
|
|
||
| setAccessToken(accessToken: string): void; | ||
|
|
||
| withAccessToken(accessToken: string): Facebook; | ||
| } | ||
|
|
||
| export const version: string; | ||
|
|
||
| export function FacebookApiException(res: Response): Error; | ||
|
||
|
|
||
| export const FB: Facebook; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also a default export. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bunch of options appear to be missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the ones mentioned in the README. Turns out the list wasn't exhaustive. I'll update the options with the ones listed in the source code.