extprg-types 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2642 -0
- package/package.json +6 -5
package/index.d.ts
ADDED
|
@@ -0,0 +1,2642 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Auto-generated. Do not edit manually.
|
|
6
|
+
* 2026-05-07T14:05:16.404Z
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// ── 第三方类型导入 ──
|
|
10
|
+
import type { Color, LimitLengthQueue, LruCache, ProgressNumber, Vector } from "@graphif/data-structures";
|
|
11
|
+
import type { Circle, CubicBezierCurve, CubicCatmullRomSpline, Line, Rectangle, Shape, SymmetryCurve } from "@graphif/shapes";
|
|
12
|
+
import type { DirEntry } from "@tauri-apps/plugin-fs";
|
|
13
|
+
import type { fetch } from "@tauri-apps/plugin-http";
|
|
14
|
+
import type { Store } from "@tauri-apps/plugin-store";
|
|
15
|
+
import type { AlignCenterHorizontal, AlignCenterVertical, AlignEndHorizontal, AlignEndVertical, AlignHorizontalJustifyStart, AlignHorizontalSpaceBetween, AlignLeft, AlignStartHorizontal, AlignStartVertical, AlignVerticalJustifyStart, AlignVerticalSpaceBetween, Aperture, ArrowDown, ArrowDownFromLine, ArrowDownToLine, ArrowDownUp, ArrowLeft, ArrowLeftFromLine, ArrowLeftRight, ArrowLeftToLine, ArrowRight, ArrowRightFromLine, ArrowRightToLine, ArrowUp, ArrowUpFromLine, ArrowUpToLine, Box, Brush, Camera, ChevronFirst, ChevronLast, ChevronsDown, ChevronsRightLeft, ChevronsUp, CircleCheck, CircleSlash, Clipboard, Code, Copy, CornerUpRight, Dot, Equal, Expand, ExternalLink, Eye, EyeOff, FilePlus, FileUp, FlaskConical, Focus, Folder, FolderPlus, Ghost, GitBranch, GitCompare, GraduationCap, Grip, History, Images, Layers, LayoutDashboard, LayoutPanelTop, Link, Lock, LucideProps, Maximize, Maximize2, Merge, Minimize, Minimize2, Moon, MousePointer, MoveHorizontal, MoveUpRight, Network, Package, Palette, PenTool, Plus, Redo, RefreshCcw, RefreshCcwDot, RefreshCw, Repeat, Save, Scissors, Search, Settings, Shrink, Slash, Sparkle, Spline, Split, SquareDashedBottomCode, SquareDot, SquareRoundCorner, SquareSquare, Sun, Tag, Trash2, TreePine, Type, Undo, Wand2, X, Zap, ZoomIn, ZoomOut } from "lucide-react";
|
|
16
|
+
import type { ForwardRefExoticComponent, RefAttributes } from "react";
|
|
17
|
+
import type { URI } from "vscode-uri";
|
|
18
|
+
import type * as react_dialog from "@radix-ui/react-dialog";
|
|
19
|
+
|
|
20
|
+
// ── 本地类型定义 ──
|
|
21
|
+
declare class AIEngine {
|
|
22
|
+
createTransport(project: Project);
|
|
23
|
+
createChatFetch(project: Project): typeof fetch;
|
|
24
|
+
getModels();
|
|
25
|
+
readRequestBody(body: BodyInit | null | undefined): Promise<any>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
declare class Association extends StageObject {
|
|
29
|
+
associationList: StageObject[];
|
|
30
|
+
color: Color;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
declare class AutoAlign {
|
|
34
|
+
constructor(project: Project);
|
|
35
|
+
getSelectionOuterRectangle(entities: Entity[]): Rectangle | null;
|
|
36
|
+
calculateDistanceByRectangle(rectA: Rectangle, rectB: Rectangle);
|
|
37
|
+
alignRectangleToTargetX(selectedRect: Rectangle, otherRect: Rectangle): number;
|
|
38
|
+
alignRectangleToTargetY(selectedRect: Rectangle, otherRect: Rectangle): number;
|
|
39
|
+
_addAlignEffectByRect(selectedRect: Rectangle, otherRect: Rectangle);
|
|
40
|
+
getGridSnapDeltaX(rect: Rectangle);
|
|
41
|
+
getGridSnapDeltaY(rect: Rectangle);
|
|
42
|
+
alignAllSelectedToGrid();
|
|
43
|
+
alignAllSelected();
|
|
44
|
+
preAlignAllSelected();
|
|
45
|
+
onEntityMoveAlignToGrid(selectedEntity: Entity);
|
|
46
|
+
onEntityMoveAlignToGridX(selectedEntity: Entity);
|
|
47
|
+
onEntityMoveAlignToGridY(selectedEntity: Entity);
|
|
48
|
+
onEntityMoveAlignToOtherEntity(selectedEntity: Entity, otherEntities: Entity[], isPreAlign = false);
|
|
49
|
+
_addAlignEffect(selectedEntity: Entity, otherEntity: Entity);
|
|
50
|
+
onEntityMoveAlignToTargetEntityX(selectedEntity: Entity, otherEntity: Entity, isPreAlign = false): number;
|
|
51
|
+
onEntityMoveAlignToTargetEntityY(selectedEntity: Entity, otherEntity: Entity, isPreAlign = false): number;
|
|
52
|
+
calculateDistance(entityA: Entity, entityB: Entity);
|
|
53
|
+
autoLayoutSelectedFastTreeMode(selectedRootEntity: ConnectableEntity);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare class AutoCompleteManager {
|
|
57
|
+
currentWindowId: string | undefined;
|
|
58
|
+
constructor(project: Project);
|
|
59
|
+
handle;
|
|
60
|
+
openWindow(node: TextNode, entries: Record<string, string>, onSelect: (value: string) => void, setWindowId: (id: string) => void);
|
|
61
|
+
handleLogic(text: string, node: TextNode, ele: HTMLTextAreaElement, setWindowId: (id: string) => void);
|
|
62
|
+
handleReference;
|
|
63
|
+
handleReferenceFile(searchText: string, node: TextNode, ele: HTMLTextAreaElement, setWindowId: (id: string) => void);
|
|
64
|
+
handleReferenceSection(searchText: string, node: TextNode, ele: HTMLTextAreaElement, setWindowId: (id: string) => void);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
declare class AutoCompute {
|
|
68
|
+
MapOperationNameFunction: StringFunctionMap;
|
|
69
|
+
MapNameFunction: StringFunctionMap;
|
|
70
|
+
MapVariableFunction: VariableFunctionMap;
|
|
71
|
+
MapOtherFunction: OtherFunctionMap;
|
|
72
|
+
variables;
|
|
73
|
+
constructor(project: Project);
|
|
74
|
+
tickNumber;
|
|
75
|
+
tick();
|
|
76
|
+
funcTypeTrans(mF: MathFunctionType): StringFunctionType;
|
|
77
|
+
isTextNodeLogic(node: TextNode): boolean;
|
|
78
|
+
isSectionLogic(section: Section): boolean;
|
|
79
|
+
sortEntityByLocation(entities: ConnectableEntity[]): ConnectableEntity[];
|
|
80
|
+
computeTextNode(node: TextNode);
|
|
81
|
+
computeSection(section: Section);
|
|
82
|
+
computeEdge(edge: LineEdge);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
declare class AutoComputeUtils {
|
|
86
|
+
constructor(project: Project);
|
|
87
|
+
getParentTextNodes(node: TextNode): TextNode[];
|
|
88
|
+
getParentEntities(node: TextNode): ConnectableEntity[];
|
|
89
|
+
getChildTextNodes(node: TextNode): TextNode[];
|
|
90
|
+
getNodeOneResult(node: TextNode, resultText: string);
|
|
91
|
+
getSectionOneResult(section: Section, resultText: string);
|
|
92
|
+
getSectionMultiResult(section: Section, resultTextList: string[]);
|
|
93
|
+
generateMultiResult(node: TextNode, resultTextList: string[]);
|
|
94
|
+
stringToNumber(str: string);
|
|
95
|
+
isNodeConnectedWithLogicNode(node: ConnectableEntity): boolean;
|
|
96
|
+
isNameIsLogicNode(name: string): boolean;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
declare class AutoLayout {
|
|
100
|
+
constructor(project: Project);
|
|
101
|
+
isGravityLayoutStart: boolean;
|
|
102
|
+
tick();
|
|
103
|
+
setGravityLayoutStart();
|
|
104
|
+
setGravityLayoutEnd();
|
|
105
|
+
getDAGLayoutInput(entities: ConnectableEntity[]): {
|
|
106
|
+
nodes: Array<{ id: string; rectangle: Rectangle }>;
|
|
107
|
+
edges: Array<{ from: string; to: string }>;
|
|
108
|
+
};
|
|
109
|
+
computeDAGLayout(input: {
|
|
110
|
+
nodes: Array<{ id: string; rectangle: Rectangle }>;
|
|
111
|
+
edges: Array<{ from: string; to: string }>;
|
|
112
|
+
}): { [nodeId: string]: Vector };
|
|
113
|
+
topologicalSort(nodes: Array<{ id: string; rectangle: Rectangle }>, edges: Array<{ from: string; to: string }>): { order: string[]; levels: Map<string, number> };
|
|
114
|
+
autoLayoutDAG(entities: ConnectableEntity[]);
|
|
115
|
+
gravityLayoutTick();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
declare class AutoLayoutFastTree {
|
|
119
|
+
constructor(project: Project);
|
|
120
|
+
getTreeBoundingRectangle(node: ConnectableEntity, skipDashed = false): Rectangle;
|
|
121
|
+
moveTreeRectTo(treeRoot: ConnectableEntity, targetLocation: Vector, skipDashed = false);
|
|
122
|
+
getSortedChildNodes(_node: ConnectableEntity, childNodes: ConnectableEntity[], direction: "col" | "row" = "col"): ConnectableEntity[];
|
|
123
|
+
alignTrees(trees: ConnectableEntity[], direction: "top" | "bottom" | "left" | "right", gap = 10, skipDashed = false);
|
|
124
|
+
adjustChildrenTreesByRootNodeLocation(rootNode: ConnectableEntity, childList: ConnectableEntity[], gap = 100, position: "rightCenter" | "leftCenter" | "bottomCenter" | "topCenter" = "rightCenter", skipDashed = false);
|
|
125
|
+
resolveSubtreeOverlaps(rootNode: ConnectableEntity, directionGroups: {
|
|
126
|
+
right?: ConnectableEntity[];
|
|
127
|
+
left?: ConnectableEntity[];
|
|
128
|
+
bottom?: ConnectableEntity[];
|
|
129
|
+
top?: ConnectableEntity[];
|
|
130
|
+
}, skipDashed = false);
|
|
131
|
+
hasOverlapOrLineIntersection(rootNode: ConnectableEntity, group1: ConnectableEntity[], group2: ConnectableEntity[], dir1: "left" | "right" | "top" | "bottom", dir2: "left" | "right" | "top" | "bottom", skipDashed = false): boolean;
|
|
132
|
+
autoLayoutFastTreeMode(rootNode: ConnectableEntity);
|
|
133
|
+
treeReverseX(selectedRootEntity: ConnectableEntity);
|
|
134
|
+
treeReverseY(selectedRootEntity: ConnectableEntity);
|
|
135
|
+
treeReverse(selectedRootEntity: ConnectableEntity, direction: "X" | "Y");
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
declare class AutoSaveBackupService {
|
|
139
|
+
lastBackupTime;
|
|
140
|
+
lastBackupHash;
|
|
141
|
+
lastSaveTime;
|
|
142
|
+
constructor(project: Project);
|
|
143
|
+
tick();
|
|
144
|
+
autoSave();
|
|
145
|
+
autoBackup();
|
|
146
|
+
manualBackup();
|
|
147
|
+
resolveAutoBackupDir(candidate: { kind: "custom"; path: string } | { kind: "default" }): Promise<string | null>;
|
|
148
|
+
tryBackupToDir(backupDir: string): Promise<boolean>;
|
|
149
|
+
backupCurrentProject(backupDir: string): Promise<boolean>;
|
|
150
|
+
generateBackupFileName(): string;
|
|
151
|
+
getOriginalFileName(): string;
|
|
152
|
+
createBackupFile(backupFilePath: string): Promise<void>;
|
|
153
|
+
manageBackupFiles(backupDir: string): Promise<void>;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
declare class BackgroundRenderer {
|
|
157
|
+
constructor(project: Project);
|
|
158
|
+
renderDotBackground(viewRect: Rectangle);
|
|
159
|
+
renderHorizonBackground(viewRect: Rectangle);
|
|
160
|
+
renderVerticalBackground(viewRect: Rectangle);
|
|
161
|
+
renderCartesianBackground(viewRect: Rectangle);
|
|
162
|
+
getCurrentGap(): number;
|
|
163
|
+
getLocationXIterator(viewRect: Rectangle, currentGap: number): IterableIterator<number>;
|
|
164
|
+
getLocationYIterator(viewRect: Rectangle, currentGap: number): IterableIterator<number>;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
declare class BaseExporter {
|
|
168
|
+
constructor(project: Project);
|
|
169
|
+
getTreeTypeString(textNode: TextNode, nodeToStringFunc: (node: TextNode, level: number) => string);
|
|
170
|
+
getNodeChildrenArray(node: TextNode): ConnectableEntity[];
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
declare class BaseImporter {
|
|
174
|
+
constructor(project: Project);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
declare class Camera {
|
|
178
|
+
frictionExponent;
|
|
179
|
+
location: Vector;
|
|
180
|
+
targetLocationByScale: Vector;
|
|
181
|
+
speed: Vector;
|
|
182
|
+
accelerateCommander: Vector;
|
|
183
|
+
currentScale: number;
|
|
184
|
+
targetScale: number;
|
|
185
|
+
shakeLocation: Vector;
|
|
186
|
+
savedCameraState: { location: Vector; scale: number } | null;
|
|
187
|
+
shockMoveDiffLocationsQueue;
|
|
188
|
+
pageMove(direction: Direction);
|
|
189
|
+
bombMove(targetLocation: Vector, frameCount = 40);
|
|
190
|
+
tick();
|
|
191
|
+
tickNumber;
|
|
192
|
+
allowScaleFollowMouseLocationTicks;
|
|
193
|
+
setAllowScaleFollowMouseLocationTicks(ticks: number);
|
|
194
|
+
zoomInByKeyboardPress();
|
|
195
|
+
zoomOutByKeyboardPress();
|
|
196
|
+
addScaleFollowMouseLocationTime(sec: number);
|
|
197
|
+
isStartZoomIn: boolean;
|
|
198
|
+
isStartZoomOut: boolean;
|
|
199
|
+
dealCycleSpace();
|
|
200
|
+
setLocationByOtherLocation(otherWorldLocation: Vector, viewLocation: Vector);
|
|
201
|
+
clearMoveCommander();
|
|
202
|
+
stopImmediately();
|
|
203
|
+
dealCameraScaleInTick();
|
|
204
|
+
constructor(project: Project);
|
|
205
|
+
reset();
|
|
206
|
+
resetBySelected();
|
|
207
|
+
resetByRectangle(viewRectangle: Rectangle);
|
|
208
|
+
resetScale();
|
|
209
|
+
resetLocationToZero();
|
|
210
|
+
saveCameraState();
|
|
211
|
+
restoreCameraState();
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
declare class Canvas {
|
|
215
|
+
ctx: CanvasRenderingContext2D;
|
|
216
|
+
constructor(project: Project, element: HTMLCanvasElement = document.createElement("canvas"));
|
|
217
|
+
mount(wrapper: HTMLDivElement);
|
|
218
|
+
dispose();
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
declare interface ClickEventPayload {
|
|
222
|
+
relativeWorldX: number;
|
|
223
|
+
relativeWorldY: number;
|
|
224
|
+
worldX: number;
|
|
225
|
+
worldY: number;
|
|
226
|
+
customData: any;
|
|
227
|
+
uuid: string;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
declare class CollisionBox {
|
|
231
|
+
shapes: Shape[];
|
|
232
|
+
constructor(shapes: Shape[]);
|
|
233
|
+
updateShapeList(shapes: Shape[]): void;
|
|
234
|
+
isContainsPoint(location: Vector): boolean;
|
|
235
|
+
isIntersectsWithRectangle(rectangle: Rectangle): boolean;
|
|
236
|
+
isContainedByRectangle(rectangle: Rectangle): boolean;
|
|
237
|
+
isIntersectsWithLine(line: Line): boolean;
|
|
238
|
+
getRectangle(): Rectangle;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
declare class CollisionBoxRenderer {
|
|
242
|
+
constructor(project: Project);
|
|
243
|
+
render(collideBox: CollisionBox, color: Color);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
declare class ComplexityDetector {
|
|
247
|
+
constructor(project: Project);
|
|
248
|
+
detectorCurrentStage(): CountResultObject;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
declare class ConnectableAssociation extends Association {
|
|
252
|
+
associationList: ConnectableEntity[];
|
|
253
|
+
reverse();
|
|
254
|
+
get target(): ConnectableEntity;
|
|
255
|
+
set target(value: ConnectableEntity);
|
|
256
|
+
get source(): ConnectableEntity;
|
|
257
|
+
set source(value: ConnectableEntity);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
declare class ConnectableEntity extends Entity {
|
|
261
|
+
geometryCenter: Vector;
|
|
262
|
+
unknown;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
declare class ConnectPoint extends ConnectableEntity {
|
|
266
|
+
CONNECT_POINT_SHRINK_RADIUS;
|
|
267
|
+
CONNECT_POINT_EXPAND_RADIUS;
|
|
268
|
+
get geometryCenter(): Vector;
|
|
269
|
+
isHiddenBySectionCollapse: boolean;
|
|
270
|
+
collisionBox: CollisionBox;
|
|
271
|
+
uuid: string;
|
|
272
|
+
get radius(): number;
|
|
273
|
+
_isSelected: boolean;
|
|
274
|
+
get isSelected(): any;
|
|
275
|
+
set isSelected(value: boolean);
|
|
276
|
+
constructor(project: Project, {
|
|
277
|
+
uuid = crypto.randomUUID() as string,
|
|
278
|
+
collisionBox = new CollisionBox([
|
|
279
|
+
new Rectangle(Vector.getZero(), Vector.same(ConnectPoint.CONNECT_POINT_SHRINK_RADIUS * 2)),
|
|
280
|
+
]),
|
|
281
|
+
details = [],
|
|
282
|
+
}, unknown = false);
|
|
283
|
+
move(delta: Vector): void;
|
|
284
|
+
moveTo(location: Vector): void;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
declare class ContentSearch {
|
|
288
|
+
constructor(project: Project);
|
|
289
|
+
searchResultNodes: StageObject[];
|
|
290
|
+
isCaseSensitive;
|
|
291
|
+
searchScope;
|
|
292
|
+
currentSearchResultIndex;
|
|
293
|
+
getStageObjectText(stageObject: StageObject): string;
|
|
294
|
+
getSelectedObjectsBounds(): Rectangle | null;
|
|
295
|
+
isObjectInBounds(obj: StageObject, bounds: Rectangle): boolean;
|
|
296
|
+
startSearch(searchString: string, autoFocus = true): boolean;
|
|
297
|
+
nextSearchResult();
|
|
298
|
+
previousSearchResult();
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
declare class Controller {
|
|
302
|
+
setCursorNameHook: (_: CursorNameEnum) => void;
|
|
303
|
+
pressingKeySet: Set<string>;
|
|
304
|
+
pressingKeysString(): string;
|
|
305
|
+
isMovingEdge;
|
|
306
|
+
lastMoveLocation;
|
|
307
|
+
mouseLocation;
|
|
308
|
+
isCameraLocked;
|
|
309
|
+
lastSelectedEntityUUID: Set<string>;
|
|
310
|
+
lastSelectedEdgeUUID: Set<string>;
|
|
311
|
+
touchStartLocation;
|
|
312
|
+
touchStartDistance;
|
|
313
|
+
touchDelta;
|
|
314
|
+
lastClickTime;
|
|
315
|
+
lastClickLocation;
|
|
316
|
+
isMouseDown: boolean[];
|
|
317
|
+
lastManipulateTime;
|
|
318
|
+
resetCountdownTimer();
|
|
319
|
+
isManipulateOverTime();
|
|
320
|
+
edgeHoverTolerance;
|
|
321
|
+
constructor(project: Project);
|
|
322
|
+
dispose();
|
|
323
|
+
mousedown(event: MouseEvent);
|
|
324
|
+
mouseup(event: MouseEvent);
|
|
325
|
+
mousewheel(event: WheelEvent);
|
|
326
|
+
handleMousedown(button: number, _x: number, _y: number);
|
|
327
|
+
handleMouseup(button: number, x: number, y: number);
|
|
328
|
+
keydown(event: KeyboardEvent);
|
|
329
|
+
keyup(event: KeyboardEvent);
|
|
330
|
+
touchstart(e: TouchEvent);
|
|
331
|
+
touchmove(e: TouchEvent);
|
|
332
|
+
touchend(e: TouchEvent);
|
|
333
|
+
associationReshape: ControllerAssociationReshapeClass;
|
|
334
|
+
camera: ControllerCameraClass;
|
|
335
|
+
cutting: ControllerCuttingClass;
|
|
336
|
+
edgeEdit: ControllerEdgeEditClass;
|
|
337
|
+
entityClickSelectAndMove: ControllerEntityClickSelectAndMoveClass;
|
|
338
|
+
entityCreate: ControllerEntityCreateClass;
|
|
339
|
+
extensionEntityClick: ControllerExtensionEntityClickClass;
|
|
340
|
+
layerMoving: ControllerLayerMovingClass;
|
|
341
|
+
entityResize: ControllerEntityResizeClass;
|
|
342
|
+
nodeConnection: ControllerNodeConnectionClass;
|
|
343
|
+
nodeEdit: ControllerNodeEditClass;
|
|
344
|
+
penStrokeControl: ControllerPenStrokeControlClass;
|
|
345
|
+
penStrokeDrawing: ControllerPenStrokeDrawingClass;
|
|
346
|
+
rectangleSelect: ControllerRectangleSelectClass;
|
|
347
|
+
sectionEdit: ControllerSectionEditClass;
|
|
348
|
+
imageScale: ControllerImageScaleClass;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
declare class ControllerAssociationReshapeClass extends ControllerClass {
|
|
352
|
+
mousewheel: (event: WheelEvent) => void;
|
|
353
|
+
lastMoveLocation: Vector;
|
|
354
|
+
mousedown: (event: MouseEvent) => void;
|
|
355
|
+
mousemove: (event: MouseEvent) => void;
|
|
356
|
+
mouseup: (event: MouseEvent) => void;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
declare class ControllerCameraClass extends ControllerClass {
|
|
360
|
+
isUsingMouseGrabMove;
|
|
361
|
+
lastMousePressLocation: Vector[];
|
|
362
|
+
isPreGrabbingWhenSpace;
|
|
363
|
+
mac;
|
|
364
|
+
keydown: (event: KeyboardEvent) => void;
|
|
365
|
+
keyup: (event: KeyboardEvent) => void;
|
|
366
|
+
mousedown;
|
|
367
|
+
mousemove: (event: MouseEvent) => void;
|
|
368
|
+
mouseMoveOutWindowForcedShutdown(vectorObject: Vector);
|
|
369
|
+
mouseup;
|
|
370
|
+
mousewheel;
|
|
371
|
+
dealStealthMode(event: WheelEvent);
|
|
372
|
+
mousewheelFunction(event: WheelEvent);
|
|
373
|
+
mouseDoubleClick: (event: MouseEvent) => void;
|
|
374
|
+
moveCameraByMouseMove(x: number, y: number, mouseIndex: number);
|
|
375
|
+
moveCameraByTouchPadTwoFingerMove(event: WheelEvent);
|
|
376
|
+
zoomCameraByMouseWheel(event: WheelEvent);
|
|
377
|
+
moveYCameraByMouseWheel(event: WheelEvent);
|
|
378
|
+
moveCameraByMouseSideWheel(event: WheelEvent);
|
|
379
|
+
zoomCameraByMouseSideWheel(event: WheelEvent);
|
|
380
|
+
moveYCameraByMouseSideWheel(event: WheelEvent);
|
|
381
|
+
moveXCameraByMouseWheel(event: WheelEvent);
|
|
382
|
+
moveXCameraByMouseSideWheel(event: WheelEvent);
|
|
383
|
+
isMouseWheel(event: WheelEvent): boolean;
|
|
384
|
+
addDistanceNumberAndDetect(distance: number): boolean;
|
|
385
|
+
detectDeltaY: LimitLengthQueue<number>;
|
|
386
|
+
importantNumbers: Set<number>;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
declare class ControllerClass {
|
|
390
|
+
constructor(project: Project);
|
|
391
|
+
lastMoveLocation: Vector;
|
|
392
|
+
lastClickTime: number;
|
|
393
|
+
lastClickLocation: Vector;
|
|
394
|
+
keydown: (event: KeyboardEvent) => void;
|
|
395
|
+
keyup: (event: KeyboardEvent) => void;
|
|
396
|
+
mousedown: (event: PointerEvent) => void;
|
|
397
|
+
mouseup: (event: PointerEvent) => void;
|
|
398
|
+
mousemove: (event: PointerEvent) => void;
|
|
399
|
+
mousewheel: (event: WheelEvent) => void;
|
|
400
|
+
mouseDoubleClick: (event: PointerEvent) => void;
|
|
401
|
+
touchstart: (event: TouchEvent) => void;
|
|
402
|
+
touchmove: (event: TouchEvent) => void;
|
|
403
|
+
touchend: (event: TouchEvent) => void;
|
|
404
|
+
dispose();
|
|
405
|
+
_mouseup;
|
|
406
|
+
_touchstart;
|
|
407
|
+
_touchmove;
|
|
408
|
+
onePointTouchMoveLocation: Vector;
|
|
409
|
+
_touchend;
|
|
410
|
+
mouseMoveOutWindowForcedShutdown(_outsideLocation: Vector);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
declare class ControllerCuttingClass extends ControllerClass {
|
|
414
|
+
_controlKeyEventRegistered;
|
|
415
|
+
_isControlKeyDown;
|
|
416
|
+
onControlKeyDown;
|
|
417
|
+
onControlKeyUp;
|
|
418
|
+
registerControlKeyEvents();
|
|
419
|
+
unregisterControlKeyEvents();
|
|
420
|
+
constructor(project: Project);
|
|
421
|
+
dispose();
|
|
422
|
+
cuttingLine: Line;
|
|
423
|
+
lastMoveLocation;
|
|
424
|
+
warningEntity: Entity[];
|
|
425
|
+
warningSections: Section[];
|
|
426
|
+
warningAssociations: Association[];
|
|
427
|
+
isUsing;
|
|
428
|
+
twoPointsMap: Record<string, Vector[]>;
|
|
429
|
+
cuttingStartLocation;
|
|
430
|
+
mousedown: (event: MouseEvent) => void;
|
|
431
|
+
mouseDownEvent(event: MouseEvent);
|
|
432
|
+
mousemove: (event: MouseEvent) => void;
|
|
433
|
+
clearIsolationPoint();
|
|
434
|
+
mouseUpFunction(mouseUpWindowLocation: Vector);
|
|
435
|
+
mouseup: (event: MouseEvent) => void;
|
|
436
|
+
mouseMoveOutWindowForcedShutdown(outsideLocation: Vector);
|
|
437
|
+
updateWarningObjectByCuttingLine();
|
|
438
|
+
addEffectByWarningEntity();
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
declare class ControllerEdgeEditClass extends ControllerClass {
|
|
442
|
+
editEdgeText(clickedLineEdge: Edge, selectAll = true);
|
|
443
|
+
editMultiTargetEdgeText(clickedEdge: MultiTargetUndirectedEdge, selectAll = true);
|
|
444
|
+
mouseDoubleClick;
|
|
445
|
+
keydown;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
declare class ControllerEntityClickSelectAndMoveClass extends ControllerClass {
|
|
449
|
+
isMovingEntity;
|
|
450
|
+
mouseDownViewLocation;
|
|
451
|
+
shakeDetector;
|
|
452
|
+
shiftAxisLock: "x" | "y" | null;
|
|
453
|
+
shiftAccumulatedDelta;
|
|
454
|
+
mousedown: (event: MouseEvent) => void;
|
|
455
|
+
mousemove: (event: MouseEvent) => void;
|
|
456
|
+
mouseup: (event: MouseEvent) => void;
|
|
457
|
+
mouseMoveOutWindowForcedShutdown(_outsideLocation: Vector): void;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
declare class ControllerEntityCreateClass extends ControllerClass {
|
|
461
|
+
constructor(project: Project);
|
|
462
|
+
mouseDoubleClick;
|
|
463
|
+
createConnectPoint(pressLocation: Vector, addToSections: Section[]);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
declare class ControllerEntityResizeClass extends ControllerClass {
|
|
467
|
+
changeSizeEntity: Entity | null;
|
|
468
|
+
mousedown: (event: MouseEvent) => void;
|
|
469
|
+
mousemove: (event: MouseEvent) => void;
|
|
470
|
+
mouseup: (event: MouseEvent) => void;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
declare class ControllerExtensionEntityClickClass extends ControllerClass {
|
|
474
|
+
constructor(project: Project);
|
|
475
|
+
mousedown;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
declare class ControllerImageScaleClass extends ControllerClass {
|
|
479
|
+
mousewheel;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
declare class ControllerLayerMovingClass extends ControllerClass {
|
|
483
|
+
get isEnabled(): boolean;
|
|
484
|
+
mousemove: (event: MouseEvent) => void;
|
|
485
|
+
mouseup: (event: MouseEvent) => void;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
declare class ControllerNodeConnectionClass extends ControllerClass {
|
|
489
|
+
_isControlKeyDown;
|
|
490
|
+
_controlKeyEventRegistered;
|
|
491
|
+
onControlKeyDown;
|
|
492
|
+
onControlKeyUp;
|
|
493
|
+
registerControlKeyEvents();
|
|
494
|
+
unregisterControlKeyEvents();
|
|
495
|
+
_lastRightMousePressLocation: Vector;
|
|
496
|
+
_isUsing: boolean;
|
|
497
|
+
get isUsing(): boolean;
|
|
498
|
+
constructor(project: Project);
|
|
499
|
+
dispose();
|
|
500
|
+
connectFromEntities: ConnectableEntity[];
|
|
501
|
+
connectToEntity: ConnectableEntity | null;
|
|
502
|
+
mouseLocations: Vector[];
|
|
503
|
+
getMouseLocationsPoints(): Vector[];
|
|
504
|
+
createConnectPointWhenConnect();
|
|
505
|
+
mousedown: (event: MouseEvent) => void;
|
|
506
|
+
_startImageLocation: Map<string, Vector>;
|
|
507
|
+
_endImageLocation: Vector | null;
|
|
508
|
+
_hoverImageLocation: Vector | null;
|
|
509
|
+
_previewSourceDirection: Direction | null;
|
|
510
|
+
_previewTargetDirection: Direction | null;
|
|
511
|
+
getHoverImageNode(): ImageNode | null;
|
|
512
|
+
getHoverImageLocation(): Vector | null;
|
|
513
|
+
onMouseDown(event: MouseEvent);
|
|
514
|
+
isMouseHoverOnTarget;
|
|
515
|
+
mousemove: (event: MouseEvent) => void;
|
|
516
|
+
mouseMove(event: MouseEvent);
|
|
517
|
+
mouseup: (event: MouseEvent) => void;
|
|
518
|
+
mouseUp(event: MouseEvent);
|
|
519
|
+
getConnectDirectionByMouseTrack(): [Direction | null, Direction | null];
|
|
520
|
+
_hasSourceSparkTriggered;
|
|
521
|
+
_hasTargetSparkTriggered;
|
|
522
|
+
getOppositeDirection(direction: Direction): Direction;
|
|
523
|
+
clickMultiConnect(releaseWorldLocation: Vector);
|
|
524
|
+
clear();
|
|
525
|
+
updatePreviewDirections();
|
|
526
|
+
directionToRate(direction: Direction | null): Vector;
|
|
527
|
+
getPreviewSourceRectangleRate(): Vector;
|
|
528
|
+
getPreviewTargetRectangleRate(): Vector;
|
|
529
|
+
dragMultiConnect(connectToEntity: ConnectableEntity, sourceDirection: Direction | null = null, targetDirection: Direction | null = null);
|
|
530
|
+
isConnecting();
|
|
531
|
+
addConnectEffect(from: ConnectableEntity, to: ConnectableEntity, sourceRectRate?: Vector, targetRectRate?: Vector);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
declare class ControllerNodeEditClass extends ControllerClass {
|
|
535
|
+
constructor(project: Project);
|
|
536
|
+
mouseDoubleClick;
|
|
537
|
+
mouseup;
|
|
538
|
+
mousemove;
|
|
539
|
+
editUrlNodeTitle(clickedUrlNode: UrlNode);
|
|
540
|
+
editLatexNode(node: LatexNode);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
declare class ControllerPenStrokeControlClass extends ControllerClass {
|
|
544
|
+
isAdjusting;
|
|
545
|
+
startAdjustWidthLocation: Vector;
|
|
546
|
+
lastAdjustWidthLocation: Vector;
|
|
547
|
+
mousedown: (event: MouseEvent) => void;
|
|
548
|
+
mousemove: (event: MouseEvent) => void;
|
|
549
|
+
mouseup: (event: MouseEvent) => void;
|
|
550
|
+
onMouseMoveWhenAdjusting;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
declare class ControllerPenStrokeDrawingClass extends ControllerClass {
|
|
554
|
+
_isUsing: boolean;
|
|
555
|
+
currentSegments: PenStrokeSegment[];
|
|
556
|
+
isDrawingLine;
|
|
557
|
+
currentStrokeWidth: number;
|
|
558
|
+
constructor(project: Project);
|
|
559
|
+
mousedown;
|
|
560
|
+
mousemove;
|
|
561
|
+
mouseup;
|
|
562
|
+
releaseMouseAndClear();
|
|
563
|
+
mousewheel: (event: WheelEvent) => void;
|
|
564
|
+
getCurrentStrokeColor();
|
|
565
|
+
changeCurrentStrokeColorAlpha(dAlpha: number);
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
declare class ControllerRectangleSelectClass extends ControllerClass {
|
|
569
|
+
_isUsing: boolean;
|
|
570
|
+
selectingRectangle: Rectangle | null;
|
|
571
|
+
get isUsing(): any;
|
|
572
|
+
shutDown();
|
|
573
|
+
mouseMoveOutWindowForcedShutdown(mouseLocation: Vector);
|
|
574
|
+
mousedown: (event: MouseEvent) => void;
|
|
575
|
+
mousemove: (event: MouseEvent) => void;
|
|
576
|
+
isSelectDirectionRight;
|
|
577
|
+
getSelectMode(): "contain" | "intersect";
|
|
578
|
+
mouseup;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
declare class ControllerSectionEditClass extends ControllerClass {
|
|
582
|
+
constructor(project: Project);
|
|
583
|
+
mouseDoubleClick;
|
|
584
|
+
mousemove;
|
|
585
|
+
keydown;
|
|
586
|
+
editSectionTitle(section: Section);
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
declare class ControllerUtils {
|
|
590
|
+
autoComplete: AutoCompleteManager;
|
|
591
|
+
constructor(project: Project);
|
|
592
|
+
editTextNode(clickedNode: TextNode, selectAll = true);
|
|
593
|
+
editNodeDetailsByKeyboard();
|
|
594
|
+
editNodeDetails(clickedNode: Entity);
|
|
595
|
+
addTextNodeByLocation(location: Vector, selectCurrent: boolean = false, autoEdit: boolean = false);
|
|
596
|
+
createConnectPoint(location: Vector);
|
|
597
|
+
addTextNodeFromCurrentSelectedNode(direction: Direction, selectCurrent = false);
|
|
598
|
+
textNodeInEditModeByUUID(uuid: string);
|
|
599
|
+
getClickedStageObject(clickedLocation: Vector);
|
|
600
|
+
isClickedResizeRect(clickedLocation: Vector): boolean;
|
|
601
|
+
selectedEntityNormalizing();
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
declare class CopyEngine {
|
|
605
|
+
copyEngineImage: CopyEngineImage;
|
|
606
|
+
copyEngineText: CopyEngineText;
|
|
607
|
+
constructor(project: Project);
|
|
608
|
+
copy();
|
|
609
|
+
paste();
|
|
610
|
+
virtualClipboardPaste();
|
|
611
|
+
cut();
|
|
612
|
+
readSystemClipboardAndPaste();
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
declare class CopyEngineImage {
|
|
616
|
+
constructor(project: Project);
|
|
617
|
+
processClipboardImage();
|
|
618
|
+
processImageStandard();
|
|
619
|
+
copyEnginePasteImage(item: Blob);
|
|
620
|
+
debugImageData(imageData: any): void;
|
|
621
|
+
fixImageData(data: Uint8ClampedArray): Uint8ClampedArray;
|
|
622
|
+
processImageWindowsCompat();
|
|
623
|
+
ensureImageDataFormat(data: any, width: number, height: number): Uint8ClampedArray;
|
|
624
|
+
validateCanvasContent(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
625
|
+
createBlobFromCanvas(canvas: HTMLCanvasElement): Promise<Blob>;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
declare class CopyEngineText {
|
|
629
|
+
constructor(project: Project);
|
|
630
|
+
copyEnginePastePlainText(item: string);
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
declare class CubicCatmullRomSplineEdge extends Edge {
|
|
634
|
+
uuid: string;
|
|
635
|
+
text: string;
|
|
636
|
+
_source: ConnectableEntity;
|
|
637
|
+
_target: ConnectableEntity;
|
|
638
|
+
color: Color;
|
|
639
|
+
alpha;
|
|
640
|
+
tension;
|
|
641
|
+
controlPoints: Vector[];
|
|
642
|
+
getControlPoints(): Vector[];
|
|
643
|
+
addControlPoint();
|
|
644
|
+
_collisionBox: CollisionBox;
|
|
645
|
+
get collisionBox(): CollisionBox;
|
|
646
|
+
fromTwoEntity(project: Project, source: ConnectableEntity, target: ConnectableEntity): CubicCatmullRomSplineEdge;
|
|
647
|
+
constructor(project: Project, {
|
|
648
|
+
uuid,
|
|
649
|
+
source,
|
|
650
|
+
target,
|
|
651
|
+
text,
|
|
652
|
+
alpha,
|
|
653
|
+
tension,
|
|
654
|
+
color,
|
|
655
|
+
controlPoints,
|
|
656
|
+
sourceRectRate,
|
|
657
|
+
targetRectRate,
|
|
658
|
+
}: Serialized.CubicCatmullRomSplineEdge, unknown = false);
|
|
659
|
+
getShape(): CubicCatmullRomSpline;
|
|
660
|
+
get textRectangle(): Rectangle;
|
|
661
|
+
autoUpdateControlPoints();
|
|
662
|
+
getArrowHead(): { location: Vector; direction: Vector };
|
|
663
|
+
adjustSizeByText(): void;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
declare enum CursorNameEnum {
|
|
667
|
+
Default = "cursor-default",
|
|
668
|
+
Pointer = "cursor-pointer",
|
|
669
|
+
Crosshair = "cursor-crosshair",
|
|
670
|
+
Move = "cursor-move",
|
|
671
|
+
Grab = "cursor-grab",
|
|
672
|
+
Grabbing = "cursor-grabbing",
|
|
673
|
+
Text = "cursor-text",
|
|
674
|
+
NotAllowed = "cursor-not-allowed",
|
|
675
|
+
EResize = "cursor-e-resize",
|
|
676
|
+
NResize = "cursor-n-resize",
|
|
677
|
+
NeResize = "cursor-ne-resize",
|
|
678
|
+
NwResize = "cursor-nw-resize",
|
|
679
|
+
SResize = "cursor-s-resize",
|
|
680
|
+
SeResize = "cursor-se-resize",
|
|
681
|
+
SwResize = "cursor-sw-resize",
|
|
682
|
+
WResize = "cursor-w-resize",
|
|
683
|
+
NsResize = "cursor-ns-resize",
|
|
684
|
+
NeswResize = "cursor-nesw-resize",
|
|
685
|
+
NwseResize = "cursor-nwse-resize",
|
|
686
|
+
ColResize = "cursor-col-resize",
|
|
687
|
+
RowResize = "cursor-row-resize",
|
|
688
|
+
AllScroll = "cursor-all-scroll",
|
|
689
|
+
ZoomIn = "cursor-zoom-in",
|
|
690
|
+
ZoomOut = "cursor-zoom-out",
|
|
691
|
+
GrabHand = "cursor-grab-hand",
|
|
692
|
+
NotAllowedHand = "cursor-not-allowed-hand",
|
|
693
|
+
Pen = "cursor-pen",
|
|
694
|
+
Eraser = "cursor-eraser",
|
|
695
|
+
Handwriting = "cursor-handwriting",
|
|
696
|
+
ZoomInHand = "cursor-zoom-in-hand",
|
|
697
|
+
ZoomOutHand = "cursor-zoom-out-hand",
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
declare class CurveRenderer {
|
|
701
|
+
constructor(project: Project);
|
|
702
|
+
renderSolidLine(start: Vector, end: Vector, color: Color, width: number): void;
|
|
703
|
+
renderSolidLineMultiple(locations: Vector[], color: Color, width: number): void;
|
|
704
|
+
renderPenStroke(stroke: PenStrokeSegment[], color: Color): void;
|
|
705
|
+
renderSolidLineMultipleSmoothly(locations: Vector[], color: Color, width: number): void;
|
|
706
|
+
smoothPoints(points: Vector[], tension = 0.5);
|
|
707
|
+
renderSolidLineMultipleWithWidth(locations: Vector[], color: Color, widthList: number[]): void;
|
|
708
|
+
renderSolidLineMultipleWithShadow(locations: Vector[], color: Color, width: number, shadowColor: Color, shadowBlur: number): void;
|
|
709
|
+
renderDashedLine(start: Vector, end: Vector, color: Color, width: number, dashLength: number): void;
|
|
710
|
+
renderDoubleLine(start: Vector, end: Vector, color: Color, width: number, gap: number): void;
|
|
711
|
+
renderBezierCurve(curve: CubicBezierCurve, color: Color, width: number): void;
|
|
712
|
+
renderDashedBezierCurve(curve: CubicBezierCurve, color: Color, width: number, dashLength: number): void;
|
|
713
|
+
renderDoubleBezierCurve(curve: CubicBezierCurve, color: Color, width: number, gap: number): void;
|
|
714
|
+
renderSymmetryCurve(curve: SymmetryCurve, color: Color, width: number): void;
|
|
715
|
+
renderGradientLine(start: Vector, end: Vector, startColor: Color, endColor: Color, width: number): void;
|
|
716
|
+
renderGradientBezierCurve(curve: CubicBezierCurve, startColor: Color, endColor: Color, width: number): void;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
declare class DeleteManager {
|
|
720
|
+
deleteHandlers;
|
|
721
|
+
registerHandler<T extends StageObject>(constructor: Constructor<T>, handler: DeleteHandler<T>);
|
|
722
|
+
constructor(project: Project);
|
|
723
|
+
deleteEntities(deleteNodes: Entity[]);
|
|
724
|
+
findDeleteHandler(object: StageObject);
|
|
725
|
+
deleteSvgNode(entity: SvgNode);
|
|
726
|
+
deleteLatexNode(entity: LatexNode);
|
|
727
|
+
deleteReferenceBlockNode(entity: ReferenceBlockNode);
|
|
728
|
+
deleteExtensionEntity(entity: ExtensionEntity);
|
|
729
|
+
deletePenStroke(penStroke: PenStroke);
|
|
730
|
+
deleteSection(entity: Section);
|
|
731
|
+
deleteImageNode(entity: ImageNode);
|
|
732
|
+
deleteUrlNode(entity: UrlNode);
|
|
733
|
+
deleteConnectPoint(entity: ConnectPoint);
|
|
734
|
+
deleteTextNode(entity: TextNode);
|
|
735
|
+
deleteEntityAfterClearAssociation(entity: ConnectableEntity);
|
|
736
|
+
deleteEdge(deleteEdge: Edge): boolean;
|
|
737
|
+
deleteMultiTargetUndirectedEdge(edge: MultiTargetUndirectedEdge);
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>);
|
|
741
|
+
declare namespace Dialog {
|
|
742
|
+
function confirm(title = "你确定?", description = "", { destructive = false } = {}): Promise<boolean>;
|
|
743
|
+
function input(title = "请输入文本", description = "", { defaultValue = "", placeholder = "...", destructive = false, multiline = false } = {}): Promise<string | undefined>;
|
|
744
|
+
function buttons<Buttons extends readonly {
|
|
745
|
+
id: string;
|
|
746
|
+
label: string;
|
|
747
|
+
variant?: Parameters<typeof Button>[number]["variant"];
|
|
748
|
+
}[]>(title: string, description: string, buttons: Buttons): Promise<Buttons[number]["id"]>;
|
|
749
|
+
function copy(title = "导出成功", description = "", value = ""): Promise<void>;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
declare enum Direction {
|
|
753
|
+
Up,
|
|
754
|
+
Down,
|
|
755
|
+
Left,
|
|
756
|
+
Right,
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
declare class DrawingControllerRenderer {
|
|
760
|
+
constructor(project: Project);
|
|
761
|
+
renderTempDrawing();
|
|
762
|
+
renderTrace(currentStrokeColor: Color);
|
|
763
|
+
renderMouse(currentStrokeColor: Color);
|
|
764
|
+
renderAdjusting(currentStrokeColor: Color);
|
|
765
|
+
renderAxisMouse();
|
|
766
|
+
diffAngle;
|
|
767
|
+
rotateUpAngle();
|
|
768
|
+
rotateDownAngle();
|
|
769
|
+
renderAngleMouse(mouseLocation: Vector);
|
|
770
|
+
renderLine(lineStart: Vector, lineEnd: Vector);
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
declare class Edge extends ConnectableAssociation {
|
|
774
|
+
uuid: string;
|
|
775
|
+
text: string;
|
|
776
|
+
collisionBox: CollisionBox;
|
|
777
|
+
get isHiddenBySectionCollapse(): boolean;
|
|
778
|
+
_isSelected: boolean;
|
|
779
|
+
get isSelected(): boolean;
|
|
780
|
+
set isSelected(value: boolean);
|
|
781
|
+
get textRectangle(): Rectangle;
|
|
782
|
+
get bodyLine(): Line;
|
|
783
|
+
get sourceLocation(): Vector;
|
|
784
|
+
get targetLocation(): Vector;
|
|
785
|
+
targetRectangleRate: Vector;
|
|
786
|
+
sourceRectangleRate: Vector;
|
|
787
|
+
getCenterLine(source: ConnectableEntity, target: ConnectableEntity): Line;
|
|
788
|
+
getNormalVectorByRate(rate: Vector): Vector | null;
|
|
789
|
+
getExactEdgePositionByRate(rect: Rectangle, rate: Vector): Vector | null;
|
|
790
|
+
adjustSizeByText(): void;
|
|
791
|
+
rename(text: string);
|
|
792
|
+
isIntersectsWithRectangle(rectangle: Rectangle): boolean;
|
|
793
|
+
isIntersectsWithLocation(location: Vector): boolean;
|
|
794
|
+
isIntersectsWithLine(line: Line): boolean;
|
|
795
|
+
isLeftToRight(): boolean;
|
|
796
|
+
isRightToLeft(): boolean;
|
|
797
|
+
isTopToBottom(): boolean;
|
|
798
|
+
isBottomToTop(): boolean;
|
|
799
|
+
isUnknownDirection(): boolean;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
declare class EdgeRenderer {
|
|
803
|
+
currentRenderer: EdgeRendererClass;
|
|
804
|
+
constructor(project: Project);
|
|
805
|
+
checkRendererBySettings(lineStyle: Settings["lineStyle"]);
|
|
806
|
+
updateRenderer(style: Settings["lineStyle"]);
|
|
807
|
+
renderLineEdge(edge: LineEdge);
|
|
808
|
+
renderCrEdge(edge: CubicCatmullRomSplineEdge);
|
|
809
|
+
getMinNonCollapseParentSection(innerEntity: ConnectableEntity): Section;
|
|
810
|
+
getEdgeView(edge: LineEdge): LineEdge;
|
|
811
|
+
getEdgeSvg(edge: LineEdge): React.ReactNode;
|
|
812
|
+
renderVirtualEdge(startNode: ConnectableEntity, mouseLocation: Vector, sourceRectangleRate?: Vector);
|
|
813
|
+
renderVirtualConfirmedEdge(startNode: ConnectableEntity, endNode: ConnectableEntity, sourceRectangleRate?: Vector, targetRectangleRate?: Vector);
|
|
814
|
+
getCuttingEffects(edge: Edge);
|
|
815
|
+
getConnectedEffects(startNode: ConnectableEntity, toNode: ConnectableEntity, sourceRectangleRate?: Vector, targetRectangleRate?: Vector);
|
|
816
|
+
renderArrowHead(endPoint: Vector, direction: Vector, size: number, color: Color);
|
|
817
|
+
generateArrowHeadSvg(endPoint: Vector, direction: Vector, size: number, edgeColor: Color): React.ReactNode;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
declare class EdgeRendererClass {
|
|
821
|
+
constructor();
|
|
822
|
+
isCycleState(edge: LineEdge): boolean;
|
|
823
|
+
isNormalState(edge: LineEdge): boolean;
|
|
824
|
+
renderNormalState(edge: LineEdge): void;
|
|
825
|
+
renderShiftingState(edge: LineEdge): void;
|
|
826
|
+
renderCycleState(edge: LineEdge): void;
|
|
827
|
+
getNormalStageSvg(edge: LineEdge): React.ReactNode;
|
|
828
|
+
getShiftingStageSvg(edge: LineEdge): React.ReactNode;
|
|
829
|
+
getCycleStageSvg(edge: LineEdge): React.ReactNode;
|
|
830
|
+
renderVirtualEdge(startNode: ConnectableEntity, mouseLocation: Vector, sourceRectangleRate?: Vector): void;
|
|
831
|
+
renderVirtualConfirmedEdge(startNode: ConnectableEntity, endNode: ConnectableEntity, sourceRectangleRate?: Vector, targetRectangleRate?: Vector): void;
|
|
832
|
+
getCuttingEffects(edge: Edge): Effect[];
|
|
833
|
+
getConnectedEffects(startNode: ConnectableEntity, toNode: ConnectableEntity, sourceRectangleRate?: Vector, targetRectangleRate?: Vector): Effect[];
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
declare class Effect {
|
|
837
|
+
constructor(timeProgress: ProgressNumber, delay: number = 0);
|
|
838
|
+
subEffects: Effect[];
|
|
839
|
+
tick(project: Project): void;
|
|
840
|
+
render(project: Project): void;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
declare class Effects {
|
|
844
|
+
constructor(project: Project);
|
|
845
|
+
effects: Effect[];
|
|
846
|
+
addEffect(effect: Effect);
|
|
847
|
+
get effectsCount(): any;
|
|
848
|
+
addEffects(effects: Effect[]);
|
|
849
|
+
tick();
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
declare class Entity extends StageObject {
|
|
853
|
+
move(delta: Vector): void;
|
|
854
|
+
isAlignExcluded;
|
|
855
|
+
moveTo(location: Vector): void;
|
|
856
|
+
details: Value;
|
|
857
|
+
isMouseHover: boolean;
|
|
858
|
+
detailsButtonRectangle(): Rectangle;
|
|
859
|
+
isMouseInDetailsButton(mouseWorldLocation: Vector): boolean;
|
|
860
|
+
referenceButtonCircle(): Circle;
|
|
861
|
+
isMouseInReferenceButton(mouseWorldLocation: Vector): boolean;
|
|
862
|
+
updateFatherSectionByMove();
|
|
863
|
+
updateOtherEntityLocationByMove();
|
|
864
|
+
collideWithOtherEntity(other: Entity);
|
|
865
|
+
isHiddenBySectionCollapse: boolean;
|
|
866
|
+
detailsManager;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
declare class EntityDetailsButtonRenderer {
|
|
870
|
+
constructor(project: Project);
|
|
871
|
+
render(entity: Entity);
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
declare class EntityMoveManager {
|
|
875
|
+
constructor(project: Project);
|
|
876
|
+
moveAccelerateCommander: Vector;
|
|
877
|
+
moveSpeed: Vector;
|
|
878
|
+
frictionExponent;
|
|
879
|
+
tick();
|
|
880
|
+
continuousMoveKeyPress(direction: Vector);
|
|
881
|
+
continuousMoveKeyRelease(direction: Vector);
|
|
882
|
+
stopImmediately();
|
|
883
|
+
canMoveEntity(entity: Entity): boolean;
|
|
884
|
+
moveEntityUtils(entity: Entity, delta: Vector, isAutoAdjustSection: boolean = true);
|
|
885
|
+
jumpMoveEntityUtils(entity: Entity, delta: Vector);
|
|
886
|
+
moveEntityToUtils(entity: Entity, location: Vector);
|
|
887
|
+
moveSelectedEntities(delta: Vector, isAutoAdjustSection: boolean = true);
|
|
888
|
+
jumpMoveSelectedConnectableEntities(delta: Vector);
|
|
889
|
+
moveEntitiesWithChildren(delta: Vector, skipDashed = true);
|
|
890
|
+
moveWithChildren(node: ConnectableEntity, delta: Vector, skipDashed = false);
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
declare class EntityRenderer {
|
|
894
|
+
sectionSortedZIndex: Section[];
|
|
895
|
+
extensionEntityRenderer: ExtensionEntityRenderer;
|
|
896
|
+
constructor(project: Project);
|
|
897
|
+
sortSectionsByZIndex();
|
|
898
|
+
tickNumber;
|
|
899
|
+
renderAllSectionsBackground(viewRectangle: Rectangle);
|
|
900
|
+
renderAllSectionsBigTitle(viewRectangle: Rectangle);
|
|
901
|
+
shouldSkipEntity(entity: Entity, viewRectangle: Rectangle): boolean;
|
|
902
|
+
isBackgroundImageNode(entity: Entity): boolean;
|
|
903
|
+
renderAllEntities(viewRectangle: Rectangle);
|
|
904
|
+
renderEntity(entity: Entity);
|
|
905
|
+
renderEntityDebug(entity: Entity);
|
|
906
|
+
renderConnectPoint(connectPoint: ConnectPoint);
|
|
907
|
+
renderImageNode(imageNode: ImageNode);
|
|
908
|
+
renderPenStroke(penStroke: PenStroke);
|
|
909
|
+
renderEntityDetails(entity: Entity);
|
|
910
|
+
_renderEntityDetails(entity: Entity, limitLiens: number);
|
|
911
|
+
renderEntityTagShap(entity: Entity);
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
declare class ExtensionEntity extends ConnectableEntity {
|
|
915
|
+
get geometryCenter(): Vector;
|
|
916
|
+
uuid: string;
|
|
917
|
+
extensionId;
|
|
918
|
+
typeName;
|
|
919
|
+
customData: any;
|
|
920
|
+
collisionBox: CollisionBox;
|
|
921
|
+
isHiddenBySectionCollapse;
|
|
922
|
+
_bitmapCache: ImageBitmap | null;
|
|
923
|
+
_isDirty;
|
|
924
|
+
_isRendering;
|
|
925
|
+
_renderFailed;
|
|
926
|
+
constructor(project: Project, {
|
|
927
|
+
uuid = crypto.randomUUID(),
|
|
928
|
+
extensionId = "",
|
|
929
|
+
typeName = "",
|
|
930
|
+
customData = {},
|
|
931
|
+
collisionBox = new CollisionBox([new Rectangle(Vector.getZero(), new Vector(100, 80))]),
|
|
932
|
+
}: {
|
|
933
|
+
uuid?: string;
|
|
934
|
+
extensionId?: string;
|
|
935
|
+
typeName?: string;
|
|
936
|
+
customData?: any;
|
|
937
|
+
collisionBox?: CollisionBox;
|
|
938
|
+
} = {});
|
|
939
|
+
get rectangle(): Rectangle;
|
|
940
|
+
get location(): Vector;
|
|
941
|
+
set location(v: Vector);
|
|
942
|
+
move(delta: Vector): void;
|
|
943
|
+
moveTo(location: Vector): void;
|
|
944
|
+
markDirty();
|
|
945
|
+
setCustomData(data: any);
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
declare interface ExtensionEntityConfig {
|
|
949
|
+
initialData: any;
|
|
950
|
+
collisionBox: CollisionBox;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
declare class ExtensionEntityRenderer {
|
|
954
|
+
constructor(project: Project);
|
|
955
|
+
render(entity: ExtensionEntity);
|
|
956
|
+
drawPendingBox(ctx: CanvasRenderingContext2D, x: number, y: number, w: number, h: number);
|
|
957
|
+
drawErrorBox(ctx: CanvasRenderingContext2D, x: number, y: number, w: number, h: number, text: string, extensionId: string, color: string);
|
|
958
|
+
drawCollisionBox(ctx: CanvasRenderingContext2D, entity: ExtensionEntity, scale: number);
|
|
959
|
+
renderSelectionOutline(ctx: CanvasRenderingContext2D, entity: ExtensionEntity, scale: number);
|
|
960
|
+
triggerWorkerRender(entity: ExtensionEntity);
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
declare interface FileSystemProvider {
|
|
964
|
+
read(uri: URI): Promise<Uint8Array>;
|
|
965
|
+
readDir(uri: URI): Promise<DirEntry[]>;
|
|
966
|
+
write(uri: URI, content: Uint8Array): Promise<void>;
|
|
967
|
+
remove(uri: URI): Promise<void>;
|
|
968
|
+
exists(uri: URI): Promise<boolean>;
|
|
969
|
+
mkdir(uri: URI): Promise<void>;
|
|
970
|
+
rename(oldUri: URI, newUri: URI): Promise<void>;
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
declare class GenerateFromFolder {
|
|
974
|
+
constructor(project: Project);
|
|
975
|
+
generateFromFolder(folderPath: string): Promise<void>;
|
|
976
|
+
generateTreeFromFolder(folderPath: string): Promise<void>;
|
|
977
|
+
getColorByPath(path: string): Color;
|
|
978
|
+
fileExtColorMap: Record<string, string>;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
declare class GraphImporter extends BaseImporter {
|
|
982
|
+
constructor(project: Project);
|
|
983
|
+
import(text: string, diffLocation: Vector = Vector.getZero()): void;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
declare class GraphMethods {
|
|
987
|
+
constructor(project: Project);
|
|
988
|
+
isTree(node: ConnectableEntity, skipDashed = false): boolean;
|
|
989
|
+
getNodeDisplayName(node: ConnectableEntity): string;
|
|
990
|
+
validateTreeStructure(rootNode: ConnectableEntity, skipDashed = false): TreeValidationResult;
|
|
991
|
+
nodeChildrenArray(node: ConnectableEntity, skipDashed = false): ConnectableEntity[];
|
|
992
|
+
nodeParentArray(node: ConnectableEntity, skipDashed = false): ConnectableEntity[];
|
|
993
|
+
edgeChildrenArray(node: ConnectableEntity): Edge[];
|
|
994
|
+
edgeParentArray(node: ConnectableEntity): Edge[];
|
|
995
|
+
getReversedEdgeDict(skipDashed = false): Record<string, string>;
|
|
996
|
+
isCurrentNodeInTreeStructAndNotRoot(node: ConnectableEntity): boolean;
|
|
997
|
+
getRoots(node: ConnectableEntity, skipDashed = false): ConnectableEntity[];
|
|
998
|
+
isConnected(node: ConnectableEntity, target: ConnectableEntity): boolean;
|
|
999
|
+
getSuccessorSet(node: ConnectableEntity, isHaveSelf: boolean = true, skipDashed = false): ConnectableEntity[];
|
|
1000
|
+
getOneStepSuccessorSet(node: ConnectableEntity): ConnectableEntity[];
|
|
1001
|
+
getEdgesBetween(node1: ConnectableEntity, node2: ConnectableEntity): Edge[];
|
|
1002
|
+
getEdgeFromTwoEntity(fromNode: ConnectableEntity, toNode: ConnectableEntity): Edge | null;
|
|
1003
|
+
getHyperEdgesByNode(node: ConnectableEntity): MultiTargetUndirectedEdge[];
|
|
1004
|
+
getOutgoingEdges(node: ConnectableEntity): Edge[];
|
|
1005
|
+
getIncomingEdges(node: ConnectableEntity): Edge[];
|
|
1006
|
+
getNodesConnectedByHyperEdges(node: ConnectableEntity): ConnectableEntity[];
|
|
1007
|
+
nodeChildrenArrayWithinSet(node: ConnectableEntity, nodeSet: Set<string>): ConnectableEntity[];
|
|
1008
|
+
nodeParentArrayWithinSet(node: ConnectableEntity, nodeSet: Set<string>): ConnectableEntity[];
|
|
1009
|
+
getTreeRootByNodes(nodes: ConnectableEntity[]): ConnectableEntity | null;
|
|
1010
|
+
isTreeByNodes(nodes: ConnectableEntity[]): boolean;
|
|
1011
|
+
isDAGByNodes(nodes: ConnectableEntity[]): boolean;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
declare class HistoryManager extends HistoryManagerAbs {
|
|
1015
|
+
memoryEfficient: HistoryManagerAbs;
|
|
1016
|
+
timeEfficient: HistoryManagerAbs;
|
|
1017
|
+
currentManager: HistoryManagerAbs;
|
|
1018
|
+
constructor(project: Project);
|
|
1019
|
+
recordStep(): void;
|
|
1020
|
+
undo(): void;
|
|
1021
|
+
redo(): void;
|
|
1022
|
+
get(index: number): Record<string, any>[];
|
|
1023
|
+
clearHistory(): void;
|
|
1024
|
+
switchMode(useTimeEfficient: boolean): void;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
declare class ImageNode extends ConnectableEntity implements ResizeAble {
|
|
1028
|
+
isHiddenBySectionCollapse: boolean;
|
|
1029
|
+
uuid: string;
|
|
1030
|
+
collisionBox: CollisionBox;
|
|
1031
|
+
attachmentId: string;
|
|
1032
|
+
scale: number;
|
|
1033
|
+
isBackground: boolean;
|
|
1034
|
+
_isSelected: boolean;
|
|
1035
|
+
get isSelected(): any;
|
|
1036
|
+
set isSelected(value: boolean);
|
|
1037
|
+
bitmap: ImageBitmap | undefined;
|
|
1038
|
+
state: "loading" | "success" | "notFound";
|
|
1039
|
+
constructor(project: Project, {
|
|
1040
|
+
uuid = crypto.randomUUID() as string,
|
|
1041
|
+
collisionBox = new CollisionBox([new Rectangle(Vector.getZero(), Vector.getZero())]),
|
|
1042
|
+
details = [],
|
|
1043
|
+
attachmentId = "",
|
|
1044
|
+
scale = 1,
|
|
1045
|
+
isBackground = false,
|
|
1046
|
+
}, unknown = false);
|
|
1047
|
+
scaleUpdate(scaleDiff: number);
|
|
1048
|
+
get rectangle(): Rectangle;
|
|
1049
|
+
get geometryCenter(): any;
|
|
1050
|
+
move(delta: Vector): void;
|
|
1051
|
+
moveTo(location: Vector): void;
|
|
1052
|
+
reverseColors();
|
|
1053
|
+
swapRedBlueChannels();
|
|
1054
|
+
resizeHandle(delta: Vector);
|
|
1055
|
+
getResizeHandleRect(): Rectangle;
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
declare class ImageRenderer {
|
|
1059
|
+
constructor(project: Project);
|
|
1060
|
+
renderImageElement(source: Exclude<CanvasImageSource, VideoFrame | SVGElement>, location: Vector, scale: number = 1 / (window.devicePixelRatio || 1));
|
|
1061
|
+
renderImageBitmap(bitmap: ImageBitmap | undefined, location: Vector, scale: number = 1 / (window.devicePixelRatio || 1));
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
declare class InputElement {
|
|
1065
|
+
input(location: Vector, defaultValue: string, onChange: (value: string) => void = () => {}, style: Partial<CSSStyleDeclaration> = {}): Promise<string>;
|
|
1066
|
+
textarea(defaultValue: string, onChange: (value: string, element: HTMLTextAreaElement) => void = () => {}, style: Partial<CSSStyleDeclaration> = {}, selectAllWhenCreated = true): Promise<string>;
|
|
1067
|
+
addSuccessEffect();
|
|
1068
|
+
addFailEffect(withToast = true);
|
|
1069
|
+
constructor(project: Project);
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
declare class KeyBindHintEngine {
|
|
1073
|
+
constructor(project: Project);
|
|
1074
|
+
ITEMS_PER_PAGE;
|
|
1075
|
+
currentPage;
|
|
1076
|
+
currentModifierCombo: string;
|
|
1077
|
+
lastModifierCombo: string;
|
|
1078
|
+
isShowingHint;
|
|
1079
|
+
hasOtherKeyPressed;
|
|
1080
|
+
hasModifierReleased;
|
|
1081
|
+
cachedKeyBinds: Array<{
|
|
1082
|
+
id: string;
|
|
1083
|
+
key: string;
|
|
1084
|
+
displayKey: string;
|
|
1085
|
+
title: string;
|
|
1086
|
+
}>;
|
|
1087
|
+
getCurrentModifierCombo(): string;
|
|
1088
|
+
isOnlyModifiersPressed(): boolean;
|
|
1089
|
+
convertModifierComboForMatching(combo: string): string;
|
|
1090
|
+
isKeyBindMatchModifier(key: string, modifierCombo: string): boolean;
|
|
1091
|
+
getMatchingKeyBinds(modifierCombo: string): Array<{
|
|
1092
|
+
id: string;
|
|
1093
|
+
key: string;
|
|
1094
|
+
displayKey: string;
|
|
1095
|
+
title: string;
|
|
1096
|
+
}>;
|
|
1097
|
+
getKeyBindTitle(id: string): string;
|
|
1098
|
+
update();
|
|
1099
|
+
render();
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
declare type KeyBindIcon = ForwardRefExoticComponent<Omit<LucideProps, "ref"> & RefAttributes<SVGSVGElement>>;
|
|
1103
|
+
|
|
1104
|
+
declare type KeyBindWhen = (project?: Project) => boolean | Promise<boolean>;
|
|
1105
|
+
|
|
1106
|
+
declare class KeyboardOnlyEngine {
|
|
1107
|
+
constructor(project: Project);
|
|
1108
|
+
openning;
|
|
1109
|
+
setOpenning(value: boolean);
|
|
1110
|
+
isOpenning();
|
|
1111
|
+
dispose();
|
|
1112
|
+
startEditNode;
|
|
1113
|
+
onKeyUp;
|
|
1114
|
+
onKeyDown;
|
|
1115
|
+
addSuccessEffect();
|
|
1116
|
+
addFailEffect();
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
declare class KeyboardOnlyGraphEngine {
|
|
1120
|
+
targetLocationController;
|
|
1121
|
+
virtualTargetLocation(): Vector;
|
|
1122
|
+
tick();
|
|
1123
|
+
constructor(project: Project);
|
|
1124
|
+
isEnableVirtualCreate(): boolean;
|
|
1125
|
+
_isCreating;
|
|
1126
|
+
_creatingFromUUID: string | null;
|
|
1127
|
+
creatingFromUUID(): string | null;
|
|
1128
|
+
isCreating(): boolean;
|
|
1129
|
+
createStart(): void;
|
|
1130
|
+
lastPressTabTime;
|
|
1131
|
+
getPressTabTimeInterval(): number;
|
|
1132
|
+
createFinished();
|
|
1133
|
+
moveVirtualTarget(delta: Vector): void;
|
|
1134
|
+
createCancel(): void;
|
|
1135
|
+
isTargetLocationHaveEntity(): boolean;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
declare class KeyboardOnlyTreeEngine {
|
|
1139
|
+
constructor(project: Project);
|
|
1140
|
+
getNodePreDirection(node: ConnectableEntity): "right" | "left" | "down" | "up";
|
|
1141
|
+
preDirectionCacheMap: Map<string, "right" | "left" | "down" | "up">;
|
|
1142
|
+
getGrowthLineStart(node: ConnectableEntity, direction: "right" | "left" | "down" | "up"): Vector;
|
|
1143
|
+
getGrowthLineEnd(node: ConnectableEntity, direction: "right" | "left" | "down" | "up"): Vector;
|
|
1144
|
+
findConnectTargetByGrowthLine(node: ConnectableEntity, direction: "right" | "left" | "down" | "up"): ConnectableEntity | null;
|
|
1145
|
+
changePreDirection(nodes: ConnectableEntity[], direction: "right" | "left" | "down" | "up"): void;
|
|
1146
|
+
addNodeEffectByPreDirection(node: ConnectableEntity): void;
|
|
1147
|
+
onDeepGenerateNode(defaultText = "新节点", selectAll = true);
|
|
1148
|
+
onBroadGenerateNode();
|
|
1149
|
+
adjustTreeNode(entity: ConnectableEntity, withEffect = true);
|
|
1150
|
+
onDeleteCurrentNode();
|
|
1151
|
+
calculateNewNodeFontScaleLevel(parentNode: ConnectableEntity, preDirection: "right" | "left" | "down" | "up"): number;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
declare class LatexNode extends ConnectableEntity {
|
|
1155
|
+
uuid: string;
|
|
1156
|
+
latexSource: string;
|
|
1157
|
+
collisionBox: CollisionBox;
|
|
1158
|
+
color: Color;
|
|
1159
|
+
fontScaleLevel: number;
|
|
1160
|
+
isHiddenBySectionCollapse: boolean;
|
|
1161
|
+
image: HTMLImageElement;
|
|
1162
|
+
svgOriginalSize: Vector;
|
|
1163
|
+
state: "loading" | "success" | "error";
|
|
1164
|
+
currentRenderedColorCss: string;
|
|
1165
|
+
_isSelected: boolean;
|
|
1166
|
+
get isSelected(): any;
|
|
1167
|
+
set isSelected(value: boolean);
|
|
1168
|
+
get rectangle(): Rectangle;
|
|
1169
|
+
get geometryCenter(): Vector;
|
|
1170
|
+
constructor(project: Project, {
|
|
1171
|
+
uuid = crypto.randomUUID(),
|
|
1172
|
+
details = [],
|
|
1173
|
+
latexSource = "",
|
|
1174
|
+
collisionBox = new CollisionBox([new Rectangle(Vector.getZero(), Vector.getZero())]),
|
|
1175
|
+
color = Color.Transparent.clone(),
|
|
1176
|
+
fontScaleLevel = 0,
|
|
1177
|
+
}: {
|
|
1178
|
+
uuid?: string;
|
|
1179
|
+
details?: any;
|
|
1180
|
+
latexSource?: string;
|
|
1181
|
+
collisionBox?: CollisionBox;
|
|
1182
|
+
color?: Color;
|
|
1183
|
+
fontScaleLevel?: number;
|
|
1184
|
+
});
|
|
1185
|
+
getScale(): number;
|
|
1186
|
+
increaseFontSize(anchorRate?: Vector): void;
|
|
1187
|
+
decreaseFontSize(anchorRate?: Vector): void;
|
|
1188
|
+
updateCollisionBoxByScale(anchorRate?: Vector): void;
|
|
1189
|
+
_adjustLocationToKeepAnchor(oldRect: Rectangle, anchorRate: Vector): void;
|
|
1190
|
+
updateLatex(newLatex: string, colorCss?: string): Promise<void>;
|
|
1191
|
+
reRenderWithColor(colorCss: string): Promise<void>;
|
|
1192
|
+
renderLatexToImage(latex: string, colorCss: string = "#000000"): Promise<void>;
|
|
1193
|
+
move(delta: Vector): void;
|
|
1194
|
+
moveTo(location: Vector): void;
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
declare class LatexNodeRenderer {
|
|
1198
|
+
constructor(project: Project);
|
|
1199
|
+
getTargetColorCss(node: LatexNode): string;
|
|
1200
|
+
render(node: LatexNode);
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
declare class LayoutManager {
|
|
1204
|
+
constructor(project: Project);
|
|
1205
|
+
alignLeft();
|
|
1206
|
+
alignRight();
|
|
1207
|
+
alignTop();
|
|
1208
|
+
alignBottom();
|
|
1209
|
+
alignCenterHorizontal();
|
|
1210
|
+
alignCenterVertical();
|
|
1211
|
+
alignHorizontalSpaceBetween();
|
|
1212
|
+
alignVerticalSpaceBetween();
|
|
1213
|
+
alignLeftToRightNoSpace();
|
|
1214
|
+
alignTopToBottomNoSpace();
|
|
1215
|
+
layoutBySelected(layoutFunction: (entities: Entity[]) => void, isDeep: boolean);
|
|
1216
|
+
adjustSelectedTextNodeWidth(mode: "maxWidth" | "minWidth" | "average");
|
|
1217
|
+
layoutToSquare(entities: Entity[]);
|
|
1218
|
+
layoutToTightSquare(entities: Entity[]);
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
declare class LineEdge extends Edge {
|
|
1222
|
+
uuid: string;
|
|
1223
|
+
text: string;
|
|
1224
|
+
color: Color;
|
|
1225
|
+
lineType: string;
|
|
1226
|
+
get collisionBox(): CollisionBox;
|
|
1227
|
+
get shiftingIndex(): number;
|
|
1228
|
+
set shiftingIndex(value: number);
|
|
1229
|
+
_shiftingIndex: number;
|
|
1230
|
+
constructor(project: Project, {
|
|
1231
|
+
associationList = [] as ConnectableEntity[],
|
|
1232
|
+
text = "",
|
|
1233
|
+
uuid = crypto.randomUUID() as string,
|
|
1234
|
+
color = Color.Transparent,
|
|
1235
|
+
sourceRectangleRate = Vector.same(0.5),
|
|
1236
|
+
targetRectangleRate = Vector.same(0.5),
|
|
1237
|
+
lineType = "solid",
|
|
1238
|
+
}, unknown = false);
|
|
1239
|
+
fromTwoEntity(project: Project, source: ConnectableEntity, target: ConnectableEntity): LineEdge;
|
|
1240
|
+
rename(text: string);
|
|
1241
|
+
get edgeWidth(): number;
|
|
1242
|
+
get textFontSize(): number;
|
|
1243
|
+
get textRectangle(): Rectangle;
|
|
1244
|
+
get shiftingMidPoint(): Vector;
|
|
1245
|
+
adjustSizeByText(): void;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
declare enum LogicNodeNameEnum {
|
|
1249
|
+
AND = "#AND#",
|
|
1250
|
+
OR = "#OR#",
|
|
1251
|
+
NOT = "#NOT#",
|
|
1252
|
+
XOR = "#XOR#",
|
|
1253
|
+
TEST = "#TEST#",
|
|
1254
|
+
ADD = "#ADD#",
|
|
1255
|
+
SUBTRACT = "#SUB#",
|
|
1256
|
+
MULTIPLY = "#MUL#",
|
|
1257
|
+
DIVIDE = "#DIV#",
|
|
1258
|
+
MODULO = "#MOD#",
|
|
1259
|
+
FLOOR = "#FLOOR#",
|
|
1260
|
+
CEIL = "#CEIL#",
|
|
1261
|
+
ROUND = "#ROUND#",
|
|
1262
|
+
SQRT = "#SQRT#",
|
|
1263
|
+
POWER = "#POW#",
|
|
1264
|
+
LOG = "#LOG#",
|
|
1265
|
+
ABS = "#ABS#",
|
|
1266
|
+
RANDOM = "#RANDOM#",
|
|
1267
|
+
RANDOM_INT = "#RANDOM_INT#",
|
|
1268
|
+
RANDOM_FLOAT = "#RANDOM_FLOAT#",
|
|
1269
|
+
RANDOM_ITEM = "#RANDOM_ITEM#",
|
|
1270
|
+
RANDOM_ITEMS = "#RANDOM_ITEMS#",
|
|
1271
|
+
RANDOM_POISSON = "#RANDOM_POISSON#",
|
|
1272
|
+
SIN = "#SIN#",
|
|
1273
|
+
COS = "#COS#",
|
|
1274
|
+
TAN = "#TAN#",
|
|
1275
|
+
ASIN = "#ASIN#",
|
|
1276
|
+
ACOS = "#ACOS#",
|
|
1277
|
+
ATAN = "#ATAN#",
|
|
1278
|
+
LN = "#LN#",
|
|
1279
|
+
EXP = "#EXP#",
|
|
1280
|
+
MAX = "#MAX#",
|
|
1281
|
+
MIN = "#MIN#",
|
|
1282
|
+
LT = "#LT#",
|
|
1283
|
+
GT = "#GT#",
|
|
1284
|
+
LTE = "#LTE#",
|
|
1285
|
+
GTE = "#GTE#",
|
|
1286
|
+
EQ = "#EQ#",
|
|
1287
|
+
NEQ = "#NEQ#",
|
|
1288
|
+
UPPER = "#UPPER#",
|
|
1289
|
+
LOWER = "#LOWER#",
|
|
1290
|
+
LEN = "#LEN#",
|
|
1291
|
+
COPY = "#COPY#",
|
|
1292
|
+
SPLIT = "#SPLIT#",
|
|
1293
|
+
REPLACE = "#REPLACE#",
|
|
1294
|
+
CONNECT = "#CONNECT#",
|
|
1295
|
+
CHECK_REGEX_MATCH = "#CHECK_REGEX_MATCH#",
|
|
1296
|
+
COUNT = "#COUNT#",
|
|
1297
|
+
AVE = "#AVE#",
|
|
1298
|
+
MEDIAN = "#MEDIAN#",
|
|
1299
|
+
MODE = "#MODE#",
|
|
1300
|
+
VARIANCE = "#VARIANCE#",
|
|
1301
|
+
STANDARD_DEVIATION = "#STANDARD_DEVIATION#",
|
|
1302
|
+
SET_VAR = "#SET_VAR#",
|
|
1303
|
+
GET_VAR = "#GET_VAR#",
|
|
1304
|
+
RGB = "#RGB#",
|
|
1305
|
+
RGBA = "#RGBA#",
|
|
1306
|
+
GET_LOCATION = "#GET_LOCATION#",
|
|
1307
|
+
SET_LOCATION = "#SET_LOCATION#",
|
|
1308
|
+
SET_LOCATION_BY_UUID = "#SET_LOCATION_BY_UUID#",
|
|
1309
|
+
GET_LOCATION_BY_UUID = "#GET_LOCATION_BY_UUID#",
|
|
1310
|
+
GET_SIZE = "#GET_SIZE#",
|
|
1311
|
+
GET_MOUSE_LOCATION = "#GET_MOUSE_LOCATION#",
|
|
1312
|
+
GET_MOUSE_WORLD_LOCATION = "#GET_MOUSE_WORLD_LOCATION#",
|
|
1313
|
+
GET_CAMERA_LOCATION = "#GET_CAMERA_LOCATION#",
|
|
1314
|
+
SET_CAMERA_LOCATION = "#SET_CAMERA_LOCATION#",
|
|
1315
|
+
GET_CAMERA_SCALE = "#GET_CAMERA_SCALE#",
|
|
1316
|
+
SET_CAMERA_SCALE = "#SET_CAMERA_SCALE#",
|
|
1317
|
+
IS_COLLISION = "#IS_COLLISION#",
|
|
1318
|
+
GET_TIME = "#GET_TIME#",
|
|
1319
|
+
GET_DATE_TIME = "#GET_DATE_TIME#",
|
|
1320
|
+
ADD_DATE_TIME = "#ADD_DATE_TIME#",
|
|
1321
|
+
PLAY_SOUND = "#PLAY_SOUND#",
|
|
1322
|
+
GET_NODE_UUID = "#GET_NODE_UUID#",
|
|
1323
|
+
GET_NODE_RGBA = "#GET_NODE_RGBA#",
|
|
1324
|
+
COLLECT_NODE_DETAILS_BY_RGBA = "#COLLECT_NODE_DETAILS_BY_RGBA#",
|
|
1325
|
+
COLLECT_NODE_NAME_BY_RGBA = "#COLLECT_NODE_NAME_BY_RGBA#",
|
|
1326
|
+
FPS = "#FPS#",
|
|
1327
|
+
CREATE_TEXT_NODE_ON_LOCATION = "#CREATE_TEXT_NODE_ON_LOCATION#",
|
|
1328
|
+
IS_HAVE_ENTITY_ON_LOCATION = "#IS_HAVE_ENTITY_ON_LOCATION#",
|
|
1329
|
+
REPLACE_GLOBAL_CONTENT = "#REPLACE_GLOBAL_CONTENT#",
|
|
1330
|
+
SEARCH_CONTENT = "#SEARCH_CONTENT#",
|
|
1331
|
+
DELETE_PEN_STROKE_BY_COLOR = "#DELETE_PEN_STROKE_BY_COLOR#",
|
|
1332
|
+
DELAY_COPY = "#DELAY_COPY#",
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
declare class MarkdownExporter extends BaseExporter {
|
|
1336
|
+
export(textNode: TextNode): string;
|
|
1337
|
+
getNodeMarkdown(node: TextNode, level: number): string;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
declare class MarkdownImporter extends BaseImporter {
|
|
1341
|
+
constructor(project: Project);
|
|
1342
|
+
import(markdownText: string, diffLocation: Vector = Vector.getZero(), autoLayout = true): void;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
declare interface MarkdownNode {
|
|
1346
|
+
title: string;
|
|
1347
|
+
content: string;
|
|
1348
|
+
children: MarkdownNode[];
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
declare class MermaidExporter {
|
|
1352
|
+
constructor(project: Project);
|
|
1353
|
+
export(entities: Entity[]): string;
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
declare class MermaidImporter extends BaseImporter {
|
|
1357
|
+
constructor(project: Project);
|
|
1358
|
+
import(text: string, diffLocation: Vector = Vector.getZero()): void;
|
|
1359
|
+
normalizeLine(line: string): string;
|
|
1360
|
+
decodeMermaidText(value: string): string;
|
|
1361
|
+
sanitizeLabel(raw: string | undefined): string | undefined;
|
|
1362
|
+
parseNodeToken(token: string): MermaidNodeToken;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
declare class MouseInteraction {
|
|
1366
|
+
constructor(project: Project);
|
|
1367
|
+
_hoverEdges: Edge[];
|
|
1368
|
+
_hoverSections: Section[];
|
|
1369
|
+
_hoverConnectPoints: ConnectPoint[];
|
|
1370
|
+
_hoverMultiTargetEdges: MultiTargetUndirectedEdge[];
|
|
1371
|
+
get hoverEdges(): Edge[];
|
|
1372
|
+
get firstHoverEdge(): Edge | undefined;
|
|
1373
|
+
get hoverSections(): Section[];
|
|
1374
|
+
get hoverConnectPoints(): ConnectPoint[];
|
|
1375
|
+
get firstHoverSection(): Section | undefined;
|
|
1376
|
+
get hoverMultiTargetEdges(): MultiTargetUndirectedEdge[];
|
|
1377
|
+
get firstHoverMultiTargetEdge(): MultiTargetUndirectedEdge | undefined;
|
|
1378
|
+
updateByMouseMove(mouseWorldLocation: Vector): void;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
declare class MultiTargetEdgeMove {
|
|
1382
|
+
constructor(project: Project);
|
|
1383
|
+
moveMultiTargetEdge(diffLocation: Vector);
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
declare class MultiTargetUndirectedEdge extends ConnectableAssociation {
|
|
1387
|
+
uuid: string;
|
|
1388
|
+
get collisionBox(): CollisionBox;
|
|
1389
|
+
text: string;
|
|
1390
|
+
color: Color;
|
|
1391
|
+
rectRates: Vector[];
|
|
1392
|
+
centerRate: Vector;
|
|
1393
|
+
arrow: UndirectedEdgeArrowType;
|
|
1394
|
+
renderType: MultiTargetUndirectedEdgeRenderType;
|
|
1395
|
+
padding: number;
|
|
1396
|
+
rename(text: string);
|
|
1397
|
+
constructor(project: Project, {
|
|
1398
|
+
associationList = [] as ConnectableEntity[],
|
|
1399
|
+
text = "",
|
|
1400
|
+
uuid = crypto.randomUUID() as string,
|
|
1401
|
+
color = Color.Transparent,
|
|
1402
|
+
rectRates = associationList.map(() => Vector.same(0.5)),
|
|
1403
|
+
arrow = "none" as UndirectedEdgeArrowType,
|
|
1404
|
+
centerRate = Vector.same(0.5),
|
|
1405
|
+
padding = 10,
|
|
1406
|
+
renderType = "line" as MultiTargetUndirectedEdgeRenderType,
|
|
1407
|
+
}: {
|
|
1408
|
+
associationList?: ConnectableEntity[];
|
|
1409
|
+
text?: string;
|
|
1410
|
+
uuid?: string;
|
|
1411
|
+
color?: Color;
|
|
1412
|
+
rectRates?: Vector[];
|
|
1413
|
+
arrow?: UndirectedEdgeArrowType;
|
|
1414
|
+
centerRate?: Vector;
|
|
1415
|
+
padding?: number;
|
|
1416
|
+
renderType?: MultiTargetUndirectedEdgeRenderType;
|
|
1417
|
+
}, unknown = false);
|
|
1418
|
+
get centerLocation(): Vector;
|
|
1419
|
+
get textRectangle(): Rectangle;
|
|
1420
|
+
createFromSomeEntity(project: Project, entities: ConnectableEntity[]);
|
|
1421
|
+
_isSelected: boolean;
|
|
1422
|
+
get isSelected(): boolean;
|
|
1423
|
+
set isSelected(value: boolean);
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
declare class MultiTargetUndirectedEdgeRenderer {
|
|
1427
|
+
constructor(project: Project);
|
|
1428
|
+
render(edge: MultiTargetUndirectedEdge);
|
|
1429
|
+
renderLineShape(edge: MultiTargetUndirectedEdge, edgeColor: Color, centerLocation: Vector): void;
|
|
1430
|
+
renderConvexShape(edge: MultiTargetUndirectedEdge, edgeColor: Color): void;
|
|
1431
|
+
renderCircle(edge: MultiTargetUndirectedEdge, edgeColor: Color): void;
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
declare class NodeAdder {
|
|
1435
|
+
constructor(project: Project);
|
|
1436
|
+
addTextNodeByClick(clickWorldLocation: Vector, addToSections: Section[], selectCurrent = false, shouldRecordHistory = true, options?: {
|
|
1437
|
+
overrideFontScaleLevel?: number;
|
|
1438
|
+
}): Promise<string>;
|
|
1439
|
+
addTextNodeFromCurrentSelectedNode(direction: Direction, addToSections: Section[], selectCurrent = false): Promise<string>;
|
|
1440
|
+
getAutoName(): Promise<string>;
|
|
1441
|
+
getAutoColor(): Color;
|
|
1442
|
+
addConnectPoint(clickWorldLocation: Vector, addToSections: Section[]): string;
|
|
1443
|
+
addNodeGraphByText(text: string, diffLocation: Vector = Vector.getZero()): void;
|
|
1444
|
+
addNodeTreeByText(text: string, indention: number, diffLocation: Vector = Vector.getZero()): void;
|
|
1445
|
+
addNodeMermaidByText(text: string, diffLocation: Vector = Vector.getZero()): void;
|
|
1446
|
+
addNodeByMarkdown(markdownText: string, diffLocation: Vector = Vector.getZero(), autoLayout = true);
|
|
1447
|
+
getIndentLevel(line: string, indention: number): number;
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
declare class NodeConnector {
|
|
1451
|
+
constructor(project: Project);
|
|
1452
|
+
isConnectable(fromNode: ConnectableEntity, toNode: ConnectableEntity): boolean;
|
|
1453
|
+
connectConnectableEntity(fromNode: ConnectableEntity, toNode: ConnectableEntity, text: string = "", targetRectRate?: [number, number], sourceRectRate?: [number, number]): void;
|
|
1454
|
+
connectEntityFast(fromNode: ConnectableEntity, toNode: ConnectableEntity, text: string = ""): void;
|
|
1455
|
+
addCrEdge(fromNode: ConnectableEntity, toNode: ConnectableEntity): void;
|
|
1456
|
+
reverseEdges(edges: LineEdge[]);
|
|
1457
|
+
changeEdgeTarget(edge: LineEdge, newTarget: ConnectableEntity);
|
|
1458
|
+
changeEdgeSource(edge: LineEdge, newSource: ConnectableEntity);
|
|
1459
|
+
changeSelectedEdgeTarget(newTarget: ConnectableEntity);
|
|
1460
|
+
changeSelectedEdgeSource(newSource: ConnectableEntity);
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
declare class PenStroke extends Entity {
|
|
1464
|
+
isAlignExcluded: boolean;
|
|
1465
|
+
isHiddenBySectionCollapse: boolean;
|
|
1466
|
+
collisionBox: CollisionBox;
|
|
1467
|
+
uuid: string;
|
|
1468
|
+
move(delta: Vector): void;
|
|
1469
|
+
moveTo(location: Vector): void;
|
|
1470
|
+
updateCollisionBoxBySegmentList();
|
|
1471
|
+
segments: PenStrokeSegment[];
|
|
1472
|
+
color: Color;
|
|
1473
|
+
getPath(): Vector[];
|
|
1474
|
+
constructor(project: Project, { uuid = crypto.randomUUID() as string, segments = [] as PenStrokeSegment[], color = Color.White });
|
|
1475
|
+
getCollisionBoxFromSegmentList(segmentList: PenStrokeSegment[]): CollisionBox;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
declare class PenStrokeSegment {
|
|
1479
|
+
location: Vector;
|
|
1480
|
+
pressure: number;
|
|
1481
|
+
constructor(location: Vector, pressure: number);
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
declare class PlainTextExporter {
|
|
1485
|
+
constructor(project: Project);
|
|
1486
|
+
export(nodes: Entity[]): string;
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
declare interface PrgMetadata {
|
|
1490
|
+
version: string;
|
|
1491
|
+
extension?: ExtensionMetadata;
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
declare class Project extends Tab {
|
|
1495
|
+
latestVersion;
|
|
1496
|
+
_uri: URI;
|
|
1497
|
+
_projectState: ProjectState;
|
|
1498
|
+
_isSaving;
|
|
1499
|
+
stage: StageObject[];
|
|
1500
|
+
tags: string[];
|
|
1501
|
+
attachments;
|
|
1502
|
+
encoder;
|
|
1503
|
+
decoder;
|
|
1504
|
+
constructor(uri: URI);
|
|
1505
|
+
newDraft(): Project;
|
|
1506
|
+
compareVersion(version1: string, version2: string): number;
|
|
1507
|
+
checkAndConfirmUpgrade(currentVersion: string, latestVersion: string): Promise<boolean>;
|
|
1508
|
+
parseProjectFile(): Promise<{
|
|
1509
|
+
serializedStageObjects: any[];
|
|
1510
|
+
tags: string[];
|
|
1511
|
+
references: { sections: Record<string, string[]>; files: string[] };
|
|
1512
|
+
metadata: PrgMetadata;
|
|
1513
|
+
readme?: string;
|
|
1514
|
+
}>;
|
|
1515
|
+
init();
|
|
1516
|
+
get isDraft(): any;
|
|
1517
|
+
get title(): string;
|
|
1518
|
+
get icon(): any;
|
|
1519
|
+
get uri(): any;
|
|
1520
|
+
set uri(uri: URI);
|
|
1521
|
+
stash();
|
|
1522
|
+
save();
|
|
1523
|
+
references: { sections: Record<string, string[]>; files: string[] };
|
|
1524
|
+
metadata: PrgMetadata;
|
|
1525
|
+
readme?: string;
|
|
1526
|
+
getFileContent();
|
|
1527
|
+
get stageHash(): any;
|
|
1528
|
+
addAttachment(data: Blob);
|
|
1529
|
+
set projectState(state: ProjectState);
|
|
1530
|
+
get projectState(): ProjectState;
|
|
1531
|
+
set isSaving(isSaving: boolean);
|
|
1532
|
+
get isSaving(): boolean;
|
|
1533
|
+
containerRef;
|
|
1534
|
+
loadService(service: { id?: string; new (...args: any[]): any });
|
|
1535
|
+
componentDidMount(): void;
|
|
1536
|
+
currentComponent: React.ComponentType | null;
|
|
1537
|
+
getComponent(): React.ComponentType;
|
|
1538
|
+
render(): React.ReactNode;
|
|
1539
|
+
canvas: Canvas;
|
|
1540
|
+
inputElement: InputElement;
|
|
1541
|
+
controllerUtils: ControllerUtils;
|
|
1542
|
+
autoComputeUtils: AutoComputeUtils;
|
|
1543
|
+
renderUtils: RenderUtils;
|
|
1544
|
+
worldRenderUtils: WorldRenderUtils;
|
|
1545
|
+
historyManager: HistoryManager;
|
|
1546
|
+
stageManager: StageManager;
|
|
1547
|
+
camera: Camera;
|
|
1548
|
+
effects: Effects;
|
|
1549
|
+
autoCompute: AutoCompute;
|
|
1550
|
+
rectangleSelect: RectangleSelect;
|
|
1551
|
+
stageNodeRotate: StageNodeRotate;
|
|
1552
|
+
complexityDetector: ComplexityDetector;
|
|
1553
|
+
aiEngine: AIEngine;
|
|
1554
|
+
copyEngine: CopyEngine;
|
|
1555
|
+
autoLayout: AutoLayout;
|
|
1556
|
+
autoLayoutFastTree: AutoLayoutFastTree;
|
|
1557
|
+
layoutManager: LayoutManager;
|
|
1558
|
+
autoAlign: AutoAlign;
|
|
1559
|
+
mouseInteraction: MouseInteraction;
|
|
1560
|
+
contentSearch: ContentSearch;
|
|
1561
|
+
deleteManager: DeleteManager;
|
|
1562
|
+
nodeAdder: NodeAdder;
|
|
1563
|
+
entityMoveManager: EntityMoveManager;
|
|
1564
|
+
stageUtils: StageUtils;
|
|
1565
|
+
multiTargetEdgeMove: MultiTargetEdgeMove;
|
|
1566
|
+
nodeConnector: NodeConnector;
|
|
1567
|
+
stageObjectColorManager: StageObjectColorManager;
|
|
1568
|
+
stageObjectSelectCounter: StageObjectSelectCounter;
|
|
1569
|
+
sectionInOutManager: SectionInOutManager;
|
|
1570
|
+
sectionPackManager: SectionPackManager;
|
|
1571
|
+
sectionCollisionSolver: SectionCollisionSolver;
|
|
1572
|
+
tagManager: TagManager;
|
|
1573
|
+
syncAssociationManager: StageSyncAssociationManager;
|
|
1574
|
+
keyboardOnlyEngine: KeyboardOnlyEngine;
|
|
1575
|
+
keyboardOnlyGraphEngine: KeyboardOnlyGraphEngine;
|
|
1576
|
+
keyboardOnlyTreeEngine: KeyboardOnlyTreeEngine;
|
|
1577
|
+
selectChangeEngine: SelectChangeEngine;
|
|
1578
|
+
textRenderer: TextRenderer;
|
|
1579
|
+
imageRenderer: ImageRenderer;
|
|
1580
|
+
referenceBlockRenderer: ReferenceBlockRenderer;
|
|
1581
|
+
shapeRenderer: ShapeRenderer;
|
|
1582
|
+
entityRenderer: EntityRenderer;
|
|
1583
|
+
edgeRenderer: EdgeRenderer;
|
|
1584
|
+
multiTargetUndirectedEdgeRenderer: MultiTargetUndirectedEdgeRenderer;
|
|
1585
|
+
curveRenderer: CurveRenderer;
|
|
1586
|
+
svgRenderer: SvgRenderer;
|
|
1587
|
+
drawingControllerRenderer: DrawingControllerRenderer;
|
|
1588
|
+
collisionBoxRenderer: CollisionBoxRenderer;
|
|
1589
|
+
entityDetailsButtonRenderer: EntityDetailsButtonRenderer;
|
|
1590
|
+
straightEdgeRenderer: StraightEdgeRenderer;
|
|
1591
|
+
symmetryCurveEdgeRenderer: SymmetryCurveEdgeRenderer;
|
|
1592
|
+
verticalPolyEdgeRenderer: VerticalPolyEdgeRenderer;
|
|
1593
|
+
sectionRenderer: SectionRenderer;
|
|
1594
|
+
svgNodeRenderer: SvgNodeRenderer;
|
|
1595
|
+
latexNodeRenderer: LatexNodeRenderer;
|
|
1596
|
+
textNodeRenderer: TextNodeRenderer;
|
|
1597
|
+
urlNodeRenderer: UrlNodeRenderer;
|
|
1598
|
+
backgroundRenderer: BackgroundRenderer;
|
|
1599
|
+
searchContentHighlightRenderer: SearchContentHighlightRenderer;
|
|
1600
|
+
renderer: Renderer;
|
|
1601
|
+
controller: Controller;
|
|
1602
|
+
stageExport: StageExport;
|
|
1603
|
+
stageExportPng: StageExportPng;
|
|
1604
|
+
stageExportSvg: StageExportSvg;
|
|
1605
|
+
stageImport: StageImport;
|
|
1606
|
+
generateFromFolder: GenerateFromFolder;
|
|
1607
|
+
keyBindHintEngine: KeyBindHintEngine;
|
|
1608
|
+
sectionMethods: SectionMethods;
|
|
1609
|
+
graphMethods: GraphMethods;
|
|
1610
|
+
stageStyleManager: StageStyleManager;
|
|
1611
|
+
autoSaveBackup: AutoSaveBackupService;
|
|
1612
|
+
referenceManager: ReferenceManager;
|
|
1613
|
+
}
|
|
1614
|
+
|
|
1615
|
+
declare namespace RecentFileManager {
|
|
1616
|
+
const store: Store;
|
|
1617
|
+
declare type RecentFile = {
|
|
1618
|
+
uri: URI;
|
|
1619
|
+
/**
|
|
1620
|
+
* 上次保存或打开的时间戳
|
|
1621
|
+
*/
|
|
1622
|
+
time: number;
|
|
1623
|
+
};
|
|
1624
|
+
function init();
|
|
1625
|
+
function addRecentFile(file: RecentFile);
|
|
1626
|
+
function addRecentFileByUri(uri: URI);
|
|
1627
|
+
function addRecentFilesByUris(uris: URI[]);
|
|
1628
|
+
function removeRecentFileByUri(uri: URI);
|
|
1629
|
+
function clearAllRecentFiles();
|
|
1630
|
+
function getRecentFiles(): Promise<RecentFile[]>;
|
|
1631
|
+
function validAndRefreshRecentFiles();
|
|
1632
|
+
function sortTimeRecentFiles();
|
|
1633
|
+
function clearRecentFiles();
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
declare class RectangleSelect {
|
|
1637
|
+
constructor(project: Project);
|
|
1638
|
+
selectStartLocation;
|
|
1639
|
+
selectEndLocation;
|
|
1640
|
+
getSelectStartLocation(): Vector;
|
|
1641
|
+
getSelectEndLocation(): Vector;
|
|
1642
|
+
selectingRectangle: Rectangle | null;
|
|
1643
|
+
limitSection: Section | null;
|
|
1644
|
+
isSelectDirectionRight;
|
|
1645
|
+
getRectangle(): Rectangle | null;
|
|
1646
|
+
shutDown();
|
|
1647
|
+
startSelecting(worldLocation: Vector);
|
|
1648
|
+
moveSelecting(newEndLocation: Vector);
|
|
1649
|
+
endSelecting();
|
|
1650
|
+
updateStageObjectByMove();
|
|
1651
|
+
isSelectWithEntity(entity: StageObject);
|
|
1652
|
+
getSelectMode(): "contain" | "intersect";
|
|
1653
|
+
getSelectMoveDistance(): number;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
declare class ReferenceBlockNode extends ConnectableEntity implements ResizeAble {
|
|
1657
|
+
isHiddenBySectionCollapse: boolean;
|
|
1658
|
+
uuid: string;
|
|
1659
|
+
collisionBox: CollisionBox;
|
|
1660
|
+
fileName: string;
|
|
1661
|
+
sectionName: string;
|
|
1662
|
+
scale: number;
|
|
1663
|
+
attachmentId: string;
|
|
1664
|
+
_isSelected: boolean;
|
|
1665
|
+
bitmap: ImageBitmap | undefined;
|
|
1666
|
+
state: "loading" | "success" | "notFound";
|
|
1667
|
+
constructor(project: Project, {
|
|
1668
|
+
uuid = crypto.randomUUID() as string,
|
|
1669
|
+
collisionBox = new CollisionBox([new Rectangle(Vector.getZero(), new Vector(400, 200))]),
|
|
1670
|
+
fileName = "",
|
|
1671
|
+
sectionName = "",
|
|
1672
|
+
scale = 1,
|
|
1673
|
+
attachmentId = "",
|
|
1674
|
+
details = [],
|
|
1675
|
+
}, unknown = false);
|
|
1676
|
+
get isSelected(): any;
|
|
1677
|
+
set isSelected(value: boolean);
|
|
1678
|
+
loadImageFromAttachment();
|
|
1679
|
+
generateScreenshot();
|
|
1680
|
+
updateCollisionBox();
|
|
1681
|
+
scaleUpdate(scaleDiff: number);
|
|
1682
|
+
get rectangle(): Rectangle;
|
|
1683
|
+
get geometryCenter(): any;
|
|
1684
|
+
move(delta: Vector): void;
|
|
1685
|
+
moveTo(location: Vector): void;
|
|
1686
|
+
refresh();
|
|
1687
|
+
goToSource();
|
|
1688
|
+
focusSectionInProject(project: Project);
|
|
1689
|
+
resizeHandle(delta: Vector);
|
|
1690
|
+
getResizeHandleRect(): Rectangle;
|
|
1691
|
+
}
|
|
1692
|
+
|
|
1693
|
+
declare class ReferenceBlockRenderer {
|
|
1694
|
+
constructor(project: Project);
|
|
1695
|
+
render(referenceBlockNode: ReferenceBlockNode);
|
|
1696
|
+
renderBrackets(rect: Rectangle, color: Color);
|
|
1697
|
+
renderSourceSectionBorder(section: Section, countNumber: number, color: Color = new Color(118, 78, 209));
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
declare class ReferenceManager {
|
|
1701
|
+
constructor(project: Project);
|
|
1702
|
+
referenceBlockTextParser(text: string): parserResult;
|
|
1703
|
+
onClickReferenceNumber(clickLocation: Vector);
|
|
1704
|
+
buildSectionName2SectionMap(sectionNames: string[]): Record<string, Section>;
|
|
1705
|
+
updateOneSectionReferenceInfo(recentFiles: RecentFileManager.RecentFile[], sectionName: string);
|
|
1706
|
+
updateCurrentProjectReference();
|
|
1707
|
+
checkReferenceBlockInProject(project: Project, fileName: string, sectionName: string);
|
|
1708
|
+
insertRefDataToSourcePrgFile(fileName: string, sectionName: string);
|
|
1709
|
+
jumpToReferenceLocation(fileName: string, referenceBlockNodeSectionName: string);
|
|
1710
|
+
openSectionReferencePanel(section: Section);
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
declare class Renderer {
|
|
1714
|
+
FONT_SIZE;
|
|
1715
|
+
NODE_PADDING;
|
|
1716
|
+
NODE_ROUNDED_RADIUS;
|
|
1717
|
+
w;
|
|
1718
|
+
h;
|
|
1719
|
+
renderedEdges: number;
|
|
1720
|
+
timings: { [key: string]: number };
|
|
1721
|
+
deltaTime;
|
|
1722
|
+
lastTime;
|
|
1723
|
+
frameCount;
|
|
1724
|
+
frameIndex;
|
|
1725
|
+
fps;
|
|
1726
|
+
resizeWindow(newW: number, newH: number);
|
|
1727
|
+
constructor(project: Project);
|
|
1728
|
+
tick();
|
|
1729
|
+
tick_();
|
|
1730
|
+
renderViewElements(_viewRectangle: Rectangle);
|
|
1731
|
+
renderZoomLevelStage();
|
|
1732
|
+
renderMainStageElements(viewRectangle: Rectangle);
|
|
1733
|
+
renderStageElementsWithoutReactions(viewRectangle: Rectangle);
|
|
1734
|
+
isOverView(viewRectangle: Rectangle, entity: StageObject): boolean;
|
|
1735
|
+
renderCenterPointer();
|
|
1736
|
+
renderHoverCollisionBox();
|
|
1737
|
+
renderSelectingRectangle();
|
|
1738
|
+
renderCuttingLine();
|
|
1739
|
+
renderConnectingLine();
|
|
1740
|
+
renderCrosshairOnHoverImage();
|
|
1741
|
+
renderKeyboardOnly();
|
|
1742
|
+
rendererLayerMovingLine();
|
|
1743
|
+
renderJumpLine(startLocation: Vector, endLocation: Vector);
|
|
1744
|
+
renderWarningStageObjects();
|
|
1745
|
+
renderTags();
|
|
1746
|
+
renderEntities(viewRectangle: Rectangle);
|
|
1747
|
+
renderEdges(viewRectangle: Rectangle);
|
|
1748
|
+
renderBackground();
|
|
1749
|
+
updateFPS();
|
|
1750
|
+
renderDebugDetails();
|
|
1751
|
+
renderSpecialKeys();
|
|
1752
|
+
transformWorld2View(location: Vector): Vector;
|
|
1753
|
+
transformWorld2View(rectangle: Rectangle): Rectangle;
|
|
1754
|
+
transformWorld2View(arg1: Vector | Rectangle): Vector | Rectangle;
|
|
1755
|
+
transformView2World(location: Vector): Vector;
|
|
1756
|
+
transformView2World(rectangle: Rectangle): Rectangle;
|
|
1757
|
+
transformView2World(arg1: Vector | Rectangle): Vector | Rectangle;
|
|
1758
|
+
getCoverWorldRectangle(): Rectangle;
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
declare class RenderUtils {
|
|
1762
|
+
constructor(project: Project);
|
|
1763
|
+
renderPixel(location: Vector, color: Color);
|
|
1764
|
+
renderArrow(direction: Vector, location: Vector, color: Color, size: number);
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
declare interface ResizeAble {
|
|
1768
|
+
resizeHandle(delta: Vector): void;
|
|
1769
|
+
getResizeHandleRect(): Rectangle;
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
declare class SearchContentHighlightRenderer {
|
|
1773
|
+
constructor(project: Project);
|
|
1774
|
+
render(frameTickIndex: number);
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
declare class Section extends ConnectableEntity {
|
|
1778
|
+
_isSelected: boolean;
|
|
1779
|
+
uuid: string;
|
|
1780
|
+
_isEditingTitle: boolean;
|
|
1781
|
+
_collisionBoxWhenCollapsed: CollisionBox;
|
|
1782
|
+
_collisionBoxNormal: CollisionBox;
|
|
1783
|
+
get isEditingTitle(): any;
|
|
1784
|
+
set isEditingTitle(value: boolean);
|
|
1785
|
+
bigTitleCameraScale;
|
|
1786
|
+
get collisionBox(): CollisionBox;
|
|
1787
|
+
collapsedCollisionBox(): CollisionBox;
|
|
1788
|
+
color: Color;
|
|
1789
|
+
text: string;
|
|
1790
|
+
children: Entity[];
|
|
1791
|
+
isCollapsed: boolean;
|
|
1792
|
+
locked: boolean;
|
|
1793
|
+
isHiddenBySectionCollapse;
|
|
1794
|
+
constructor(project: Project, {
|
|
1795
|
+
uuid = crypto.randomUUID() as string,
|
|
1796
|
+
text = "",
|
|
1797
|
+
collisionBox = new CollisionBox([new Rectangle(new Vector(0, 0), new Vector(0, 0))]),
|
|
1798
|
+
_collisionBoxNormal: collisionBoxNormal = undefined as CollisionBox | undefined,
|
|
1799
|
+
color = Color.Transparent,
|
|
1800
|
+
locked = false,
|
|
1801
|
+
isCollapsed = false,
|
|
1802
|
+
children = [] as Entity[],
|
|
1803
|
+
details = [] as Value,
|
|
1804
|
+
} = {}, unknown = false);
|
|
1805
|
+
fromEntities(project: Project, entities: Entity[]): Section;
|
|
1806
|
+
rename(newName: string);
|
|
1807
|
+
adjustLocationAndSize();
|
|
1808
|
+
adjustChildrenStateByCollapse(parentCollapsed = false);
|
|
1809
|
+
get isSelected(): any;
|
|
1810
|
+
set isSelected(value: boolean);
|
|
1811
|
+
get rectangle(): Rectangle;
|
|
1812
|
+
get geometryCenter(): any;
|
|
1813
|
+
move(delta: Vector): void;
|
|
1814
|
+
collideWithOtherEntity(other: Entity): void;
|
|
1815
|
+
moveTo(location: Vector): void;
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
declare class SectionCollisionSolver {
|
|
1819
|
+
constructor(project: Project);
|
|
1820
|
+
solveOverlaps(grownSection: Section, visited: Set<string> = new Set()): void;
|
|
1821
|
+
updateAncestorsAfterShift(entity: Entity, visited: Set<string>): void;
|
|
1822
|
+
getSiblingsSections(section: Section): Section[];
|
|
1823
|
+
computePushDelta(grownRect: Rectangle, siblingRect: Rectangle): Vector;
|
|
1824
|
+
rawShiftEntityTree(entity: Entity, delta: Vector): void;
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
declare class SectionInOutManager {
|
|
1828
|
+
constructor(project: Project);
|
|
1829
|
+
goInSection(entities: Entity[], section: Section);
|
|
1830
|
+
goInSections(entities: Entity[], sections: Section[]);
|
|
1831
|
+
goOutSection(entities: Entity[], section: Section);
|
|
1832
|
+
entityDropParent(entity: Entity);
|
|
1833
|
+
sectionDropChild(section: Section, entity: Entity);
|
|
1834
|
+
convertSectionToTextNode(section: Section);
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
declare class SectionMethods {
|
|
1838
|
+
constructor(project: Project);
|
|
1839
|
+
getFatherSections(entity: Entity): Section[];
|
|
1840
|
+
isObjectBeLockedBySection(object: StageObject): boolean;
|
|
1841
|
+
getFatherSectionsList(entity: Entity): Section[];
|
|
1842
|
+
getSectionsByInnerLocation(location: Vector): Section[];
|
|
1843
|
+
deeperSections(sections: Section[]): Section[];
|
|
1844
|
+
shallowerSection(sections: Section[]): Section[];
|
|
1845
|
+
shallowerNotSectionEntities(entities: Entity[]): Entity[];
|
|
1846
|
+
isEntityInSection(entity: Entity, section: Section): boolean;
|
|
1847
|
+
isEntityInSection_fake(entity: Entity, section: Section): boolean;
|
|
1848
|
+
_isEntityInSection(entity: Entity, section: Section, deep = 0): boolean;
|
|
1849
|
+
isTreePack(rootNode: Section);
|
|
1850
|
+
getSectionMaxDeep(section: Section): number;
|
|
1851
|
+
getAllEntitiesInSelectedSectionsOrEntities(selectedEntities: Entity[]): Entity[];
|
|
1852
|
+
getSortedSectionsByZ(sections: Section[]): Section[];
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
declare class SectionPackManager {
|
|
1856
|
+
constructor(project: Project);
|
|
1857
|
+
packSection(): void;
|
|
1858
|
+
modifyHiddenDfs(section: Section, isCollapsed: boolean);
|
|
1859
|
+
unpackSection(): void;
|
|
1860
|
+
switchCollapse(): void;
|
|
1861
|
+
textNodeToSection(): void;
|
|
1862
|
+
textNodeTreeToSection(rootNode: TextNode): void;
|
|
1863
|
+
textNodeTreeToSectionNoDeep(rootNode: TextNode): void;
|
|
1864
|
+
targetTextNodeToSection(textNode: TextNode, ignoreEdges: boolean = false, addConnectPoints: boolean = false): Section;
|
|
1865
|
+
unpackSelectedSections();
|
|
1866
|
+
unpackSections(entities: Entity[]);
|
|
1867
|
+
packEntityToSection(addEntities: Entity[]);
|
|
1868
|
+
createSectionFromSelectionRectangle(): void;
|
|
1869
|
+
packSelectedEntitiesToSection(): void;
|
|
1870
|
+
getSmartSectionTitle(addEntities: Entity[]): string;
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1873
|
+
declare class SectionRenderer {
|
|
1874
|
+
constructor(project: Project);
|
|
1875
|
+
renderCollapsed(section: Section);
|
|
1876
|
+
renderNoCollapse(section: Section);
|
|
1877
|
+
renderBackgroundColor(section: Section);
|
|
1878
|
+
renderBigCoveredTitle(section: Section);
|
|
1879
|
+
renderTopTitle(section: Section);
|
|
1880
|
+
render(section: Section): void;
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
declare class SelectChangeEngine {
|
|
1884
|
+
lastSelectNodeByKeyboardUUID;
|
|
1885
|
+
constructor(project: Project);
|
|
1886
|
+
selectUp(addSelect = false);
|
|
1887
|
+
selectDown(addSelect = false);
|
|
1888
|
+
selectLeft(addSelect = false);
|
|
1889
|
+
selectRight(addSelect = false);
|
|
1890
|
+
navigateInDirection(selectedNode: ConnectableEntity, direction: Direction): ConnectableEntity | null;
|
|
1891
|
+
getSameLevelCandidates(parentSection: Section, excludeNode: ConnectableEntity): ConnectableEntity[];
|
|
1892
|
+
getTopLevelCandidates(excludeNode: ConnectableEntity): ConnectableEntity[];
|
|
1893
|
+
expandSelect(isKeepExpand = false, reversed: boolean = false);
|
|
1894
|
+
afterSelect(selectedNodeRect: ConnectableEntity, newSelectedConnectableEntity: ConnectableEntity | null, clearOldSelect = true);
|
|
1895
|
+
getCurrentSelectedNode(): ConnectableEntity | null;
|
|
1896
|
+
addEffect(selectedNodeRect: Rectangle, newSelectNodeRect: Rectangle);
|
|
1897
|
+
getMostNearConnectableEntity(nodes: ConnectableEntity[], location: Vector): ConnectableEntity | null;
|
|
1898
|
+
selectMostNearLocationNode(location: Vector): ConnectableEntity | null;
|
|
1899
|
+
collectNodesInStrip(node: ConnectableEntity, direction: Direction, candidates: ConnectableEntity[]): ConnectableEntity[];
|
|
1900
|
+
getMostNearInStripByDh(nodes: ConnectableEntity[], nodeRect: Rectangle, direction: Direction): ConnectableEntity | null;
|
|
1901
|
+
collectFanNodes(node: ConnectableEntity, direction: Direction, candidates: ConnectableEntity[]): ConnectableEntity[];
|
|
1902
|
+
collectTopNodes(node: ConnectableEntity, candidates?: ConnectableEntity[]): ConnectableEntity[];
|
|
1903
|
+
collectBottomNodes(node: ConnectableEntity, candidates?: ConnectableEntity[]): ConnectableEntity[];
|
|
1904
|
+
collectLeftNodes(node: ConnectableEntity, candidates?: ConnectableEntity[]): ConnectableEntity[];
|
|
1905
|
+
collectRightNodes(node: ConnectableEntity, candidates?: ConnectableEntity[]): ConnectableEntity[];
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
declare namespace Serialized {
|
|
1909
|
+
declare type Vector = [number, number];
|
|
1910
|
+
declare type Color = [number, number, number, number];
|
|
1911
|
+
declare type StageObject = {
|
|
1912
|
+
uuid: string;
|
|
1913
|
+
type: string;
|
|
1914
|
+
};
|
|
1915
|
+
declare type Entity = StageObject & {
|
|
1916
|
+
location: Vector;
|
|
1917
|
+
details: string;
|
|
1918
|
+
};
|
|
1919
|
+
declare type TextNodeSizeAdjust = "auto" | "manual";
|
|
1920
|
+
declare type TextNode = Entity & {
|
|
1921
|
+
type: "core:text_node";
|
|
1922
|
+
size: Vector;
|
|
1923
|
+
text: string;
|
|
1924
|
+
color: Color;
|
|
1925
|
+
sizeAdjust: TextNodeSizeAdjust;
|
|
1926
|
+
};
|
|
1927
|
+
function isTextNode(obj: StageObject): obj is TextNode;
|
|
1928
|
+
declare type Section = Entity & {
|
|
1929
|
+
type: "core:section";
|
|
1930
|
+
size: Vector;
|
|
1931
|
+
text: string;
|
|
1932
|
+
color: Color;
|
|
1933
|
+
|
|
1934
|
+
children: string[]; // uuid[]
|
|
1935
|
+
isHidden: boolean;
|
|
1936
|
+
isCollapsed: boolean;
|
|
1937
|
+
};
|
|
1938
|
+
function isSection(obj: StageObject): obj is Section;
|
|
1939
|
+
declare type ConnectPoint = Entity & {
|
|
1940
|
+
type: "core:connect_point";
|
|
1941
|
+
};
|
|
1942
|
+
function isConnectPoint(obj: StageObject): obj is ConnectPoint;
|
|
1943
|
+
declare type ImageNode = Entity & {
|
|
1944
|
+
path: string;
|
|
1945
|
+
size: Vector;
|
|
1946
|
+
scale: number;
|
|
1947
|
+
type: "core:image_node";
|
|
1948
|
+
};
|
|
1949
|
+
function isImageNode(obj: StageObject): obj is ImageNode;
|
|
1950
|
+
declare type UrlNode = Entity & {
|
|
1951
|
+
url: string;
|
|
1952
|
+
title: string;
|
|
1953
|
+
size: Vector;
|
|
1954
|
+
color: Color;
|
|
1955
|
+
type: "core:url_node";
|
|
1956
|
+
};
|
|
1957
|
+
function isUrlNode(obj: StageObject): obj is UrlNode;
|
|
1958
|
+
declare type PortalNode = Entity & {
|
|
1959
|
+
// 连接的文件
|
|
1960
|
+
portalFilePath: string;
|
|
1961
|
+
targetLocation: Vector;
|
|
1962
|
+
cameraScale: number;
|
|
1963
|
+
// 显示的可更改标题
|
|
1964
|
+
title: string;
|
|
1965
|
+
// 传送门的大小
|
|
1966
|
+
size: Vector;
|
|
1967
|
+
// 颜色
|
|
1968
|
+
color: Color;
|
|
1969
|
+
type: "core:portal_node";
|
|
1970
|
+
};
|
|
1971
|
+
function isPortalNode(obj: StageObject): obj is PortalNode;
|
|
1972
|
+
declare type PenStroke = Entity & {
|
|
1973
|
+
type: "core:pen_stroke";
|
|
1974
|
+
content: string;
|
|
1975
|
+
color: Color;
|
|
1976
|
+
};
|
|
1977
|
+
function isPenStroke(obj: StageObject): obj is PenStroke;
|
|
1978
|
+
declare type SvgNode = Entity & {
|
|
1979
|
+
type: "core:svg_node";
|
|
1980
|
+
content: string;
|
|
1981
|
+
size: Vector;
|
|
1982
|
+
color: Color;
|
|
1983
|
+
scale: number;
|
|
1984
|
+
};
|
|
1985
|
+
function isSvgNode(obj: StageObject): obj is SvgNode;
|
|
1986
|
+
declare type Association = StageObject & {
|
|
1987
|
+
text: string;
|
|
1988
|
+
color: Color;
|
|
1989
|
+
};
|
|
1990
|
+
declare type UndirectedEdgeArrowType = "inner" | "outer" | "none";
|
|
1991
|
+
declare type MultiTargetUndirectedEdgeRenderType = "line" | "convex";
|
|
1992
|
+
declare type MultiTargetUndirectedEdge = Association & {
|
|
1993
|
+
type: "core:multi_target_undirected_edge";
|
|
1994
|
+
targets: string[];
|
|
1995
|
+
arrow: UndirectedEdgeArrowType;
|
|
1996
|
+
rectRates: [number, number][]; // 默认中心 0.5, 0.5
|
|
1997
|
+
centerRate: [number, number]; // 默认中心 0.5, 0.5
|
|
1998
|
+
padding: number;
|
|
1999
|
+
renderType: MultiTargetUndirectedEdgeRenderType;
|
|
2000
|
+
};
|
|
2001
|
+
function isMultiTargetUndirectedEdge(obj: StageObject): obj is MultiTargetUndirectedEdge;
|
|
2002
|
+
declare type Edge = Association & {
|
|
2003
|
+
source: string;
|
|
2004
|
+
target: string;
|
|
2005
|
+
sourceRectRate: [number, number]; // 默认中心 0.5, 0.5
|
|
2006
|
+
targetRectRate: [number, number]; // 默认中心 0.5, 0.5
|
|
2007
|
+
};
|
|
2008
|
+
function isEdge(obj: StageObject): obj is Edge;
|
|
2009
|
+
declare type LineEdge = Edge & {
|
|
2010
|
+
type: "core:line_edge";
|
|
2011
|
+
color: Color;
|
|
2012
|
+
text: string;
|
|
2013
|
+
};
|
|
2014
|
+
function isLineEdge(obj: StageObject): obj is LineEdge;
|
|
2015
|
+
function isCubicCatmullRomSplineEdge(obj: StageObject): obj is CubicCatmullRomSplineEdge;
|
|
2016
|
+
declare type CubicCatmullRomSplineEdge = Edge & {
|
|
2017
|
+
type: "core:cublic_catmull_rom_spline_edge";
|
|
2018
|
+
text: string;
|
|
2019
|
+
controlPoints: Vector[];
|
|
2020
|
+
alpha: number;
|
|
2021
|
+
tension: number;
|
|
2022
|
+
};
|
|
2023
|
+
declare type CoreEntity = TextNode | Section | ConnectPoint | ImageNode | UrlNode | PenStroke | PortalNode | SvgNode;
|
|
2024
|
+
function isCoreEntity(obj: StageObject): obj is CoreEntity;
|
|
2025
|
+
declare type CoreAssociation = LineEdge | CubicCatmullRomSplineEdge | MultiTargetUndirectedEdge;
|
|
2026
|
+
declare type File = {
|
|
2027
|
+
version: typeof Project.latestVersion;
|
|
2028
|
+
entities: CoreEntity[];
|
|
2029
|
+
associations: CoreAssociation[];
|
|
2030
|
+
tags: string[];
|
|
2031
|
+
};
|
|
2032
|
+
}
|
|
2033
|
+
|
|
2034
|
+
declare interface Service {
|
|
2035
|
+
tick(): void;
|
|
2036
|
+
dispose(): void | Promise<void>;
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2039
|
+
declare type Settings = z.infer<typeof settingsSchema>;
|
|
2040
|
+
|
|
2041
|
+
declare class ShapeRenderer {
|
|
2042
|
+
constructor(project: Project);
|
|
2043
|
+
renderCircle(centerLocation: Vector, radius: number, color: Color, strokeColor: Color, strokeWidth: number): void;
|
|
2044
|
+
renderArc(centerLocation: Vector, radius: number, angle1: number, angle2: number, strokeColor: Color, strokeWidth: number): void;
|
|
2045
|
+
renderRectFromCenter(centerLocation: Vector, width: number, height: number, color: Color, strokeColor: Color, strokeWidth: number, radius: number = 0): void;
|
|
2046
|
+
renderRect(rect: Rectangle, color: Color, strokeColor: Color, strokeWidth: number, radius: number = 0);
|
|
2047
|
+
renderDashedRect(rect: Rectangle, color: Color, strokeColor: Color, strokeWidth: number, radius: number = 0, dashLength = 5);
|
|
2048
|
+
renderRectWithShadow(rect: Rectangle, fillColor: Color, strokeColor: Color, strokeWidth: number, shadowColor: Color, shadowBlur: number, shadowOffsetX: number = 0, shadowOffsetY: number = 0, radius: number = 0);
|
|
2049
|
+
renderPolygonAndFill(points: Vector[], fillColor: Color, strokeColor: Color, strokeWidth: number, lineJoin: "round" | "bevel" = "round"): void;
|
|
2050
|
+
renderTriangleFromCenter(centerLocation: Vector, size: number, rotation: number, fillColor: Color, strokeColor: Color, strokeWidth: number): void;
|
|
2051
|
+
renderSquareFromCenter(centerLocation: Vector, size: number, rotation: number, fillColor: Color, strokeColor: Color, strokeWidth: number): void;
|
|
2052
|
+
renderCircleTransition(viewLocation: Vector, radius: number, centerColor: Color);
|
|
2053
|
+
renderCameraShapeBorder(rect: Rectangle, borderColor: Color, borderWidth: number);
|
|
2054
|
+
renderResizeArrow(rect: Rectangle, color: Color, strokeWidth: number);
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
declare class StageExport {
|
|
2058
|
+
plainTextExporter: PlainTextExporter;
|
|
2059
|
+
markdownExporter: MarkdownExporter;
|
|
2060
|
+
tabExporter: TabExporter;
|
|
2061
|
+
mermaidExporter: MermaidExporter;
|
|
2062
|
+
constructor(project: Project);
|
|
2063
|
+
getPlainTextByEntities(nodes: Entity[]);
|
|
2064
|
+
getMarkdownStringByTextNode(textNode: TextNode);
|
|
2065
|
+
getTabStringByTextNode(textNode: TextNode);
|
|
2066
|
+
getMermaidTextByEntities(entities: Entity[]): string;
|
|
2067
|
+
}
|
|
2068
|
+
|
|
2069
|
+
declare class StageExportPng {
|
|
2070
|
+
constructor(project: Project);
|
|
2071
|
+
exportStage_(emitter: EventEmitter<EventMap>, signal: AbortSignal, sleepTime: number);
|
|
2072
|
+
exportStage(signal: AbortSignal, sleepTime: number = 2);
|
|
2073
|
+
generateCanvasNode(): HTMLCanvasElement;
|
|
2074
|
+
}
|
|
2075
|
+
|
|
2076
|
+
declare class StageExportSvg {
|
|
2077
|
+
constructor(project: Project);
|
|
2078
|
+
svgConfig: SvgExportConfig;
|
|
2079
|
+
exportContext: {
|
|
2080
|
+
outputDir: string;
|
|
2081
|
+
imageMap: Map<string, string>; // attachmentId -> relative file path
|
|
2082
|
+
} | null;
|
|
2083
|
+
setConfig(config: SvgExportConfig);
|
|
2084
|
+
dumpNode(node: TextNode);
|
|
2085
|
+
dumpSection(section: Section);
|
|
2086
|
+
dumpSectionBase(section: Section);
|
|
2087
|
+
dumpEdge(edge: LineEdge): React.ReactNode;
|
|
2088
|
+
dumpEntityDetails(entity: Entity): React.ReactNode;
|
|
2089
|
+
getEntityDetailsDataAttribute(entity: Entity): string | undefined;
|
|
2090
|
+
dumpUrlNode(node: UrlNode);
|
|
2091
|
+
dumpImageNode(node: ImageNode, svgConfigObject: SvgExportConfig);
|
|
2092
|
+
getEntitiesOuterRectangle(entities: Entity[], padding: number): Rectangle;
|
|
2093
|
+
dumpSelected(): React.ReactNode;
|
|
2094
|
+
dumpStage(): React.ReactNode;
|
|
2095
|
+
dumpStageToSVGString(): string;
|
|
2096
|
+
dumpSelectedToSVGString(): string;
|
|
2097
|
+
exportStageToSVGFile(filePath: string): Promise<void>;
|
|
2098
|
+
exportSelectedToSVGFile(filePath: string): Promise<void>;
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2101
|
+
declare class StageImport {
|
|
2102
|
+
graphImporter: GraphImporter;
|
|
2103
|
+
treeImporter: TreeImporter;
|
|
2104
|
+
mermaidImporter: MermaidImporter;
|
|
2105
|
+
markdownImporter: MarkdownImporter;
|
|
2106
|
+
constructor(project: Project);
|
|
2107
|
+
addNodeGraphByText(text: string, diffLocation: Vector = Vector.getZero());
|
|
2108
|
+
addNodeTreeByText(text: string, indention: number, diffLocation: Vector = Vector.getZero());
|
|
2109
|
+
addNodeTreeByTextFromNode(uuid: string, text: string, indention: number): { success: boolean; error?: string; nodeCount?: number };
|
|
2110
|
+
addNodeMermaidByText(text: string, diffLocation: Vector = Vector.getZero());
|
|
2111
|
+
addNodeByMarkdown(markdownText: string, diffLocation: Vector = Vector.getZero(), autoLayout = true);
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
declare class StageManager {
|
|
2115
|
+
constructor(project: Project);
|
|
2116
|
+
get(uuid: string);
|
|
2117
|
+
isEmpty(): boolean;
|
|
2118
|
+
getTextNodes(): TextNode[];
|
|
2119
|
+
getConnectableEntity(): ConnectableEntity[];
|
|
2120
|
+
isEntityExists(uuid: string): boolean;
|
|
2121
|
+
getSections(): Section[];
|
|
2122
|
+
getImageNodes(): ImageNode[];
|
|
2123
|
+
getConnectPoints(): ConnectPoint[];
|
|
2124
|
+
getUrlNodes(): UrlNode[];
|
|
2125
|
+
getPenStrokes(): PenStroke[];
|
|
2126
|
+
getSvgNodes(): SvgNode[];
|
|
2127
|
+
getLatexNodes(): LatexNode[];
|
|
2128
|
+
getStageObjects(): StageObject[];
|
|
2129
|
+
getEntities(): Entity[];
|
|
2130
|
+
getEntitiesByUUIDs(uuids: string[]): Entity[];
|
|
2131
|
+
isNoEntity(): boolean;
|
|
2132
|
+
delete(stageObject: StageObject);
|
|
2133
|
+
getAssociations(): Association[];
|
|
2134
|
+
getEdges(): Edge[];
|
|
2135
|
+
getLineEdges(): LineEdge[];
|
|
2136
|
+
getCrEdges(): CubicCatmullRomSplineEdge[];
|
|
2137
|
+
add(stageObject: StageObject);
|
|
2138
|
+
updateReferences();
|
|
2139
|
+
getTextNodeByUUID(uuid: string): TextNode | null;
|
|
2140
|
+
getConnectableEntityByUUID(uuid: string): ConnectableEntity | null;
|
|
2141
|
+
isSectionByUUID(uuid: string): boolean;
|
|
2142
|
+
getSectionByUUID(uuid: string): Section | null;
|
|
2143
|
+
getCenter(): Vector;
|
|
2144
|
+
getSize(): Vector;
|
|
2145
|
+
getBoundingRectangle(): Rectangle;
|
|
2146
|
+
findTextNodeByLocation(location: Vector): TextNode | null;
|
|
2147
|
+
findLineEdgeByLocation(location: Vector): LineEdge | null;
|
|
2148
|
+
findAssociationByLocation(location: Vector): Association | null;
|
|
2149
|
+
findSectionByLocation(location: Vector): Section | null;
|
|
2150
|
+
findImageNodeByLocation(location: Vector): ImageNode | null;
|
|
2151
|
+
findConnectableEntityByLocation(location: Vector): ConnectableEntity | null;
|
|
2152
|
+
findEntityByLocation(location: Vector): Entity | null;
|
|
2153
|
+
findConnectPointByLocation(location: Vector): ConnectPoint | null;
|
|
2154
|
+
isHaveEntitySelected(): boolean;
|
|
2155
|
+
getSelectedEntities(): Entity[];
|
|
2156
|
+
getSelectedAssociations(): Association[];
|
|
2157
|
+
getSelectedStageObjects(): StageObject[];
|
|
2158
|
+
getBoundingBoxOfSelected(): Rectangle;
|
|
2159
|
+
isEntityOnLocation(location: Vector): boolean;
|
|
2160
|
+
isAssociationOnLocation(location: Vector): boolean;
|
|
2161
|
+
deleteEntities(deleteNodes: Entity[]);
|
|
2162
|
+
deleteSelectedStageObjects();
|
|
2163
|
+
deleteAssociation(deleteAssociation: Association): boolean;
|
|
2164
|
+
deleteEdge(deleteEdge: Edge): boolean;
|
|
2165
|
+
w;
|
|
2166
|
+
connectEntity(fromNode: ConnectableEntity, toNode: ConnectableEntity, isCrEdge: boolean = false);
|
|
2167
|
+
connectMultipleEntities(fromNodes: ConnectableEntity[], toNode: ConnectableEntity, isCrEdge: boolean = false, sourceRectRate?: [number, number], targetRectRate?: [number, number]);
|
|
2168
|
+
reverseNodeEdges(connectEntity: ConnectableEntity);
|
|
2169
|
+
reverseSelectedNodeEdge();
|
|
2170
|
+
reverseSelectedEdges();
|
|
2171
|
+
generateNodeTreeByText(text: string, indention: number = 4, location = this.project.camera.location);
|
|
2172
|
+
generateNodeGraphByText(text: string, location = this.project.camera.location);
|
|
2173
|
+
generateNodeMermaidByText(text: string, location = this.project.camera.location);
|
|
2174
|
+
generateNodeByMarkdown(text: string, location = this.project.camera.location, autoLayout = true);
|
|
2175
|
+
packEntityToSection(addEntities: Entity[]);
|
|
2176
|
+
packEntityToSectionBySelected();
|
|
2177
|
+
goInSection(entities: Entity[], section: Section);
|
|
2178
|
+
goOutSection(entities: Entity[], section: Section);
|
|
2179
|
+
packSelectedSection();
|
|
2180
|
+
unpackSelectedSection();
|
|
2181
|
+
sectionSwitchCollapse();
|
|
2182
|
+
connectEntityByCrEdge(fromNode: ConnectableEntity, toNode: ConnectableEntity);
|
|
2183
|
+
refreshAllStageObjects();
|
|
2184
|
+
refreshSelected();
|
|
2185
|
+
changeSelectedEdgeConnectLocation(direction: Direction | null, isSource: boolean = false);
|
|
2186
|
+
changeEdgesConnectLocation(edges: Edge[], direction: Direction | null, isSource: boolean = false);
|
|
2187
|
+
switchLineEdgeToCrEdge();
|
|
2188
|
+
switchEdgeToUndirectedEdge();
|
|
2189
|
+
switchUndirectedEdgeToEdge();
|
|
2190
|
+
addSelectedCREdgeControlPoint();
|
|
2191
|
+
addSelectedCREdgeTension();
|
|
2192
|
+
reduceSelectedCREdgeTension();
|
|
2193
|
+
setSelectedEdgeLineType(lineType: string);
|
|
2194
|
+
selectAll();
|
|
2195
|
+
clearSelectAll();
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
declare class StageNodeRotate {
|
|
2199
|
+
constructor(project: Project);
|
|
2200
|
+
moveEdges(lastMoveLocation: Vector, diffLocation: Vector);
|
|
2201
|
+
rotateNodeDfs(rotateCenterNode: ConnectableEntity, currentNode: ConnectableEntity, degrees: number, visitedUUIDs: string[]): void;
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2204
|
+
declare class StageObject {
|
|
2205
|
+
project: Project;
|
|
2206
|
+
uuid: string;
|
|
2207
|
+
collisionBox: CollisionBox;
|
|
2208
|
+
get isPhysical(): boolean;
|
|
2209
|
+
_isSelected: boolean;
|
|
2210
|
+
get isSelected(): boolean;
|
|
2211
|
+
set isSelected(value: boolean);
|
|
2212
|
+
_isSyncing: boolean;
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2215
|
+
declare class StageObjectColorManager {
|
|
2216
|
+
constructor(project: Project);
|
|
2217
|
+
setSelectedStageObjectColor(color: Color);
|
|
2218
|
+
darkenNodeColor();
|
|
2219
|
+
lightenNodeColor();
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2222
|
+
declare class StageObjectSelectCounter {
|
|
2223
|
+
constructor(project: Project);
|
|
2224
|
+
selectedStageObjectCount;
|
|
2225
|
+
selectedEntityCount;
|
|
2226
|
+
selectedAssociationCount;
|
|
2227
|
+
selectedEdgeCount;
|
|
2228
|
+
selectedCREdgeCount;
|
|
2229
|
+
selectedImageNodeCount;
|
|
2230
|
+
selectedTextNodeCount;
|
|
2231
|
+
selectedSectionCount;
|
|
2232
|
+
selectedMultiTargetUndirectedEdgeCount;
|
|
2233
|
+
lastUpdateTimestamp;
|
|
2234
|
+
update();
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2237
|
+
declare class StageStyleManager {
|
|
2238
|
+
currentStyle;
|
|
2239
|
+
constructor();
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
declare class StageSyncAssociationManager {
|
|
2243
|
+
constructor(project: Project);
|
|
2244
|
+
createTwinsFromSelectedEntities(): void;
|
|
2245
|
+
getSyncAssociations(): SyncAssociation[];
|
|
2246
|
+
getSyncAssociationsByMember(member: StageObject): SyncAssociation[];
|
|
2247
|
+
getSyncSiblings(member: StageObject): StageObject[];
|
|
2248
|
+
createTwinTextNode(source: TextNode): TextNode;
|
|
2249
|
+
syncFrom(source: StageObject, key: SyncableKey, syncingSet: Set<string> = new Set()): void;
|
|
2250
|
+
onStageObjectDeleted(deleted: StageObject): void;
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
declare class StageUtils {
|
|
2254
|
+
constructor(project: Project);
|
|
2255
|
+
replaceAutoNameWithoutStage(template: string): string;
|
|
2256
|
+
replaceAutoNameTemplate(currentName: string, targetStageObject: StageObject): string;
|
|
2257
|
+
isNameConflictWithTextNodes(name: string): boolean;
|
|
2258
|
+
isNameConflictWithSections(name: string): boolean;
|
|
2259
|
+
}
|
|
2260
|
+
|
|
2261
|
+
declare class StraightEdgeRenderer extends EdgeRendererClass {
|
|
2262
|
+
constructor(project: Project);
|
|
2263
|
+
getCuttingEffects(edge: LineEdge): Effect[];
|
|
2264
|
+
getConnectedEffects(startNode: ConnectableEntity, toNode: ConnectableEntity, sourceRectangleRate?: Vector, targetRectangleRate?: Vector): Effect[];
|
|
2265
|
+
renderLine(start: Vector, end: Vector, edge: LineEdge, width: number): void;
|
|
2266
|
+
renderNormalState(edge: LineEdge): void;
|
|
2267
|
+
getNormalStageSvg(edge: LineEdge): React.ReactNode;
|
|
2268
|
+
getCycleStageSvg(): React.ReactNode;
|
|
2269
|
+
getShiftingStageSvg(): React.ReactNode;
|
|
2270
|
+
renderArrowHead(edge: LineEdge, direction: Vector, endPoint = edge.bodyLine.end.clone(), size = 15);
|
|
2271
|
+
shouldRenderTargetArrow(edge: LineEdge): boolean;
|
|
2272
|
+
renderShiftingState(edge: LineEdge): void;
|
|
2273
|
+
renderCycleState(edge: LineEdge): void;
|
|
2274
|
+
renderVirtualEdge(startNode: ConnectableEntity, mouseLocation: Vector, sourceRectangleRate?: Vector): void;
|
|
2275
|
+
renderVirtualConfirmedEdge(startNode: ConnectableEntity, endNode: ConnectableEntity, sourceRectangleRate?: Vector, targetRectangleRate?: Vector): void;
|
|
2276
|
+
}
|
|
2277
|
+
|
|
2278
|
+
declare class SvgNode extends ConnectableEntity implements ResizeAble {
|
|
2279
|
+
color: Color;
|
|
2280
|
+
uuid: string;
|
|
2281
|
+
scale: number;
|
|
2282
|
+
collisionBox: CollisionBox;
|
|
2283
|
+
attachmentId: string;
|
|
2284
|
+
isHiddenBySectionCollapse: boolean;
|
|
2285
|
+
originalSize: Vector;
|
|
2286
|
+
image: HTMLImageElement;
|
|
2287
|
+
constructor(project: Project, {
|
|
2288
|
+
uuid = crypto.randomUUID(),
|
|
2289
|
+
details = [],
|
|
2290
|
+
attachmentId = "",
|
|
2291
|
+
collisionBox = new CollisionBox([new Rectangle(Vector.getZero(), Vector.getZero())]),
|
|
2292
|
+
scale = 1,
|
|
2293
|
+
color = Color.Transparent,
|
|
2294
|
+
});
|
|
2295
|
+
get geometryCenter(): Vector;
|
|
2296
|
+
scaleUpdate(scaleDiff: number);
|
|
2297
|
+
move(delta: Vector): void;
|
|
2298
|
+
moveTo(location: Vector): void;
|
|
2299
|
+
changeColor(newColor: Color, mode: "fill" | "stroke" = "fill");
|
|
2300
|
+
resizeHandle(delta: Vector);
|
|
2301
|
+
getResizeHandleRect(): Rectangle;
|
|
2302
|
+
}
|
|
2303
|
+
|
|
2304
|
+
declare class SvgNodeRenderer {
|
|
2305
|
+
constructor(project: Project);
|
|
2306
|
+
render(svgNode: SvgNode);
|
|
2307
|
+
}
|
|
2308
|
+
|
|
2309
|
+
declare class SvgRenderer {
|
|
2310
|
+
svgCache: { [key: string]: HTMLImageElement };
|
|
2311
|
+
constructor(project: Project);
|
|
2312
|
+
renderSvgFromLeftTop(svg: string, location: Vector, width: number, height: number): void;
|
|
2313
|
+
renderSvgFromCenter(svg: string, centerLocation: Vector, width: number, height: number): void;
|
|
2314
|
+
renderSvgFromLeftTopWithoutSize(svg: string, location: Vector, scaleNumber = 1): void;
|
|
2315
|
+
renderSvgFromCenterWithoutSize(svg: string, centerLocation: Vector): void;
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
declare class SymmetryCurveEdgeRenderer extends EdgeRendererClass {
|
|
2319
|
+
constructor(project: Project);
|
|
2320
|
+
shouldRenderTargetArrow(edge: LineEdge): boolean;
|
|
2321
|
+
getCuttingEffects(edge: LineEdge): Effect[];
|
|
2322
|
+
getConnectedEffects(startNode: ConnectableEntity, toNode: ConnectableEntity, sourceRectangleRate?: Vector, targetRectangleRate?: Vector): Effect[];
|
|
2323
|
+
renderNormalState(edge: LineEdge): void;
|
|
2324
|
+
renderShiftingState(edge: LineEdge): void;
|
|
2325
|
+
renderCycleState(edge: LineEdge): void;
|
|
2326
|
+
getNormalStageSvg(edge: LineEdge): React.ReactNode;
|
|
2327
|
+
getCycleStageSvg(): React.ReactNode;
|
|
2328
|
+
getShiftingStageSvg(): React.ReactNode;
|
|
2329
|
+
renderVirtualEdge(startNode: ConnectableEntity, mouseLocation: Vector, sourceRectangleRate?: Vector): void;
|
|
2330
|
+
renderVirtualConfirmedEdge(startNode: ConnectableEntity, endNode: ConnectableEntity, sourceRectangleRate?: Vector, targetRectangleRate?: Vector): void;
|
|
2331
|
+
renderArrowCurve(curve: SymmetryCurve, color: Color, width = 2, edge?: LineEdge): void;
|
|
2332
|
+
renderText(curve: SymmetryCurve, edge: LineEdge): void;
|
|
2333
|
+
}
|
|
2334
|
+
|
|
2335
|
+
declare type SyncableKey = "text" | "color" | "details";
|
|
2336
|
+
|
|
2337
|
+
declare class SyncAssociation extends Association {
|
|
2338
|
+
uuid: string;
|
|
2339
|
+
keys: SyncableKey[];
|
|
2340
|
+
associationList: StageObject[];
|
|
2341
|
+
get collisionBox(): CollisionBox;
|
|
2342
|
+
get isPhysical(): boolean;
|
|
2343
|
+
_isSelected: boolean;
|
|
2344
|
+
get isSelected(): boolean;
|
|
2345
|
+
set isSelected(value: boolean);
|
|
2346
|
+
constructor(project: Project, {
|
|
2347
|
+
uuid = crypto.randomUUID() as string,
|
|
2348
|
+
keys = ["text", "color", "details"] as SyncableKey[],
|
|
2349
|
+
associationList = [] as StageObject[],
|
|
2350
|
+
color = Color.Transparent,
|
|
2351
|
+
}: {
|
|
2352
|
+
uuid?: string;
|
|
2353
|
+
keys?: SyncableKey[];
|
|
2354
|
+
associationList?: StageObject[];
|
|
2355
|
+
color?: Color;
|
|
2356
|
+
}, unknown = false);
|
|
2357
|
+
applyFrom(source: StageObject): void;
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
declare class Tab extends React.Component<Record<string, never>, Record<string, never>> {
|
|
2361
|
+
eventEmitter;
|
|
2362
|
+
services;
|
|
2363
|
+
fileSystemProviders;
|
|
2364
|
+
tickableServices: Service[];
|
|
2365
|
+
rafHandle;
|
|
2366
|
+
getComponent(): React.ComponentType;
|
|
2367
|
+
get title(): string;
|
|
2368
|
+
get icon(): React.ComponentType<any> | null;
|
|
2369
|
+
constructor(props: Record<string, never>);
|
|
2370
|
+
registerFileSystemProvider(scheme: string, provider: { new (...args: any[]): FileSystemProvider });
|
|
2371
|
+
get fs(): FileSystemProvider;
|
|
2372
|
+
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
2373
|
+
emit(event: string | symbol, ...args: any[]): boolean;
|
|
2374
|
+
removeAllListeners(event?: string | symbol): this;
|
|
2375
|
+
loadService(service: { id?: string; new (...args: any[]): any });
|
|
2376
|
+
disposeService(serviceId: string);
|
|
2377
|
+
getService<T extends keyof this & string>(serviceId: T): this[T];
|
|
2378
|
+
init(): Promise<void>;
|
|
2379
|
+
loop();
|
|
2380
|
+
pause();
|
|
2381
|
+
tick();
|
|
2382
|
+
dispose();
|
|
2383
|
+
get isRunning(): boolean;
|
|
2384
|
+
render(): React.ReactNode;
|
|
2385
|
+
}
|
|
2386
|
+
|
|
2387
|
+
declare class TabExporter extends BaseExporter {
|
|
2388
|
+
export(textNode: TextNode): string;
|
|
2389
|
+
getTabText(node: TextNode, level: number): string;
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
declare class TagManager {
|
|
2393
|
+
constructor(project: Project);
|
|
2394
|
+
tagSet: Set<string>;
|
|
2395
|
+
reset(uuids: string[]);
|
|
2396
|
+
addTag(uuid: string);
|
|
2397
|
+
removeTag(uuid: string);
|
|
2398
|
+
hasTag(uuid: string): boolean;
|
|
2399
|
+
updateTags();
|
|
2400
|
+
moveUpTag(uuid: string);
|
|
2401
|
+
moveDownTag(uuid: string);
|
|
2402
|
+
changeTagBySelected();
|
|
2403
|
+
refreshTagNamesUI();
|
|
2404
|
+
moveCameraToTag(tagUUID: string);
|
|
2405
|
+
}
|
|
2406
|
+
|
|
2407
|
+
declare class TextNode extends ConnectableEntity implements ResizeAble {
|
|
2408
|
+
uuid: string;
|
|
2409
|
+
text: string;
|
|
2410
|
+
collisionBox: CollisionBox;
|
|
2411
|
+
color: Color;
|
|
2412
|
+
isAiGenerating: boolean;
|
|
2413
|
+
fontScaleLevel: number;
|
|
2414
|
+
enableResizeCharCount;
|
|
2415
|
+
sizeAdjust: string;
|
|
2416
|
+
_isSelected: boolean;
|
|
2417
|
+
get isSelected(): any;
|
|
2418
|
+
get rectangle(): Rectangle;
|
|
2419
|
+
get geometryCenter(): any;
|
|
2420
|
+
set isSelected(value: boolean);
|
|
2421
|
+
_isEditing: boolean;
|
|
2422
|
+
get isEditing(): any;
|
|
2423
|
+
set isEditing(value: boolean);
|
|
2424
|
+
isHiddenBySectionCollapse;
|
|
2425
|
+
constructor(project: Project, {
|
|
2426
|
+
uuid = crypto.randomUUID() as string,
|
|
2427
|
+
text = "",
|
|
2428
|
+
details = [],
|
|
2429
|
+
collisionBox = new CollisionBox([new Rectangle(Vector.getZero(), Vector.getZero())]),
|
|
2430
|
+
color = Color.Transparent,
|
|
2431
|
+
sizeAdjust = "auto",
|
|
2432
|
+
fontScaleLevel = 0,
|
|
2433
|
+
}: {
|
|
2434
|
+
uuid?: string;
|
|
2435
|
+
text?: string;
|
|
2436
|
+
details?: Value;
|
|
2437
|
+
color?: Color;
|
|
2438
|
+
sizeAdjust?: "auto" | "manual";
|
|
2439
|
+
collisionBox?: CollisionBox;
|
|
2440
|
+
fontScaleLevel?: number;
|
|
2441
|
+
}, unknown = false);
|
|
2442
|
+
fontSizeCache: number;
|
|
2443
|
+
getFontSize(): number;
|
|
2444
|
+
getPadding(): number;
|
|
2445
|
+
getBorderWidth(): number;
|
|
2446
|
+
getBorderRadius(): number;
|
|
2447
|
+
updateFontSizeCache(): void;
|
|
2448
|
+
setFontScaleLevel(level: number);
|
|
2449
|
+
increaseFontSize(anchorRate?: Vector): void;
|
|
2450
|
+
decreaseFontSize(anchorRate?: Vector): void;
|
|
2451
|
+
_adjustLocationToKeepAnchor(oldRect: Rectangle, anchorRate: Vector): void;
|
|
2452
|
+
adjustSizeByText();
|
|
2453
|
+
adjustHeightByText();
|
|
2454
|
+
forceAdjustSizeByText();
|
|
2455
|
+
rename(text: string);
|
|
2456
|
+
resizeHandle(delta: Vector);
|
|
2457
|
+
resizeWidthTo(width: number);
|
|
2458
|
+
getResizeHandleRect(): Rectangle;
|
|
2459
|
+
move(delta: Vector);
|
|
2460
|
+
collideWithOtherEntity(other: Entity): void;
|
|
2461
|
+
moveTo(location: Vector);
|
|
2462
|
+
}
|
|
2463
|
+
|
|
2464
|
+
declare class TextNodeRenderer {
|
|
2465
|
+
constructor(project: Project);
|
|
2466
|
+
renderTextNode(node: TextNode);
|
|
2467
|
+
renderKeyboardTreeHint(node: TextNode): void;
|
|
2468
|
+
renderLogicNodeWarningTrap(node: TextNode);
|
|
2469
|
+
renderTextNodeTextLayer(node: TextNode);
|
|
2470
|
+
}
|
|
2471
|
+
|
|
2472
|
+
declare class TextRenderer {
|
|
2473
|
+
cache;
|
|
2474
|
+
constructor(project: Project);
|
|
2475
|
+
hash(text: string, size: number): string;
|
|
2476
|
+
getCache(text: string, size: number);
|
|
2477
|
+
getCacheNearestSize(text: string, size: number): ImageBitmap | undefined;
|
|
2478
|
+
buildCache(text: string, size: number, color: Color): CanvasImageSource;
|
|
2479
|
+
renderText(text: string, location: Vector, size: number, color: Color = Color.White): void;
|
|
2480
|
+
renderTempText(text: string, location: Vector, size: number, color: Color = Color.White): void;
|
|
2481
|
+
renderTextFromCenter(text: string, centerLocation: Vector, size: number, color: Color = Color.White): void;
|
|
2482
|
+
renderTempTextFromCenter(text: string, centerLocation: Vector, size: number, color: Color = Color.White): void;
|
|
2483
|
+
renderTextInRectangle(text: string, rectangle: Rectangle, color: Color): void;
|
|
2484
|
+
getFontSizeByRectangleSize(text: string, rectangle: Rectangle): Vector;
|
|
2485
|
+
renderMultiLineText(text: string, location: Vector, fontSize: number, limitWidth: number, color: Color = Color.White, lineHeight: number = 1.2, limitLines: number = Infinity): void;
|
|
2486
|
+
renderTempMultiLineText(text: string, location: Vector, fontSize: number, limitWidth: number, color: Color = Color.White, lineHeight: number = 1.2, limitLines: number = Infinity): void;
|
|
2487
|
+
renderMultiLineTextFromCenterWithStroke(text: string, centerLocation: Vector, size: number, fillColor: Color, strokeColor: Color, limitWidth: number = Infinity, lineHeight: number = 1.2): void;
|
|
2488
|
+
renderMultiLineTextFromCenter(text: string, centerLocation: Vector, size: number, limitWidth: number, color: Color, lineHeight: number = 1.2, limitLines: number = Infinity): void;
|
|
2489
|
+
renderTempMultiLineTextFromCenter(text: string, centerLocation: Vector, size: number, limitWidth: number, color: Color, lineHeight: number = 1.2, limitLines: number = Infinity): void;
|
|
2490
|
+
textArrayCache: LruCache<string, string[]>;
|
|
2491
|
+
textToTextArrayWrapCache(text: string, fontSize: number, limitWidth: number): string[];
|
|
2492
|
+
textToTextArray(text: string, fontSize: number, limitWidth: number): string[];
|
|
2493
|
+
measureMultiLineTextSize(text: string, fontSize: number, limitWidth: number, lineHeight: number = 1.2): Vector;
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
declare const transformedKeys;
|
|
2497
|
+
|
|
2498
|
+
declare class TreeImporter extends BaseImporter {
|
|
2499
|
+
constructor(project: Project);
|
|
2500
|
+
import(text: string, indention: number, diffLocation: Vector = Vector.getZero()): void;
|
|
2501
|
+
importFromNode(uuid: string, text: string, indention: number): { success: boolean; error?: string; nodeCount?: number };
|
|
2502
|
+
getIndentLevel(line: string, indention: number): number;
|
|
2503
|
+
}
|
|
2504
|
+
|
|
2505
|
+
declare interface UIKeyBind {
|
|
2506
|
+
id: string;
|
|
2507
|
+
key: string;
|
|
2508
|
+
isEnabled: boolean;
|
|
2509
|
+
onPress: (project?: Project) => void;
|
|
2510
|
+
when: KeyBindWhen;
|
|
2511
|
+
icon?: KeyBindIcon;
|
|
2512
|
+
isContinuous?: boolean;
|
|
2513
|
+
onRelease?: (project?: Project) => void;
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2516
|
+
declare class UrlNode extends ConnectableEntity {
|
|
2517
|
+
uuid: string;
|
|
2518
|
+
title: string;
|
|
2519
|
+
url: string;
|
|
2520
|
+
color: Color;
|
|
2521
|
+
collisionBox: CollisionBox;
|
|
2522
|
+
width: number;
|
|
2523
|
+
height: number;
|
|
2524
|
+
titleHeight: number;
|
|
2525
|
+
_isEditingTitle: boolean;
|
|
2526
|
+
isMouseHoverTitle: boolean;
|
|
2527
|
+
isMouseHoverUrl: boolean;
|
|
2528
|
+
get isEditingTitle(): any;
|
|
2529
|
+
set isEditingTitle(value: boolean);
|
|
2530
|
+
get geometryCenter(): Vector;
|
|
2531
|
+
get titleRectangle(): Rectangle;
|
|
2532
|
+
get urlRectangle(): Rectangle;
|
|
2533
|
+
get rectangle(): Rectangle;
|
|
2534
|
+
move(delta: Vector): void;
|
|
2535
|
+
moveTo(location: Vector): void;
|
|
2536
|
+
isHiddenBySectionCollapse: boolean;
|
|
2537
|
+
constructor(project: Project, {
|
|
2538
|
+
uuid = crypto.randomUUID() as string,
|
|
2539
|
+
title = "",
|
|
2540
|
+
details = [],
|
|
2541
|
+
url = "",
|
|
2542
|
+
collisionBox = new CollisionBox([new Rectangle(Vector.getZero(), new Vector(UrlNode.width, UrlNode.height))]),
|
|
2543
|
+
color = Color.Transparent,
|
|
2544
|
+
});
|
|
2545
|
+
rename(title: string): void;
|
|
2546
|
+
adjustSizeByText();
|
|
2547
|
+
}
|
|
2548
|
+
|
|
2549
|
+
declare class UrlNodeRenderer {
|
|
2550
|
+
constructor(project: Project);
|
|
2551
|
+
render(urlNode: UrlNode): void;
|
|
2552
|
+
renderHoverState(urlNode: UrlNode): void;
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
declare class VerticalPolyEdgeRenderer extends EdgeRendererClass {
|
|
2556
|
+
constructor(project: Project);
|
|
2557
|
+
getCuttingEffects(edge: LineEdge): Effect[];
|
|
2558
|
+
getConnectedEffects(startNode: ConnectableEntity, toNode: ConnectableEntity, sourceRectangleRate?: Vector, targetRectangleRate?: Vector): Effect[];
|
|
2559
|
+
getVerticalDirection(edge: LineEdge): Vector;
|
|
2560
|
+
fixedLength: number;
|
|
2561
|
+
renderTest(edge: LineEdge);
|
|
2562
|
+
gaussianFunction(x: number);
|
|
2563
|
+
renderNormalState(edge: LineEdge): void;
|
|
2564
|
+
renderShiftingState(edge: LineEdge): void;
|
|
2565
|
+
shouldRenderTargetArrow(edge: LineEdge): boolean;
|
|
2566
|
+
renderArrowHead(edge: LineEdge, direction: Vector, endPoint = edge.bodyLine.end.clone());
|
|
2567
|
+
renderCycleState(edge: LineEdge): void;
|
|
2568
|
+
getNormalStageSvg(edge: LineEdge): React.ReactNode;
|
|
2569
|
+
getCycleStageSvg(): React.ReactNode;
|
|
2570
|
+
getShiftingStageSvg(): React.ReactNode;
|
|
2571
|
+
renderVirtualEdge(startNode: ConnectableEntity, mouseLocation: Vector, sourceRectangleRate?: Vector): void;
|
|
2572
|
+
renderVirtualConfirmedEdge(startNode: ConnectableEntity, endNode: ConnectableEntity, sourceRectangleRate?: Vector, targetRectangleRate?: Vector): void;
|
|
2573
|
+
}
|
|
2574
|
+
|
|
2575
|
+
declare class WorldRenderUtils {
|
|
2576
|
+
constructor(project: Project);
|
|
2577
|
+
renderCubicCatmullRomSpline(spline: CubicCatmullRomSpline, color: Color, width: number): void;
|
|
2578
|
+
renderBezierCurve(curve: CubicBezierCurve, color: Color, width: number): void;
|
|
2579
|
+
renderSymmetryCurve(curve: SymmetryCurve, color: Color, width: number): void;
|
|
2580
|
+
renderDashedSymmetryCurve(curve: SymmetryCurve, color: Color, width: number, dashLength: number): void;
|
|
2581
|
+
renderDoubleSymmetryCurve(curve: SymmetryCurve, color: Color, width: number, gap: number): void;
|
|
2582
|
+
renderLaser(start: Vector, end: Vector, width: number, color: Color): void;
|
|
2583
|
+
renderPrismaticBlock(centerLocation: Vector, radius: number, color: Color, strokeColor: Color, strokeWidth: number): void;
|
|
2584
|
+
renderRectangleFlash(rectangle: Rectangle, shadowColor: Color, shadowBlur: number, roundedRadius = 0);
|
|
2585
|
+
renderCuttingFlash(start: Vector, end: Vector, width: number, shadowColor: Color): void;
|
|
2586
|
+
}
|
|
2587
|
+
|
|
2588
|
+
// ── Asyncify: 递归包裹所有属性和方法返回值为 Promise ──
|
|
2589
|
+
// 用于模拟 Comlink 代理的行为,所有值访问都是异步的
|
|
2590
|
+
type Asyncify<T> =
|
|
2591
|
+
T extends null | undefined | void | never
|
|
2592
|
+
? T
|
|
2593
|
+
: T extends (...args: infer A) => infer R
|
|
2594
|
+
? (...args: A) => Promise<Asyncify<Awaited<R>>>
|
|
2595
|
+
: T extends Promise<unknown>
|
|
2596
|
+
? T
|
|
2597
|
+
: T extends Array<infer U>
|
|
2598
|
+
? Promise<Asyncify<U>>[]
|
|
2599
|
+
: T extends object
|
|
2600
|
+
? { [K in keyof T]: Asyncify<T[K]> }
|
|
2601
|
+
: Promise<T>;
|
|
2602
|
+
|
|
2603
|
+
// ── 扩展宿主 API ──
|
|
2604
|
+
|
|
2605
|
+
export declare function extensionHostApiFactory(extension: Extension): Asyncify<{
|
|
2606
|
+
toast(message: string): Promise<void>;
|
|
2607
|
+
toast_success(message: string): Promise<void>;
|
|
2608
|
+
toast_error(message: string): Promise<void>;
|
|
2609
|
+
toast_warning(message: string): Promise<void>;
|
|
2610
|
+
dialog_confirm: typeof Dialog.confirm;
|
|
2611
|
+
dialog_input: typeof Dialog.input;
|
|
2612
|
+
dialog_copy: typeof Dialog.copy;
|
|
2613
|
+
dialog_buttons: typeof Dialog.buttons;
|
|
2614
|
+
fetch: fetch;
|
|
2615
|
+
fetch_base64(url: string): Promise<string>;
|
|
2616
|
+
fetch_json(url: string): Promise<unknown>;
|
|
2617
|
+
fetch_binary(url: string): Promise<{ buffer: Uint8Array; mimeType: string }>;
|
|
2618
|
+
shell_execute(program: string, args?: string[], stdin?: string): Promise<{ code: number | null; stdout: string; stderr: string }>;
|
|
2619
|
+
settings_getOwn(key: string): Promise<any>;
|
|
2620
|
+
settings_setOwn(key: string, value: unknown): Promise<void>;
|
|
2621
|
+
settings_getGlobal(key: string): Promise<any>;
|
|
2622
|
+
settings_setGlobal(key: string, value: unknown): Promise<any>;
|
|
2623
|
+
keybinds_register(id: string, icon: KeyBindIcon, defaultKey: string, onPress: () => void, onRelease?: () => void, isContinuous?: boolean): Promise<void>;
|
|
2624
|
+
keybinds_unregisterAll(): Promise<void>;
|
|
2625
|
+
tabs_getAll(): Promise<Tab[]>;
|
|
2626
|
+
tabs_getAllProjects(): Promise<Project[]>;
|
|
2627
|
+
tabs_getCurrent(): Promise<Tab | null>;
|
|
2628
|
+
tabs_getCurrentProject(): Promise<Project | null>;
|
|
2629
|
+
entity_registerType(typeName: string, initialData: any, collisionBox: CollisionBox, renderFn: (data: any) => Promise<ImageBitmap>): Promise<void>;
|
|
2630
|
+
entity_onClick(typeName: string, handler: (payload: ClickEventPayload) => void): Promise<void>;
|
|
2631
|
+
entity_create(typeName: string, data: any, location: { x: number; y: number }): Promise<ExtensionEntity>;
|
|
2632
|
+
}>;
|
|
2633
|
+
|
|
2634
|
+
declare global {
|
|
2635
|
+
prg: Asyncify<ReturnType<typeof extensionHostApiFactory>>;
|
|
2636
|
+
interface Window {
|
|
2637
|
+
prg: Asyncify<ReturnType<typeof extensionHostApiFactory>>;
|
|
2638
|
+
}
|
|
2639
|
+
interface DedicatedWorkerGlobalScope {
|
|
2640
|
+
prg: Asyncify<ReturnType<typeof extensionHostApiFactory>>;
|
|
2641
|
+
}
|
|
2642
|
+
}
|