-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
type-test.ts
55 lines (41 loc) · 1.67 KB
/
type-test.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
// import firebase from '@react-native-firebase/app';
import firebase, { FirebaseAuthTypes } from '.';
console.log(firebase.default().currentUser);
// checks module exists at root
console.log(firebase.auth().app.name);
console.log(firebase.auth().currentUser);
// checks module exists at app level
console.log(firebase.app().auth().app.name);
console.log(firebase.app().auth().currentUser);
// checks statics exist
console.log(firebase.auth.SDK_VERSION);
// checks statics exist on defaultExport
console.log(firebase.firebase.SDK_VERSION);
// checks root exists
console.log(firebase.SDK_VERSION);
// checks firebase named export exists on module
console.log(firebase.firebase.SDK_VERSION);
// checks multi-app support exists
console.log(firebase.auth(firebase.app()).app.name);
// checks default export supports app arg
console.log(firebase.auth(firebase.app('foo')).app.name);
// Statics
console.log(firebase.auth.EmailAuthProvider.PROVIDER_ID);
console.log(firebase.auth.PhoneAuthProvider.PROVIDER_ID);
console.log(firebase.auth.GoogleAuthProvider.PROVIDER_ID);
console.log(firebase.auth.GithubAuthProvider.PROVIDER_ID);
console.log(firebase.auth.TwitterAuthProvider.PROVIDER_ID);
console.log(firebase.auth.FacebookAuthProvider.PROVIDER_ID);
console.log(firebase.auth.PhoneAuthState.CODE_SENT);
firebase.auth().onAuthStateChanged((user: FirebaseAuthTypes.User) => {
if (user) {
console.log(user.email);
console.log(user.displayName);
}
});
const u = firebase.auth().currentUser;
console.log(u ? u.displayName : '');
console.log(u ? u.email : '');
console.log(u ? u.toJSON() : '');
firebase.auth().signInAnonymously().then();
firebase.auth().signInWithEmailAndPassword('', '').then();