Import it from @grafloria/engine.
tsclass DSL
Methods
constructor(options: DSLOptions = {})parse(text: string): DiagramModel— Parse DSL text into a DiagramModelparseDetailed(text: string): ParseResult— Parse DSL text with detailed resultsvalidate(text: string): { valid: boolean; errors: string[] }— Validate DSL text without creating a diagramsuggestLayout(text: string): LayoutSuggestion | null— Get layout suggestion for text without parsing fullytokenize(text: string): Token[]— Get token stream for debuggingparseToAST(text: string): DiagramNode— Get AST for debuggingsetOptions(options: Partial<DSLOptions>): void— Set optionsgetOptions(): DSLOptions— Get current optionsgenerate(diagram: DiagramModel, options?: GeneratorOptions): string— Generate DSL text from diagramgenerateFormatted( diagram: DiagramModel, generatorOptions?: GeneratorOptions, formatterOptions?: FormatterOptions ): string— Generate and format DSL text from diagramgeneratePretty(diagram: DiagramModel, addHeaders: boolean = true): string— Generate pretty-printed DSL textformat(text: string, options?: FormatterOptions): string— Format DSL texttestRoundTrip(text: string): { success: boolean; originalNodes: number; originalLinks: number; regeneratedNodes: number; regeneratedLinks: number; generatedText: string; }— Round-trip test: parse → generate → parse Returns true if the round-trip preserves structureparseERD(text: string): DiagramModel— Parse ERD (Entity Relationship Diagram).generateERD(diagram: DiagramModel): string— Generate ERD DSL from diagramparseBPMN(text: string): DiagramModel— Parse BPMN (Business Process Model)generateBPMN(diagram: DiagramModel): string— Generate BPMN DSL from diagramparseUML(text: string): DiagramModel— Parse UML Class Diagram.
The scaffolding this replaces returned an EMPTY diagram for canonical
classDiagram input.
generateUML(diagram: DiagramModel): string— Generate UML DSL from diagram
Was this page helpful?