drawui-core 0.4.1 → 0.5.0
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/README.md +44 -0
- package/dist/index.cjs +25 -25
- package/dist/index.d.cts +423 -12
- package/dist/index.d.ts +423 -12
- package/dist/index.js +25 -25
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -18,7 +18,7 @@ interface ShapeStyle {
|
|
|
18
18
|
/** 描边色透明度(0-1),缺省为 1;与 strokeColor 叠加使用 */
|
|
19
19
|
strokeOpacity?: number;
|
|
20
20
|
}
|
|
21
|
-
type ShapeType = 'rectangle' | 'rounded-rectangle' | 'circle' | 'ellipse' | 'diamond' | 'triangle' | 'hexagon' | 'parallelogram' | 'trapezoid' | 'pentagon' | 'octagon' | 'star' | 'cylinder' | 'cloud' | 'heart' | 'block-arrow-right' | 'block-arrow-left' | 'block-arrow-up' | 'block-arrow-down' | 'block-arrow-double' | 'right-triangle' | 'cross' | 'speech-rect' | 'speech-round' | 'cube' | 'sector' | 'delay' | 'predefined-process' | 'document' | 'stadium' | 'class-catalog' | 'chevron' | 'brace-left' | 'brace-right' | 'envelope' | 'checkbox' | 'sticky-note' | 'triangular-pyramid' | 'quadrangular-pyramid' | 'cuboid' | 'sphere' | 'ellipsoid' | 'pie' | 'hollow-pie' | 'uml-class' | 'uml-interface' | 'mind-map' | 'table' | 'icon' | 'line' | 'arrow' | 'text' | 'draw';
|
|
21
|
+
type ShapeType = 'rectangle' | 'rounded-rectangle' | 'circle' | 'ellipse' | 'diamond' | 'triangle' | 'hexagon' | 'parallelogram' | 'trapezoid' | 'pentagon' | 'octagon' | 'star' | 'cylinder' | 'cloud' | 'heart' | 'block-arrow-right' | 'block-arrow-left' | 'block-arrow-up' | 'block-arrow-down' | 'block-arrow-double' | 'right-triangle' | 'cross' | 'speech-rect' | 'speech-round' | 'cube' | 'sector' | 'delay' | 'predefined-process' | 'document' | 'stadium' | 'class-catalog' | 'chevron' | 'brace-left' | 'brace-right' | 'envelope' | 'checkbox' | 'sticky-note' | 'triangular-pyramid' | 'quadrangular-pyramid' | 'cuboid' | 'sphere' | 'ellipsoid' | 'pie' | 'hollow-pie' | 'uml-class' | 'uml-interface' | 'mind-map' | 'table' | 'icon' | 'line' | 'arrow' | 'text' | 'draw' | 'image';
|
|
22
22
|
interface BaseShape {
|
|
23
23
|
id: string;
|
|
24
24
|
type: ShapeType;
|
|
@@ -32,7 +32,20 @@ interface BaseShape {
|
|
|
32
32
|
highlightColor?: string;
|
|
33
33
|
/** 文字高亮背景透明度(0-1),缺省为 1 */
|
|
34
34
|
highlightOpacity?: number;
|
|
35
|
+
/** 锁定:不可选中/拖动/缩放/删除(右键菜单可解锁) */
|
|
36
|
+
locked?: boolean;
|
|
37
|
+
/** 水平翻转(围绕自身中心镜像;文字/连线等不适用,见 isFlippableShapeType) */
|
|
38
|
+
flipX?: boolean;
|
|
39
|
+
/** 垂直翻转(围绕自身中心镜像) */
|
|
40
|
+
flipY?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* 分组 id:同一组的图形「同进同退」——点选任一成员即选中整组(一起拖动/删除/改变层级),
|
|
43
|
+
* 组锁定时整组都不可选中、不可拖动,等同于给多个图形绑了一把锁。
|
|
44
|
+
*/
|
|
45
|
+
groupId?: string;
|
|
35
46
|
}
|
|
47
|
+
/** 该类型的图形是否支持水平/垂直翻转(右键菜单据此禁用) */
|
|
48
|
+
declare function isFlippableShapeType(type: ShapeType): boolean;
|
|
36
49
|
interface RectangleShape extends BaseShape {
|
|
37
50
|
type: 'rectangle';
|
|
38
51
|
width: number;
|
|
@@ -154,6 +167,23 @@ interface IconShape extends BaseShape {
|
|
|
154
167
|
* 尺寸模型与矩形完全一致(以 (x,y) 为中心 + width/height),差异只在轮廓,
|
|
155
168
|
* 轮廓定义见 `shapePaths.ts`,canvas 与 SVG 导出共用。
|
|
156
169
|
*/
|
|
170
|
+
/**
|
|
171
|
+
* 图片图形:`src` 是图片地址 —— 可以是第三方上传接口返回的远端 URL,
|
|
172
|
+
* 也可以是本地上传的临时地址(`blob:`/`data:`,此时 `temporary: true`,刷新即失效)。
|
|
173
|
+
*/
|
|
174
|
+
interface ImageShape extends BaseShape {
|
|
175
|
+
type: 'image';
|
|
176
|
+
width: number;
|
|
177
|
+
height: number;
|
|
178
|
+
src: string;
|
|
179
|
+
/** src 是本地临时地址(blob:/data:),没有配置上传接口时的兜底,刷新后失效 */
|
|
180
|
+
temporary?: boolean;
|
|
181
|
+
/** 原始像素宽高:用于等比缩放与「恢复到原始比例」 */
|
|
182
|
+
naturalWidth?: number;
|
|
183
|
+
naturalHeight?: number;
|
|
184
|
+
/** 圆角半径(世界单位) */
|
|
185
|
+
borderRadius?: number;
|
|
186
|
+
}
|
|
157
187
|
interface PathShape extends BaseShape {
|
|
158
188
|
type: 'block-arrow-double' | 'right-triangle' | 'cross' | 'speech-rect' | 'speech-round' | 'cube' | 'sector' | 'delay' | 'predefined-process' | 'document' | 'class-catalog' | 'chevron' | 'brace-left' | 'brace-right' | 'envelope' | 'checkbox' | 'triangular-pyramid' | 'quadrangular-pyramid' | 'cuboid' | 'sphere' | 'ellipsoid' | 'pie' | 'hollow-pie';
|
|
159
189
|
width: number;
|
|
@@ -360,8 +390,8 @@ interface TableShape extends BaseShape {
|
|
|
360
390
|
/** cells[row][col] */
|
|
361
391
|
cells: TableCell[][];
|
|
362
392
|
}
|
|
363
|
-
type Shape = RectangleShape | RoundedRectangleShape | CircleShape | EllipseShape | DiamondShape | TriangleShape | HexagonShape | ParallelogramShape | TrapezoidShape | PentagonShape | OctagonShape | StarShape | CylinderShape | CloudShape | HeartShape | BlockArrowShape | StadiumShape | StickyNoteShape | IconShape | PathShape | UmlClassShape | UmlInterfaceShape | LineShape | ArrowShape | TextShape | DrawShape | MindMapShape | TableShape;
|
|
364
|
-
type ToolType = 'select' | 'hand' | 'rectangle' | 'rounded-rectangle' | 'circle' | 'ellipse' | 'diamond' | 'triangle' | 'hexagon' | 'parallelogram' | 'trapezoid' | 'pentagon' | 'octagon' | 'star' | 'cylinder' | 'cloud' | 'heart' | 'block-arrow-right' | 'block-arrow-left' | 'block-arrow-up' | 'block-arrow-down' | 'block-arrow-double' | 'right-triangle' | 'cross' | 'speech-rect' | 'speech-round' | 'cube' | 'sector' | 'delay' | 'predefined-process' | 'document' | 'stadium' | 'class-catalog' | 'chevron' | 'brace-left' | 'brace-right' | 'envelope' | 'checkbox' | 'sticky-note' | 'triangular-pyramid' | 'quadrangular-pyramid' | 'cuboid' | 'sphere' | 'ellipsoid' | 'pie' | 'hollow-pie' | 'uml-class' | 'uml-interface' | 'line' | 'arrow' | 'text' | 'draw' | 'pen' | 'highlighter' | 'eraser' | 'mind-map' | 'table' | 'icon';
|
|
393
|
+
type Shape = RectangleShape | RoundedRectangleShape | CircleShape | EllipseShape | DiamondShape | TriangleShape | HexagonShape | ParallelogramShape | TrapezoidShape | PentagonShape | OctagonShape | StarShape | CylinderShape | CloudShape | HeartShape | BlockArrowShape | StadiumShape | StickyNoteShape | IconShape | ImageShape | PathShape | UmlClassShape | UmlInterfaceShape | LineShape | ArrowShape | TextShape | DrawShape | MindMapShape | TableShape;
|
|
394
|
+
type ToolType = 'select' | 'hand' | 'rectangle' | 'rounded-rectangle' | 'circle' | 'ellipse' | 'diamond' | 'triangle' | 'hexagon' | 'parallelogram' | 'trapezoid' | 'pentagon' | 'octagon' | 'star' | 'cylinder' | 'cloud' | 'heart' | 'block-arrow-right' | 'block-arrow-left' | 'block-arrow-up' | 'block-arrow-down' | 'block-arrow-double' | 'right-triangle' | 'cross' | 'speech-rect' | 'speech-round' | 'cube' | 'sector' | 'delay' | 'predefined-process' | 'document' | 'stadium' | 'class-catalog' | 'chevron' | 'brace-left' | 'brace-right' | 'envelope' | 'checkbox' | 'sticky-note' | 'triangular-pyramid' | 'quadrangular-pyramid' | 'cuboid' | 'sphere' | 'ellipsoid' | 'pie' | 'hollow-pie' | 'uml-class' | 'uml-interface' | 'line' | 'arrow' | 'text' | 'draw' | 'pen' | 'highlighter' | 'eraser' | 'mind-map' | 'table' | 'icon' | 'image';
|
|
365
395
|
interface CameraState {
|
|
366
396
|
x: number;
|
|
367
397
|
y: number;
|
|
@@ -379,6 +409,53 @@ interface EditorData {
|
|
|
379
409
|
camera: CameraState;
|
|
380
410
|
}
|
|
381
411
|
|
|
412
|
+
/**
|
|
413
|
+
* 图片上传通道。
|
|
414
|
+
*
|
|
415
|
+
* 两种模式(由接入方决定):
|
|
416
|
+
* A. 配了上传接口 `ImageUploadConfig`(url 必填)→ 由**接入方自己的服务器**接收文件,
|
|
417
|
+
* 返回图片地址,我们拿到地址后只存 URL(刷新不丢)。
|
|
418
|
+
* B. 没配 → 退回**本地临时二进制流**(`URL.createObjectURL(file)`,标记 temporary),
|
|
419
|
+
* 图片只在当前页面内存里有效,刷新即失效。
|
|
420
|
+
*
|
|
421
|
+
* 也支持直接给一个函数(`ImageUploader`):需要签名、分片、转存等自定义逻辑时用它,
|
|
422
|
+
* 优先级高于 URL 配置。
|
|
423
|
+
*/
|
|
424
|
+
|
|
425
|
+
/** 上传通道内置的图片体积上限:30 MB。超过此体积禁止上传,由接入方通过 `maxSizeBytes` 覆盖。 */
|
|
426
|
+
declare const DEFAULT_IMAGE_MAX_SIZE_BYTES: number;
|
|
427
|
+
/** 上传接口配置(走内置 fetch 实现) */
|
|
428
|
+
interface ImageUploadConfig {
|
|
429
|
+
/** 上传地址,例如 https://api.example.com/upload */
|
|
430
|
+
url: string;
|
|
431
|
+
/** 请求方法,默认 POST */
|
|
432
|
+
method?: 'POST' | 'PUT';
|
|
433
|
+
/** 文件字段名,默认 'file' */
|
|
434
|
+
fieldName?: string;
|
|
435
|
+
/** 额外请求头(如 Authorization) */
|
|
436
|
+
headers?: Record<string, string>;
|
|
437
|
+
/** 额外表单字段 */
|
|
438
|
+
fields?: Record<string, string>;
|
|
439
|
+
/** 是否带 cookie,默认 'same-origin' */
|
|
440
|
+
withCredentials?: boolean;
|
|
441
|
+
/** 从响应 JSON 里取 url 的路径,如 'data.url';不填则自动探测 */
|
|
442
|
+
responseUrlPath?: string;
|
|
443
|
+
/** 超时(毫秒),默认 60000 */
|
|
444
|
+
timeoutMs?: number;
|
|
445
|
+
/** 单张图片体积上限(字节)。超过此大小直接抛出 `image.tooLarge`,不会真的发请求。默认 30 MB。 */
|
|
446
|
+
maxSizeBytes?: number;
|
|
447
|
+
}
|
|
448
|
+
/** 自定义上传函数:返回图片可访问的 URL */
|
|
449
|
+
type ImageUploader = (file: File) => Promise<string>;
|
|
450
|
+
type ImageUploadOption = ImageUploadConfig | ImageUploader;
|
|
451
|
+
declare function isUploaderFunction(v: unknown): v is ImageUploader;
|
|
452
|
+
/** 从响应体文本里解析出图片地址(导出给接入方复用时也用得上) */
|
|
453
|
+
declare function parseUploadResponse(body: string, responseUrlPath?: string): string;
|
|
454
|
+
/** 走配置里的 URL 上传文件,返回图片地址 */
|
|
455
|
+
declare function uploadImageViaConfig(file: File, cfg: ImageUploadConfig): Promise<string>;
|
|
456
|
+
/** 从一批图形里找出「本地临时图片」的地址(刷新后会失效,界面可据此提示) */
|
|
457
|
+
declare function collectTemporaryImageSrcs(shapes: Shape[]): string[];
|
|
458
|
+
|
|
382
459
|
interface Mat2d {
|
|
383
460
|
a: number;
|
|
384
461
|
b: number;
|
|
@@ -682,7 +759,34 @@ declare const zhCN: {
|
|
|
682
759
|
readonly 'table.insertColLeft': "在左侧插入列";
|
|
683
760
|
readonly 'table.insertColRight': "在右侧插入列";
|
|
684
761
|
readonly 'table.pickHint': "拖选行列数";
|
|
762
|
+
readonly 'ctx.copy': "复制";
|
|
763
|
+
readonly 'ctx.copyAsImage': "复制为图片";
|
|
764
|
+
readonly 'ctx.paste': "粘贴";
|
|
765
|
+
readonly 'ctx.duplicate': "创建副本";
|
|
766
|
+
readonly 'ctx.layer': "层级";
|
|
767
|
+
readonly 'ctx.bringToFront': "置于顶层";
|
|
768
|
+
readonly 'ctx.bringForward': "上移一层";
|
|
769
|
+
readonly 'ctx.sendBackward': "下移一层";
|
|
770
|
+
readonly 'ctx.sendToBack': "置于底层";
|
|
771
|
+
readonly 'ctx.copyStyle': "复制样式";
|
|
772
|
+
readonly 'ctx.pasteStyle': "粘贴样式";
|
|
773
|
+
readonly 'ctx.rotate90': "90°";
|
|
774
|
+
readonly 'ctx.rotate180': "180°";
|
|
775
|
+
readonly 'ctx.rotate270': "270°";
|
|
776
|
+
readonly 'ctx.rotate': "旋转";
|
|
777
|
+
readonly 'ctx.group': "成组";
|
|
778
|
+
readonly 'ctx.ungroup': "解组";
|
|
779
|
+
readonly 'ctx.lock': "锁定";
|
|
780
|
+
readonly 'ctx.unlock': "解锁";
|
|
781
|
+
readonly 'ctx.delete': "删除";
|
|
685
782
|
readonly 'toolbar.icon': "图标";
|
|
783
|
+
readonly 'toolbar.image': "图片";
|
|
784
|
+
readonly 'tool.image': "图片";
|
|
785
|
+
readonly 'image.uploadFailed': "图片上传失败";
|
|
786
|
+
readonly 'image.insertFailed': "图片插入失败";
|
|
787
|
+
readonly 'image.tooLarge': "图片超过 30 MB,无法上传";
|
|
788
|
+
readonly 'image.temporaryInserted': "已插入临时图片(未配置上传接口,刷新后会丢失)";
|
|
789
|
+
readonly 'image.naturalSize': "原图尺寸";
|
|
686
790
|
readonly 'icon.search': "搜索图标";
|
|
687
791
|
readonly 'icon.empty': "没有匹配的图标";
|
|
688
792
|
readonly 'icon.recent': "最近使用";
|
|
@@ -742,7 +846,7 @@ declare function exportToBlob(shapes: Shape[], format: ExportFormat, opts?: Expo
|
|
|
742
846
|
/** 浏览器端触发下载 */
|
|
743
847
|
declare function downloadBlob(blob: Blob, fileName: string): void;
|
|
744
848
|
|
|
745
|
-
type Listener = () => void;
|
|
849
|
+
type Listener$1 = () => void;
|
|
746
850
|
type NotificationListener = (message: string) => void;
|
|
747
851
|
/** 核心 → React 的 UI 指令事件 */
|
|
748
852
|
type UiEvent = {
|
|
@@ -752,6 +856,11 @@ type UiEvent = {
|
|
|
752
856
|
context: GenerationContext;
|
|
753
857
|
existingArrowId?: string;
|
|
754
858
|
defaultShapeType: ShapeType;
|
|
859
|
+
}
|
|
860
|
+
/** 图片上传/加载失败(接入方可据此弹 toast) */
|
|
861
|
+
| {
|
|
862
|
+
kind: 'imageError';
|
|
863
|
+
message: string;
|
|
755
864
|
};
|
|
756
865
|
/** Editor 构造选项:主题色 / 语言 / 初始数据 / 本地持久化开关 */
|
|
757
866
|
interface EditorOptions {
|
|
@@ -763,6 +872,14 @@ interface EditorOptions {
|
|
|
763
872
|
shapes?: Shape[];
|
|
764
873
|
/** 是否启用 localStorage 持久化(默认 true;提供 shapes 时自动关闭) */
|
|
765
874
|
persist?: boolean;
|
|
875
|
+
/**
|
|
876
|
+
* 图片上传通道(「图片」按钮 / 粘贴 / 拖入文件时用):
|
|
877
|
+
* - 传 `{ url }` 配置:文件会 POST 到接入方自己的服务器,服务器返回图片地址 → 只存 URL,刷新不丢
|
|
878
|
+
* - 传函数:完全自定义上传(签名、分片、转存等)
|
|
879
|
+
* - 不传:退回**本地临时二进制流**(`URL.createObjectURL`),图形带 `temporary: true`,
|
|
880
|
+
* 图片只活在这个页面里,刷新即失效
|
|
881
|
+
*/
|
|
882
|
+
imageUpload?: ImageUploadOption;
|
|
766
883
|
}
|
|
767
884
|
declare class Editor {
|
|
768
885
|
private canvas;
|
|
@@ -815,8 +932,21 @@ declare class Editor {
|
|
|
815
932
|
* 同样「只影响之后创建的便签」;改选中便签的颜色走 updateSelectedShapesStyle。
|
|
816
933
|
*/
|
|
817
934
|
private stickyNoteColor;
|
|
935
|
+
/** 图片上传通道(null = 本地临时 blob 兜底) */
|
|
936
|
+
private imageUploadOption;
|
|
937
|
+
/** 图片加载完成 → 重绘的取消订阅函数 */
|
|
938
|
+
private removeImageReadyListener;
|
|
939
|
+
/** 本编辑器创建的临时图片地址(blob:),图形删掉后释放 */
|
|
940
|
+
private ownImageUrls;
|
|
941
|
+
/** 插入图片的错开步进,避免多张图完全重叠 */
|
|
942
|
+
private imageInsertSeq;
|
|
943
|
+
/** Ctrl+V 时若系统剪贴板里是图片,paste 事件已处理 → 跳过一次内部粘贴 */
|
|
944
|
+
private imagePasteHandled;
|
|
818
945
|
/** 连续插入图标时的错开计数(避免每次都叠在同一处) */
|
|
819
946
|
private iconInsertSeq;
|
|
947
|
+
private clipboardShapes;
|
|
948
|
+
private pasteSeq;
|
|
949
|
+
private copiedStyle;
|
|
820
950
|
constructor(canvas: HTMLCanvasElement, options?: EditorOptions);
|
|
821
951
|
private setupEventListeners;
|
|
822
952
|
/** 窗口失焦(切页签/alt-tab):按下状态与一切瞬态预览都作废,避免"卡住" */
|
|
@@ -864,8 +994,43 @@ declare class Editor {
|
|
|
864
994
|
private updateBoundArrows;
|
|
865
995
|
private getBindingPosition;
|
|
866
996
|
private deleteShape;
|
|
867
|
-
|
|
868
|
-
|
|
997
|
+
/**
|
|
998
|
+
* 选中图形(additive=true 时切换选中态);id 为空串清空选中。右键菜单/外部控制用。
|
|
999
|
+
* ⚠️ 组感知:点任一成员都会选中它所属的整组(同组的绑行为一致),additive 时整组一起加减。
|
|
1000
|
+
*/
|
|
1001
|
+
selectShape(id: string, additive: boolean): void;
|
|
1002
|
+
/** 整体替换选中集(右键菜单/外部控制用);框选结果同样按组扩张 */
|
|
1003
|
+
selectShapes(ids: string[]): void;
|
|
1004
|
+
/** 某图形所在的整组 id 列表(不在组里就只有它自己) */
|
|
1005
|
+
private getGroupMembers;
|
|
1006
|
+
/** 选中集是否恰好是完整的一个组(返回 groupId,否则 null) */
|
|
1007
|
+
getSelectedGroupId(): string | null;
|
|
1008
|
+
/** 选中集里是否包含成组图形(用于右键菜单显示「解组」) */
|
|
1009
|
+
hasSelectedGroup(): boolean;
|
|
1010
|
+
/** 取某个组的所有成员 id(含锁定的成员) */
|
|
1011
|
+
private groupMemberIds;
|
|
1012
|
+
/**
|
|
1013
|
+
* 成组:把选中图形绑成一个整体,并整组锁定(同飞书「组合后不再被选中」的观感,
|
|
1014
|
+
* 用户想改动先解锁,解锁后整组仍同进同退:点任一成员 = 选中整组一起拖)。
|
|
1015
|
+
* @returns 新建的 groupId;选中不足 2 个时返回 null
|
|
1016
|
+
*/
|
|
1017
|
+
groupSelected(): string | null;
|
|
1018
|
+
/**
|
|
1019
|
+
* 解组:清掉这些图形的组标记并顺带解锁(整组一起解,即使只选中了组内一部分成员)。
|
|
1020
|
+
* @returns 是否确实解掉了组
|
|
1021
|
+
*/
|
|
1022
|
+
ungroupSelected(): boolean;
|
|
1023
|
+
/** 解掉指定 gid 的组(内部统一入口,含 locked 清理) */
|
|
1024
|
+
ungroupIds(groupIds: string[]): boolean;
|
|
1025
|
+
/** 整组锁定/解锁(groupId 相同的图形一起改) */
|
|
1026
|
+
setGroupLocked(groupId: string, locked: boolean): boolean;
|
|
1027
|
+
/**
|
|
1028
|
+
* 无视「组/锁定」直接选中一个图形(仅供右键菜单:右键命中锁定的组成员要能把整组选上,
|
|
1029
|
+
* 否则用户没有任何入口把组解锁)。普通点选一律走 selectShape。
|
|
1030
|
+
*/
|
|
1031
|
+
selectShapeRaw(id: string): void;
|
|
1032
|
+
/** 选中集里任一成员所属的组 id(右键菜单「解锁本组」用) */
|
|
1033
|
+
getGroupIdOfSelected(): string | null;
|
|
869
1034
|
private setBrushRect;
|
|
870
1035
|
/** 设置对齐参考线(由工具在拖拽过程中调用) */
|
|
871
1036
|
private setSnapGuides;
|
|
@@ -927,6 +1092,56 @@ declare class Editor {
|
|
|
927
1092
|
}): void;
|
|
928
1093
|
/** 批量更新选中线条/箭头的连线类型 */
|
|
929
1094
|
updateConnectionType(connectionType: ConnectionType): void;
|
|
1095
|
+
/** 获取选中的图形(按画布层级顺序,即 shapes 数组顺序) */
|
|
1096
|
+
getSelectedShapes(): Shape[];
|
|
1097
|
+
/** 是否正处于就地编辑(编辑文字/表格/思维导图节点) */
|
|
1098
|
+
isEditing(): boolean;
|
|
1099
|
+
/** 删除选中的图形(锁定的图形跳过),返回是否有删除 */
|
|
1100
|
+
deleteSelected(): boolean;
|
|
1101
|
+
/** 复制选中的图形到内部剪贴板(锁定的图形跳过) */
|
|
1102
|
+
copySelected(): boolean;
|
|
1103
|
+
/** 内部剪贴板里是否有可粘贴的内容 */
|
|
1104
|
+
hasClipboard(): boolean;
|
|
1105
|
+
/** 深拷贝一批图形并生成新 id、平移 offset(连线的世界坐标 points / 手工折点同步平移) */
|
|
1106
|
+
private cloneWithOffset;
|
|
1107
|
+
/** 粘贴内部剪贴板:副本阶梯偏移并选中,一步撤销 */
|
|
1108
|
+
paste(): boolean;
|
|
1109
|
+
/** 在原位创建选中图形的副本(偏移一点并选中副本),一步撤销 */
|
|
1110
|
+
duplicateSelected(): boolean;
|
|
1111
|
+
/** 把选中的图形导出为 PNG 并写入系统剪贴板(透明背景),返回是否成功 */
|
|
1112
|
+
copySelectedAsImage(): Promise<boolean>;
|
|
1113
|
+
/** 复制第一个选中图形的样式(边框/填充/文字色/字号) */
|
|
1114
|
+
copyStyle(): boolean;
|
|
1115
|
+
/** 是否已经复制过样式(右键菜单「粘贴样式」的可用条件) */
|
|
1116
|
+
hasCopiedStyle(): boolean;
|
|
1117
|
+
/** 把复制的样式粘贴到所有选中图形(一步撤销) */
|
|
1118
|
+
pasteStyle(): boolean;
|
|
1119
|
+
/**
|
|
1120
|
+
* 水平/垂直翻转选中的图形(围绕各自中心镜像,toggle 语义)。
|
|
1121
|
+
* 文字/连线/表格/UML/思维导图/便签不支持翻转(isFlippableShapeType),会被跳过。
|
|
1122
|
+
*/
|
|
1123
|
+
flipSelected(axis: 'horizontal' | 'vertical'): boolean;
|
|
1124
|
+
/**
|
|
1125
|
+
* 按角度旋转选中图形(**顺时针为正**,单位:度)。每个图形绕自身中心转,
|
|
1126
|
+
* 与拖拽旋转手柄一致;整体一步撤销。锁定图形不参与。
|
|
1127
|
+
*/
|
|
1128
|
+
rotateSelected(degrees: number): boolean;
|
|
1129
|
+
/** 选中图形旋转 90°(clockwise=false 为逆时针);保留旧签名,内部走 rotateSelected */
|
|
1130
|
+
rotateSelected90(clockwise?: boolean): boolean;
|
|
1131
|
+
/** 锁定/解锁选中图形;锁定后自动取消选中(锁定图形不可选中) */
|
|
1132
|
+
setSelectedShapesLocked(locked: boolean): boolean;
|
|
1133
|
+
/** 锁定/解锁指定图形(右键锁定的图形时用它解锁,图形不必在选中集里) */
|
|
1134
|
+
setShapeLocked(id: string, locked: boolean): boolean;
|
|
1135
|
+
/** 某个图形是否被锁定 */
|
|
1136
|
+
isShapeLocked(id: string): boolean;
|
|
1137
|
+
/** 置于顶层:选中的图形整体移到最上面(保持它们之间的相对顺序) */
|
|
1138
|
+
bringToFront(): boolean;
|
|
1139
|
+
/** 置于底层:选中的图形整体移到最下面 */
|
|
1140
|
+
sendToBack(): boolean;
|
|
1141
|
+
/** 上移一层:每个选中图形与它上面相邻的非选中图形交换 */
|
|
1142
|
+
bringForward(): boolean;
|
|
1143
|
+
/** 下移一层:每个选中图形与它下面相邻的非选中图形交换 */
|
|
1144
|
+
sendBackward(): boolean;
|
|
930
1145
|
/** 批量更新选中箭头的箭头类型 */
|
|
931
1146
|
updateArrowHeadType(arrowHead: ArrowHeadType): void;
|
|
932
1147
|
/**
|
|
@@ -948,6 +1163,45 @@ declare class Editor {
|
|
|
948
1163
|
* - 计入撤销历史;图标 id 不存在时返回 undefined(不做任何事)。
|
|
949
1164
|
*/
|
|
950
1165
|
insertIcon(iconId: string, size?: number): string | undefined;
|
|
1166
|
+
/** 运行时配置图片上传通道(null = 退回本地临时 blob)。常见于接入方拿到用户配置后再注入 */
|
|
1167
|
+
setImageUpload(option: ImageUploadOption | null): void;
|
|
1168
|
+
getImageUpload(): ImageUploadOption | null;
|
|
1169
|
+
/** 是否配置了上传通道:false 表示插入的图片是本地临时 blob,刷新即失效 */
|
|
1170
|
+
hasImageUploader(): boolean;
|
|
1171
|
+
/** 画布上所有「本地临时图片」的地址(接入方保存前可据此提示「刷新会丢」) */
|
|
1172
|
+
getTemporaryImageSrcs(): string[];
|
|
1173
|
+
hasTemporaryImages(): boolean;
|
|
1174
|
+
/**
|
|
1175
|
+
* 插入一张图片图形(同步)。尺寸按原始像素等比缩放到长边不超过 `IMAGE_MAX_SIDE`;
|
|
1176
|
+
* 拿不到原始尺寸时用 320×240 兜底。返回新图形 id。
|
|
1177
|
+
*/
|
|
1178
|
+
insertImageShape(opts: {
|
|
1179
|
+
src: string;
|
|
1180
|
+
naturalWidth?: number;
|
|
1181
|
+
naturalHeight?: number;
|
|
1182
|
+
temporary?: boolean;
|
|
1183
|
+
at?: Vec2;
|
|
1184
|
+
}): string;
|
|
1185
|
+
/**
|
|
1186
|
+
* 上传(或本地兜底)后插入一张图片:
|
|
1187
|
+
* - 配了上传通道 → 调接入方接口拿远端 URL(`temporary` 不置位,刷新不丢)
|
|
1188
|
+
* - 没配 → `URL.createObjectURL(file)` 本地临时地址(`temporary: true`,刷新即失效)
|
|
1189
|
+
* 上传失败会抛出(错误信息可直接展示给用户);返回新图形 id。
|
|
1190
|
+
*
|
|
1191
|
+
* 单张图片超过 30 MB 会被直接拒绝;`ImageUploadConfig` 可通过 `maxSizeBytes` 自定义上限。
|
|
1192
|
+
*/
|
|
1193
|
+
insertImageFile(file: File, at?: Vec2): Promise<string>;
|
|
1194
|
+
/** 批量插入(工具栏多选 / 拖入多个文件 / 粘贴多张图) */
|
|
1195
|
+
insertImageFiles(files: FileList | File[], at?: Vec2): Promise<string[]>;
|
|
1196
|
+
/** 直接用图片地址插入(已有素材库 / 贴图片链接) */
|
|
1197
|
+
insertImageFromUrl(src: string, at?: Vec2): Promise<string>;
|
|
1198
|
+
/** 释放已经没有任何图形引用的临时图片地址(删除/清空/替换数据后调用) */
|
|
1199
|
+
private releaseUnusedImageUrls;
|
|
1200
|
+
/**
|
|
1201
|
+
* 系统剪贴板粘贴:剪贴板里有图片就直接插图(优先级高于内部图形剪贴板)。
|
|
1202
|
+
* 截图后 Ctrl+V 贴进画布走的就是这里。
|
|
1203
|
+
*/
|
|
1204
|
+
private handlePasteEvent;
|
|
951
1205
|
/** 视口中心(世界坐标):插入类操作(图标)的默认落点 */
|
|
952
1206
|
private viewportCenter;
|
|
953
1207
|
/** 修改「新建便签」的纸面色:只影响之后创建的便签;非法色值会被忽略 */
|
|
@@ -1193,6 +1447,14 @@ declare class Editor {
|
|
|
1193
1447
|
width: number;
|
|
1194
1448
|
height: number;
|
|
1195
1449
|
};
|
|
1450
|
+
/** 当前可视区对应的世界坐标范围(用于画板范围、小地图等) */
|
|
1451
|
+
getViewportBounds(): Rect;
|
|
1452
|
+
/**
|
|
1453
|
+
* 画板「应覆盖的范围」(世界坐标):内容包围盒 ∪ 当前可视区,再各加 padding。
|
|
1454
|
+
* 一次性的纯计算,不做任何状态保留;宿主若要「删了图形后延迟缩回」的语义,
|
|
1455
|
+
* 用 `BoardExtentKeeper`(见 core 的 boardExtent.ts)包一层。
|
|
1456
|
+
*/
|
|
1457
|
+
getBoardExtent(padding?: number): Rect;
|
|
1196
1458
|
/**
|
|
1197
1459
|
* 导出当前画布为图片 Blob。
|
|
1198
1460
|
* @param format png | svg | pdf
|
|
@@ -1223,7 +1485,7 @@ declare class Editor {
|
|
|
1223
1485
|
render(): void;
|
|
1224
1486
|
/** 合帧渲染:同一帧内多次调用只会触发一次实际重绘 */
|
|
1225
1487
|
private scheduleRender;
|
|
1226
|
-
subscribe(listener: Listener): () => boolean;
|
|
1488
|
+
subscribe(listener: Listener$1): () => boolean;
|
|
1227
1489
|
subscribeNotifications(listener: NotificationListener): () => boolean;
|
|
1228
1490
|
private notify;
|
|
1229
1491
|
private notifyListeners;
|
|
@@ -1454,6 +1716,12 @@ declare class Renderer {
|
|
|
1454
1716
|
* - 线宽用「网格单位」而不是屏幕单位,所以图标放大时线条跟着变粗,像字体图标那样;
|
|
1455
1717
|
* - 用 `Path2D` 直接吃 SVG path 字符串,与 SVG 导出共用同一份路径数据(含圆弧,无需自己解析)。
|
|
1456
1718
|
*/
|
|
1719
|
+
/**
|
|
1720
|
+
* 图片:命中缓存就画,没命中先画占位块(斜线 + 灰底/失败时红底)。
|
|
1721
|
+
* `peekImage()` 会顺手启动异步加载,加载完成后 imageStore 通知 Editor 重绘,
|
|
1722
|
+
* 所以这里不需要任何 await —— 画布永远是同步画一帧。
|
|
1723
|
+
*/
|
|
1724
|
+
private drawImageShape;
|
|
1457
1725
|
private drawIcon;
|
|
1458
1726
|
private drawUmlClass;
|
|
1459
1727
|
/**
|
|
@@ -1654,6 +1922,24 @@ declare class Renderer {
|
|
|
1654
1922
|
private drawArrowHeads;
|
|
1655
1923
|
private drawText;
|
|
1656
1924
|
private drawFreehand;
|
|
1925
|
+
/**
|
|
1926
|
+
* 锁定标记:图形右上角画一枚小挂锁(尺寸按屏幕像素恒定),
|
|
1927
|
+
* 独立于选中态 —— 锁定的图形通常选不中,得靠这枚锁告诉用户「它为什么点不动」。
|
|
1928
|
+
*/
|
|
1929
|
+
private drawLockBadge;
|
|
1930
|
+
/**
|
|
1931
|
+
* 锁定组的统一标记:整组只画**一把锁**,挂在组包围盒顶部居中,
|
|
1932
|
+
* 而不是组里每个成员各挂一把(一堆锁没法看)。只要组处于锁定状态就画,
|
|
1933
|
+
* 与选中无关(锁定的组本来也选不中,这枚锁就是唯一的视觉提示)。
|
|
1934
|
+
*/
|
|
1935
|
+
private drawGroupLockBadges;
|
|
1936
|
+
/** 在指定位置(徽标左上角,世界坐标)画一枚挂锁徽标 */
|
|
1937
|
+
private drawLockBadgeAt;
|
|
1938
|
+
/**
|
|
1939
|
+
* 组外框:选中集恰好是一个完整的组(且不止一个成员)时,给整组描一圈虚线,
|
|
1940
|
+
* 提示「这些图形是绑在一起的」。整组锁定的成员画不到(成员不可选),不需要外框。
|
|
1941
|
+
*/
|
|
1942
|
+
private drawGroupFrames;
|
|
1657
1943
|
private drawSelectionOutline;
|
|
1658
1944
|
private drawSelectionHandles;
|
|
1659
1945
|
/**
|
|
@@ -1702,8 +1988,12 @@ declare const STICKY_NOTE_DEFAULT_COLOR: string;
|
|
|
1702
1988
|
*/
|
|
1703
1989
|
declare const STICKY_FOLD_RATIO = 0.2;
|
|
1704
1990
|
/**
|
|
1705
|
-
* 便签文字的可用区域缩放:常规内边距 0.85
|
|
1706
|
-
*
|
|
1991
|
+
* 便签文字的可用区域缩放:常规内边距 0.85 再让掉半个折角 = 0.75。
|
|
1992
|
+
*
|
|
1993
|
+
* 为什么这样就够、不需要再把文字整体往左上挪:文字块是**居中**摆放的,
|
|
1994
|
+
* 可用区 0.75 倍时文字块右下角最多落在 (0.875w, 0.875h);而折角三角区是
|
|
1995
|
+
* `Δx/0.2w + Δy/0.2h > 1` 的那一块,把 0.875 代进去是 0.375+0.375 = 0.75 < 1,
|
|
1996
|
+
* **已经在折角斜边之外**。所以居中排版天然不会压到折角。
|
|
1707
1997
|
*/
|
|
1708
1998
|
declare const STICKY_TEXT_SCALE: number;
|
|
1709
1999
|
|
|
@@ -1788,6 +2078,76 @@ declare const ICON_CATEGORY_INK: Record<IconCategoryId, string>;
|
|
|
1788
2078
|
/** 取某个图标的默认墨色:图标自带 ink 优先(全彩贴纸),否则用分类主色,最后退回全局默认 */
|
|
1789
2079
|
declare function iconInk(icon: IconDef): string;
|
|
1790
2080
|
|
|
2081
|
+
/**
|
|
2082
|
+
* 画板范围(Board Extent)—— 宿主用来决定「画板这块 DOM / 可滚区域该多大」。
|
|
2083
|
+
*
|
|
2084
|
+
* 语义(与产品约定一致):
|
|
2085
|
+
* - **长出去就立刻长**:内容跑到更远处时,画板范围马上跟着扩(这合理,不需要等待)。
|
|
2086
|
+
* - **缩回来要谨慎**:内容被删掉后空出来的那块,不能马上收 ——
|
|
2087
|
+
* · 鼠标没动过 → 先不变(否则指针底下的东西会突然跳/滚动位置变了)
|
|
2088
|
+
* · 鼠标动过、但要让出的那块还在可视区里 → 还是不变(用户正看着它)
|
|
2089
|
+
* · 鼠标动过、且要让出的那块已经完全在可视区之外 → 这时才把这块空间收回
|
|
2090
|
+
*
|
|
2091
|
+
* 本文件不碰 DOM,纯几何 + 状态机,宿主(React / 业务容器)拿到结果自己去设尺寸。
|
|
2092
|
+
*/
|
|
2093
|
+
|
|
2094
|
+
declare function isEmptyRect(r: Rect | null | undefined): boolean;
|
|
2095
|
+
/** 两个矩形求并(任一为空则返回另一个的副本) */
|
|
2096
|
+
declare function unionRect(a: Rect | null, b: Rect | null): Rect | null;
|
|
2097
|
+
/** 两个矩形是否相交(边界接触不算相交) */
|
|
2098
|
+
declare function rectsIntersect(a: Rect | null, b: Rect | null): boolean;
|
|
2099
|
+
/** 向内收缩 r,得到「target 之外、r 之内的部分」是否有内容(用于判断「要让出的那块」是否与可视区重叠) */
|
|
2100
|
+
declare function subtractUnion(a: Rect, b: Rect): Rect[];
|
|
2101
|
+
interface BoardExtentUpdate {
|
|
2102
|
+
/** 内容包围盒(世界坐标);没有内容传 null */
|
|
2103
|
+
content: Rect | null;
|
|
2104
|
+
/** 当前可视区(世界坐标) */
|
|
2105
|
+
viewport: Rect;
|
|
2106
|
+
/** 自上次 update 以来指针是否移动过(宿主提供;决定能不能缩回) */
|
|
2107
|
+
pointerMoved: boolean;
|
|
2108
|
+
/** 内容外的留白 */
|
|
2109
|
+
padding?: number;
|
|
2110
|
+
/**
|
|
2111
|
+
* 画板范围是否必须覆盖当前可视区:
|
|
2112
|
+
* - true(默认):相机式画布 —— 画布必须盖住整屏,否则滚动出画面
|
|
2113
|
+
* - false:可滚动画板 —— 范围只跟内容走,空出来的远处空间才有机会被「收回」
|
|
2114
|
+
*/
|
|
2115
|
+
includeViewport?: boolean;
|
|
2116
|
+
/** 内容为空时,画板至少保留这么大(默认 = 一个视口大小) */
|
|
2117
|
+
minSize?: {
|
|
2118
|
+
width: number;
|
|
2119
|
+
height: number;
|
|
2120
|
+
};
|
|
2121
|
+
/** 内容为空时画板回到的位置(默认世界原点)——可滚动画板的「默认画板位置」 */
|
|
2122
|
+
anchor?: {
|
|
2123
|
+
x: number;
|
|
2124
|
+
y: number;
|
|
2125
|
+
};
|
|
2126
|
+
}
|
|
2127
|
+
interface BoardExtentResult {
|
|
2128
|
+
/** 本次应该采用的画板范围 */
|
|
2129
|
+
extent: Rect;
|
|
2130
|
+
/** 相比上次是否有变化(宿主据此决定要不要改 DOM 尺寸 / 滚动位置) */
|
|
2131
|
+
changed: boolean;
|
|
2132
|
+
/** 本次是「长大」还是「缩回」还是没变 */
|
|
2133
|
+
action: 'grow' | 'shrink' | 'hold' | 'init';
|
|
2134
|
+
/** hold 时说明原因(便于调试 / 埋点) */
|
|
2135
|
+
holdReason?: 'pointer-still' | 'still-visible';
|
|
2136
|
+
}
|
|
2137
|
+
/**
|
|
2138
|
+
* 画板范围状态机:调用 `update()` 传入当前内容/可视区/指针状态,拿回应该采用的范围。
|
|
2139
|
+
* 一次会话里保持同一个实例即可。
|
|
2140
|
+
*/
|
|
2141
|
+
declare class BoardExtentKeeper {
|
|
2142
|
+
private current;
|
|
2143
|
+
/** 重置(例如加载了新文档 / 宿主容器尺寸变了) */
|
|
2144
|
+
reset(extent?: Rect | null): void;
|
|
2145
|
+
get(): Rect | null;
|
|
2146
|
+
/** 本次「理想范围」:内容 + 留白;内容为空时退化成「默认画板」那一块 */
|
|
2147
|
+
private desiredOf;
|
|
2148
|
+
update(input: BoardExtentUpdate): BoardExtentResult;
|
|
2149
|
+
}
|
|
2150
|
+
|
|
1791
2151
|
interface ToolContext {
|
|
1792
2152
|
addShape(shape: Shape): void;
|
|
1793
2153
|
updateShape(id: string, updates: Partial<Shape>): void;
|
|
@@ -2137,12 +2497,22 @@ declare function calcUmlClassSize(className: string, attributes: UmlAttribute[],
|
|
|
2137
2497
|
};
|
|
2138
2498
|
declare class ShapeTool extends Tool {
|
|
2139
2499
|
type: ShapeType;
|
|
2500
|
+
/** 按下点(页面坐标);null = 未按下 */
|
|
2501
|
+
private pressPoint;
|
|
2502
|
+
/** 本次按下的图形 id(按下即生成默认尺寸,拖动只改它的大小) */
|
|
2503
|
+
private draftId;
|
|
2504
|
+
/** 是否已进入拖拽状态(超过阈值) */
|
|
2505
|
+
private dragging;
|
|
2140
2506
|
constructor(context: ToolContext, shapeType: ShapeType);
|
|
2141
2507
|
onPointerDown(point: Vec2, _event: PointerEvent): void;
|
|
2142
|
-
onPointerMove(
|
|
2508
|
+
onPointerMove(point: Vec2, event: PointerEvent): void;
|
|
2143
2509
|
onPointerUp(_point: Vec2, _event: PointerEvent): void;
|
|
2144
|
-
onKeyDown(
|
|
2510
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
2145
2511
|
onKeyUp(_event: KeyboardEvent): void;
|
|
2512
|
+
/** 拖拽生成中 = 一次未结束的交互(指针丢失时编辑器会来收尾) */
|
|
2513
|
+
hasTransientState(): boolean;
|
|
2514
|
+
/** 丢事件自愈:保持图形当前尺寸落定(历史点在按下时已记),清掉拖拽状态 */
|
|
2515
|
+
cancelTransient(): boolean;
|
|
2146
2516
|
getCursor(point: Vec2): string | null;
|
|
2147
2517
|
}
|
|
2148
2518
|
|
|
@@ -2428,4 +2798,45 @@ declare function umlAttrRowText(a: UmlAttribute): string;
|
|
|
2428
2798
|
/** 方法行:`+ name(params): returnType`;同上 */
|
|
2429
2799
|
declare function umlMethodRowText(m: UmlMethod): string;
|
|
2430
2800
|
|
|
2431
|
-
|
|
2801
|
+
/**
|
|
2802
|
+
* 图片资源仓库:`src` → 已加载的 HTMLImageElement 缓存 + 异步加载 + 就绪回调。
|
|
2803
|
+
*
|
|
2804
|
+
* 设计要点(都是踩过的坑):
|
|
2805
|
+
* - Renderer 是**同步一次性绘制**的,所以绘制时只做 `peekImage()`:命中就画,没命中先画占位;
|
|
2806
|
+
* 加载完成后通过监听者通知(Editor 会把它接到 requestRender 上)自动重绘补齐。
|
|
2807
|
+
* - 远端 http(s) 图片默认加 `crossOrigin='anonymous'`:不加的话画布会被污染(tainted),
|
|
2808
|
+
* 之后 `toDataURL()`/导出会直接抛错。
|
|
2809
|
+
* - 加载失败要**记住失败**,否则每帧都会重新 new Image 去打一个坏地址(疯狂重试)。
|
|
2810
|
+
* - 本地兜底的 `blob:` 地址由我们创建,删除图形时通过 `releaseObjectUrl()` 释放。
|
|
2811
|
+
*/
|
|
2812
|
+
|
|
2813
|
+
interface LoadedImage {
|
|
2814
|
+
img: HTMLImageElement;
|
|
2815
|
+
width: number;
|
|
2816
|
+
height: number;
|
|
2817
|
+
src: string;
|
|
2818
|
+
}
|
|
2819
|
+
type Listener = () => void;
|
|
2820
|
+
/** 图片加载完成/失败时通知(Editor 接到 requestRender)。返回取消订阅函数 */
|
|
2821
|
+
declare function addImageReadyListener(cb: Listener): () => void;
|
|
2822
|
+
/** 配置远端图的 crossOrigin(传 null 表示不加) */
|
|
2823
|
+
declare function setImageCrossOrigin(value: string | null): void;
|
|
2824
|
+
/** 同步取已加载的图片(未加载/失败返回 null,并顺带触发加载) */
|
|
2825
|
+
declare function peekImage(src: string): LoadedImage | null;
|
|
2826
|
+
/** 该地址是否已确认加载失败 */
|
|
2827
|
+
declare function isImageFailed(src: string): boolean;
|
|
2828
|
+
/** 该地址是否正在加载 */
|
|
2829
|
+
declare function isImageLoading(src: string): boolean;
|
|
2830
|
+
/** 加载图片(命中缓存直接返回)。失败返回 null,并记录失败状态 */
|
|
2831
|
+
declare function loadImage(src: string): Promise<LoadedImage | null>;
|
|
2832
|
+
/** 让一批图形里的图片全部就绪(导出前调用,否则导出的图会是空的) */
|
|
2833
|
+
declare function ensureImagesLoaded(shapes: Shape[]): Promise<void>;
|
|
2834
|
+
/**
|
|
2835
|
+
* 取图片的 dataURL(导出 SVG 内嵌用):
|
|
2836
|
+
* 已加载的图片画到离屏 canvas 再 toDataURL;跨域被拒等失败时返回 null(调用方退回原始地址)。
|
|
2837
|
+
*/
|
|
2838
|
+
declare function imageDataUrl(src: string): string | null;
|
|
2839
|
+
/** 清空缓存(测试/卸载时用;会释放自己创建的 blob 地址) */
|
|
2840
|
+
declare function clearImageCache(): void;
|
|
2841
|
+
|
|
2842
|
+
export { type ArrowBinding, type ArrowHeadType, type ArrowShape, type ArrowStyle, ArrowTool, BoardExtentKeeper, type BoardExtentResult, type BoardExtentUpdate, Camera, type CameraState, type CircleShape, type ConnectionType, DEFAULT_HIGHLIGHTER_COLOR, DEFAULT_IMAGE_MAX_SIZE_BYTES, type DiamondShape, type DrawShape, type DrawuiTheme, type DrawuiThemeSelection, Editor, type EditorData, type EditorOptions, type EditorState, type EllipseShape, type ExportFormat, type ExportOptions, type FreehandMode, FreehandTool, type GenerationContext, HandTool, type HexagonShape, ICONS, ICON_CATEGORIES, ICON_CATEGORY_INK, ICON_DEFAULT_INK, ICON_DEFAULT_SIZE, ICON_GRID, type IconCategoryId, type IconDef, type IconLayer, type IconShape, type ImageShape, type ImageUploadConfig, type ImageUploadOption, type ImageUploader, LANGUAGES, type Language, type LineShape, LineTool, MINDMAP_COLORS, MINDMAP_FONT_SIZE, MINDMAP_MAX_WIDTH, MINDMAP_MIN_WIDTH, MINDMAP_NODE_HEIGHT, MIN_HANDLE_SEGMENT, MIN_JOG, Mat2d, type MessageKey, type MindMapLayoutResult, type MindMapNode, type MindMapNodePos, type MindMapShape, type OctagonShape, type ParallelogramShape, type PentagonShape, type Rect, type RectangleShape, Renderer, type RoundedRectangleShape, STICKY_FOLD_RATIO, STICKY_NOTE_COLORS, STICKY_NOTE_DEFAULT_COLOR, STICKY_TEXT_SCALE, type SegmentHandle, SelectTool, type Shape, type ShapeStyle, ShapeTool, type ShapeType, type SnapGuide, type StarShape, type StickyNoteShape, TABLE_CELL_PADDING_X, TABLE_CELL_PADDING_Y, TABLE_DEFAULT_COL_WIDTH, TABLE_DEFAULT_ROW_HEIGHT, TABLE_FONT_SIZE, TABLE_HEADER_FILL, TABLE_LINE_HEIGHT_RATIO, TABLE_MAX_AUTO_LINES, TABLE_MIN_COL_WIDTH, TABLE_MIN_ROW_HEIGHT, TABLE_MOVE_HANDLE_GAP, TABLE_MOVE_HANDLE_HEIGHT, TABLE_MOVE_HANDLE_WIDTH, THEME, type TableCell, type TableShape, type TextShape, type ToolType, type TrapezoidShape, type TriangleShape, UML_FONT_SIZE, UML_HEADER_HEIGHT, UML_LINE_HEIGHT, UML_MIN_WIDTH, UML_PADDING_X, UML_PADDING_Y, type UiEvent, type UmlAttribute, type UmlClassShape, type UmlInterfaceShape, type UmlMethod, type UmlVisibility, Vec, type Vec2 as Vec2Type, addImageReadyListener, calcUmlClassSize, clearImageCache, cloneMindMapNode, cloneTable, cloneTableCells, collapseRoute, collectTemporaryImageSrcs, connectorSegmentHandles, countMindMapNodes, createTableCells, downloadBlob, ensureImagesLoaded, exportToBlob, findMindMapNode, getContentBounds, getIcon, getLanguage, getMindMapNodeDepth, getMindMapParent, getTheme, hasIcon, hexToRgba, hitTableBody, hitTableMoveHandle, iconInk, iconsByCategory, imageDataUrl, isEmptyRect, isFlippableShapeType, isImageFailed, isImageLoading, isStubCorner, isUploaderFunction, layoutMindMap, loadImage, mindMapNodeColor, mindMapNodeSize, offsetConnectorSegment, parseUploadResponse, peekImage, pickSegmentHandle, pointToSegmentDistance, pruneStubBends, rectsIntersect, renderSVGString, renderToCanvas, routeToUserPoints, sameRoute, searchIcons, setImageCrossOrigin, setLanguage, setTheme, shadeColor, subscribeLanguage, subscribeTheme, subtractUnion, t, tableAnchorAt, tableCellAtLocalClamped, tableCellLineCount, tableCellLocalRect, tableCellTextStartOffset, tableCoveredMap, tableDeleteColumn, tableDeleteRow, tableExpandRangeToMerges, tableGrowRowHeights, tableInsertColumn, tableInsertRow, tableLocalPoint, tableMerge, tableMoveHandleLocalRect, tablePagePoint, tableRangeHasMerge, tableRangeLocalRect, tableRowAtPoint, tableSplit, tableSplitRange, tableTotalHeight, tableTotalWidth, umlAttrRowText, umlMethodRowText, unionRect, uploadImageViaConfig };
|