-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
48 lines (39 loc) · 859 Bytes
/
types.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
export interface Message { message: string, user: string, id: string }
type StorageValue = null | string | number | boolean | object;
export interface RoomItem {
users: string[]
messages: Message[]
}
export interface ChatData {
server: string
history: Message[]
data: Message
error: string
}
export interface Room {
user: string
room: string
}
export interface TokensByUser {
access: Record<string, string>
refresh: Record<string, string>
}
export interface RoomsDB extends StorageValue {
[key: string]: RoomItem
}
export interface TokensDB extends StorageValue {
[key: string]: TokensByUser
}
declare module '#auth-utils' {
interface User {
room: string
user: string
}
interface UserSession {
tokens: TokensByUser,
user: User
}
// interface SecureSessionData {
// // Add your own fields
// }
}