import { mxCell, mxCellState, mxPopupMenuHandler } from 'mxgraph'; import MyGraph from '../graph'; export declare type ItemType = 'vertex' | 'edge'; export interface NodeConfig extends Record { id: string; width: number; height: number; x: number; y: number; style: string; type: ItemType; parentId?: string; source?: mxCell; target?: mxCell; value?: string; } export interface SidebarNodeConfig { name: string; style: string; type: ItemType; width: number; height: number; value?: string; info?: Record; } export interface SidebarHTMLItem { html: string; width: number; height: number; cell: mxCell; code: string; } export interface SidebarHTML { name: string; icon?: { type: 'iconfont' | 'image'; value: string; } | string; nodes?: SidebarHTMLItem[]; children?: SidebarHTML[]; } export interface DrawInstance { graph: MyGraph; } export interface ToolbarProps { graph?: MyGraph; toolbar?: iToolbarSection[]; } export interface iToolbarItem { value?: string; name: string; key: string; tip?: string; icon?: string; iconType?: 'iconfont' | 'image'; children?: iToolbarItemDropdown[]; type: 'default' | 'multiple' | 'single' | 'dropdown'; } export interface iToolbarItemDropdown { name: string; value: string; icon?: string; } export interface iToolbarSection { name: string; children: iToolbarItem[]; } export interface IType { [property: string]: T; } export interface SidebarProps { graph?: MyGraph; nodes: SidebarNode[]; card?: boolean; } export interface SidebarNode { icon?: { type: 'iconfont' | 'image'; value: string; } | string; name: string; nodes?: SidebarNodeConfig[]; children?: SidebarNode[]; } export interface DrawProps extends ToolbarProps, SidebarProps { hideSidebar?: boolean; handleAddVertex?: (cell: mxCell, x: number, y: number, target: mxCell) => void; handleDeleteCell?: (cell: mxCell) => void; handleAddEdge?: (cell: mxCell) => void; handleMoveCell?: (cell: mxCell) => void; cellRightClick?: (cells: mxCell[], menu: mxPopupMenuHandler) => void; beforeDeleteCell?: (cell: mxCell) => boolean; beforeAddVertex?: (cell: mxCell) => boolean; handleRotate?: (cell: mxCell) => void; handleGeomertyChange?: (cells: mxCell[], key: string, value: number | string) => void; handleStyleChange?: (cells: mxCell[], key: string, value: number | string | [string[], (string | null)[]]) => void; outlineMap?: boolean; showHoverIcon?: boolean; hoverIconHandler?: (type: string, evt: MouseEvent, cell: mxCellState) => void; }