import { Node, ToolType, ConnectionPoint } from '../workflow-designer.types'; import { WorkflowStage } from 'verben-workflow-ui/src/lib/models'; import { WorkflowDesignerState } from '../workflow-designer.state'; import * as i0 from "@angular/core"; /** * Node helpers used by `DesignerToolbarComponent` and `StageDialogComponent`. * * ⚠️ **Partially adopted, and it has drifted from `WorkflowDesignerState`.** * Most components use `state` directly; this service duplicates a subset of its * logic. The copies are not identical — see {@link addNode} below and * `./docs/06-known-issues.md` section A. * * Prefer `WorkflowDesignerState` for new work. If you must change behaviour * here, check whether `state` needs the same change. */ export declare class NodeManagementService { private state; constructor(state: WorkflowDesignerState); /** * Adds a new node to the specified swimlane. * * ⚠️ **This disagrees with `WorkflowDesignerState.addNode` by 40px.** It * subtracts an extra `- 40` "header height" that neither `state.addNode` nor * the render template applies, so a node placed through this method lands * 40px higher than one placed through the canvas. * * `state.addNode` is the correct one. Do not copy the `- 40` outward; the fix * is to remove it here, which is tracked in `./docs/06-known-issues.md`. * * @param y **Absolute** canvas Y — same contract as `state.addNode`. */ addNode(swimlaneIndex: number, type: ToolType, x: number, y: number, stageData?: Partial, workflowData?: { id: string; name: string; }): Node | null; /** * Gets the total count of nodes across all swimlanes */ getNodeCount(): number; /** * Find a node by ID */ findNodeById(id: string): { node: Node; swimlaneIndex: number; } | null; /** * Generate connection points for a node */ generateConnectionPoints(node: Node): ConnectionPoint[]; /** * Update node properties */ updateNodeProperties(nodeId: string, properties: Partial): boolean; /** * Update stage data for a node */ updateStageData(nodeId: string, stageData: Partial): boolean; /** * Set a node as a start node */ setAsStartNode(nodeId: string): boolean; /** * Delete a node */ deleteNode(nodeId: string): boolean; /** * Check if a node has outgoing connections */ hasOutgoingConnections(nodeId: string): boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }