/** * Block Diagram AST Types * * Block diagrams (block-beta) are used to create block-based layouts with * configurable columns and various node shapes. */ /** * Node shape types in block diagrams */ export type BlockNodeShape = 'square' | 'round' | 'circle' | 'doublecircle' | 'diamond' | 'hexagon' | 'stadium' | 'subroutine' | 'cylinder' | 'asymmetric' | 'trapezoid' | 'trapezoid-alt' | 'lean-right' | 'lean-left' | 'block-arrow'; /** * Direction for block arrows */ export type BlockArrowDirection = 'left' | 'right' | 'up' | 'down' | 'x' | 'y'; /** * Edge/link type */ export type BlockEdgeType = 'arrow' | 'open' | 'dotted' | 'thick' | 'invisible'; /** * A node in a block diagram */ export interface BlockNode { /** Unique identifier for the node */ id: string; /** Display label (if different from id) */ label?: string; /** Node shape */ shape: BlockNodeShape; /** Width in columns (default 1) */ widthInColumns: number; /** Directions for block arrows */ directions?: BlockArrowDirection[]; } /** * A space block for layout purposes */ export interface BlockSpace { /** Unique identifier */ id: string; /** Type discriminator */ type: 'space'; /** Width in columns */ width: number; } /** * A composite block containing child elements */ export interface BlockComposite { /** Unique identifier */ id: string; /** Type discriminator */ type: 'composite'; /** Display label */ label?: string; /** Child elements */ children: BlockElement[]; } /** * An edge/link between nodes */ export interface BlockEdge { /** Unique identifier */ id: string; /** Source node id */ start: string; /** Target node id */ end: string; /** Edge label */ label?: string; /** Edge type */ edgeType: BlockEdgeType; } /** * Column setting statement */ export interface BlockColumnSetting { /** Type discriminator */ type: 'column-setting'; /** Number of columns (-1 for auto) */ columns: number; } /** * Class definition for styling */ export interface BlockClassDef { /** Type discriminator */ type: 'classDef'; /** Class name */ id: string; /** CSS styles */ css: string; } /** * Apply class to nodes */ export interface BlockApplyClass { /** Type discriminator */ type: 'applyClass'; /** Node IDs (comma-separated) */ id: string; /** Style class name */ styleClass: string; } /** * Apply inline styles to nodes */ export interface BlockApplyStyles { /** Type discriminator */ type: 'applyStyles'; /** Node IDs (comma-separated) */ id: string; /** Style string */ stylesStr: string; } /** * Union of all block element types */ export type BlockElement = BlockNode | BlockSpace | BlockComposite | BlockEdge | BlockColumnSetting | BlockClassDef | BlockApplyClass | BlockApplyStyles; /** * Block Diagram AST */ export interface BlockAST { /** Diagram type discriminator */ type: 'block'; /** Accessibility title */ accTitle?: string; /** Accessibility description */ accDescr?: string; /** Root elements of the diagram */ elements: BlockElement[]; /** Class definitions */ classDefs: Map; /** Class assignments (node id -> class name) */ classAssignments: Map; /** Style assignments (node id -> style string) */ styleAssignments: Map; } /** * Creates an empty BlockAST */ export declare function createEmptyBlockAST(): BlockAST; /** * Type guard for BlockNode */ export declare function isBlockNode(element: BlockElement): element is BlockNode; /** * Type guard for BlockSpace */ export declare function isBlockSpace(element: BlockElement): element is BlockSpace; /** * Type guard for BlockComposite */ export declare function isBlockComposite(element: BlockElement): element is BlockComposite; /** * Type guard for BlockEdge */ export declare function isBlockEdge(element: BlockElement): element is BlockEdge; /** * Type guard for BlockColumnSetting */ export declare function isBlockColumnSetting(element: BlockElement): element is BlockColumnSetting; /** * Type guard for BlockClassDef */ export declare function isBlockClassDef(element: BlockElement): element is BlockClassDef; /** * Type guard for BlockApplyClass */ export declare function isBlockApplyClass(element: BlockElement): element is BlockApplyClass; /** * Type guard for BlockApplyStyles */ export declare function isBlockApplyStyles(element: BlockElement): element is BlockApplyStyles; //# sourceMappingURL=block.d.ts.map