From 1845938e70a4c8a36a9d267f90d844a9cd57208e Mon Sep 17 00:00:00 2001 From: hjlarry Date: Tue, 13 Jan 2026 22:18:54 +0800 Subject: [PATCH] fix type issue --- .../collaboration/core/collaboration-manager.ts | 10 ++++++---- .../collaboration/types/collaboration.ts | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/web/app/components/workflow/collaboration/core/collaboration-manager.ts b/web/app/components/workflow/collaboration/core/collaboration-manager.ts index fb83f6d85e..de98c3e428 100644 --- a/web/app/components/workflow/collaboration/core/collaboration-manager.ts +++ b/web/app/components/workflow/collaboration/core/collaboration-manager.ts @@ -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, } diff --git a/web/app/components/workflow/collaboration/types/collaboration.ts b/web/app/components/workflow/collaboration/types/collaboration.ts index 4e74d8fbda..dc154d3888 100644 --- a/web/app/components/workflow/collaboration/types/collaboration.ts +++ b/web/app/components/workflow/collaboration/types/collaboration.ts @@ -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 timestamp: number }