@ray-js/robot-map-sdk 0.0.4 → 0.0.5-beta.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/dist/constant/methods.js +1 -1
- package/dist/index.d.ts +963 -52
- package/dist/index.rjs.js +1 -1
- package/dist-app/assets/index-DXwi5Z5p.js +1 -0
- package/dist-app/index.html +1 -1
- package/dist-docs/404.html +2 -2
- package/dist-docs/assets/{app.Djy1DeYm.js → app.ImNciwLP.js} +1 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.BnEnKmCZ.js +1 -0
- package/dist-docs/assets/chunks/{VPLocalSearchBox.DrbIC04M.js → VPLocalSearchBox.BRkuUFv4.js} +1 -1
- package/dist-docs/assets/chunks/{theme.x3MYIFoS.js → theme.8Y64nJoP.js} +2 -2
- package/dist-docs/assets/{guide_advanced-usage.md.BEPxsaJf.js → guide_advanced-usage.md.DO2hzf-K.js} +24 -2
- package/dist-docs/assets/{guide_advanced-usage.md.BEPxsaJf.lean.js → guide_advanced-usage.md.DO2hzf-K.lean.js} +1 -1
- package/dist-docs/assets/{guide_getting-started.md.Bpx-HSDt.js → guide_getting-started.md.BA1taIq8.js} +1 -1
- package/dist-docs/assets/{reference_callbacks.md.DgCt5RdP.js → reference_callbacks.md.B9JgcUCR.js} +2 -2
- package/dist-docs/assets/{reference_callbacks.md.DgCt5RdP.lean.js → reference_callbacks.md.B9JgcUCR.lean.js} +1 -1
- package/dist-docs/assets/{reference_methods.md.Cl2prV6n.js → reference_methods.md.DGVZpJAe.js} +2 -2
- package/dist-docs/assets/reference_methods.md.DGVZpJAe.lean.js +1 -0
- package/dist-docs/guide/advanced-usage.html +27 -5
- package/dist-docs/guide/concepts.html +3 -3
- package/dist-docs/guide/getting-started.html +5 -5
- package/dist-docs/hashmap.json +1 -1
- package/dist-docs/index.html +3 -3
- package/dist-docs/reference/callbacks.html +5 -5
- package/dist-docs/reference/config.html +3 -3
- package/dist-docs/reference/data.html +3 -3
- package/dist-docs/reference/methods.html +5 -5
- package/dist-docs/reference/runtime.html +3 -3
- package/dist-docs/reference/types.html +3 -3
- package/dist-docs/reference/utils.html +3 -3
- package/package.json +1 -1
- package/dist-app/assets/index-BzOggZDJ.js +0 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.CEe4hvsB.js +0 -1
- package/dist-docs/assets/reference_methods.md.Cl2prV6n.lean.js +0 -1
- /package/dist-docs/assets/{guide_getting-started.md.Bpx-HSDt.lean.js → guide_getting-started.md.BA1taIq8.lean.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { Rectangle } from 'pixi.js';
|
|
|
15
15
|
import { SPECIAL_ROOM_IDS } from '@ray-js/robot-protocol';
|
|
16
16
|
import { SpecialRoomId } from '@ray-js/robot-protocol';
|
|
17
17
|
import { Sprite } from 'pixi.js';
|
|
18
|
+
import { StructuredMapDataSource } from '@ray-js/robot-protocol';
|
|
18
19
|
import { TextStyleFontWeight } from 'pixi.js';
|
|
19
20
|
import { Texture } from 'pixi.js';
|
|
20
21
|
|
|
@@ -310,6 +311,11 @@ export declare type AppConfig = {
|
|
|
310
311
|
opacity: number
|
|
311
312
|
/** 缩放系数 */
|
|
312
313
|
scale: number
|
|
314
|
+
// 地毯材质配置,针对地毯需要不同类型的填充材质的情况,比如羊毛地毯,长毛地毯等等
|
|
315
|
+
// 优先级比src要高,非必要情况,非必要不要传递,使用src的配置即可
|
|
316
|
+
material?: { type: number; src: string; opacity: number; scale: number }[]
|
|
317
|
+
// 地毯是否支持编辑,默认为false,非必要不要开启,会影响地毯绘制性能
|
|
318
|
+
enableEdit?: boolean
|
|
313
319
|
}
|
|
314
320
|
|
|
315
321
|
/** 机器人配置 */
|
|
@@ -544,6 +550,49 @@ export declare type AppOptions = {
|
|
|
544
550
|
runtime: DeepPartialRuntimeConfig
|
|
545
551
|
}
|
|
546
552
|
|
|
553
|
+
declare abstract class BaseControlButton<T extends BaseControlButtonOptions = BaseControlButtonOptions> extends FixedSizeContainer {
|
|
554
|
+
protected background: Graphics;
|
|
555
|
+
protected icon: EnhancedSprite;
|
|
556
|
+
protected options: T;
|
|
557
|
+
constructor(options: T);
|
|
558
|
+
/**
|
|
559
|
+
* 抽象方法:子类需要实现具体的事件监听逻辑
|
|
560
|
+
*/
|
|
561
|
+
protected abstract setupEvents(): void;
|
|
562
|
+
/**
|
|
563
|
+
* 设置点击热区
|
|
564
|
+
*/
|
|
565
|
+
private setupHitArea;
|
|
566
|
+
/**
|
|
567
|
+
* 渲染按钮
|
|
568
|
+
*/
|
|
569
|
+
private render;
|
|
570
|
+
/**
|
|
571
|
+
* 渲染背景
|
|
572
|
+
*/
|
|
573
|
+
protected renderBackground(): void;
|
|
574
|
+
/**
|
|
575
|
+
* 渲染图标
|
|
576
|
+
*/
|
|
577
|
+
protected renderIcon(): Promise<void>;
|
|
578
|
+
/**
|
|
579
|
+
* 销毁组件
|
|
580
|
+
*/
|
|
581
|
+
destroy(): void;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
declare type BaseControlButtonOptions = {
|
|
585
|
+
iconAlias: string;
|
|
586
|
+
backgroundColor: ColorSource;
|
|
587
|
+
config?: {
|
|
588
|
+
iconWrapperWidth: number;
|
|
589
|
+
iconWrapperHeight: number;
|
|
590
|
+
iconWrapperBorderRadius: number;
|
|
591
|
+
iconWidth: number;
|
|
592
|
+
iconHeight: number;
|
|
593
|
+
};
|
|
594
|
+
};
|
|
595
|
+
|
|
547
596
|
/**
|
|
548
597
|
* 基础自定义元素参数(所有类型共享)
|
|
549
598
|
*/
|
|
@@ -567,6 +616,54 @@ export declare type BaseCustomElementParam = {
|
|
|
567
616
|
sizeFixed?: boolean
|
|
568
617
|
}
|
|
569
618
|
|
|
619
|
+
/** 区域和地毯配置的基础类型 */
|
|
620
|
+
export declare type BaseZoneConfig = {
|
|
621
|
+
/** 最小尺寸 (米) */
|
|
622
|
+
minSize: number
|
|
623
|
+
/** 图标容器填充颜色 */
|
|
624
|
+
iconWrapperFillColor: ColorSource
|
|
625
|
+
/** 描边颜色 */
|
|
626
|
+
strokeColor: ColorSource
|
|
627
|
+
/** 描边宽度 */
|
|
628
|
+
strokeWidth: number
|
|
629
|
+
/** 填充颜色 */
|
|
630
|
+
fillColor: ColorSource
|
|
631
|
+
/** 轮廓偏移 */
|
|
632
|
+
outlineOffset: number
|
|
633
|
+
/** 轮廓描边颜色 */
|
|
634
|
+
outlineStrokeColor: ColorSource
|
|
635
|
+
/** 轮廓描边宽度 */
|
|
636
|
+
outlineStrokeWidth: number
|
|
637
|
+
/** 轮廓填充颜色 */
|
|
638
|
+
outlineFillColor: ColorSource
|
|
639
|
+
/** 轮廓是否虚线 */
|
|
640
|
+
outlineDashed: boolean
|
|
641
|
+
/** 轮廓虚线数组 */
|
|
642
|
+
outlineDashArray: [number, number]
|
|
643
|
+
/** 是否显示旋转图标 */
|
|
644
|
+
showRotateButton: boolean
|
|
645
|
+
/** 文本颜色 */
|
|
646
|
+
textColor: ColorSource
|
|
647
|
+
/** 文本位置 */
|
|
648
|
+
textPosition: 'top' | 'right' | 'bottom' | 'left'
|
|
649
|
+
/** 文本偏移 */
|
|
650
|
+
textOffset: number
|
|
651
|
+
/** 编辑模式样式 */
|
|
652
|
+
editing: {
|
|
653
|
+
/** 是否虚线 */
|
|
654
|
+
isDashed: boolean
|
|
655
|
+
/** 虚线数组 */
|
|
656
|
+
dashArray: [number, number]
|
|
657
|
+
}
|
|
658
|
+
/** 普通模式样式 */
|
|
659
|
+
normal: {
|
|
660
|
+
/** 是否虚线 */
|
|
661
|
+
isDashed: boolean
|
|
662
|
+
/** 虚线数组 */
|
|
663
|
+
dashArray: [number, number]
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
|
|
570
667
|
/** 边界框 */
|
|
571
668
|
export declare type Bounds = {
|
|
572
669
|
/** 最小X坐标 */
|
|
@@ -619,6 +716,18 @@ declare class Carpet extends Container {
|
|
|
619
716
|
destroy(): void;
|
|
620
717
|
}
|
|
621
718
|
|
|
719
|
+
/** 地毯配置 */
|
|
720
|
+
export declare type CarpetConfig = BaseZoneConfig & {
|
|
721
|
+
/** 是否开启自由旋转模式 */
|
|
722
|
+
enableFreeRotate: boolean
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
declare type CarpetOptions = {
|
|
726
|
+
carpetData: CustomCarpetParam;
|
|
727
|
+
textureMap: Map<number, Texture>;
|
|
728
|
+
events?: CustomCarpetEvents;
|
|
729
|
+
};
|
|
730
|
+
|
|
622
731
|
declare class ChargingStation extends Container {
|
|
623
732
|
chargingStation: ChargingStationIcon;
|
|
624
733
|
ring: Ring;
|
|
@@ -669,6 +778,10 @@ export declare type ControlsConfig = {
|
|
|
669
778
|
scaleIconSrc: string
|
|
670
779
|
/** 移动图标资源路径 */
|
|
671
780
|
moveIconSrc: string
|
|
781
|
+
/** 横向缩放图标资源路径 */
|
|
782
|
+
horizontalScaleIconSrc: string
|
|
783
|
+
/** 纵向缩放图标资源路径 */
|
|
784
|
+
verticalScaleIconSrc: string
|
|
672
785
|
/** 移动按钮偏移 */
|
|
673
786
|
moveButtonOffset: number
|
|
674
787
|
/** 文本字体大小 */
|
|
@@ -683,6 +796,8 @@ export declare type ControlsConfig = {
|
|
|
683
796
|
forbiddenMopZone: ZoneConfig
|
|
684
797
|
/** 清扫区域配置 */
|
|
685
798
|
cleanZone: ZoneConfig
|
|
799
|
+
/** 地毯配置 */
|
|
800
|
+
carpet: CarpetConfig
|
|
686
801
|
/** 虚拟墙配置 */
|
|
687
802
|
virtualWall: VirtualWallConfig
|
|
688
803
|
/** 定点清扫配置 */
|
|
@@ -904,6 +1019,282 @@ declare class ControlsManager {
|
|
|
904
1019
|
destroy(): void;
|
|
905
1020
|
}
|
|
906
1021
|
|
|
1022
|
+
declare class CustomCarpet extends Container {
|
|
1023
|
+
private carpetData;
|
|
1024
|
+
private carpetConfig;
|
|
1025
|
+
private controlsConfig;
|
|
1026
|
+
private carpetEvents;
|
|
1027
|
+
private controlFill;
|
|
1028
|
+
private editControlLayer;
|
|
1029
|
+
private clickHandler;
|
|
1030
|
+
private maskContainer;
|
|
1031
|
+
private maskGraphics;
|
|
1032
|
+
private texture;
|
|
1033
|
+
private textureMap;
|
|
1034
|
+
private tilingSprite;
|
|
1035
|
+
private initialZonePoints;
|
|
1036
|
+
private unsubscribeFns;
|
|
1037
|
+
constructor(options: CarpetOptions);
|
|
1038
|
+
/**
|
|
1039
|
+
* 处理地毯数据(点集合)
|
|
1040
|
+
*/
|
|
1041
|
+
private processCarpetData;
|
|
1042
|
+
/**
|
|
1043
|
+
* 获取控制元素配置
|
|
1044
|
+
*/
|
|
1045
|
+
private getControlsConfig;
|
|
1046
|
+
/**
|
|
1047
|
+
* 获取当前编辑状态(是否在 editingCarpetIds 中)
|
|
1048
|
+
*/
|
|
1049
|
+
private isEditingEnabled;
|
|
1050
|
+
/**
|
|
1051
|
+
* 获取当前选中状态(是否在 selectedCarpetIds 中)
|
|
1052
|
+
*/
|
|
1053
|
+
private isSelected;
|
|
1054
|
+
/**
|
|
1055
|
+
* 是否应该显示编辑框(在 editingCarpetIds 或 selectedCarpetIds 中)
|
|
1056
|
+
*/
|
|
1057
|
+
private shouldShowEditControl;
|
|
1058
|
+
/**
|
|
1059
|
+
* 初始化组件
|
|
1060
|
+
*/
|
|
1061
|
+
private initializeComponents;
|
|
1062
|
+
/**
|
|
1063
|
+
* 创建遮罩容器(用于地毯纹理)
|
|
1064
|
+
*/
|
|
1065
|
+
private createMaskContainer;
|
|
1066
|
+
/**
|
|
1067
|
+
* 创建控制填充组件
|
|
1068
|
+
*/
|
|
1069
|
+
private createControlFill;
|
|
1070
|
+
/**
|
|
1071
|
+
* 创建编辑控制层(通过 EditControlManager)
|
|
1072
|
+
*/
|
|
1073
|
+
private createEditControlLayer;
|
|
1074
|
+
/**
|
|
1075
|
+
* 设置点击处理器(用于非编辑状态下的点击)
|
|
1076
|
+
*/
|
|
1077
|
+
private setupClickHandler;
|
|
1078
|
+
/**
|
|
1079
|
+
* 设置 enableRoomSelection 监听器
|
|
1080
|
+
*/
|
|
1081
|
+
private setupEnableRoomSelectionListener;
|
|
1082
|
+
/**
|
|
1083
|
+
* 检查是否启用了房间选择模式
|
|
1084
|
+
*/
|
|
1085
|
+
private isRoomSelectionEnabled;
|
|
1086
|
+
/**
|
|
1087
|
+
* 更新点击处理器状态
|
|
1088
|
+
*/
|
|
1089
|
+
private updateClickHandlerState;
|
|
1090
|
+
/**
|
|
1091
|
+
* 计算地毯边界
|
|
1092
|
+
*/
|
|
1093
|
+
private calculateBounds;
|
|
1094
|
+
/**
|
|
1095
|
+
* 计算自定义形状的外接矩形点集
|
|
1096
|
+
*/
|
|
1097
|
+
private calculateBoundingRectanglePoints;
|
|
1098
|
+
/**
|
|
1099
|
+
* 更新遮罩形状
|
|
1100
|
+
*/
|
|
1101
|
+
private updateMaskShape;
|
|
1102
|
+
/**
|
|
1103
|
+
* 异步加载地毯纹理
|
|
1104
|
+
*/
|
|
1105
|
+
private loadTexture;
|
|
1106
|
+
/**
|
|
1107
|
+
* 创建平铺纹理精灵
|
|
1108
|
+
*/
|
|
1109
|
+
private createTilingSprite;
|
|
1110
|
+
/**
|
|
1111
|
+
* 更新平铺纹理位置和大小
|
|
1112
|
+
*/
|
|
1113
|
+
private updateTilingSprite;
|
|
1114
|
+
/**
|
|
1115
|
+
* 处理拖拽开始
|
|
1116
|
+
*/
|
|
1117
|
+
private handleDragStart;
|
|
1118
|
+
/**
|
|
1119
|
+
* 处理拖拽移动
|
|
1120
|
+
*/
|
|
1121
|
+
private handleDragMove;
|
|
1122
|
+
/**
|
|
1123
|
+
* 处理拖拽结束
|
|
1124
|
+
*/
|
|
1125
|
+
private handleDragEnd;
|
|
1126
|
+
/**
|
|
1127
|
+
* 处理移动开始
|
|
1128
|
+
*/
|
|
1129
|
+
private handleMoveStart;
|
|
1130
|
+
/**
|
|
1131
|
+
* 处理移动过程
|
|
1132
|
+
*/
|
|
1133
|
+
private handleMove;
|
|
1134
|
+
/**
|
|
1135
|
+
* 处理移动结束
|
|
1136
|
+
*/
|
|
1137
|
+
private handleMoveEnd;
|
|
1138
|
+
/**
|
|
1139
|
+
* 应用平移变换(拖拽和移动的公共方法)
|
|
1140
|
+
*/
|
|
1141
|
+
private applyTranslation;
|
|
1142
|
+
/**
|
|
1143
|
+
* 处理旋转开始
|
|
1144
|
+
*/
|
|
1145
|
+
private handleRotationStart;
|
|
1146
|
+
/**
|
|
1147
|
+
* 处理旋转移动
|
|
1148
|
+
*/
|
|
1149
|
+
private handleRotationMove;
|
|
1150
|
+
/**
|
|
1151
|
+
* 处理旋转结束
|
|
1152
|
+
*/
|
|
1153
|
+
private handleRotationEnd;
|
|
1154
|
+
/**
|
|
1155
|
+
* 处理缩放开始
|
|
1156
|
+
*/
|
|
1157
|
+
private handleScaleStart;
|
|
1158
|
+
/**
|
|
1159
|
+
* 处理缩放移动
|
|
1160
|
+
*/
|
|
1161
|
+
private handleScaleMove;
|
|
1162
|
+
/**
|
|
1163
|
+
* 处理水平缩放移动
|
|
1164
|
+
*/
|
|
1165
|
+
private handleScaleMoveHorizontal;
|
|
1166
|
+
/**
|
|
1167
|
+
* 处理垂直缩放移动
|
|
1168
|
+
*/
|
|
1169
|
+
private handleScaleMoveVertical;
|
|
1170
|
+
/**
|
|
1171
|
+
* 处理缩放结束
|
|
1172
|
+
*/
|
|
1173
|
+
private handleScaleEnd;
|
|
1174
|
+
/**
|
|
1175
|
+
* 处理删除操作
|
|
1176
|
+
*/
|
|
1177
|
+
private handleDelete;
|
|
1178
|
+
/**
|
|
1179
|
+
* 处理点击事件
|
|
1180
|
+
*/
|
|
1181
|
+
private handleClick;
|
|
1182
|
+
/**
|
|
1183
|
+
* 处理点集更新
|
|
1184
|
+
*/
|
|
1185
|
+
private handlePointsUpdate;
|
|
1186
|
+
/**
|
|
1187
|
+
* 绘制地毯
|
|
1188
|
+
*/
|
|
1189
|
+
private drawCarpet;
|
|
1190
|
+
/**
|
|
1191
|
+
* 更新编辑状态(公共方法)
|
|
1192
|
+
*/
|
|
1193
|
+
updateEditState(): void;
|
|
1194
|
+
/**
|
|
1195
|
+
* 更新地毯数据
|
|
1196
|
+
*/
|
|
1197
|
+
updateCarpetData(newData: CustomCarpetParam): void;
|
|
1198
|
+
/**
|
|
1199
|
+
* 获取当前地毯数据
|
|
1200
|
+
*/
|
|
1201
|
+
getCarpetData(): CustomCarpetParam;
|
|
1202
|
+
/**
|
|
1203
|
+
* 刷新显示(用于单位变化等场景)
|
|
1204
|
+
*/
|
|
1205
|
+
refreshDisplay(): void;
|
|
1206
|
+
/**
|
|
1207
|
+
* 销毁组件
|
|
1208
|
+
*/
|
|
1209
|
+
destroy(): void;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
declare type CustomCarpetEvents = {
|
|
1213
|
+
onRemove?: (id: string) => void;
|
|
1214
|
+
onUpdate?: (zone: CustomCarpetParam) => void;
|
|
1215
|
+
onClick?: (zone: CustomCarpetParam) => void;
|
|
1216
|
+
};
|
|
1217
|
+
|
|
1218
|
+
declare class CustomCarpetManager {
|
|
1219
|
+
private customCarpetMap;
|
|
1220
|
+
private unsubscribeFns;
|
|
1221
|
+
private textureMap;
|
|
1222
|
+
private texturesLoaded;
|
|
1223
|
+
private texturesLoadingPromise;
|
|
1224
|
+
constructor();
|
|
1225
|
+
/**
|
|
1226
|
+
* 加载材质纹理
|
|
1227
|
+
* 如果已经加载过,直接返回已完成的 Promise
|
|
1228
|
+
* 如果正在加载,返回正在进行的 Promise
|
|
1229
|
+
* 如果未加载,开始加载并返回 Promise
|
|
1230
|
+
*/
|
|
1231
|
+
loadTextures(): Promise<void>;
|
|
1232
|
+
/**
|
|
1233
|
+
* 内部方法:实际加载纹理
|
|
1234
|
+
*/
|
|
1235
|
+
private _loadTextures;
|
|
1236
|
+
/**
|
|
1237
|
+
* 根据地图原点更新所有自定义地毯位置
|
|
1238
|
+
*/
|
|
1239
|
+
updatePositionByOrigin(x: number, y: number): void;
|
|
1240
|
+
/**
|
|
1241
|
+
* 绘制自定义地毯
|
|
1242
|
+
*/
|
|
1243
|
+
drawCustomCarpets(carpets: CustomCarpetParam[]): Promise<void>;
|
|
1244
|
+
/**
|
|
1245
|
+
* 获取所有自定义地毯数据
|
|
1246
|
+
*/
|
|
1247
|
+
getCustomCarpets(): CustomCarpetParam[];
|
|
1248
|
+
/**
|
|
1249
|
+
* 根据 ID 获取自定义地毯
|
|
1250
|
+
*/
|
|
1251
|
+
getCustomCarpetById(id: string): CustomCarpet | undefined;
|
|
1252
|
+
/**
|
|
1253
|
+
* 清除所有自定义地毯
|
|
1254
|
+
*/
|
|
1255
|
+
clearAllCustomCarpets(): void;
|
|
1256
|
+
/**
|
|
1257
|
+
* 添加新自定义地毯到 LAYER_CUSTOM_CARPET
|
|
1258
|
+
*/
|
|
1259
|
+
private addNewCustomCarpet;
|
|
1260
|
+
/**
|
|
1261
|
+
* 移除自定义地毯
|
|
1262
|
+
*/
|
|
1263
|
+
private removeCustomCarpet;
|
|
1264
|
+
/**
|
|
1265
|
+
* 更新自定义地毯编辑状态
|
|
1266
|
+
*/
|
|
1267
|
+
private updateCarpetsEditState;
|
|
1268
|
+
/**
|
|
1269
|
+
* 比较两个地毯数据是否相等
|
|
1270
|
+
*/
|
|
1271
|
+
private isCarpetDataEqual;
|
|
1272
|
+
/**
|
|
1273
|
+
* 刷新显示(单位变化时调用)
|
|
1274
|
+
*/
|
|
1275
|
+
refreshDisplay(): void;
|
|
1276
|
+
/**
|
|
1277
|
+
* 销毁管理器
|
|
1278
|
+
*/
|
|
1279
|
+
destroy(): void;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
/** 自定义地毯参数 */
|
|
1283
|
+
export declare type CustomCarpetParam = {
|
|
1284
|
+
/** 地毯ID */
|
|
1285
|
+
id: string
|
|
1286
|
+
/** 地毯材质 */
|
|
1287
|
+
type: number
|
|
1288
|
+
/** 点集合(用于矩形和圆形) */
|
|
1289
|
+
points?: Point[]
|
|
1290
|
+
|
|
1291
|
+
/** 形状 */
|
|
1292
|
+
shape: 'rectangle' | 'round' | 'custom',
|
|
1293
|
+
|
|
1294
|
+
/** 自定义数据 */
|
|
1295
|
+
customData?: Record<string, any>
|
|
1296
|
+
}
|
|
1297
|
+
|
|
907
1298
|
/**
|
|
908
1299
|
* 自定义元素参数
|
|
909
1300
|
*/
|
|
@@ -1072,6 +1463,351 @@ export declare type DividerConfig = {
|
|
|
1072
1463
|
defaultDirection: Direction
|
|
1073
1464
|
}
|
|
1074
1465
|
|
|
1466
|
+
declare type EditControlConfig = {
|
|
1467
|
+
outlineStrokeColor: ColorSource;
|
|
1468
|
+
outlineStrokeWidth: number;
|
|
1469
|
+
outlineDashed: boolean;
|
|
1470
|
+
outlineDashArray: [number, number];
|
|
1471
|
+
outlineFillColor?: ColorSource;
|
|
1472
|
+
outlineOffset: number;
|
|
1473
|
+
iconWrapperFillColor: ColorSource;
|
|
1474
|
+
showRotateButton: boolean;
|
|
1475
|
+
showScaleButton?: boolean;
|
|
1476
|
+
showRadialScaleButton?: boolean;
|
|
1477
|
+
showDeleteButton?: boolean;
|
|
1478
|
+
showMoveButton?: boolean;
|
|
1479
|
+
textColor: ColorSource;
|
|
1480
|
+
textPosition: 'top' | 'right' | 'bottom' | 'left';
|
|
1481
|
+
textOffset: number;
|
|
1482
|
+
moveButtonOffset: number;
|
|
1483
|
+
textFontSize: number;
|
|
1484
|
+
textFontFamily: string;
|
|
1485
|
+
textFontWeight: TextStyleFontWeight;
|
|
1486
|
+
};
|
|
1487
|
+
|
|
1488
|
+
declare type EditControlEvents = {
|
|
1489
|
+
onRemove?: () => void;
|
|
1490
|
+
onRotateStart?: (rotationCenter: Point) => void;
|
|
1491
|
+
onRotateMove?: (newPoints?: Point[]) => void;
|
|
1492
|
+
onRotateEnd?: () => void;
|
|
1493
|
+
onClickRotate?: (newPoints?: Point[]) => void;
|
|
1494
|
+
onScaleStart?: () => void;
|
|
1495
|
+
onScaleMove?: (newPoints?: Point[]) => void;
|
|
1496
|
+
onScaleMoveHorizontal?: (newPoints?: Point[]) => void;
|
|
1497
|
+
onScaleMoveVertical?: (newPoints?: Point[]) => void;
|
|
1498
|
+
onScaleEnd?: () => void;
|
|
1499
|
+
onMoveStart?: () => void;
|
|
1500
|
+
onMoveMove?: (event: FederatedPointerEvent) => void;
|
|
1501
|
+
onMoveEnd?: () => void;
|
|
1502
|
+
onClick?: () => void;
|
|
1503
|
+
onPointsUpdate?: (newPoints: Point[]) => void;
|
|
1504
|
+
};
|
|
1505
|
+
|
|
1506
|
+
/**
|
|
1507
|
+
* 编辑控制层组件
|
|
1508
|
+
* 统一管理编辑状态下的控制按钮、轮廓边框、移动延长线和尺寸文本
|
|
1509
|
+
*/
|
|
1510
|
+
declare class EditControlLayer extends Container {
|
|
1511
|
+
private config;
|
|
1512
|
+
private events;
|
|
1513
|
+
private zonePoints;
|
|
1514
|
+
private outlinePoints;
|
|
1515
|
+
private minSize;
|
|
1516
|
+
private initialZonePoints;
|
|
1517
|
+
private scaleCache;
|
|
1518
|
+
private rotationCache;
|
|
1519
|
+
private outlineBorder;
|
|
1520
|
+
private moveLine;
|
|
1521
|
+
private sizeText;
|
|
1522
|
+
private controlButtons;
|
|
1523
|
+
private deleteButton;
|
|
1524
|
+
private rotateButton;
|
|
1525
|
+
private scaleButton;
|
|
1526
|
+
private moveButton;
|
|
1527
|
+
private horizontalScaleButton;
|
|
1528
|
+
private verticalScaleButton;
|
|
1529
|
+
private horizontalScaleInitialPosition;
|
|
1530
|
+
private verticalScaleInitialPosition;
|
|
1531
|
+
private clickHandler;
|
|
1532
|
+
private throttledUpdateOutline;
|
|
1533
|
+
constructor(options: EditControlLayerOptions);
|
|
1534
|
+
/**
|
|
1535
|
+
* 初始化组件
|
|
1536
|
+
*/
|
|
1537
|
+
private initializeComponents;
|
|
1538
|
+
/**
|
|
1539
|
+
* 创建轮廓边框
|
|
1540
|
+
*/
|
|
1541
|
+
private createOutlineBorder;
|
|
1542
|
+
/**
|
|
1543
|
+
* 创建移动按钮延长线
|
|
1544
|
+
*/
|
|
1545
|
+
private createMoveLine;
|
|
1546
|
+
/**
|
|
1547
|
+
* 创建尺寸文本
|
|
1548
|
+
*/
|
|
1549
|
+
private createSizeText;
|
|
1550
|
+
private createDeleteButton;
|
|
1551
|
+
private createRotateButton;
|
|
1552
|
+
private onClickRotateButton;
|
|
1553
|
+
private createScaleButton;
|
|
1554
|
+
private createHorizontalScaleButton;
|
|
1555
|
+
private createVerticalScaleButton;
|
|
1556
|
+
private createMoveButton;
|
|
1557
|
+
/**
|
|
1558
|
+
* 创建并添加按钮到容器
|
|
1559
|
+
*/
|
|
1560
|
+
private createAndAddButton;
|
|
1561
|
+
/**
|
|
1562
|
+
* 创建控制按钮
|
|
1563
|
+
*/
|
|
1564
|
+
private createControlButtons;
|
|
1565
|
+
/**
|
|
1566
|
+
* 计算轮廓边框的点
|
|
1567
|
+
*/
|
|
1568
|
+
private calculateOutlinePoints;
|
|
1569
|
+
/**
|
|
1570
|
+
* 计算移动按钮的位置(在 MOVE 点的延长线上)
|
|
1571
|
+
* 使用角平分线算法计算按钮位置,使其位于 MOVE、SCALE、REMOVE 三个点形成的角的角平分线上
|
|
1572
|
+
*/
|
|
1573
|
+
private calculateMoveButtonPosition;
|
|
1574
|
+
/**
|
|
1575
|
+
* 计算移动按钮延长线的点
|
|
1576
|
+
* 返回从 MOVE 点到移动按钮位置的线段
|
|
1577
|
+
*/
|
|
1578
|
+
private calculateMoveLinePoints;
|
|
1579
|
+
/**
|
|
1580
|
+
* 计算区域尺寸文本(宽x高格式)
|
|
1581
|
+
*/
|
|
1582
|
+
private calculateSizeText;
|
|
1583
|
+
/**
|
|
1584
|
+
* 计算边的中点
|
|
1585
|
+
*/
|
|
1586
|
+
private getEdgeCenter;
|
|
1587
|
+
/**
|
|
1588
|
+
* 计算垂直于边的偏移方向
|
|
1589
|
+
* @param start 边的起点
|
|
1590
|
+
* @param end 边的终点
|
|
1591
|
+
* @param offset 偏移距离
|
|
1592
|
+
* @param reverseNormal 是否反转法向量方向(用于 bottom case)
|
|
1593
|
+
*/
|
|
1594
|
+
private calculatePerpendicularOffset;
|
|
1595
|
+
/**
|
|
1596
|
+
* 计算尺寸文本位置(基于textPosition)
|
|
1597
|
+
*/
|
|
1598
|
+
private calculateSizeTextPosition;
|
|
1599
|
+
/**
|
|
1600
|
+
* 计算尺寸文本旋转角度(与对应边平行)
|
|
1601
|
+
*/
|
|
1602
|
+
private calculateSizeTextRotation;
|
|
1603
|
+
/**
|
|
1604
|
+
* 计算水平缩放按钮旋转角度(与右侧边平行)
|
|
1605
|
+
*/
|
|
1606
|
+
private calculateHorizontalScaleButtonRotation;
|
|
1607
|
+
/**
|
|
1608
|
+
* 计算垂直缩放按钮旋转角度(与底边平行)
|
|
1609
|
+
*/
|
|
1610
|
+
private calculateVerticalScaleButtonRotation;
|
|
1611
|
+
/**
|
|
1612
|
+
* 更新点集(公共方法)
|
|
1613
|
+
*/
|
|
1614
|
+
updatePoints(points: Point[]): void;
|
|
1615
|
+
/**
|
|
1616
|
+
* 更新轮廓边框
|
|
1617
|
+
*/
|
|
1618
|
+
updateOutlineBorder(): void;
|
|
1619
|
+
/**
|
|
1620
|
+
* 更新移动按钮延长线
|
|
1621
|
+
*/
|
|
1622
|
+
updateMoveLine(): void;
|
|
1623
|
+
/**
|
|
1624
|
+
* 更新尺寸文本
|
|
1625
|
+
*/
|
|
1626
|
+
updateSizeText(): void;
|
|
1627
|
+
/**
|
|
1628
|
+
* 更新尺寸文本位置
|
|
1629
|
+
*/
|
|
1630
|
+
updateSizeTextPosition(): void;
|
|
1631
|
+
/**
|
|
1632
|
+
* 更新控制按钮位置
|
|
1633
|
+
*/
|
|
1634
|
+
updateControlButtonsPosition(): void;
|
|
1635
|
+
/**
|
|
1636
|
+
* 设置点击处理器
|
|
1637
|
+
*/
|
|
1638
|
+
private setupClickHandler;
|
|
1639
|
+
/**
|
|
1640
|
+
* 注册缩放事件监听
|
|
1641
|
+
*/
|
|
1642
|
+
private registerScaleListener;
|
|
1643
|
+
/**
|
|
1644
|
+
* 处理缩放变化时的outline更新
|
|
1645
|
+
*/
|
|
1646
|
+
private updateOutlineForScale;
|
|
1647
|
+
/**
|
|
1648
|
+
* 初始化缩放计算缓存
|
|
1649
|
+
*/
|
|
1650
|
+
private initializeScaleCache;
|
|
1651
|
+
/**
|
|
1652
|
+
* 处理内部缩放移动
|
|
1653
|
+
* @param deltaX X 方向的偏移量
|
|
1654
|
+
* @param deltaY Y 方向的偏移量
|
|
1655
|
+
* @returns 计算后的新点集,如果无法缩放则返回 null
|
|
1656
|
+
*/
|
|
1657
|
+
private handleInternalScaleMove;
|
|
1658
|
+
/**
|
|
1659
|
+
* 重置缩放状态
|
|
1660
|
+
*/
|
|
1661
|
+
private resetScaleState;
|
|
1662
|
+
/**
|
|
1663
|
+
* 处理内部水平缩放移动
|
|
1664
|
+
* @param deltaX X 方向的偏移量
|
|
1665
|
+
* @param deltaY Y 方向的偏移量
|
|
1666
|
+
* @returns 计算后的新点集,如果无法缩放则返回 null
|
|
1667
|
+
*/
|
|
1668
|
+
private handleInternalHorizontalScaleMove;
|
|
1669
|
+
/**
|
|
1670
|
+
* 处理内部垂直缩放移动
|
|
1671
|
+
* @param deltaX X 方向的偏移量
|
|
1672
|
+
* @param deltaY Y 方向的偏移量
|
|
1673
|
+
* @returns 计算后的新点集,如果无法缩放则返回 null
|
|
1674
|
+
*/
|
|
1675
|
+
private handleInternalVerticalScaleMove;
|
|
1676
|
+
/**
|
|
1677
|
+
* 根据缩放比例计算新的点集
|
|
1678
|
+
*/
|
|
1679
|
+
private calculatePointsFromScale;
|
|
1680
|
+
/**
|
|
1681
|
+
* 初始化旋转计算缓存
|
|
1682
|
+
*/
|
|
1683
|
+
private initializeRotationCache;
|
|
1684
|
+
/**
|
|
1685
|
+
* 处理内部旋转移动
|
|
1686
|
+
* 优化:基于初始点集和累计角度计算,避免累积误差
|
|
1687
|
+
* @returns 计算后的新点集,如果无法旋转则返回 null
|
|
1688
|
+
*/
|
|
1689
|
+
private handleInternalRotationMove;
|
|
1690
|
+
/**
|
|
1691
|
+
* 重置旋转状态
|
|
1692
|
+
*/
|
|
1693
|
+
private resetRotationState;
|
|
1694
|
+
/**
|
|
1695
|
+
* 计算旋转中心(用于点击旋转)
|
|
1696
|
+
*/
|
|
1697
|
+
private calculateRotationCenter;
|
|
1698
|
+
/**
|
|
1699
|
+
* 更新编辑状态
|
|
1700
|
+
* @param options 控制各个元素显示/隐藏的选项
|
|
1701
|
+
*/
|
|
1702
|
+
updateEditState({ showRotateButton, showScaleButton, showRadialScaleButton, showDeleteButton, showMoveButton, showBorder, showSizeText, borderStyle, }: {
|
|
1703
|
+
showRotateButton?: boolean;
|
|
1704
|
+
showScaleButton?: boolean;
|
|
1705
|
+
showRadialScaleButton?: boolean;
|
|
1706
|
+
showDeleteButton?: boolean;
|
|
1707
|
+
showMoveButton?: boolean;
|
|
1708
|
+
showBorder?: boolean;
|
|
1709
|
+
showSizeText?: boolean;
|
|
1710
|
+
borderStyle?: {
|
|
1711
|
+
isDashed: boolean;
|
|
1712
|
+
dashArray?: [number, number];
|
|
1713
|
+
};
|
|
1714
|
+
}): void;
|
|
1715
|
+
/**
|
|
1716
|
+
* 获取操作状态
|
|
1717
|
+
*/
|
|
1718
|
+
getOperationState(): OperationState;
|
|
1719
|
+
/**
|
|
1720
|
+
* 停止所有操作
|
|
1721
|
+
*/
|
|
1722
|
+
stopAllOperations(): void;
|
|
1723
|
+
/**
|
|
1724
|
+
* 获取控制按钮容器(供外部添加额外按钮)
|
|
1725
|
+
*/
|
|
1726
|
+
getControlButtonsContainer(): Container;
|
|
1727
|
+
/**
|
|
1728
|
+
* 获取移动按钮(供外部调用)
|
|
1729
|
+
*/
|
|
1730
|
+
getMoveButton(): MoveControlButton | null;
|
|
1731
|
+
/**
|
|
1732
|
+
* 计算指定边的中点位置
|
|
1733
|
+
* @param startIndex 起始点索引
|
|
1734
|
+
* @param endIndex 结束点索引
|
|
1735
|
+
*/
|
|
1736
|
+
calculateEdgeMidpoint(startIndex: number, endIndex: number): Point;
|
|
1737
|
+
/**
|
|
1738
|
+
* 销毁组件
|
|
1739
|
+
*/
|
|
1740
|
+
destroy(): void;
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
declare type EditControlLayerOptions = {
|
|
1744
|
+
config: EditControlConfig;
|
|
1745
|
+
zonePoints: Point[];
|
|
1746
|
+
events?: EditControlEvents;
|
|
1747
|
+
minSize?: number;
|
|
1748
|
+
};
|
|
1749
|
+
|
|
1750
|
+
/**
|
|
1751
|
+
* 编辑控制管理器
|
|
1752
|
+
* 统一管理所有编辑控制层,将它们放在最顶层以确保始终可见
|
|
1753
|
+
*/
|
|
1754
|
+
declare class EditControlManager {
|
|
1755
|
+
private editControlLayers;
|
|
1756
|
+
constructor();
|
|
1757
|
+
/**
|
|
1758
|
+
* 注册编辑控制层
|
|
1759
|
+
* @param id 组件唯一标识(如 Zone ID、Carpet ID)
|
|
1760
|
+
* @param options 编辑控制层配置
|
|
1761
|
+
* @returns 创建的 EditControlLayer 实例
|
|
1762
|
+
*/
|
|
1763
|
+
registerEditControl(id: string | number, options: EditControlLayerOptions): EditControlLayer;
|
|
1764
|
+
/**
|
|
1765
|
+
* 注销编辑控制层
|
|
1766
|
+
* @param id 组件唯一标识
|
|
1767
|
+
*/
|
|
1768
|
+
unregisterEditControl(id: string | number): void;
|
|
1769
|
+
/**
|
|
1770
|
+
* 获取编辑控制层
|
|
1771
|
+
* @param id 组件唯一标识
|
|
1772
|
+
* @returns EditControlLayer 实例,如果不存在则返回 undefined
|
|
1773
|
+
*/
|
|
1774
|
+
getEditControl(id: string | number): EditControlLayer | undefined;
|
|
1775
|
+
/**
|
|
1776
|
+
* 更新编辑控制层状态
|
|
1777
|
+
* @param id 组件唯一标识
|
|
1778
|
+
* @param options 控制各个元素显示/隐藏的选项
|
|
1779
|
+
*/
|
|
1780
|
+
updateEditState(id: string | number, options: {
|
|
1781
|
+
showRotateButton?: boolean;
|
|
1782
|
+
showScaleButton?: boolean;
|
|
1783
|
+
showRadialScaleButton?: boolean;
|
|
1784
|
+
showDeleteButton?: boolean;
|
|
1785
|
+
showMoveButton?: boolean;
|
|
1786
|
+
showBorder?: boolean;
|
|
1787
|
+
showSizeText?: boolean;
|
|
1788
|
+
borderStyle?: {
|
|
1789
|
+
isDashed: boolean;
|
|
1790
|
+
dashArray?: [number, number];
|
|
1791
|
+
};
|
|
1792
|
+
}): void;
|
|
1793
|
+
/**
|
|
1794
|
+
* 清空所有编辑控制层
|
|
1795
|
+
*/
|
|
1796
|
+
clearAll(): void;
|
|
1797
|
+
/**
|
|
1798
|
+
* 获取所有编辑控制层
|
|
1799
|
+
* @returns 所有编辑控制层的数组
|
|
1800
|
+
*/
|
|
1801
|
+
getAllEditControls(): EditControlLayer[];
|
|
1802
|
+
updatePositionByOrigin(x: number, y: number): void;
|
|
1803
|
+
/**
|
|
1804
|
+
* 检查是否存在编辑控制层
|
|
1805
|
+
* @param id 组件唯一标识
|
|
1806
|
+
* @returns 是否存在
|
|
1807
|
+
*/
|
|
1808
|
+
hasEditControl(id: string | number): boolean;
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1075
1811
|
/**
|
|
1076
1812
|
* 固定大小动画精灵基类
|
|
1077
1813
|
* 基于 EnhancedSprite 扩展,支持帧动画播放
|
|
@@ -1276,6 +2012,31 @@ declare class EnhancedSprite extends Sprite {
|
|
|
1276
2012
|
}): void;
|
|
1277
2013
|
}
|
|
1278
2014
|
|
|
2015
|
+
/**
|
|
2016
|
+
* 固定大小元素基类
|
|
2017
|
+
* 用于创建在地图缩放时保持固定视觉大小的元素
|
|
2018
|
+
*/
|
|
2019
|
+
declare class FixedSizeContainer extends Container {
|
|
2020
|
+
private throttledUpdateScale;
|
|
2021
|
+
constructor();
|
|
2022
|
+
/**
|
|
2023
|
+
* 注册缩放事件监听
|
|
2024
|
+
*/
|
|
2025
|
+
private registerScaleListener;
|
|
2026
|
+
/**
|
|
2027
|
+
* 更新元素缩放,以保持固定大小
|
|
2028
|
+
*/
|
|
2029
|
+
protected updateScale(scale: number): void;
|
|
2030
|
+
/**
|
|
2031
|
+
* 组件销毁时清理资源
|
|
2032
|
+
*/
|
|
2033
|
+
destroy(options?: {
|
|
2034
|
+
children?: boolean;
|
|
2035
|
+
texture?: boolean;
|
|
2036
|
+
baseTexture?: boolean;
|
|
2037
|
+
}): void;
|
|
2038
|
+
}
|
|
2039
|
+
|
|
1279
2040
|
declare class Free extends Graphics {
|
|
1280
2041
|
constructor();
|
|
1281
2042
|
/**
|
|
@@ -1317,7 +2078,10 @@ declare class Heatmap extends Container {
|
|
|
1317
2078
|
y: number;
|
|
1318
2079
|
signal: number;
|
|
1319
2080
|
hasPoint: boolean;
|
|
1320
|
-
}>>, useGradient?: boolean, heatmapAlpha?: number
|
|
2081
|
+
}>>, useGradient?: boolean, heatmapAlpha?: number, offset?: {
|
|
2082
|
+
x: number;
|
|
2083
|
+
y: number;
|
|
2084
|
+
}): void;
|
|
1321
2085
|
/**
|
|
1322
2086
|
* 裁剪热力图 仅显示房间区域
|
|
1323
2087
|
* 根据roomFill图层的子元素 组合Graphics生成大Graphics裁剪
|
|
@@ -1336,6 +2100,16 @@ declare class Heatmap extends Container {
|
|
|
1336
2100
|
* @returns 渐变热力图mesh
|
|
1337
2101
|
*/
|
|
1338
2102
|
private gradientDrawing;
|
|
2103
|
+
/**
|
|
2104
|
+
* 更新位置
|
|
2105
|
+
* @param x
|
|
2106
|
+
* @param y
|
|
2107
|
+
*/
|
|
2108
|
+
updatePositionByOrigin(x: number, y: number): void;
|
|
2109
|
+
/**
|
|
2110
|
+
* 销毁热力图
|
|
2111
|
+
*/
|
|
2112
|
+
destroy(): void;
|
|
1339
2113
|
}
|
|
1340
2114
|
|
|
1341
2115
|
declare class HeatmapManager {
|
|
@@ -1369,12 +2143,22 @@ declare class HeatmapManager {
|
|
|
1369
2143
|
* @param pointsTopLeftOrigin 热力图路径点
|
|
1370
2144
|
* @returns 信号网格
|
|
1371
2145
|
*/
|
|
1372
|
-
calculateInterpolatedSignal(pointsTopLeftOrigin: HeatmapPoint[]): {
|
|
2146
|
+
calculateInterpolatedSignal(pointsTopLeftOrigin: HeatmapPoint[], mapData: MapDataSource): {
|
|
1373
2147
|
x: number;
|
|
1374
2148
|
y: number;
|
|
1375
2149
|
signal: number;
|
|
1376
2150
|
hasPoint: boolean;
|
|
1377
2151
|
}[][];
|
|
2152
|
+
/**
|
|
2153
|
+
* 更新热力图位置
|
|
2154
|
+
* @param x
|
|
2155
|
+
* @param y
|
|
2156
|
+
*/
|
|
2157
|
+
updatePositionByOrigin(x: number, y: number): void;
|
|
2158
|
+
/**
|
|
2159
|
+
* 销毁热力图
|
|
2160
|
+
*/
|
|
2161
|
+
destroy(): void;
|
|
1378
2162
|
}
|
|
1379
2163
|
|
|
1380
2164
|
/** 热力图点 */
|
|
@@ -1515,6 +2299,10 @@ declare class Interaction extends Container {
|
|
|
1515
2299
|
*/
|
|
1516
2300
|
private updateInteractionMode;
|
|
1517
2301
|
setupInteraction(): void;
|
|
2302
|
+
/**
|
|
2303
|
+
* 处理全局取消或失去焦点事件
|
|
2304
|
+
*/
|
|
2305
|
+
private handleGlobalCancel;
|
|
1518
2306
|
resetPan(targetPosition: {
|
|
1519
2307
|
x: number;
|
|
1520
2308
|
y: number;
|
|
@@ -1563,6 +2351,10 @@ declare class Interaction extends Container {
|
|
|
1563
2351
|
* 退出手势劫持模式
|
|
1564
2352
|
*/
|
|
1565
2353
|
private exitGestureHijacked;
|
|
2354
|
+
/**
|
|
2355
|
+
* 强制结束当前正在进行的手势交互
|
|
2356
|
+
*/
|
|
2357
|
+
forceEndGesture(): void;
|
|
1566
2358
|
/**
|
|
1567
2359
|
* 暂停手势劫持(双指模式)
|
|
1568
2360
|
*/
|
|
@@ -1598,11 +2390,13 @@ declare type Managers = {
|
|
|
1598
2390
|
detectedObjectManager: DetectedObjectManager;
|
|
1599
2391
|
customElementsManager: CustomElementsManager;
|
|
1600
2392
|
roomsManager: RoomManager;
|
|
2393
|
+
customCarpetManager: CustomCarpetManager;
|
|
2394
|
+
editControlManager: EditControlManager;
|
|
1601
2395
|
};
|
|
1602
2396
|
|
|
1603
|
-
export declare const MAP_API_METHODS: readonly ["areRoomsAdjacent", "getForbiddenSweepZones", "getForbiddenMopZones", "getCleanZones", "getVirtualWalls", "getSpots", "getWayPoints", "getViewportCenterPoint", "getMapCenterPoint", "getWallPointsByViewportCenter", "getForbiddenSweepZonePointsByViewportCenter", "getForbiddenMopZonePointsByViewportCenter", "getCleanZonePointsByViewportCenter", "getSpotPointByViewportCenter", "getEffectiveDividerPoints", "getDividerEndPoints", "isNearChargerOrRobot", "isPointInAnyRoom", "isWallIntersectsAnyRoom", "isZoneIntersectsAnyRoom", "resetPanZoom", "snapshot", "snapshotByData"];
|
|
2397
|
+
export declare const MAP_API_METHODS: readonly ["areRoomsAdjacent", "getForbiddenSweepZones", "getForbiddenMopZones", "getCleanZones", "getVirtualWalls", "getSpots", "getWayPoints", "getViewportCenterPoint", "getMapCenterPoint", "getWallPointsByViewportCenter", "getForbiddenSweepZonePointsByViewportCenter", "getForbiddenMopZonePointsByViewportCenter", "getCleanZonePointsByViewportCenter", "getSpotPointByViewportCenter", "getEffectiveDividerPoints", "getDividerEndPoints", "isNearChargerOrRobot", "isPointInAnyRoom", "isWallIntersectsAnyRoom", "isZoneIntersectsAnyRoom", "resetPanZoom", "snapshot", "snapshotByData", "getCustomCarpets", "forceEndGesture"];
|
|
1604
2398
|
|
|
1605
|
-
export declare const MAP_CALLBACK_METHODS: readonly ["onMapFirstDrawed", "onMapDrawed", "onPathDrawed", "onRoomPropertiesDrawed", "onClickRoom", "onClickRoomProperties", "onRemoveForbiddenSweepZone", "onRemoveForbiddenMopZone", "onRemoveCleanZone", "onRemoveVirtualWall", "onUpdateForbiddenSweepZone", "onUpdateForbiddenMopZone", "onUpdateCleanZone", "onUpdateVirtualWall", "onUpdateSpot", "onUpdateWayPoint", "onUpdateDivider", "onClickForbiddenSweepZone", "onClickForbiddenMopZone", "onClickCleanZone", "onClickVirtualWall", "onClickSpot", "onClickWayPoint", "onClickDetectedObject", "onClickCustomElement", "onClickMap"];
|
|
2399
|
+
export declare const MAP_CALLBACK_METHODS: readonly ["onMapFirstDrawed", "onMapDrawed", "onPathDrawed", "onRoomPropertiesDrawed", "onClickRoom", "onClickRoomProperties", "onRemoveForbiddenSweepZone", "onRemoveForbiddenMopZone", "onRemoveCleanZone", "onRemoveVirtualWall", "onUpdateForbiddenSweepZone", "onUpdateForbiddenMopZone", "onUpdateCleanZone", "onUpdateVirtualWall", "onUpdateSpot", "onUpdateWayPoint", "onUpdateDivider", "onClickForbiddenSweepZone", "onClickForbiddenMopZone", "onClickCleanZone", "onClickVirtualWall", "onClickSpot", "onClickWayPoint", "onClickDetectedObject", "onClickCustomElement", "onClickMap", "onClickCarpet", "onDeleteCarpet", "onUpdateCustomCarpet", "onDeleteCustomCarpet", "onGestureStart", "onGestureEnd"];
|
|
1606
2400
|
|
|
1607
2401
|
/**
|
|
1608
2402
|
* 地图 API 接口定义
|
|
@@ -1619,6 +2413,12 @@ export declare interface MapApi {
|
|
|
1619
2413
|
* 将地图的缩放和平移状态重置到初始位置,使地图完整显示在视口中。
|
|
1620
2414
|
*/
|
|
1621
2415
|
resetPanZoom(): void;
|
|
2416
|
+
/**
|
|
2417
|
+
* 强制结束当前正在进行的手势交互
|
|
2418
|
+
*
|
|
2419
|
+
* 当小程序侧检测到 touchend 或其他需要强制结束手势的情况时调用。
|
|
2420
|
+
*/
|
|
2421
|
+
forceEndGesture(): void;
|
|
1622
2422
|
/**
|
|
1623
2423
|
* 获取当前地图上所有禁扫区域数据
|
|
1624
2424
|
*
|
|
@@ -1637,6 +2437,12 @@ export declare interface MapApi {
|
|
|
1637
2437
|
* @returns 区域数据数组
|
|
1638
2438
|
*/
|
|
1639
2439
|
getCleanZones(): ZoneParam[];
|
|
2440
|
+
/**
|
|
2441
|
+
* 获取当前地图上所有自定义地毯数据
|
|
2442
|
+
*
|
|
2443
|
+
* @returns 地毯数据数组
|
|
2444
|
+
*/
|
|
2445
|
+
getCustomCarpets(): CustomCarpetParam[];
|
|
1640
2446
|
/**
|
|
1641
2447
|
* 获取当前地图上所有虚拟墙数据
|
|
1642
2448
|
*
|
|
@@ -1899,7 +2705,7 @@ declare class MapApplication extends Application implements MapApi {
|
|
|
1899
2705
|
* @returns Promise<void>
|
|
1900
2706
|
*
|
|
1901
2707
|
*/
|
|
1902
|
-
drawMap(mapData:
|
|
2708
|
+
drawMap(mapData: StructuredMapDataSource): Promise<void>;
|
|
1903
2709
|
/**
|
|
1904
2710
|
* 绘制栅格地图数据
|
|
1905
2711
|
*
|
|
@@ -1935,6 +2741,12 @@ declare class MapApplication extends Application implements MapApi {
|
|
|
1935
2741
|
*
|
|
1936
2742
|
*/
|
|
1937
2743
|
drawRoomProperty(roomInfos: RoomProperty[]): Promise<void>;
|
|
2744
|
+
/**
|
|
2745
|
+
* 绘制自定义地毯
|
|
2746
|
+
* @param carpets 自定义地毯数组
|
|
2747
|
+
* @returns void
|
|
2748
|
+
*/
|
|
2749
|
+
drawCustomCarpets(carpets: CustomCarpetParam[]): Promise<void>;
|
|
1938
2750
|
/**
|
|
1939
2751
|
* 绘制热力图
|
|
1940
2752
|
* @param param - 绘制参数
|
|
@@ -1981,6 +2793,11 @@ declare class MapApplication extends Application implements MapApi {
|
|
|
1981
2793
|
* @param objects - 检测物体参数数组
|
|
1982
2794
|
*/
|
|
1983
2795
|
drawDetectedObjects(objects: DetectedObjectParam[]): Promise<void>;
|
|
2796
|
+
/**
|
|
2797
|
+
* 绘制自定义地毯
|
|
2798
|
+
* @param customCarpet - 自定义地毯参数数组
|
|
2799
|
+
*/
|
|
2800
|
+
drawCustomCarpet(customCarpet: CustomCarpetParam[]): void;
|
|
1984
2801
|
/**
|
|
1985
2802
|
* 绘制自定义元素
|
|
1986
2803
|
* @param elements - 自定义元素参数数组
|
|
@@ -2027,6 +2844,11 @@ declare class MapApplication extends Application implements MapApi {
|
|
|
2027
2844
|
* @returns 分割线有效端点
|
|
2028
2845
|
*/
|
|
2029
2846
|
getEffectiveDividerPoints(): Point[] | null;
|
|
2847
|
+
/**
|
|
2848
|
+
* 获取当前地图上所有自定义地毯数据
|
|
2849
|
+
* @returns 地毯数据数组
|
|
2850
|
+
*/
|
|
2851
|
+
getCustomCarpets(): CustomCarpetParam[];
|
|
2030
2852
|
/**
|
|
2031
2853
|
* 获取分割线端点
|
|
2032
2854
|
* @returns 分割线端点
|
|
@@ -2039,6 +2861,12 @@ declare class MapApplication extends Application implements MapApi {
|
|
|
2039
2861
|
* 将地图的缩放和平移状态重置到初始位置,使地图完整显示在视口中。
|
|
2040
2862
|
*/
|
|
2041
2863
|
resetPanZoom(): void;
|
|
2864
|
+
/**
|
|
2865
|
+
* 强制结束当前正在进行的手势交互
|
|
2866
|
+
*
|
|
2867
|
+
* 当小程序侧检测到 touchend 或其他需要强制结束手势的情况时调用。
|
|
2868
|
+
*/
|
|
2869
|
+
forceEndGesture(): void;
|
|
2042
2870
|
/**
|
|
2043
2871
|
* 将地图适配到视图中,居中并缩放
|
|
2044
2872
|
* @param mapBounds 地图边界信息
|
|
@@ -2580,6 +3408,55 @@ export declare interface MapCallbacks {
|
|
|
2580
3408
|
*
|
|
2581
3409
|
*/
|
|
2582
3410
|
onClickMap?: (point: Point) => void;
|
|
3411
|
+
/**
|
|
3412
|
+
* 点击地毯回调
|
|
3413
|
+
*
|
|
3414
|
+
* 当用户点击地毯区域时触发(需要启用 carpet.enableEdit)。
|
|
3415
|
+
*
|
|
3416
|
+
* @param carpet - 被点击的地毯信息,包含索引和数据
|
|
3417
|
+
*
|
|
3418
|
+
*/
|
|
3419
|
+
onClickCarpet?: (carpet: {
|
|
3420
|
+
id: string;
|
|
3421
|
+
}) => void;
|
|
3422
|
+
/**
|
|
3423
|
+
* 删除地图地毯回调
|
|
3424
|
+
*
|
|
3425
|
+
* 当用户删除地图中的地毯时触发。
|
|
3426
|
+
*
|
|
3427
|
+
* @param carpet - 被删除的地毯信息
|
|
3428
|
+
*
|
|
3429
|
+
*/
|
|
3430
|
+
onDeleteCarpet?: (carpet: {
|
|
3431
|
+
id: string;
|
|
3432
|
+
}) => void;
|
|
3433
|
+
/**
|
|
3434
|
+
* 删除自定义地毯回调
|
|
3435
|
+
*
|
|
3436
|
+
* 当用户删除自定义地毯时触发。
|
|
3437
|
+
*
|
|
3438
|
+
* @param carpet - 被删除的自定义地毯信息
|
|
3439
|
+
*
|
|
3440
|
+
*/
|
|
3441
|
+
onDeleteCustomCarpet?: (carpet: {
|
|
3442
|
+
id: string;
|
|
3443
|
+
}) => void;
|
|
3444
|
+
/**
|
|
3445
|
+
* 更新自定义地毯回调
|
|
3446
|
+
*
|
|
3447
|
+
* 当用户编辑自定义地毯(移动、旋转、缩放)后触发。
|
|
3448
|
+
*
|
|
3449
|
+
* @param carpet - 更新后的自定义地毯数据
|
|
3450
|
+
*
|
|
3451
|
+
*/
|
|
3452
|
+
onUpdateCustomCarpet?: (carpet: CustomCarpetParam) => void;
|
|
3453
|
+
onGestureStart?: () => void;
|
|
3454
|
+
/**
|
|
3455
|
+
* 手势交互结束回调
|
|
3456
|
+
*
|
|
3457
|
+
* 当用户结束手势交互时触发。
|
|
3458
|
+
*/
|
|
3459
|
+
onGestureEnd?: () => void;
|
|
2583
3460
|
}
|
|
2584
3461
|
|
|
2585
3462
|
/**
|
|
@@ -2655,7 +3532,7 @@ declare class MapManager {
|
|
|
2655
3532
|
/**
|
|
2656
3533
|
* 处理结构化地图数据(房间形状、障碍物等)
|
|
2657
3534
|
*/
|
|
2658
|
-
drawMap(mapData:
|
|
3535
|
+
drawMap(mapData: StructuredMapDataSource): Promise<boolean>;
|
|
2659
3536
|
/**
|
|
2660
3537
|
* 处理栅格地图数据
|
|
2661
3538
|
* @param mapPointsStr 栅格数据字符串
|
|
@@ -2676,6 +3553,13 @@ declare class MapManager {
|
|
|
2676
3553
|
* @returns 是否需要触发fitMapToView
|
|
2677
3554
|
*/
|
|
2678
3555
|
private shouldFitMapToView;
|
|
3556
|
+
/**
|
|
3557
|
+
* 将栅格数据转换为结构化数据格式
|
|
3558
|
+
* @param carpetPixels 地毯像素数据
|
|
3559
|
+
* @param mapWidth 地图宽度
|
|
3560
|
+
* @returns 结构化地毯数据数组
|
|
3561
|
+
*/
|
|
3562
|
+
private convertRasterToStructuredData;
|
|
2679
3563
|
/**
|
|
2680
3564
|
* 更新地毯显示
|
|
2681
3565
|
* 类似于RoomFloorType的模式,根据当前状态决定是否重建地毯
|
|
@@ -2806,6 +3690,66 @@ export declare type MapType = 'structured' | 'raster'
|
|
|
2806
3690
|
/** 测量单位 */
|
|
2807
3691
|
export declare type MeasurementUnit = 'meter' | 'feet' | 'centimeter'
|
|
2808
3692
|
|
|
3693
|
+
declare class MoveControlButton extends BaseControlButton<MoveControlButtonOptions> {
|
|
3694
|
+
private isMoving;
|
|
3695
|
+
private dragStartPosition;
|
|
3696
|
+
constructor(options: MoveControlButtonOptions);
|
|
3697
|
+
/**
|
|
3698
|
+
* 设置移动事件监听
|
|
3699
|
+
*/
|
|
3700
|
+
private setupMoveEventListeners;
|
|
3701
|
+
/**
|
|
3702
|
+
* 清理移动事件监听
|
|
3703
|
+
*/
|
|
3704
|
+
private cleanupMoveEventListeners;
|
|
3705
|
+
/**
|
|
3706
|
+
* 设置手势事件监听
|
|
3707
|
+
*/
|
|
3708
|
+
protected setupEvents(): void;
|
|
3709
|
+
/**
|
|
3710
|
+
* 处理指针按下事件(开始移动)
|
|
3711
|
+
*/
|
|
3712
|
+
private handlePointerDown;
|
|
3713
|
+
/**
|
|
3714
|
+
* 开始移动
|
|
3715
|
+
*/
|
|
3716
|
+
private startMoving;
|
|
3717
|
+
/**
|
|
3718
|
+
* 处理移动过程中的指针移动
|
|
3719
|
+
*/
|
|
3720
|
+
private handleMovePointerMove;
|
|
3721
|
+
/**
|
|
3722
|
+
* 处理移动结束
|
|
3723
|
+
*/
|
|
3724
|
+
private handleMovePointerUp;
|
|
3725
|
+
/**
|
|
3726
|
+
* 处理移动取消(多点触控干扰)
|
|
3727
|
+
*/
|
|
3728
|
+
private handleMoveCancel;
|
|
3729
|
+
/**
|
|
3730
|
+
* 获取是否正在移动
|
|
3731
|
+
*/
|
|
3732
|
+
isCurrentlyMoving(): boolean;
|
|
3733
|
+
/**
|
|
3734
|
+
* 获取拖拽开始位置
|
|
3735
|
+
*/
|
|
3736
|
+
getDragStartPosition(): Point | null;
|
|
3737
|
+
/**
|
|
3738
|
+
* 强制停止移动(用于清理)
|
|
3739
|
+
*/
|
|
3740
|
+
stopMoving(): void;
|
|
3741
|
+
/**
|
|
3742
|
+
* 销毁组件
|
|
3743
|
+
*/
|
|
3744
|
+
destroy(): void;
|
|
3745
|
+
}
|
|
3746
|
+
|
|
3747
|
+
declare type MoveControlButtonOptions = BaseControlButtonOptions & {
|
|
3748
|
+
onMoveStart?: () => void;
|
|
3749
|
+
onMoveMove?: (event: FederatedPointerEvent) => void;
|
|
3750
|
+
onMoveEnd?: () => void;
|
|
3751
|
+
};
|
|
3752
|
+
|
|
2809
3753
|
declare class Obstacle extends Graphics {
|
|
2810
3754
|
constructor();
|
|
2811
3755
|
/**
|
|
@@ -2833,6 +3777,14 @@ declare class Obstacle extends Graphics {
|
|
|
2833
3777
|
*/
|
|
2834
3778
|
export declare const offsetPointsToAvoidOverlap: (points: Point[], existingPointsArray: Point[][], maxAttempts?: number) => Point[];
|
|
2835
3779
|
|
|
3780
|
+
declare type OperationState = {
|
|
3781
|
+
isDragging: boolean;
|
|
3782
|
+
isScaling: boolean;
|
|
3783
|
+
isRotating: boolean;
|
|
3784
|
+
isMoving: boolean;
|
|
3785
|
+
hasAnyOperation: boolean;
|
|
3786
|
+
};
|
|
3787
|
+
|
|
2836
3788
|
/**
|
|
2837
3789
|
* 解析后的点阵地图数据
|
|
2838
3790
|
*/
|
|
@@ -3506,6 +4458,8 @@ export declare type RuntimeConfig = {
|
|
|
3506
4458
|
editingSpotIds: string[]
|
|
3507
4459
|
/** 正在编辑的途径点ID列表 */
|
|
3508
4460
|
editingWayPointIds: string[]
|
|
4461
|
+
/** 正在编辑的地毯ID列表 */
|
|
4462
|
+
editingCarpetIds: string[]
|
|
3509
4463
|
/** 地图旋转角度(度) */
|
|
3510
4464
|
mapRotation: number
|
|
3511
4465
|
/** 房间属性折叠的房间ID列表 */
|
|
@@ -3542,6 +4496,8 @@ export declare type RuntimeConfig = {
|
|
|
3542
4496
|
showRobotSleepAnimation: boolean
|
|
3543
4497
|
/** 是否显示机器人脉冲圈 */
|
|
3544
4498
|
showRobotPulseCircle: boolean
|
|
4499
|
+
/** 选中的地毯ID列表 */
|
|
4500
|
+
selectedCarpetIds: string[]
|
|
3545
4501
|
}
|
|
3546
4502
|
|
|
3547
4503
|
/**
|
|
@@ -3825,52 +4781,7 @@ export declare type WayPointParam = {
|
|
|
3825
4781
|
}
|
|
3826
4782
|
|
|
3827
4783
|
/** 区域配置 */
|
|
3828
|
-
export declare type ZoneConfig =
|
|
3829
|
-
/** 最小尺寸 (米) */
|
|
3830
|
-
minSize: number
|
|
3831
|
-
/** 图标容器填充颜色 */
|
|
3832
|
-
iconWrapperFillColor: ColorSource
|
|
3833
|
-
/** 描边颜色 */
|
|
3834
|
-
strokeColor: ColorSource
|
|
3835
|
-
/** 描边宽度 */
|
|
3836
|
-
strokeWidth: number
|
|
3837
|
-
/** 填充颜色 */
|
|
3838
|
-
fillColor: ColorSource
|
|
3839
|
-
/** 轮廓偏移 */
|
|
3840
|
-
outlineOffset: number
|
|
3841
|
-
/** 轮廓描边颜色 */
|
|
3842
|
-
outlineStrokeColor: ColorSource
|
|
3843
|
-
/** 轮廓描边宽度 */
|
|
3844
|
-
outlineStrokeWidth: number
|
|
3845
|
-
/** 轮廓填充颜色 */
|
|
3846
|
-
outlineFillColor: ColorSource
|
|
3847
|
-
/** 轮廓是否虚线 */
|
|
3848
|
-
outlineDashed: boolean
|
|
3849
|
-
/** 轮廓虚线数组 */
|
|
3850
|
-
outlineDashArray: [number, number]
|
|
3851
|
-
/** 是否显示旋转图标 */
|
|
3852
|
-
showRotateButton: boolean
|
|
3853
|
-
/** 文本颜色 */
|
|
3854
|
-
textColor: ColorSource
|
|
3855
|
-
/** 文本位置 */
|
|
3856
|
-
textPosition: 'top' | 'right' | 'bottom' | 'left'
|
|
3857
|
-
/** 文本偏移 */
|
|
3858
|
-
textOffset: number
|
|
3859
|
-
/** 编辑模式样式 */
|
|
3860
|
-
editing: {
|
|
3861
|
-
/** 是否虚线 */
|
|
3862
|
-
isDashed: boolean
|
|
3863
|
-
/** 虚线数组 */
|
|
3864
|
-
dashArray: [number, number]
|
|
3865
|
-
}
|
|
3866
|
-
/** 普通模式样式 */
|
|
3867
|
-
normal: {
|
|
3868
|
-
/** 是否虚线 */
|
|
3869
|
-
isDashed: boolean
|
|
3870
|
-
/** 虚线数组 */
|
|
3871
|
-
dashArray: [number, number]
|
|
3872
|
-
}
|
|
3873
|
-
}
|
|
4784
|
+
export declare type ZoneConfig = BaseZoneConfig
|
|
3874
4785
|
|
|
3875
4786
|
/** 区域参数 */
|
|
3876
4787
|
export declare type ZoneParam = {
|