import { FunctionComponent, ReactElement } from 'react'; export interface GraphStateMachine { id: string; type?: string; version?: string; nodes: Node[]; edges: Edge[]; } export interface Node { id: string; key: string; meta: NodeMeta; view: NodeView; } interface NodeMeta { type: string; name: string; description?: string | null; approval?: NodeMetaApproval | null; form?: NodeMetaForm | null; config?: { timestampVisible: boolean; iconVisible: boolean; }; } interface NodeMetaApproval { candidateGroup: string; agreeActions: string[]; rejectActions: string[]; } interface NodeMetaForm { key: string; schema: any; } interface NodeView { status: string; disabled: boolean; name: string; userId: number | null; timestamp: number | null; form?: NodeViewForm | null; approval?: NodeViewApproval | null; } export interface NodeViewForm { key: string; payload: { [key: string]: any; }; } export interface NodeViewApproval { candidateUsers?: CandidateUsersEntity[] | null; agreed: boolean; refused: boolean; } interface CandidateUsersEntity { id: number; name: string; avatar: string; accounts?: AccountsEntity[] | null; } interface AccountsEntity { id: number; type: string; uid: string; chatId: string; } interface Edge { id: string; meta: EdgeMeta; view: EdgeView; } interface EdgeMeta { points: string[]; } interface EdgeView { status: string | null; disabled: boolean; } export declare type Permission = { extendValue: string; id: number; name: string; type: number; value: string; }; export interface GraphStateMachineConfig { icons?: { [key: string]: ReactElement; }; colors?: { [key: string]: string; }; extra?: { [key: string]: FunctionComponent<{ node: Node; }>; }; components?: { [key: string]: FunctionComponent<{ node: Node; }>; }; forms?: { [key: string]: { header?: FunctionComponent<{ node: Node; }>; footer?: FunctionComponent<{ node: Node; }>; onSubmit?: (data: any) => void; }; }; } export {};