import { WritableSignal } from '@angular/core';
import { Tag, Workflow } from 'verben-workflow-ui/src/lib/models';
import { UtilService } from 'verben-workflow-ui/src/lib/services';
import { DesignerCanvasComponent } from './designer-canvas/designer-canvas.component';
import { WorkflowDataService } from './workflow-data.service';
import { WorkflowDesignerState } from './workflow-designer.state';
import { ToolType } from './workflow-designer.types';
import * as i0 from "@angular/core";
/**
* The workflow designer's root component and **the only thing
* `WorkflowDesignerModule` exports** — everything else in this folder is
* internal.
*
* ```html
*
* ```
*
* Responsibilities are deliberately narrow: load and save the workflow, host
* the toolbar and the lane/actor-tag dialogs, and translate toolbar tool
* selection plus canvas clicks into state mutations. The heavy lifting —
* rendering and all pointer interaction — belongs to
* {@link DesignerCanvasComponent}.
*
* ## Integration requirements
*
* Consuming apps must provide the `ENVIRONMENT` injection token and have a
* reachable Workflow API; the designer throws on construction without the
* former and renders empty without the latter. Note there are **no outputs** —
* saving is driven by the built-in toolbar button, and the host is not notified
* when it happens.
*
* @see ./docs/07-integration.md — full setup guide
* @see ./docs/01-architecture.md — how this fits with the canvas and state
*/
export declare class WorkflowDesignerComponent {
state: WorkflowDesignerState;
private dataService;
private utilService;
canvasRef: DesignerCanvasComponent;
/** Code of the workflow to load. `null` renders an empty canvas. */
workflowCode: string | null;
/** Active toolbar tool; `null` means pointer mode. */
selectedTool: ToolType;
showSwimlaneDialog: boolean;
showActorTagsDialog: boolean;
editingSwimlaneIndex: number | null;
editingSwimlane: WritableSignal<{
name: string;
tags: Tag[];
} | null>;
isLoading: boolean;
isSaving: boolean;
constructor(state: WorkflowDesignerState, dataService: WorkflowDataService, utilService: UtilService);
ngOnInit(): void;
saveWorkflow(): void;
/**
* Fetches a workflow by code and hands the first result to
* {@link parseWorkflowData}. Called from `ngOnInit` when `workflowCode` is
* set.
*
* Failures are logged and swallowed — the canvas simply stays empty. If the
* designer renders blank, check the `ENVIRONMENT` provider and the
* `WorkFlowAPI` base URL before suspecting the code itself.
*/
loadWorkflow(code: string): void;
/**
* Maps an API `Workflow` into the designer's editing model — the load-side
* counterpart to `WorkflowDesignerState.transformToWorkflowModel`.
*
* Steps, in order:
* 1. Reset `swimlanes`, `connections`, and the `*Record` maps, and stash the
* full workflow for save-time state derivation.
* 2. Rebuild lanes sorted by `Position`, registering lane-id → index mappings.
* 3. Rebuild nodes from `Stages`, keyed by `IsSubProcess` into `subflow` or
* `stage` type, then generate their connection points.
* 4. Rebuild connections from `Actions`.
*
* Nodes are constructed **literally here** rather than through
* `state.addNode`, so that `stage.Code` is preserved as the node id and
* identity survives the round trip. That also means this path bypasses
* `addNode`'s coordinate conversion — stage coordinates come back from the
* API already lane-relative and are used as-is.
*
* ⚠️ **This is the live parser.** `TransformerService.parseWorkflowData` is a
* dead duplicate reached by nothing — edit this one. See
* `./docs/06-known-issues.md` section A.
*/
parseWorkflowData(workflow: Workflow): void;
findSwimlaneIndexByLaneId(laneId: string): number;
onToolSelected(tool: ToolType): void;
openSwimlaneDialog(): void;
/**
* Handles a canvas click by branching on the active tool: opening the
* swimlane dialog, placing a stage/decision/form node, or starting the
* subflow picker. The tool resets to `null` after a successful placement.
*
* ⚠️ **Sentinel value.** `{ x: -1, y: laneIndex }` is not a position — it
* means "edit the swimlane at `laneIndex`", emitted by the lane's pencil
* button. It is intercepted before any placement logic runs. Any change to
* this method must preserve that check, and callers must never emit a
* genuine click with `x === -1`.
*
* Node placement passes the click Y through **absolute**, with the target
* lane derived as `Math.floor(event.y / 263)` — the canonical coordinate
* contract described in `./docs/02-coordinate-system.md`.
*/
handleCanvasPositionClick(event: {
x: number;
y: number;
}): void;
onSwimlaneDialogFilled(event: {
tags: Tag[];
name: string;
}): void;
onSwimlaneDialogDeleted(): void;
private finishSwimlaneDelete;
onSubflowSelected(): void;
openActorTagsDialog(): void;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵcmp: i0.ɵɵComponentDeclaration;
}