import { DirectedGraph } from 'eventemitter3-graphology'; import { StepMetadata } from '../decorators/Step'; export type DSLDefinition = { variables: Record; plan: Statement; }; export type StatementConditions = { when?: (variables: Record, plan: Statement) => boolean; wait?: ((variables: Record, plan: Statement) => boolean) | [(variables: Record, plan: Statement) => boolean, number]; timeout?: number; retries?: number; required?: boolean; }; export type Statement = { sequence?: Sequence; parallel?: Parallel; execute?: Execute; foreach?: ForEach; while?: While; doWhile?: DoWhile; } & StatementConditions; export type Sequence = { elements: Statement[]; } & StatementConditions; export type Parallel = { branches: Statement[]; } & StatementConditions; export type Execute = { name?: string; code?: string; step?: string; activity?: string; workflow?: string; with?: string[]; store?: string; } & StatementConditions; export type DSLGeneration = { nodeId: string; graph: DirectedGraph; bindings: Record; acts: Record Promise>; steps: Record Promise>; nodeIds: string[]; execute: () => Promise; }; export type ForEach = { in: string; as: string; body: Statement; }; export type While = { condition: (variables: Record, plan: Statement) => boolean; body: Statement; }; export type DoWhile = { body: Statement; condition: (variables: Record, plan: Statement) => boolean; }; export declare function DSLInterpreter(dsl: DSLDefinition, injectedActivities?: Record Promise>, injectedSteps?: Record Promise>, options?: { visualizationFormat?: 'list' | 'tree'; }): AsyncGenerator; /** * Adapter function to convert StepMetadata from the @Step decorator into DSLDefinition format * * @param steps Array of step metadata from a Workflow class * @param initialVariables Initial variables for the DSL * @param workflowInstance The workflow instance (optional) * @returns DSLDefinition object representing the workflow steps */ export declare function convertStepsToDSL(steps: StepMetadata[], initialVariables?: Record, workflowInstance?: any): DSLDefinition;