forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ng-facebook.d.ts
46 lines (36 loc) · 1.61 KB
/
ng-facebook.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Type definitions for ng-facebook
// Project: https://github.com/GoDisco/ngFacebook
// Definitions by: Crevil <https://github.com/Crevil>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
/// <reference path="../fbsdk/fbsdk.d.ts" />
declare namespace angular.ngFacebook {
interface IFacebookProvider {
setAppId(appId: string): IFacebookProvider;
getAppId(): string;
setVersion(version: string): IFacebookProvider;
getVersion(): string;
setPermissions(permissions: string|Array<string>): IFacebookProvider;
getPermissions(): string;
setCustomInit(customInit: FBInitParams): IFacebookProvider;
getCustomInit(): FBInitParams;
}
interface IFacebookService {
config<T extends string|number|FBInitParams>(property: string): T;
init(): void;
setCache<T>(attr: string, val: T): void;
getCache<T>(attr: string): T;
clearCache(): void;
isConnected(): boolean;
getAuthResponse(): {};
getLoginStatus(force?: boolean): angular.IPromise<{}>;
login(permissions?: string, rerequest?: boolean): angular.IPromise<{}>;
logout(): angular.IPromise<void>;
ui(params: FBUIParams): angular.IPromise<any>;
api(path: string): angular.IPromise<{}>;
api(path: string, method: string): angular.IPromise<{}>;
api(path: string, params: Object): angular.IPromise<{}>;
api(path: string, method: string, params: Object): angular.IPromise<{}>;
cachedApi(path: string): angular.IPromise<any>;
}
}