/
drawio-types.d.ts
78 lines (63 loc) · 1.88 KB
/
drawio-types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
declare const Draw: {
loadPlugin(handler: (ui: DrawioUI) => void): void;
};
declare const log: any;
declare class mxCellHighlight {
constructor(graph: DrawioGraph, color: string, arg: number);
public highlight(arg: DrawioCellState | null): void;
public destroy(): void;
}
declare class mxMouseEvent {
public readonly graphX: number;
public readonly graphY: number;
}
declare const mxEvent: {
DOUBLE_CLICK: string;
CHANGE: string;
};
declare const mxUtils: {
isNode(node: any): node is HTMLElement;
createXmlDocument(): XMLDocument;
};
declare interface DrawioUI {
editor: DrawioEditor;
}
declare interface DrawioEditor {
graph: DrawioGraph;
}
declare interface DrawioGraph {
insertVertex(arg0: undefined, arg1: null, label: string, arg3: number, arg4: number, arg5: number, arg6: number, arg7: string): void;
addListener: any;
model: DrawioGraphModel;
getLabel(cell: DrawioCell): string;
getSelectionModel(): DrawioGraphSelectionModel;
view: DrawioGraphView;
addMouseListener(listener: {
mouseMove?: (graph: DrawioGraph, event: mxMouseEvent) => void;
mouseDown?: (graph: DrawioGraph, event: mxMouseEvent) => void
mouseUp?: (graph: DrawioGraph, event: mxMouseEvent) => void;
}): void;
}
declare interface DrawioGraphView {
getState(cell: DrawioCell): DrawioCellState;
canvas: SVGElement;
}
declare interface DrawioCellState {
cell: DrawioCell;
}
declare interface DrawioGraphSelectionModel {
addListener(event: string, handler: (...args: any[]) => void): void;
cells: DrawioCell[];
}
declare interface DrawioCell {
id: string;
style: string
}
declare interface DrawioGraphModel {
setValue(c: DrawioCell, label: string): void;
beginUpdate(): void;
endUpdate(): void;
cells: Record<any, DrawioCell>;
setStyle(cell: DrawioCell, style: string): void;
isVertex(cell: DrawioCell): boolean;
}