File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,22 @@ import {UpdateDirtyNoteJob} from "./realtimeUpdateDirtyNoteJob";
24
24
import { CleanDanglingUserJob } from "./realtimeCleanDanglingUserJob" ;
25
25
import { SaveRevisionJob } from "./realtimeSaveRevisionJob" ;
26
26
27
+
28
+ export interface RealtimeUserData {
29
+ id ?: string
30
+ color ?: string
31
+ address ?: string
32
+ 'user-agent' ?: string
33
+ photo ?: string
34
+
35
+ cursor ?: any
36
+ login ?: boolean
37
+ userid ?: string
38
+ name ?: string
39
+
40
+ idle ?: any
41
+ type ?: any
42
+ }
27
43
const chance = new Chance ( )
28
44
29
45
export let io : SocketIO . Server = null
@@ -95,8 +111,8 @@ export function emitCheck(note) {
95
111
}
96
112
97
113
// actions
98
- export const users = { }
99
114
export const notes = { }
115
+ export const users : Record < string , RealtimeUserData > = { }
100
116
101
117
export function getNotePool ( ) : any {
102
118
return notes
@@ -130,11 +146,11 @@ export function getNoteFromNotePool(noteId) {
130
146
return notes [ noteId ]
131
147
}
132
148
133
- export function getUserPool ( ) {
149
+ export function getUserPool ( ) : Record < string , RealtimeUserData > {
134
150
return users
135
151
}
136
152
137
- export function getUserFromUserPool ( userId ) {
153
+ export function getUserFromUserPool ( userId : string ) : RealtimeUserData | null {
138
154
return users [ userId ]
139
155
}
140
156
You can’t perform that action at this time.
0 commit comments