import { ElementRef, EventEmitter, OnInit, WritableSignal } from '@angular/core'; import { EscalationType, Form, Workflow, WorkflowAction, WorkflowStage } from 'verben-workflow-ui/src/lib/models'; import { WorkflowDataService } from '../workflow-data.service'; import { WorkflowDesignerState } from '../workflow-designer.state'; import { Connection, ConnectionPoint, Node, SwimlaneItem, ToolType, Node as WFNode } from '../workflow-designer.types'; import * as i0 from "@angular/core"; export declare class DesignerCanvasComponent implements OnInit { state: WorkflowDesignerState; private dataService; selectedTool: ToolType; clickedPosition: EventEmitter<{ x: number; y: number; }>; subflowSelected: EventEmitter; pendingStagePosition: { swimlaneIndex: number; x: number; y: number; } | null; stagePropertiesUpdated: EventEmitter<{ nodeId: string; stageData: Partial; }>; actionPropertiesUpdated: EventEmitter<{ connectionId: string; actionData: Partial; }>; canvasRef: ElementRef; onWindowMouseUp(event: MouseEvent): void; canvasWidth: number; canvasHeight: number; gridSize: number; swimlaneHeight: number; visibleConnectionPointsNodeId: string | null; popupVisible: boolean; popupX: number; popupY: number; allowedNodeTypes: string[]; showStartNodeFormPopup: boolean; startNodeFormsList: Form[]; isLoadingStartNodeForms: boolean; startNodeFormPopupX: number; startNodeFormPopupY: number; activeNodeForFormSelection: Node | null; nodeForms: WritableSignal>; showSubflowPopup: boolean; workflowsList: Workflow[]; isLoadingWorkflows: boolean; subflowPopupX: number; subflowPopupY: number; pendingSubflowPosition: { swimlaneIndex: number; x: number; y: number; } | null; pendingDecisionConnection: { decisionNodeId: string; swimlaneIndex: number; x: number; y: number; } | null; pendingConnectionSourcePoint: ConnectionPoint | null; pendingConnectionSourceSwimlaneIndex: number | null; isDraggingNode: boolean; draggingNode: Node | null; private draggingNodeSwimlaneIndex; /** Mouse offset relative to node top-left at drag start (absolute canvas coords). */ private dragOffsetX; private dragOffsetY; showDecisionConditionDialog: boolean; showConditionsDialog: boolean; activeDecisionNodeId: string; activeConnectionId: string; decisionConditionPopupX: number; decisionConditionPopupY: number; isCreatingStageFromDecision: boolean; pendingDecisionCondition: string; activeStageId: string | null; activeActionId: string | null; showStageDialogLocal: boolean; showEscalationDialogLocal: boolean; activeEscalationType: WritableSignal; activeStageCode: WritableSignal; activeStageData: Partial; activeActionData: Connection | null; showActionDialogLocal: boolean; potentialTargetPointId: string | null; constructor(state: WorkflowDesignerState, dataService: WorkflowDataService); ngOnInit(): void; onCanvasClick(event: MouseEvent): void; onShowShieldDialog(stageId: string): void; onShowActionDialog(connectionInfo: Connection): void; onShowEscalationDialog(event: { stageId: string; type: EscalationType; }): void; onStageDialogClosed(): void; onActionDialogClosed(): void; onActionDialogDeleted(connectionId: string): void; onEscalationDialogClosed(): void; onStageDialogSaved(stageData: Partial): void; onActionDialogSaved(actionData: Connection): void; updateCanvasSize(): void; private getMousePosition; private getViewportPosition; showConnectionPoints(nodeId: string, swimlaneIndex: number): void; isMouseOverNode(event: MouseEvent, node: WFNode, swimlaneIndex: number): boolean; getNodeBoundsWithPadding(node: WFNode, swimlaneIndex: number): { x: number; y: number; width: number; height: number; }; hideConnectionPoints(nodeId: string): void; isConnectionPointVisible(nodeId: string): boolean; startConnectionDrag(event: MouseEvent, point: ConnectionPoint, swimlaneIndex: number): void; highlightPotentialTargets(event: MouseEvent): void; /** * Called from the template when the user presses the mouse button on a node. * Starts the drag interaction and registers document-level listeners so the * drag continues even when the cursor leaves the SVG canvas. */ onNodeMouseDown(event: MouseEvent, node: Node, swimlaneIndex: number): void; /** * Arrow function (preserves `this`) — runs on every mousemove while dragging * a node. Updates node.x / node.y in-place so Angular's change detection * picks it up and redraws the node and all connected paths automatically. */ onNodeDragMove: (event: MouseEvent) => void; /** Scratch fields used to pass computed values from move → end handlers. */ private _pendingTargetSwimlaneIndex; private _pendingAbsoluteY; /** * Arrow function (preserves `this`) — fires on mouseup after a node drag. * Finalises the node position and performs swimlane migration if necessary. */ onNodeDragEnd: (_event: MouseEvent) => void; /** * Returns a CSS cursor value for the node rendering. * Shows 'grabbing' while the node is being dragged, 'grab' otherwise. */ getCursorForNode(nodeId: string): string; onMouseMove: (event: MouseEvent) => void; updateConnectionDrag(currentX: number, currentY: number): void; onMouseUp: (event: MouseEvent) => void; findConnectionPointAtPosition(x: number, y: number, tolerance?: number): { point: ConnectionPoint; nodeId: string; swimlaneIndex: number; } | null; isPositionInsideSwimlane(y: number): boolean; showConnectionPopup(x: number, y: number): void; hideConnectionPopup(): void; createNodeConnection(nodeType: string): void; onDecisionConditionSaved(event: { connectionId: string; condition: string; }): void; onDecisionConditionCancelled(): void; getConnectionPath(): string; getConnectionPathForSavedConnection(connection: Connection): string; getOrthogonalPath(startX: number, startY: number, endX: number, endY: number, pointType: 'top' | 'right' | 'bottom' | 'left'): string; selectFormForStage(form: Form | null, node: Node): void; onStagePropertiesUpdated(event: { nodeId: string; stageData: Partial; }): void; onConnectionCreated(connection: Connection): void; updateNodeConnections(node: WFNode): void; onEditSwimlane(event: MouseEvent, swimlane: SwimlaneItem, swimlaneIndex: number): void; toggleStartNodeFormPopup(event: MouseEvent, nodeX: number, nodeY: number, swimlaneIndex: number, node?: Node): void; selectStartNodeForm(form: Form | null): void; showSubflowSelectionPopup(x: number, y: number, swimlaneIndex: number): void; selectSubflowWorkflow(workflow: Workflow): void; showDecisionConditionsPopup(event: MouseEvent, node: WFNode, swimlaneIndex: number): void; ensureSwimlaneInView(swimlaneIndex: number): void; getLabelPosition(connection: Connection): { x: number; y: number; }; saveConnectionLabel(connection: Connection, label: string): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }