/
types.d.ts
82 lines (65 loc) · 1.98 KB
/
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
79
80
81
82
declare type CustomDrawioAction = UpdateVerticesAction | AddVerticesAction | GetVerticesAction | LinkSelectedNodeWithDataAction | NodeSelectionEnabledAction | UpdateGhostCursors | UpdateGhostSelections;
declare type CustomDrawioEvent = NodeSelectedEvent | GetVerticesResultEvent | UpdateLocalStorage | PluginLoaded | CursorChangedEvent | SelectionChangedEvent;
declare interface NodeSelectionEnabledAction {
action: "setNodeSelectionEnabled";
enabled: boolean;
}
declare interface UpdateVerticesAction {
action: "updateVertices",
verticesToUpdate: { id: string; label: string }[];
}
declare interface AddVerticesAction {
action: "addVertices";
vertices: { label: string }[];
}
declare interface GetVerticesAction {
action: "getVertices";
}
declare interface LinkSelectedNodeWithDataAction {
action: "linkSelectedNodeWithData";
linkedData: any;
}
declare interface NodeSelectedEvent {
event: "nodeSelected";
linkedData: any;
label: string;
}
declare interface GetVerticesResultEvent {
event: "getVertices";
message: GetVerticesAction;
vertices: { id: string; label: string }[];
}
declare interface UpdateLocalStorage {
event: "updateLocalStorage";
newLocalStorage: Record<string, string>;
}
declare interface PluginLoaded {
event: "pluginLoaded";
pluginId: string;
}
// Liveshare
declare interface CursorChangedEvent {
event: "cursorChanged";
position: { x: number, y: number } | undefined;
}
declare interface UpdateGhostCursors {
action: "updateGhostCursors";
cursors: CursorUpdateInfo[];
}
declare interface SelectionChangedEvent {
event: "selectionChanged";
selectedCellIds: string[];
}
declare interface UpdateGhostSelections {
action: "updateGhostSelections";
selections: SelectionsUpdateInfo[]
}
declare interface CursorUpdateInfo {
name: string;
id: string;
position: { x: number, y: number };
}
declare interface SelectionsUpdateInfo {
id: string;
selectedCellIds: string[];
}