forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
firebase-simplelogin.d.ts
94 lines (72 loc) · 2.32 KB
/
firebase-simplelogin.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Type definitions for Firebase Simple Login
// Project: https://www.firebase.com/docs/security/simple-login-overview.html
// Definitions by: Wilker Lucio <http://github.com/wilkerlucio>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="./firebase.d.ts" />
interface IFirebaseSimpleLoginError {
code: string;
message: string;
}
interface IFirebaseSimpleLoginOptions {
// general options
debug?: boolean
rememberMe?: boolean
// email
email?: string
password?: string
// facebook / github / google / twitter
preferRedirect?: boolean
// facebook / github / google
scope?: string
// facebook
access_token?: string
// twitter
oauth_token?: string
// persona
backgroundColor?: string
privacyPolicy?: string
siteLogo?: string
siteName?: string
termsOfService?: string
}
interface IFirebaseSimpleLoginUser {
// general data
firebaseAuthToken: string;
id: string;
provider: string;
uid: string;
// email / persona
md5_hash?: string;
// email
email?: string;
// facebook / github / google / twitter
accessToken?: string
displayName?: string
thirdPartyUserData?: Object
// github / twitter
username?: string
// twitter
accessTokenSecret?: string
}
declare class FirebaseSimpleLogin {
email: string;
id: string;
provider: string;
uid: string;
username: string;
constructor(firebase: Firebase, callback: (err: IFirebaseSimpleLoginError, user: IFirebaseSimpleLoginUser) => any);
login(loginType: string, options?: IFirebaseSimpleLoginOptions): void;
logout(): void;
createUser(email: string,
password: string,
callback?: (err: IFirebaseSimpleLoginError, user: IFirebaseSimpleLoginUser) => any): void;
changePassword(email: string,
oldPassword: string,
newPassword: string,
callback?: (err: IFirebaseSimpleLoginError, success: boolean) => any): void;
sendPasswordResetEmail(email: string,
callback?: (err: IFirebaseSimpleLoginError, success: boolean) => any): void;
removeUser(email: string,
password: string,
callback?: (err: IFirebaseSimpleLoginError, success: boolean) => any): void;
}