import { ActiveNode } from './active-node'; import { Observable, Subscription } from 'rxjs'; import { ServerCall } from './server-call'; import { CoreServices } from '../services'; export interface ActiveState { id?: string; itemType: 'flow'; layout?: { showFooter: boolean; showHeader: boolean; showToolbar: boolean; showCommandBar: boolean; }, activateStateGuard?: (svc: CoreServices) => Observable; deactivateStateGuard?: (svc: CoreServices) => Observable; dontLoadNodes?: boolean; dontLoadItemOneFromServer?: boolean; name: string; header?: { title?: string | ((svc: CoreServices) => Observable); controls?: (p) => any; }; footer?: { type: 'pagination' | 'node_nav'; }; actionPanel?: (instance: any) => () => any[]; instructions?: { editRoles: { [id: number]: string }; viewRoles: { [id: number]: string }; }; includeForOnlyStates?: any[]; excludeForOnlyStates?: any[]; excludeForOnlyRoles?: any[]; useMockContextData?: boolean; mockContextData?: { [id: string]: any; }; serverCalls?: { [id: string]: ServerCall; }; serverQuery?: {}; events?: { [name: string]: { triggerOn: string | string[]; triggerWhen: (...prop: any) => boolean; dataMutations: (svc: CoreServices) => void; serverCalls?: { [id: string]: ServerCall; }; }; }; ev?: { [name: string]: { trigger: {source: string; on: string; when: {prop: string; operator: string; value: any}}[]; dataMutations: (svc: CoreServices) => void; serverCalls?: { [id: string]: ServerCall; }; } }; valuesToBigForm?: (svc: CoreServices) => void | Subscription; bigFormToStoreMapper?: { [id: string]: string | string[] | [Function, string] | [Function, string][] }; startNode?: string; nodes?: { [id: string]: ActiveNode }; // State level Lifecycle onStateInit?: (instance) => void; onStateDestroy?: (instance) => void; flowErrorMessages?: { [key: string]: string }; }