Skip to content

@yantrix/codegen v0.5.2 • Docs


Yantrix API / @yantrix/codegen / generateAutomataFromStateDiagram

Function: generateAutomataFromStateDiagram() ​

ts
function generateAutomataFromStateDiagram(diagram, options): Promise<string>

Main function that's used to asynchronously generate Yantrix FSMs.

Parameters ​

• diagram: TStateDiagramMatrix

The state diagram, processed by Mermaid & Yantrix Parsers (mermaid-parser, yantrix-parser)

• options: IGenerateOptions

Options for configuring the generation process, such as the output language and automata class name

Returns ​

Promise<string>

  • A promise with the code of generated FSM as string