import type { VNode } from 'preact'; import type { DiagramDef } from '../types.js'; import type { PlacementDiagnostic } from '../gg/diagnostics.js'; import type { DiagramSettings } from '../config.js'; /** * Back-compat alias: callers that used to pass a loose DiagramOptions * object (`{ suppressErrors, width }`) can still do so. Internally this * is a DiagramSettings layer. */ export type DiagramOptions = DiagramSettings; /** Build the Preact VNode tree for a diagram. Diagnostics are discarded * — use `renderDiagram` instead if you need them. */ export declare function buildDiagramTree(rawDef: DiagramDef, opts?: DiagramOptions): any; /** Props accepted by the `` Preact component. */ export interface DiagramProps extends DiagramOptions { def: DiagramDef; } /** * Preact functional component wrapper around `buildDiagramTree` — embed a * diagram directly in your JSX: * * import { Diagram } from 'gridgram' * * * For plain SVG string output (no Preact host), use `renderDiagram` instead. */ export declare function Diagram(props: DiagramProps): VNode; /** Render result carrying the SVG alongside any placement / route * diagnostics the pipeline produced. Icon-unresolved diagnostics come * from `resolveDiagramIcons` upstream; callers typically merge the * two lists. */ export interface RenderResult { svg: string; diagnostics: PlacementDiagnostic[]; } /** * Render a DiagramDef to an SVG string *and* return the layout * diagnostics. Diagnostics include `label-collision` (a label was * forced into an overlapping fallback) and `route-failed` (a connector * couldn't be routed around obstacle nodes). Empty array on a clean * layout. */ export declare function renderDiagram(def: DiagramDef, opts?: DiagramOptions): RenderResult; /** Render a DiagramDef to a standalone SVG string (no XML declaration). * Discards diagnostics — prefer `renderDiagram` when you need agent- * readable feedback about layout issues. */ export declare function renderDiagramSvg(def: DiagramDef, opts?: DiagramOptions): string; /** * Compute the final rasterized pixel dimensions for a DiagramDef. * Used by the CLI to size sharp's PNG output in accordance with the * render-time `width` option and the canvas aspect. */ export declare function computeRenderDimensions(rawDef: DiagramDef, opts?: DiagramOptions): { width: number; height: number; }; //# sourceMappingURL=Diagram.d.ts.map