@ray-js/robot-map-sdk 0.0.4 → 0.0.5-beta.1
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 +913 -52
- package/dist/index.rjs.js +1 -1
- package/dist-app/assets/index-DQW_UsEo.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.DNnKzlMv.js} +1 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.DQN_056y.js +1 -0
- package/dist-docs/assets/chunks/{VPLocalSearchBox.DrbIC04M.js → VPLocalSearchBox.DWdvNJl1.js} +1 -1
- package/dist-docs/assets/chunks/{theme.x3MYIFoS.js → theme.BuR8lIdF.js} +2 -2
- package/dist-docs/assets/{guide_getting-started.md.Bpx-HSDt.js → guide_getting-started.md.ao36ql6D.js} +1 -1
- package/dist-docs/guide/advanced-usage.html +3 -3
- 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 +3 -3
- package/dist-docs/reference/config.html +3 -3
- package/dist-docs/reference/data.html +3 -3
- package/dist-docs/reference/methods.html +3 -3
- 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/{guide_getting-started.md.Bpx-HSDt.lean.js → guide_getting-started.md.ao36ql6D.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
|
/**
|
|
@@ -1360,7 +2121,7 @@ declare class HeatmapManager {
|
|
|
1360
2121
|
* @returns
|
|
1361
2122
|
*/
|
|
1362
2123
|
draw({ mapData, heatmapPoints, useGradient, }: {
|
|
1363
|
-
mapData:
|
|
2124
|
+
mapData: StructuredMapDataSource;
|
|
1364
2125
|
heatmapPoints: HeatmapPoint[];
|
|
1365
2126
|
useGradient?: boolean;
|
|
1366
2127
|
}): void;
|
|
@@ -1598,11 +2359,13 @@ declare type Managers = {
|
|
|
1598
2359
|
detectedObjectManager: DetectedObjectManager;
|
|
1599
2360
|
customElementsManager: CustomElementsManager;
|
|
1600
2361
|
roomsManager: RoomManager;
|
|
2362
|
+
customCarpetManager: CustomCarpetManager;
|
|
2363
|
+
editControlManager: EditControlManager;
|
|
1601
2364
|
};
|
|
1602
2365
|
|
|
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"];
|
|
2366
|
+
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"];
|
|
1604
2367
|
|
|
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"];
|
|
2368
|
+
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"];
|
|
1606
2369
|
|
|
1607
2370
|
/**
|
|
1608
2371
|
* 地图 API 接口定义
|
|
@@ -1637,6 +2400,12 @@ export declare interface MapApi {
|
|
|
1637
2400
|
* @returns 区域数据数组
|
|
1638
2401
|
*/
|
|
1639
2402
|
getCleanZones(): ZoneParam[];
|
|
2403
|
+
/**
|
|
2404
|
+
* 获取当前地图上所有自定义地毯数据
|
|
2405
|
+
*
|
|
2406
|
+
* @returns 地毯数据数组
|
|
2407
|
+
*/
|
|
2408
|
+
getCustomCarpets(): CustomCarpetParam[];
|
|
1640
2409
|
/**
|
|
1641
2410
|
* 获取当前地图上所有虚拟墙数据
|
|
1642
2411
|
*
|
|
@@ -1899,7 +2668,7 @@ declare class MapApplication extends Application implements MapApi {
|
|
|
1899
2668
|
* @returns Promise<void>
|
|
1900
2669
|
*
|
|
1901
2670
|
*/
|
|
1902
|
-
drawMap(mapData:
|
|
2671
|
+
drawMap(mapData: StructuredMapDataSource): Promise<void>;
|
|
1903
2672
|
/**
|
|
1904
2673
|
* 绘制栅格地图数据
|
|
1905
2674
|
*
|
|
@@ -1935,6 +2704,12 @@ declare class MapApplication extends Application implements MapApi {
|
|
|
1935
2704
|
*
|
|
1936
2705
|
*/
|
|
1937
2706
|
drawRoomProperty(roomInfos: RoomProperty[]): Promise<void>;
|
|
2707
|
+
/**
|
|
2708
|
+
* 绘制自定义地毯
|
|
2709
|
+
* @param carpets 自定义地毯数组
|
|
2710
|
+
* @returns void
|
|
2711
|
+
*/
|
|
2712
|
+
drawCustomCarpets(carpets: CustomCarpetParam[]): Promise<void>;
|
|
1938
2713
|
/**
|
|
1939
2714
|
* 绘制热力图
|
|
1940
2715
|
* @param param - 绘制参数
|
|
@@ -1942,7 +2717,7 @@ declare class MapApplication extends Application implements MapApi {
|
|
|
1942
2717
|
*
|
|
1943
2718
|
*/
|
|
1944
2719
|
drawHeatmap({ mapData, heatmapPoints, useGradient, }: {
|
|
1945
|
-
mapData:
|
|
2720
|
+
mapData: StructuredMapDataSource;
|
|
1946
2721
|
heatmapPoints: HeatmapPoint[];
|
|
1947
2722
|
useGradient?: boolean;
|
|
1948
2723
|
}): void;
|
|
@@ -1981,6 +2756,11 @@ declare class MapApplication extends Application implements MapApi {
|
|
|
1981
2756
|
* @param objects - 检测物体参数数组
|
|
1982
2757
|
*/
|
|
1983
2758
|
drawDetectedObjects(objects: DetectedObjectParam[]): Promise<void>;
|
|
2759
|
+
/**
|
|
2760
|
+
* 绘制自定义地毯
|
|
2761
|
+
* @param customCarpet - 自定义地毯参数数组
|
|
2762
|
+
*/
|
|
2763
|
+
drawCustomCarpet(customCarpet: CustomCarpetParam[]): void;
|
|
1984
2764
|
/**
|
|
1985
2765
|
* 绘制自定义元素
|
|
1986
2766
|
* @param elements - 自定义元素参数数组
|
|
@@ -2027,6 +2807,11 @@ declare class MapApplication extends Application implements MapApi {
|
|
|
2027
2807
|
* @returns 分割线有效端点
|
|
2028
2808
|
*/
|
|
2029
2809
|
getEffectiveDividerPoints(): Point[] | null;
|
|
2810
|
+
/**
|
|
2811
|
+
* 获取当前地图上所有自定义地毯数据
|
|
2812
|
+
* @returns 地毯数据数组
|
|
2813
|
+
*/
|
|
2814
|
+
getCustomCarpets(): CustomCarpetParam[];
|
|
2030
2815
|
/**
|
|
2031
2816
|
* 获取分割线端点
|
|
2032
2817
|
* @returns 分割线端点
|
|
@@ -2580,6 +3365,48 @@ export declare interface MapCallbacks {
|
|
|
2580
3365
|
*
|
|
2581
3366
|
*/
|
|
2582
3367
|
onClickMap?: (point: Point) => void;
|
|
3368
|
+
/**
|
|
3369
|
+
* 点击地毯回调
|
|
3370
|
+
*
|
|
3371
|
+
* 当用户点击地毯区域时触发(需要启用 carpet.enableEdit)。
|
|
3372
|
+
*
|
|
3373
|
+
* @param carpet - 被点击的地毯信息,包含索引和数据
|
|
3374
|
+
*
|
|
3375
|
+
*/
|
|
3376
|
+
onClickCarpet?: (carpet: {
|
|
3377
|
+
id: string;
|
|
3378
|
+
}) => void;
|
|
3379
|
+
/**
|
|
3380
|
+
* 删除地图地毯回调
|
|
3381
|
+
*
|
|
3382
|
+
* 当用户删除地图中的地毯时触发。
|
|
3383
|
+
*
|
|
3384
|
+
* @param carpet - 被删除的地毯信息
|
|
3385
|
+
*
|
|
3386
|
+
*/
|
|
3387
|
+
onDeleteCarpet?: (carpet: {
|
|
3388
|
+
id: string;
|
|
3389
|
+
}) => void;
|
|
3390
|
+
/**
|
|
3391
|
+
* 删除自定义地毯回调
|
|
3392
|
+
*
|
|
3393
|
+
* 当用户删除自定义地毯时触发。
|
|
3394
|
+
*
|
|
3395
|
+
* @param carpet - 被删除的自定义地毯信息
|
|
3396
|
+
*
|
|
3397
|
+
*/
|
|
3398
|
+
onDeleteCustomCarpet?: (carpet: {
|
|
3399
|
+
id: string;
|
|
3400
|
+
}) => void;
|
|
3401
|
+
/**
|
|
3402
|
+
* 更新自定义地毯回调
|
|
3403
|
+
*
|
|
3404
|
+
* 当用户编辑自定义地毯(移动、旋转、缩放)后触发。
|
|
3405
|
+
*
|
|
3406
|
+
* @param carpet - 更新后的自定义地毯数据
|
|
3407
|
+
*
|
|
3408
|
+
*/
|
|
3409
|
+
onUpdateCustomCarpet?: (carpet: CustomCarpetParam) => void;
|
|
2583
3410
|
}
|
|
2584
3411
|
|
|
2585
3412
|
/**
|
|
@@ -2655,7 +3482,7 @@ declare class MapManager {
|
|
|
2655
3482
|
/**
|
|
2656
3483
|
* 处理结构化地图数据(房间形状、障碍物等)
|
|
2657
3484
|
*/
|
|
2658
|
-
drawMap(mapData:
|
|
3485
|
+
drawMap(mapData: StructuredMapDataSource): Promise<boolean>;
|
|
2659
3486
|
/**
|
|
2660
3487
|
* 处理栅格地图数据
|
|
2661
3488
|
* @param mapPointsStr 栅格数据字符串
|
|
@@ -2676,6 +3503,13 @@ declare class MapManager {
|
|
|
2676
3503
|
* @returns 是否需要触发fitMapToView
|
|
2677
3504
|
*/
|
|
2678
3505
|
private shouldFitMapToView;
|
|
3506
|
+
/**
|
|
3507
|
+
* 将栅格数据转换为结构化数据格式
|
|
3508
|
+
* @param carpetPixels 地毯像素数据
|
|
3509
|
+
* @param mapWidth 地图宽度
|
|
3510
|
+
* @returns 结构化地毯数据数组
|
|
3511
|
+
*/
|
|
3512
|
+
private convertRasterToStructuredData;
|
|
2679
3513
|
/**
|
|
2680
3514
|
* 更新地毯显示
|
|
2681
3515
|
* 类似于RoomFloorType的模式,根据当前状态决定是否重建地毯
|
|
@@ -2806,6 +3640,66 @@ export declare type MapType = 'structured' | 'raster'
|
|
|
2806
3640
|
/** 测量单位 */
|
|
2807
3641
|
export declare type MeasurementUnit = 'meter' | 'feet' | 'centimeter'
|
|
2808
3642
|
|
|
3643
|
+
declare class MoveControlButton extends BaseControlButton<MoveControlButtonOptions> {
|
|
3644
|
+
private isMoving;
|
|
3645
|
+
private dragStartPosition;
|
|
3646
|
+
constructor(options: MoveControlButtonOptions);
|
|
3647
|
+
/**
|
|
3648
|
+
* 设置移动事件监听
|
|
3649
|
+
*/
|
|
3650
|
+
private setupMoveEventListeners;
|
|
3651
|
+
/**
|
|
3652
|
+
* 清理移动事件监听
|
|
3653
|
+
*/
|
|
3654
|
+
private cleanupMoveEventListeners;
|
|
3655
|
+
/**
|
|
3656
|
+
* 设置手势事件监听
|
|
3657
|
+
*/
|
|
3658
|
+
protected setupEvents(): void;
|
|
3659
|
+
/**
|
|
3660
|
+
* 处理指针按下事件(开始移动)
|
|
3661
|
+
*/
|
|
3662
|
+
private handlePointerDown;
|
|
3663
|
+
/**
|
|
3664
|
+
* 开始移动
|
|
3665
|
+
*/
|
|
3666
|
+
private startMoving;
|
|
3667
|
+
/**
|
|
3668
|
+
* 处理移动过程中的指针移动
|
|
3669
|
+
*/
|
|
3670
|
+
private handleMovePointerMove;
|
|
3671
|
+
/**
|
|
3672
|
+
* 处理移动结束
|
|
3673
|
+
*/
|
|
3674
|
+
private handleMovePointerUp;
|
|
3675
|
+
/**
|
|
3676
|
+
* 处理移动取消(多点触控干扰)
|
|
3677
|
+
*/
|
|
3678
|
+
private handleMoveCancel;
|
|
3679
|
+
/**
|
|
3680
|
+
* 获取是否正在移动
|
|
3681
|
+
*/
|
|
3682
|
+
isCurrentlyMoving(): boolean;
|
|
3683
|
+
/**
|
|
3684
|
+
* 获取拖拽开始位置
|
|
3685
|
+
*/
|
|
3686
|
+
getDragStartPosition(): Point | null;
|
|
3687
|
+
/**
|
|
3688
|
+
* 强制停止移动(用于清理)
|
|
3689
|
+
*/
|
|
3690
|
+
stopMoving(): void;
|
|
3691
|
+
/**
|
|
3692
|
+
* 销毁组件
|
|
3693
|
+
*/
|
|
3694
|
+
destroy(): void;
|
|
3695
|
+
}
|
|
3696
|
+
|
|
3697
|
+
declare type MoveControlButtonOptions = BaseControlButtonOptions & {
|
|
3698
|
+
onMoveStart?: () => void;
|
|
3699
|
+
onMoveMove?: (event: FederatedPointerEvent) => void;
|
|
3700
|
+
onMoveEnd?: () => void;
|
|
3701
|
+
};
|
|
3702
|
+
|
|
2809
3703
|
declare class Obstacle extends Graphics {
|
|
2810
3704
|
constructor();
|
|
2811
3705
|
/**
|
|
@@ -2833,6 +3727,14 @@ declare class Obstacle extends Graphics {
|
|
|
2833
3727
|
*/
|
|
2834
3728
|
export declare const offsetPointsToAvoidOverlap: (points: Point[], existingPointsArray: Point[][], maxAttempts?: number) => Point[];
|
|
2835
3729
|
|
|
3730
|
+
declare type OperationState = {
|
|
3731
|
+
isDragging: boolean;
|
|
3732
|
+
isScaling: boolean;
|
|
3733
|
+
isRotating: boolean;
|
|
3734
|
+
isMoving: boolean;
|
|
3735
|
+
hasAnyOperation: boolean;
|
|
3736
|
+
};
|
|
3737
|
+
|
|
2836
3738
|
/**
|
|
2837
3739
|
* 解析后的点阵地图数据
|
|
2838
3740
|
*/
|
|
@@ -3506,6 +4408,8 @@ export declare type RuntimeConfig = {
|
|
|
3506
4408
|
editingSpotIds: string[]
|
|
3507
4409
|
/** 正在编辑的途径点ID列表 */
|
|
3508
4410
|
editingWayPointIds: string[]
|
|
4411
|
+
/** 正在编辑的地毯ID列表 */
|
|
4412
|
+
editingCarpetIds: string[]
|
|
3509
4413
|
/** 地图旋转角度(度) */
|
|
3510
4414
|
mapRotation: number
|
|
3511
4415
|
/** 房间属性折叠的房间ID列表 */
|
|
@@ -3542,6 +4446,8 @@ export declare type RuntimeConfig = {
|
|
|
3542
4446
|
showRobotSleepAnimation: boolean
|
|
3543
4447
|
/** 是否显示机器人脉冲圈 */
|
|
3544
4448
|
showRobotPulseCircle: boolean
|
|
4449
|
+
/** 选中的地毯ID列表 */
|
|
4450
|
+
selectedCarpetIds: string[]
|
|
3545
4451
|
}
|
|
3546
4452
|
|
|
3547
4453
|
/**
|
|
@@ -3825,52 +4731,7 @@ export declare type WayPointParam = {
|
|
|
3825
4731
|
}
|
|
3826
4732
|
|
|
3827
4733
|
/** 区域配置 */
|
|
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
|
-
}
|
|
4734
|
+
export declare type ZoneConfig = BaseZoneConfig
|
|
3874
4735
|
|
|
3875
4736
|
/** 区域参数 */
|
|
3876
4737
|
export declare type ZoneParam = {
|