-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobal.d.ts
235 lines (193 loc) · 3.77 KB
/
global.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
interface ObjNode {
objId: string;
childNodes: ObjNode[];
depth: number;
}
type ObjType =
| 'RECT'
| 'TEXT'
| 'ROOT'
| 'LINE'
| 'CIRCLE'
| 'GRAPHROOT'
| 'LIVEGRAPH'
| 'GRAPHNODE';
interface Obj {
objId: string;
type: ObjType;
x: number;
y: number;
depth: number;
parentId: string;
}
interface ObjDimensions {
x: number;
y: number;
w: number;
h: number;
}
interface LiveGraphObj extends Obj {
type: 'LIVEGRAPH';
data: GraphData;
}
interface GraphNodeObj extends Obj {
type: 'GRAPHNODE';
label: string;
}
interface GraphRootObj extends GraphNodeObj {
type: 'GRAPHROOT';
}
interface CircleObj extends Obj {
type: 'CIRCLE';
r: number;
color: string;
}
interface CircleOptions {
color?: string;
}
type ViewerPage = 'HOME' | 'DATA' | 'LOAD';
interface ThreeGraphData {
nodes: NodeDataLegacy[];
links: LinkDataLegacy[];
}
type ExtendedSpriteText = import('three-spritetext').default & {
initialScale: { x: number; y: number };
};
interface NodeData {
documentId: number;
children: NodeData[];
id: string;
label: string;
labelMesh?: ExtendedSpriteText;
scale: number;
x?: number;
y?: number;
fx?: number;
fy?: number;
vx?: number;
vy?: number;
}
interface NodeDataLegacy {
id: string;
name: string;
val: number;
color: string;
r: number;
__threeObj?: Mesh;
}
interface LinkData {
documentId: number;
source: string | NodeData;
target: string | NodeData;
}
interface LinkDataLegacy {
source: string;
target: string;
color: string;
}
interface RectObj extends Obj {
type: 'RECT';
w: number;
h: number;
color: string;
}
type OverflowType = 'normal' | 'break-word';
type TextAlgin = 'center' | 'left' | 'right';
interface TextObj extends Obj {
type: 'TEXT';
w: number;
fontSize: number;
overflow: OverflowType;
text: string;
color: string;
textAlign: TextAlgin;
}
interface TextOptions {
fontSize?: number;
overflow?: OverflowType;
textAlign?: TextAlgin;
text?: string;
color?: string;
}
interface LineObj extends Obj {
type: 'LINE';
x2: number;
y2: number;
color: string;
strokeWidth: number;
}
interface LineOptions {
color?: string;
strokeWidth?: number;
}
interface Coord {
x: number;
y: number;
}
type Tool = 'HAND' | 'SELECT' | 'RECT' | 'TEXT' | 'LINE' | 'BUNDLE' | 'CIRCLE' | 'HIGHLIGHT';
interface WBDocument {
documentId: number;
documentName: string;
dataType: WBSourceDataType;
createdAt: number;
modifiedAt: number;
}
type WBDocumentData = Map<string, Obj>;
type WBDocumentListReponse = WBDocumentMetaData[];
type WBDocumentReponse = WBDocument;
type WBDocumentCreateResponse = WBDocument;
interface UserData {
userId: number;
nickname: string;
email: string;
}
type UserDataResponse = UserData;
interface ToastData {
id: number;
duraton: number;
msg: string;
}
type DragData = { mousePos: Coord; mode: DragMode; prevObj: Obj };
type DragMode = 'move' | 'n' | 'e' | 'w' | 's' | 'ne' | 'nw' | 'sw' | 'se';
interface TextRequest {
text: string;
}
interface GraphData {
root: number;
keywords: string[];
graph: Map<string, number[]>;
}
type WBSourceDataType = 'pdf' | 'audio';
interface WBSourceData {
url: string;
}
type WBSourcePdfData = WBSourceData;
interface WBSourceAudioData extends WBSourceData {
data: SpeechData[];
}
interface SpeechData {
start: number;
end: number;
text: string;
}
interface ObjBundle {
x: number;
y: number;
w: number;
h: number;
objs: Obj[];
}
interface KeywordSourceResult {
str: string;
keyword: string;
location: number[];
}
type KeywordType = 'ADD' | 'STABLE' | 'DELETE';
interface KeywordState {
enabled: boolean;
type: KeywordType;
}
interface KeywordResponse {
text: string;
}
type ViewerEventType = 'mindmap' | 'answer' | 'audio' | 'keywords' | 'sse' | 'ping';