mirror of https://github.com/langgenius/dify.git
fix type issue
This commit is contained in:
parent
fad81ab85e
commit
1845938e70
|
|
@ -11,6 +11,7 @@ import type {
|
|||
} from '../../types'
|
||||
import type {
|
||||
CollaborationState,
|
||||
CollaborationUpdate,
|
||||
CursorPosition,
|
||||
NodePanelPresenceMap,
|
||||
NodePanelPresenceUser,
|
||||
|
|
@ -815,13 +816,14 @@ export class CollaborationManager {
|
|||
})
|
||||
}
|
||||
|
||||
private setupSocketEventListeners(socket: any): void {
|
||||
socket.on('collaboration_update', (update: any) => {
|
||||
private setupSocketEventListeners(socket: Socket): void {
|
||||
socket.on('collaboration_update', (update: CollaborationUpdate) => {
|
||||
if (update.type === 'mouse_move') {
|
||||
// Update cursor state for this user
|
||||
const data = update.data as { x: number; y: number }
|
||||
this.cursors[update.userId] = {
|
||||
x: update.data.x,
|
||||
y: update.data.y,
|
||||
x: data.x,
|
||||
y: data.y,
|
||||
userId: update.userId,
|
||||
timestamp: update.timestamp,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,9 +49,22 @@ export type GraphSyncData = {
|
|||
edges: Edge[]
|
||||
}
|
||||
|
||||
export type CollaborationEventType
|
||||
= | 'mouse_move'
|
||||
| 'vars_and_features_update'
|
||||
| 'sync_request'
|
||||
| 'app_state_update'
|
||||
| 'app_meta_update'
|
||||
| 'mcp_server_update'
|
||||
| 'workflow_update'
|
||||
| 'comments_update'
|
||||
| 'node_panel_presence'
|
||||
| 'app_publish_update'
|
||||
| 'graph_resync_request'
|
||||
|
||||
export type CollaborationUpdate = {
|
||||
type: 'mouse_move' | 'vars_and_features_update' | 'sync_request' | 'app_state_update' | 'app_meta_update' | 'mcp_server_update' | 'workflow_update' | 'comments_update' | 'node_panel_presence' | 'app_publish_update'
|
||||
type: CollaborationEventType
|
||||
userId: string
|
||||
data: any
|
||||
data: Record<string, unknown>
|
||||
timestamp: number
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue