import type { BpmnAssociation, BpmnDefinitions, BpmnDiEdge, BpmnDiPlane, BpmnDiShape, BpmnFlowElement, BpmnGroup, BpmnLane, BpmnMessageFlow, BpmnParticipant, BpmnSequenceFlow, BpmnTextAnnotation } from "@bpmnkit/core"; import type { RenderedEdge, RenderedShape } from "./types.js"; /** The outline used to crop a connection to a shape. */ interface ShapeGeom { x: number; y: number; width: number; height: number; kind: "circle" | "diamond" | "rect"; } export interface ModelIndex { /** id → BpmnFlowElement (all levels flattened) */ elements: Map; /** id → BpmnSequenceFlow */ flows: Map; /** id → BpmnTextAnnotation */ annotations: Map; /** id → BpmnParticipant */ participants: Map; /** id → BpmnLane */ lanes: Map; /** id → BpmnAssociation */ associations: Map; /** id → BpmnGroup */ groups: Map; /** id → BpmnMessageFlow */ messageFlows: Map; /** IDs of sequence flows that are the default flow of their source gateway */ defaultFlowIds: Set; } /** * Creates the SVG `` section for this canvas instance. * Uses `instanceId` to make marker IDs unique per canvas, avoiding * conflicts when multiple canvases are mounted on the same page. * * @returns the filled-arrowhead marker ID (sequence-flow terminus). Other * marker IDs are derived from `instanceId` via {@link markerIds}. */ export declare function createDefs(svg: SVGSVGElement, instanceId: string): string; /** * Creates and inserts an SVG dot-grid background pattern. * The `` filling the entire viewport and the `` definition * are both inserted into the SVG. Returns the `` element so the * viewport controller can keep `patternTransform` in sync. */ export declare function createGrid(svg: SVGSVGElement, instanceId: string): SVGPatternElement; export interface RenderResult { shapes: RenderedShape[]; edges: RenderedEdge[]; } /** * Shared per-render state — a model index and docking geometry — reused by the * full {@link render} pass and by single-element updates in the {@link Scene}. */ export interface RenderContext { index: ModelIndex; geomById: Map; drillableIds: ReadonlySet; instanceId: string; } /** Builds a {@link RenderContext} for a plane (index + docking geometry). */ export declare function buildRenderContext(defs: BpmnDefinitions, plane: BpmnDiPlane, drillableIds: ReadonlySet, instanceId: string): RenderContext; /** Renders a single edge's `` (no DOM insertion). */ export declare function renderEdgeGroup(edge: BpmnDiEdge, ctx: RenderContext): SVGGElement; /** Which layer a shape's `` belongs to. */ export type ShapeLayer = "containers" | "shapes"; /** The result of rendering a single shape: its ``, target layer, and external label. */ export interface RenderedShapeGroup { group: SVGGElement; layer: ShapeLayer; label: SVGGElement | null; rendered: RenderedShape; } /** Renders a single shape's `` (+ optional external label), without DOM insertion. */ export declare function renderShapeGroup(shape: BpmnDiShape, ctx: RenderContext): RenderedShapeGroup; /** * Renders a `BpmnDefinitions` model into SVG element groups, appending them to * the provided layers. Thin wrapper over {@link buildRenderContext} + * {@link renderEdgeGroup}/{@link renderShapeGroup}, retained for existing * callers (the editor). New code should prefer the {@link Scene} class. * * Edges are placed below shapes (rendered first) so connection lines don't * cover shape bodies. Shapes are rendered in DI order so container shapes * (sub-processes) appear before their children. */ export declare function render(defs: BpmnDefinitions, containersLayer: SVGGElement, edgesLayer: SVGGElement, shapesLayer: SVGGElement, labelsLayer: SVGGElement, _markerId: string, instanceId: string, /** The DI plane to render. Defaults to the first diagram's plane. */ targetPlane?: BpmnDiPlane, /** Element ids that own their own plane and can be drilled into. */ drillableIds?: ReadonlySet): RenderResult; export interface DiagramBounds { minX: number; minY: number; maxX: number; maxY: number; } /** * Computes the bounding box of all shapes in a DI plane (the first diagram's * plane by default). Returns `null` if the plane has no shapes. */ export declare function computeDiagramBounds(defs: BpmnDefinitions, targetPlane?: BpmnDiPlane): DiagramBounds | null; export {}; //# sourceMappingURL=renderer.d.ts.map