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";
2424import { CleanDanglingUserJob } from "./realtimeCleanDanglingUserJob" ;
2525import { SaveRevisionJob } from "./realtimeSaveRevisionJob" ;
2626
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+ }
2743const chance = new Chance ( )
2844
2945export let io : SocketIO . Server = null
@@ -95,8 +111,8 @@ export function emitCheck(note) {
95111}
96112
97113// actions
98- export const users = { }
99114export const notes = { }
115+ export const users : Record < string , RealtimeUserData > = { }
100116
101117export function getNotePool ( ) : any {
102118 return notes
@@ -130,11 +146,11 @@ export function getNoteFromNotePool(noteId) {
130146 return notes [ noteId ]
131147}
132148
133- export function getUserPool ( ) {
149+ export function getUserPool ( ) : Record < string , RealtimeUserData > {
134150 return users
135151}
136152
137- export function getUserFromUserPool ( userId ) {
153+ export function getUserFromUserPool ( userId : string ) : RealtimeUserData | null {
138154 return users [ userId ]
139155}
140156
You can’t perform that action at this time.
0 commit comments