-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathfirebase-types.ts
106 lines (93 loc) · 1.95 KB
/
firebase-types.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
95
96
97
98
99
100
101
102
103
104
105
106
import { Image, PrivacyType, ProviderData, ProviderType } from 'types-module'
export enum FirebaseAuthAction {
VERIFY_EMAIL = 'verifyEmail',
RECOVERY_EMAIL = 'recoverEmail',
RESET_PASSWORD = 'resetPassword'
}
export enum FirebaseAuthActionParams {
ACTION = 'mode',
ACTION_CODE = 'oobCode',
}
export interface RegistrationCredentials {
name: string,
email: string,
password: string
}
export interface LoginCredentials {
email: string,
password: string,
rememberMe: boolean
}
export interface SocialLoginCredentials {
providerType: ProviderType,
rememberMe: boolean
}
export interface ProviderConfig {
providerType: ProviderType,
colorType: string,
icon: string,
iconPack: string
}
export const SupportedProviders: ProviderConfig[] = [
{
providerType: ProviderType.PASSWORD,
colorType: 'is-primary',
icon: 'at',
iconPack: 'fas'
},
{
providerType: ProviderType.GOOGLE,
colorType: 'is-danger',
icon: 'google',
iconPack: 'fab'
},
{
providerType: ProviderType.TWITTER,
colorType: 'is-info',
icon: 'twitter',
iconPack: 'fab'
},
{
providerType: ProviderType.FACEBOOK,
colorType: 'is-link',
icon: 'facebook',
iconPack: 'fab'
}
]
export interface ProviderLink {
providerConfig: ProviderConfig,
providerData?: ProviderData,
linked: boolean,
linkMethod: () => void
}
export interface SearchData {
name: string,
username: string,
profilePhoto: Image,
coverPhoto: Image,
privacy: PrivacyType
}
export interface PagingResponse<T> {
total: number,
totalPages: number,
data: T[],
}
/**
Firebase Storage Types
*/
export interface StorageRef {
folderRef: string,
parameters?: any
}
export const ProfilePhotoStorageRef: StorageRef = {
folderRef: 'user/:userId/profilePhoto/',
parameters: {
userId: ':userId'
}
}
export const CoverPhotoStorageRef: StorageRef = {
folderRef: 'user/:userId/coverPhoto/',
parameters: {
userId: ':userId'
}
}