forked from Harrylever/mxchat-fe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypings.ts
executable file
·115 lines (95 loc) · 1.84 KB
/
typings.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
107
108
109
110
111
112
113
114
115
export interface IAuthState {
id: string
email: string
access: string
refresh: string
}
export interface IAccount extends ICreateAccountFormValues {
_id: string
profileImage: string
role: ('standard' | 'admin')[]
}
export type IUser = Omit<IAccount, 'password' | 'role'>
export interface ICreateAccountFormValues {
username: string
firstname: string
lastname: string
email: string
password: string
}
export interface ILoginFormValues {
email: string
password: string
}
export interface IUseGoogleAuthValues {
username: string
firstname: string
lastname: string
email: string
profileImage: string
}
export interface QueryBaseResponse<T> {
message: string
data: T
}
export interface MutationBaseResponse {
data?: any
message: string
}
export interface ILoginResValues {
exp: number
iat: number
jti: string
token_type: string
_id: string
email: string
username: string
}
export interface IChat {
id: string
members: Array<string>
}
export interface IMobileChat {
id: string
me: string
recipient: IUser
}
export interface IMessage {
_id?: string
chatId: string
senderId: IAccount
text: string
createdAt?: string
aesKey: string
iv: string
}
export type IPlainMessage = Omit<IMessage, 'aesKey' | 'iv'>
export interface IOnlineUser {
email: string
id: string
}
export interface INotification {
date: unknown
senderId: IAccount
message: string
isRead: boolean
}
export type TRoute = 'chats' | 'groups' | 'settings' | 'contacts'
export interface InternalRoute {
active: TRoute
}
export type TInViewTab = 'chats' | 'groups'
export interface IGetRecipientAccountValues {
members: string[]
accountId: string
}
export interface RouteProps {
user?: IUser
}
export interface IEncryptedMessage {
text: string
senderId: string
chatId: string
aesKey: string
iv: string
}