import { EventObject , MachineConfig } from 'xstate' ; import { MachineOptions , StatesConfig } from 'xstate/lib/types' ; import { Application } from './Application' ; import { ApplicationContext , ApplicationRole , ApplicationStateSchema , } from './StateMachine' ; import { ApplicationTypes } from './ApplicationTypes' ; import { Schema , StaticText } from './Form' ; import { AnswerValidator } from '../validation/AnswerValidator' ; export interface ApplicationTemplate < TContext extends ApplicationContext , TStateSchema extends ApplicationStateSchema < TEvents > , TEvents extends EventObject > { readonly readyForProduction ? : boolean ; readonly type : ApplicationTypes ; readonly name : StaticText ; readonly institution ? : StaticText ; readonly translationNamespaces ? : string [ ] ; readonly dataSchema : Schema ; readonly stateMachineConfig : MachineConfig < TContext , TStateSchema , TEvents > & { states : StatesConfig < TContext , TStateSchema , TEvents > ; } ; readonly stateMachineOptions ? : Partial < MachineOptions < TContext , TEvents > > ; mapUserToRole ( nationalId , application ) : ApplicationRole | undefined ; answerValidators ? : Record < string , AnswerValidator > ; }