/** * Block Diagram Wrapper Class * * Provides a fluent API for creating and manipulating block-beta diagrams. */ import { DiagramWrapper } from './diagram-wrapper.js'; import type { BlockAST, BlockArrowDirection, BlockComposite, BlockEdge, BlockEdgeType, BlockNode, BlockNodeShape, BlockSpace } from './types/block.js'; import type { RenderOptions } from './types/render-options.js'; /** * Options for adding a node */ export interface AddBlockNodeOptions { /** Node label (defaults to id if not provided) */ label?: string; /** Node shape */ shape?: BlockNodeShape; /** Width in columns */ widthInColumns?: number; /** Directions for block arrows */ directions?: BlockArrowDirection[]; } /** * Options for adding an edge */ export interface AddBlockEdgeOptions { /** Edge label */ label?: string; /** Edge type */ edgeType?: BlockEdgeType; } /** * Block diagram wrapper class */ export declare class Block extends DiagramWrapper { private constructor(); /** * Creates an empty block diagram */ static create(): Block; /** * Creates a Block from an existing AST */ static from(ast: BlockAST): Block; /** * Parses Mermaid block-beta syntax into a Block */ static parse(text: string): Block; /** * Renders the block diagram to Mermaid syntax */ render(options?: RenderOptions): string; /** * Creates a deep clone of this diagram */ clone(): Block; /** * Sets the number of columns for the layout */ setColumns(columns: number | 'auto'): this; /** * Gets the current column setting */ getColumns(): number | 'auto' | undefined; /** * Adds a node to the diagram */ addNode(id: string, options?: AddBlockNodeOptions): this; /** * Gets a node by id */ getNode(id: string): BlockNode | undefined; /** * Finds all nodes in the diagram (including nested) */ findNodes(): BlockNode[]; /** * Removes a node by id */ removeNode(id: string): this; /** * Gets the number of nodes */ get nodeCount(): number; /** * Adds an edge between two nodes */ addEdge(from: string, to: string, options?: AddBlockEdgeOptions): this; /** * Finds all edges in the diagram */ findEdges(): BlockEdge[]; /** * Removes an edge by id or by source/target */ removeEdge(idOrFrom: string, to?: string): this; /** * Gets the number of edges */ get edgeCount(): number; /** * Adds a space block for layout */ addSpace(width?: number): this; /** * Finds all space blocks */ findSpaces(): BlockSpace[]; /** * Adds a composite (nested) block */ addComposite(id: string, label?: string): this; /** * Gets a composite block by id */ getComposite(id: string): BlockComposite | undefined; /** * Finds all composite blocks */ findComposites(): BlockComposite[]; /** * Defines a CSS class */ defineClass(name: string, css: string): this; /** * Applies a class to nodes */ applyClass(nodeIds: string | string[], className: string): this; /** * Applies inline styles to nodes */ applyStyles(nodeIds: string | string[], styles: string): this; /** * Gets all defined classes */ getClassDefs(): Map; /** * Sets the accessibility title */ setAccTitle(title: string): this; /** * Gets the accessibility title */ getAccTitle(): string | undefined; /** * Sets the accessibility description */ setAccDescr(descr: string): this; /** * Gets the accessibility description */ getAccDescr(): string | undefined; /** * Gets the total number of elements */ get elementCount(): number; } //# sourceMappingURL=block.d.ts.map