/// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// import { mxCell as typeMxCell, mxPopupMenuHandler, mxCellState as typeMxCellState } from 'mxgraph'; import { Action } from './actions'; import { NodeConfig } from './type/type'; import mxIcon from './mxIcon'; declare const mxGraph: typeof import("mxgraph").mxGraph; declare class MyGraph extends mxGraph { gridColor: string; showGrid: boolean; rubberband: import("mxgraph").mxRubberband; keyHandler: import("mxgraph").mxKeyHandler; currentEdge?: { style: string; panelId: string; }; actions: Action; createVertexStatus: boolean; createEdgeStatus: boolean; nodeProps: any; edgeProps: any; lineStyle?: Record[]; cellRightClick?: (cells: typeMxCell[], menu: mxPopupMenuHandler) => void; handleAddVertex?: (cell: typeMxCell, x: number, y: number, target: typeMxCell) => void; handleDeleteCell?: (cell: typeMxCell) => void; handleAddEdge?: (cell: typeMxCell) => void; handleDropIn?: (target: typeMxCell, cells: typeMxCell[]) => void; handleDropOut?: (target: typeMxCell, cells: typeMxCell[]) => void; handleMoveCell?: (cell: typeMxCell) => void; handleSizeChange?: (props: { x: string; y: string; width: string; height: string; id: string; }) => void; handleRotate?: (cell: typeMxCell) => void; beforeDeleteCell?: (cell: typeMxCell) => boolean; beforeAddVertex?: (cell: typeMxCell) => boolean; currentState?: typeMxCellState; currentIcon?: mxIcon; showHoverIcon?: boolean; hoverIconHandler?: (type: string, evt: MouseEvent, cell: typeMxCellState) => void; constructor(container: HTMLElement); _init(): void; _setDefaultConfig(): void; _setDefaultEdgeStyle(): void; _initKeyHandler(): void; _setDrop(): void; /** * 初始化大部分action的是否可用状态 * toolbar是否可用操作通过这个函数进行状态管理 */ _initActionState(): void; _setAnchors(): void; _initRotate(): void; _rightClickMenu(): void; _initHoverIcon(): void; dragEnter(evt: MouseEvent, state: typeMxCellState): void; dragLeave(evt: MouseEvent, state: typeMxCellState): void; /** * 创建背景grid svg * @param {string}} color grid的颜色 */ createSvgGrid(): string; /**设置Grid */ setGrid(): void; sidebarToGraph(dragCell: typeMxCell, x: number, y: number, target: typeMxCell): void; insertVertetByConfig(cfg: NodeConfig): typeMxCell; insertEdge(parent: typeMxCell, id: string | null, value: any, source: typeMxCell, target: typeMxCell, style?: string | undefined): typeMxCell; moveCells(cells: typeMxCell[], dx: number, dy: number, clone: boolean, target?: typeMxCell | undefined, evt?: Event | undefined, mapping?: any): typeMxCell[]; findById(id: string | ((cell: typeMxCell) => boolean)): typeMxCell | undefined; getAllCells(): typeMxCell[]; deleteCells(cells: typeMxCell[]): void; insertEdgeByConfig(cfg: NodeConfig): typeMxCell; /** * 撤回和取消撤回的监听函数 */ addUndoListener(): void; /** * 是否可以撤回 */ canUndo(): boolean; /** * 是否可以取消撤回 */ canRedo(): boolean; /**监听rotate */ listenRotation(): void; exportImage(): void; /** * 将svg dom转换为canvas下载 * @param {HTMLDom} svg svg dom */ svgToPng(svg: SVGElement, w: number, h: number): void; getSvg(background: string): { root: HTMLElement | SVGSVGElement; w: number; h: number; }; createSvgCanvas(node: SVGElement): import("mxgraph").mxSvgCanvas2D; createSvgImageExport(): import("mxgraph").mxImageExport; updateSvgLinks(node: SVGElement): void; } export default MyGraph;