-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathstate-types.ts
63 lines (54 loc) · 1.31 KB
/
state-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
import { namespace } from 'vuex-class'
import { AuthUser } from 'types-module'
export enum NotificationType {
DANGER = 'is-danger',
WARNING = 'is-warning',
INFO = 'is-info',
SUCCESS = 'is-success'
}
export interface NotificationMessage {
type: NotificationType,
message: string,
hasIcon?: boolean
}
export interface AuthState {
authUser?: AuthUser,
forceLogout: boolean,
rememberMe: boolean
}
export interface ProfileState {
}
export interface NotificationState {
notificationMessage?: NotificationMessage,
}
export interface LoadingState {
loading: boolean
}
export interface RootState {
auth?: AuthState,
notification?: NotificationState,
loading?: LoadingState,
profile?: ProfileState
}
export const StateNamespace = {
auth: namespace('auth'),
notification: namespace('notification'),
loading: namespace('loading'),
profile: namespace('profile')
}
export const StoreConfig = {
auth: {
setAuthUser: 'auth/setAuthUser',
forceLogout: 'auth/forceLogout',
logout: 'auth/logout',
saveRememberMe: 'auth/saveRememberMe'
},
notification: {
saveNotificationMessage: 'notification/saveNotificationMessage',
clearNotificationMessage: 'notification/clearNotificationMessage'
},
loading: {
setLoading: 'loading/setLoading',
saveLoading: 'loading/saveLoading'
}
}