| 41 | * All methods that access state are async to support Redis operations |
| 42 | */ |
| 43 | export interface IRoomManager { |
| 44 | readonly io: Server |
| 45 | |
| 46 | /** |
| 47 | * Initialize the room manager (connect to Redis, etc.) |
| 48 | */ |
| 49 | initialize(): Promise<void> |
| 50 | |
| 51 | /** |
| 52 | * Whether the room manager is ready to serve requests |
| 53 | */ |
| 54 | isReady(): boolean |
| 55 | |
| 56 | /** |
| 57 | * Clean shutdown |
| 58 | */ |
| 59 | shutdown(): Promise<void> |
| 60 | |
| 61 | /** |
| 62 | * Add a user to a workflow room |
| 63 | */ |
| 64 | addUserToRoom(workflowId: string, socketId: string, presence: UserPresence): Promise<void> |
| 65 | |
| 66 | /** |
| 67 | * Remove a user from their current room |
| 68 | * Optional workflowIdHint is used when socket mapping keys are missing/expired. |
| 69 | * Returns the workflowId they were in, or null if not in any room. |
| 70 | */ |
| 71 | removeUserFromRoom(socketId: string, workflowIdHint?: string): Promise<string | null> |
| 72 | |
| 73 | /** |
| 74 | * Get the workflow ID for a socket |
| 75 | */ |
| 76 | getWorkflowIdForSocket(socketId: string): Promise<string | null> |
| 77 | |
| 78 | /** |
| 79 | * Get user session data for a socket |
| 80 | */ |
| 81 | getUserSession(socketId: string): Promise<UserSession | null> |
| 82 | |
| 83 | /** |
| 84 | * Get all users in a workflow room |
| 85 | */ |
| 86 | getWorkflowUsers(workflowId: string): Promise<UserPresence[]> |
| 87 | |
| 88 | /** |
| 89 | * Check if a workflow room exists |
| 90 | */ |
| 91 | hasWorkflowRoom(workflowId: string): Promise<boolean> |
| 92 | |
| 93 | /** |
| 94 | * Update user activity (cursor, selection, lastActivity) |
| 95 | */ |
| 96 | updateUserActivity( |
| 97 | workflowId: string, |
| 98 | socketId: string, |
| 99 | updates: Partial<Pick<UserPresence, 'cursor' | 'selection' | 'lastActivity'>> |
| 100 | ): Promise<void> |
no outgoing calls
no test coverage detected