import { Condition, SubFlowsConfig, SubFlowMachineContext } from './types'; import StoreAPI from '../store'; export default class CreateMachineConfig { private readonly storeApi; private actions; private readonly flowsConfig; constructor(flowsConfig: SubFlowsConfig, storeApi: StoreAPI); createConfig(): { id: string; initial: string; context: { runInFlowTypes: string[] | undefined; currentFlowToCheck: string; error: boolean; }; states: any; }; createFlows(): any; createFlow(flowName: string, conditions: Array, nextFlowName?: string, runInFlowTypes?: Array): { [x: string]: { id: string; initial: string; states: { checkStart: { invoke: { id: string; src: (context: SubFlowMachineContext, event: any) => Promise; onDone: string; onError: string; }; }; checkFlow: { type: string; onDone: string; states: any; }; checkDone: { type: string; invoke: { id: string; src: (context: any, event: any) => Promise; onDone: string; }; }; }; }; }; createConditions(conditions: Array): any; createCondition(conditionName: string, onCheckHandler: Function, mandatory?: boolean): { [x: string]: { id: string; initial: string; states: { check: { invoke: { id: string; src: (context: SubFlowMachineContext, event: any) => any; onDone: string; onError: string; }; }; error: { invoke: { id: string; src: (context: SubFlowMachineContext, event: any) => Promise; onDone: string; }; }; done: { type: string; }; }; }; }; }