import { CoreServices } from '../services/core.services'; import { ActivatedRoute } from '@angular/router'; import { Observable, Subscription } from 'rxjs'; import { ServerCallConfig } from './server-call.config'; import { ServerQueryConfig } from './server-query.config'; import { StateConfig } from './state.config'; import { EventConfig } from './event.config'; import { Type } from '@angular/core'; import { FooterButtonConfig } from './footer-button.config'; export interface NodeConfig { name?: string; hideTab?: boolean; layout?: { showFooter?: boolean; showHeader?: boolean; showToolbar?: boolean; showActionPanel?: boolean; }; controls?: (p: any) => any; canActivate?: any[]; canDeactivate?: any[]; activateGuard?: (svc: CoreServices, route?: ActivatedRoute) => Observable; deactivateGuard?: (svc: CoreServices, route?: ActivatedRoute) => Observable; title?: string | ((svc: CoreServices, route?: ActivatedRoute) => Observable); footerType: 'pagination' | 'node_nav' | 'none'; errorHandler?: { displayFormat: 'inline' | 'toast' | 'dialog' | 'none'; retryPolicy?: 'none' | 'manual' | 'auto' | { retryInterval: number; retryCount: number; }; onRetryComplete?: (svc: CoreServices, route?: ActivatedRoute) => Observable; }; initFormFields?: (svc: CoreServices, route?: ActivatedRoute) => void | Subscription; checkValidityForFields?: string[]; nodeType?: 'singleView' | 'decision' | 'subflow'; mockContextData?: { [id: string]: any; }; serverCalls?: ServerCallConfig[]; serverQueries?: ServerQueryConfig[]; subFlow?: StateConfig; events?: { [name: string]: EventConfig; }; decision?: (svc: CoreServices, route?: ActivatedRoute) => void | Subscription; intersectData?: (svc: CoreServices, route?: ActivatedRoute) => void; inputs?: { [id: string]: any; }; outputs?: { [id: string]: (ev?: any, svc?: CoreServices, route?: ActivatedRoute) => void; }; component?: Type | TemplateDefinition; navs?: FooterButtonConfig[]; onNodeInit?: (svc: CoreServices, route?: ActivatedRoute) => void; onNodeDestroy?: (svc: CoreServices, route?: ActivatedRoute) => void; } export interface TemplateDefinition { children: OrganismDefinition[]; layout?: string; } export interface OrganismDefinition { component: Type; inputs: { [key: string]: any; }; outputs?: { [id: string]: (ev?: any, svc?: CoreServices, route?: ActivatedRoute) => void; }; }