@ray-js/robot-map-sdk 0.0.2-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/README.md +34 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.d.ts +3501 -0
- package/dist/index.es.js +1 -0
- package/dist-app/assets/index-ByRT_epP.js +1 -0
- package/dist-app/assets/robot-C6x7WFAQ.png +0 -0
- package/dist-app/assets/sleep-C_YKDk6M.json +879 -0
- package/dist-app/index.html +16 -0
- package/package.json +81 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3501 @@
|
|
|
1
|
+
import { AnimatedSprite } from 'pixi.js';
|
|
2
|
+
import { AppContainer as AppContainer_2 } from './AppContainer';
|
|
3
|
+
import { Application } from 'pixi.js';
|
|
4
|
+
import { ApplicationOptions } from 'pixi.js';
|
|
5
|
+
import { ColorSource } from 'pixi.js';
|
|
6
|
+
import { Container } from 'pixi.js';
|
|
7
|
+
import { ControlsConfig as ControlsConfig_2 } from '..';
|
|
8
|
+
import { ControlsManager as ControlsManager_2 } from '../managers/ControlsManager';
|
|
9
|
+
import { CustomElementsManager as CustomElementsManager_2 } from '../managers/CustomElementsManager';
|
|
10
|
+
import { DetectedObjectManager as DetectedObjectManager_2 } from '../managers/DetectedObjectManager';
|
|
11
|
+
import { DividerConfig as DividerConfig_2 } from '..';
|
|
12
|
+
import { Emitter } from 'mitt';
|
|
13
|
+
import { FederatedPointerEvent } from 'pixi.js';
|
|
14
|
+
import { Graphics } from 'pixi.js';
|
|
15
|
+
import { HeatmapManager as HeatmapManager_2 } from '../managers/HeatmapManager';
|
|
16
|
+
import { Interaction as Interaction_2 } from './Interaction';
|
|
17
|
+
import { MapCallbacks as MapCallbacks_2 } from '..';
|
|
18
|
+
import { MapData } from '@ray-js/robot-protocol';
|
|
19
|
+
import { MapHeader } from '@ray-js/robot-protocol';
|
|
20
|
+
import { MapManager as MapManager_2 } from '../managers/MapManager';
|
|
21
|
+
import { MapState as MapState_2 } from '..';
|
|
22
|
+
import { PathData } from '@ray-js/robot-protocol';
|
|
23
|
+
import { PathManager as PathManager_2 } from '../managers/PathManager';
|
|
24
|
+
import { Rectangle } from 'pixi.js';
|
|
25
|
+
import { RingConfig as RingConfig_2 } from '..';
|
|
26
|
+
import { RoomData as RoomData_2 } from '..';
|
|
27
|
+
import { RoomManager as RoomManager_2 } from '../managers/RoomManager';
|
|
28
|
+
import { RuntimeConfig as RuntimeConfig_2 } from '..';
|
|
29
|
+
import { Sprite } from 'pixi.js';
|
|
30
|
+
import { TextStyleFontWeight } from 'pixi.js';
|
|
31
|
+
import { Texture } from 'pixi.js';
|
|
32
|
+
import { Ticker } from 'pixi.js';
|
|
33
|
+
import { ViewportContainer as ViewportContainer_2 } from './ViewportContainer';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 地图静态配置
|
|
37
|
+
* 定义了视觉样式、素材资源、交互行为等一次性配置项
|
|
38
|
+
*/
|
|
39
|
+
export declare type AppConfig = {
|
|
40
|
+
/** 全局配置 */
|
|
41
|
+
global: {
|
|
42
|
+
/** 容器距离顶部位置 */
|
|
43
|
+
containerTop: string
|
|
44
|
+
/** 容器距离左侧位置 */
|
|
45
|
+
containerLeft: string
|
|
46
|
+
/** 容器宽度 */
|
|
47
|
+
containerWidth: string
|
|
48
|
+
/** 容器高度 */
|
|
49
|
+
containerHeight: string
|
|
50
|
+
/** 背景颜色 */
|
|
51
|
+
backgroundColor: ColorSource
|
|
52
|
+
}
|
|
53
|
+
/** 地图基础配置 */
|
|
54
|
+
map: {
|
|
55
|
+
/** 自动填充百分比 */
|
|
56
|
+
autoPaddingPercent: number
|
|
57
|
+
/** 障碍点颜色 */
|
|
58
|
+
obstacleColor: ColorSource
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** 热力图配置 */
|
|
62
|
+
heatmap: {
|
|
63
|
+
/** 热力图单元格大小 */
|
|
64
|
+
cellSize: number
|
|
65
|
+
/** 最大距离 */
|
|
66
|
+
maxDistance: number
|
|
67
|
+
/** 平滑迭代次数 */
|
|
68
|
+
smoothIterations: number
|
|
69
|
+
/** 热力图透明度 */
|
|
70
|
+
heatmapAlpha: number
|
|
71
|
+
/** 颜色渐变配置 */
|
|
72
|
+
colorGradients: [
|
|
73
|
+
ColorSource,
|
|
74
|
+
ColorSource,
|
|
75
|
+
ColorSource,
|
|
76
|
+
ColorSource,
|
|
77
|
+
ColorSource,
|
|
78
|
+
ColorSource,
|
|
79
|
+
ColorSource,
|
|
80
|
+
ColorSource,
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** 房间配置 */
|
|
85
|
+
room: {
|
|
86
|
+
/** 房间颜色配置 */
|
|
87
|
+
colors: {
|
|
88
|
+
/** 激活状态颜色 */
|
|
89
|
+
active: string[]
|
|
90
|
+
/** 非激活状态颜色 */
|
|
91
|
+
inactive: string[]
|
|
92
|
+
/** 房间名称颜色 */
|
|
93
|
+
name: string[]
|
|
94
|
+
/** 属性主题颜色 */
|
|
95
|
+
propertyTheme: string[]
|
|
96
|
+
/** 选择指示器背景颜色 */
|
|
97
|
+
selectionIndicatorBackground: string[]
|
|
98
|
+
/** 选择指示器图标颜色 */
|
|
99
|
+
selectionIndicatorIcon: string[]
|
|
100
|
+
/** 无房间数据特殊颜色 */
|
|
101
|
+
[SPECIAL_ROOM_IDS.NO_ROOM_DATA]: string
|
|
102
|
+
/** 房间间隙特殊颜色 */
|
|
103
|
+
[SPECIAL_ROOM_IDS.ROOM_GAP]: string
|
|
104
|
+
/** 障碍物房间特殊颜色 */
|
|
105
|
+
[SPECIAL_ROOM_IDS.OBSTACLE_ROOM]: string
|
|
106
|
+
/** 未知房间特殊颜色 */
|
|
107
|
+
[SPECIAL_ROOM_IDS.UNKNOWN_ROOM]: string
|
|
108
|
+
}
|
|
109
|
+
/** 房间名称配置 */
|
|
110
|
+
nameLabel: {
|
|
111
|
+
/** 字体大小 */
|
|
112
|
+
fontSize: number
|
|
113
|
+
/** 字体名称 */
|
|
114
|
+
fontFamily: string
|
|
115
|
+
/** 字体粗细 */
|
|
116
|
+
fontWeight: TextStyleFontWeight
|
|
117
|
+
}
|
|
118
|
+
/** 房间属性配置 */
|
|
119
|
+
property: {
|
|
120
|
+
/** 显示顺序 */
|
|
121
|
+
displayOrders: ('cleanMode' | 'suction' | 'cistern' | 'cleanTimes')[]
|
|
122
|
+
/** 图标宽度 */
|
|
123
|
+
iconWidth: number
|
|
124
|
+
/** 图标高度 */
|
|
125
|
+
iconHeight: number
|
|
126
|
+
/** 是否可折叠 */
|
|
127
|
+
foldable: boolean
|
|
128
|
+
/** X轴偏移 */
|
|
129
|
+
offsetX: number
|
|
130
|
+
/** Y轴偏移 */
|
|
131
|
+
offsetY: number
|
|
132
|
+
/** 图标间距 */
|
|
133
|
+
iconGap: number
|
|
134
|
+
/** 容器样式 */
|
|
135
|
+
container: {
|
|
136
|
+
/** 背景颜色 */
|
|
137
|
+
backgroundColor: ColorSource
|
|
138
|
+
/** 垂直内边距 */
|
|
139
|
+
paddingVertical: number
|
|
140
|
+
/** 水平内边距 */
|
|
141
|
+
paddingHorizontal: number
|
|
142
|
+
/** 边框圆角 */
|
|
143
|
+
borderRadius: number
|
|
144
|
+
/** 气泡箭头高度 */
|
|
145
|
+
tailHeight: number
|
|
146
|
+
/** 气泡箭头宽度 */
|
|
147
|
+
tailWidth: number
|
|
148
|
+
}
|
|
149
|
+
/** 吸力配置 */
|
|
150
|
+
suction: {
|
|
151
|
+
/** 资源数组 */
|
|
152
|
+
assets: string[]
|
|
153
|
+
}
|
|
154
|
+
/** 水量配置 */
|
|
155
|
+
cistern: {
|
|
156
|
+
/** 资源数组 */
|
|
157
|
+
assets: string[]
|
|
158
|
+
}
|
|
159
|
+
/** 清扫模式配置 */
|
|
160
|
+
cleanMode: {
|
|
161
|
+
/** 资源数组 */
|
|
162
|
+
assets: string[]
|
|
163
|
+
}
|
|
164
|
+
/** 清扫次数配置 */
|
|
165
|
+
cleanTimes: {
|
|
166
|
+
/** 资源数组 */
|
|
167
|
+
assets: string[]
|
|
168
|
+
}
|
|
169
|
+
/** 清扫顺序配置 */
|
|
170
|
+
cleanOrder: {
|
|
171
|
+
/** 颜色 */
|
|
172
|
+
color: ColorSource
|
|
173
|
+
/** 字体名称 */
|
|
174
|
+
fontFamily: string
|
|
175
|
+
/** 字体粗细 */
|
|
176
|
+
fontWeight: TextStyleFontWeight
|
|
177
|
+
/** 字体大小 */
|
|
178
|
+
fontSize: number
|
|
179
|
+
/** 右侧间隔 */
|
|
180
|
+
gapRight: number
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/** 选择指示器配置 */
|
|
184
|
+
selectionIndicator: {
|
|
185
|
+
/** 图标资源路径 */
|
|
186
|
+
iconSrc: string
|
|
187
|
+
/** 图标宽度 */
|
|
188
|
+
iconWidth: number
|
|
189
|
+
/** 图标高度 */
|
|
190
|
+
iconHeight: number
|
|
191
|
+
/** 容器宽度 */
|
|
192
|
+
containerWidth: number
|
|
193
|
+
/** 容器高度 */
|
|
194
|
+
containerHeight: number
|
|
195
|
+
/** 描边宽度 */
|
|
196
|
+
strokeWidth: number
|
|
197
|
+
/** 描边颜色 */
|
|
198
|
+
strokeColor: ColorSource
|
|
199
|
+
/** 边框圆角 */
|
|
200
|
+
borderRadius: number
|
|
201
|
+
/** X轴偏移 */
|
|
202
|
+
offsetX: number
|
|
203
|
+
/** Y轴偏移 */
|
|
204
|
+
offsetY: number
|
|
205
|
+
/** 气泡箭头高度 */
|
|
206
|
+
tailHeight: number
|
|
207
|
+
/** 气泡箭头宽度 */
|
|
208
|
+
tailWidth: number
|
|
209
|
+
}
|
|
210
|
+
/** 地板材质配置 */
|
|
211
|
+
floorType: {
|
|
212
|
+
/** 资源数组(建议使用材质的最小重复单元) */
|
|
213
|
+
assets: string[]
|
|
214
|
+
/** 透明度 */
|
|
215
|
+
opacity: number
|
|
216
|
+
/** 缩放系数 */
|
|
217
|
+
scale: number
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** 路径配置 */
|
|
222
|
+
path: {
|
|
223
|
+
/** 线条宽度是否固定 (不跟随地图缩放变化) */
|
|
224
|
+
lineWidthFixed: boolean
|
|
225
|
+
/**
|
|
226
|
+
* 增量阈值
|
|
227
|
+
*
|
|
228
|
+
* 当路径点数量变化超过该阈值时,使用全量绘制,否则使用增量绘制。
|
|
229
|
+
*
|
|
230
|
+
* 设置为0时,不使用增量绘制。
|
|
231
|
+
*
|
|
232
|
+
* */
|
|
233
|
+
incrementalThreshold: number
|
|
234
|
+
/** 清扫路径配置 */
|
|
235
|
+
commonPath: {
|
|
236
|
+
/** 颜色 */
|
|
237
|
+
color: ColorSource
|
|
238
|
+
/** 宽度 */
|
|
239
|
+
width: number
|
|
240
|
+
}
|
|
241
|
+
/** 转场路径配置 */
|
|
242
|
+
transitionPath: {
|
|
243
|
+
/** 颜色 */
|
|
244
|
+
color: ColorSource
|
|
245
|
+
/** 宽度 */
|
|
246
|
+
width: number
|
|
247
|
+
}
|
|
248
|
+
/** 回充路径配置 */
|
|
249
|
+
chargePath: {
|
|
250
|
+
/** 颜色 */
|
|
251
|
+
color: ColorSource
|
|
252
|
+
/** 宽度 */
|
|
253
|
+
width: number
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/** 地毯配置 */
|
|
258
|
+
carpet: {
|
|
259
|
+
/** 地毯资源路径 */
|
|
260
|
+
src: string
|
|
261
|
+
/** 透明度 */
|
|
262
|
+
opacity: number
|
|
263
|
+
/** 缩放系数 */
|
|
264
|
+
scale: number
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/** 机器人配置 */
|
|
268
|
+
robot: {
|
|
269
|
+
/** 图标配置 */
|
|
270
|
+
icon: {
|
|
271
|
+
/** 尺寸是否固定 */
|
|
272
|
+
sizeFixed: boolean
|
|
273
|
+
/** 宽度 */
|
|
274
|
+
width: number
|
|
275
|
+
/** 高度 */
|
|
276
|
+
height: number
|
|
277
|
+
/** 图标资源路径 */
|
|
278
|
+
src: string
|
|
279
|
+
}
|
|
280
|
+
/** 机器人移动速度(米/秒) */
|
|
281
|
+
speed: number
|
|
282
|
+
/** 角度校正(度)
|
|
283
|
+
*
|
|
284
|
+
* 用于校正图标默认朝向,0度表示图标朝右
|
|
285
|
+
*
|
|
286
|
+
*/
|
|
287
|
+
rotationCorrection: number
|
|
288
|
+
/** 睡眠动画配置 */
|
|
289
|
+
sleepAnimation: {
|
|
290
|
+
/**
|
|
291
|
+
* 睡眠动画JSON资源路径
|
|
292
|
+
*
|
|
293
|
+
* 使用TexturePacker生成的JSON文件
|
|
294
|
+
*/
|
|
295
|
+
jsonSrc: string
|
|
296
|
+
/**
|
|
297
|
+
* 帧名称前缀
|
|
298
|
+
*
|
|
299
|
+
* 用于指定动画帧的名称前缀,例如 "sleep_"
|
|
300
|
+
*
|
|
301
|
+
*/
|
|
302
|
+
framePrefix: string
|
|
303
|
+
/** 宽度 */
|
|
304
|
+
width: number
|
|
305
|
+
/** 高度 */
|
|
306
|
+
height: number
|
|
307
|
+
/** 尺寸是否固定 */
|
|
308
|
+
sizeFixed: boolean
|
|
309
|
+
/** 总帧数 */
|
|
310
|
+
frameCount: number
|
|
311
|
+
/** X轴偏移 */
|
|
312
|
+
offsetX: number
|
|
313
|
+
/** Y轴偏移 */
|
|
314
|
+
offsetY: number
|
|
315
|
+
}
|
|
316
|
+
} & RingConfig
|
|
317
|
+
|
|
318
|
+
/** 充电桩配置 */
|
|
319
|
+
chargingStation: {
|
|
320
|
+
icon: {
|
|
321
|
+
/** 尺寸是否固定 */
|
|
322
|
+
sizeFixed: boolean
|
|
323
|
+
/** 宽度 */
|
|
324
|
+
width: number
|
|
325
|
+
/** 高度 */
|
|
326
|
+
height: number
|
|
327
|
+
/** 图标资源路径 */
|
|
328
|
+
src: string
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* 角度校正(度)
|
|
332
|
+
*
|
|
333
|
+
* 用于校正图标默认朝向,0度表示图标朝右
|
|
334
|
+
*
|
|
335
|
+
*/
|
|
336
|
+
rotationCorrection: number
|
|
337
|
+
} & RingConfig
|
|
338
|
+
|
|
339
|
+
/** 交互配置 */
|
|
340
|
+
interaction: {
|
|
341
|
+
/** 缩放范围 */
|
|
342
|
+
zoomRange: {
|
|
343
|
+
/** 最小缩放比例 */
|
|
344
|
+
min: number
|
|
345
|
+
/** 最大缩放比例 */
|
|
346
|
+
max: number
|
|
347
|
+
}
|
|
348
|
+
/** 是否启用双击缩放功能 */
|
|
349
|
+
enableDoubleTapZoom: boolean
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/** 控制元素配置 */
|
|
353
|
+
controls: ControlsConfig
|
|
354
|
+
|
|
355
|
+
/** 分割线配置 */
|
|
356
|
+
divider: DividerConfig
|
|
357
|
+
|
|
358
|
+
/** AI物体配置 */
|
|
359
|
+
detectedObject: {
|
|
360
|
+
/** 高度 */
|
|
361
|
+
height: number
|
|
362
|
+
/** 宽度 */
|
|
363
|
+
width: number
|
|
364
|
+
/** 是否可交互 */
|
|
365
|
+
interactive: boolean
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/** 截图配置 */
|
|
369
|
+
snapshot: {
|
|
370
|
+
/** 格式 */
|
|
371
|
+
format: 'png' | 'jpg' | 'webp'
|
|
372
|
+
/** 质量 */
|
|
373
|
+
quality: number
|
|
374
|
+
/** 抗锯齿 */
|
|
375
|
+
antialias: boolean
|
|
376
|
+
/** 分辨率 */
|
|
377
|
+
resolution: number
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* AppContainer 同时作为应用的主容器和层级管理器
|
|
383
|
+
* 管理所有地图相关的层级和组件
|
|
384
|
+
*/
|
|
385
|
+
declare class AppContainer extends Container {
|
|
386
|
+
private layers;
|
|
387
|
+
constructor();
|
|
388
|
+
/**
|
|
389
|
+
* 初始化所有预定义的层级
|
|
390
|
+
*/
|
|
391
|
+
private initializeLayers;
|
|
392
|
+
/**
|
|
393
|
+
* 获取指定名称的层容器
|
|
394
|
+
* @param name 层名称
|
|
395
|
+
* @returns 对应的容器,如果不存在则返回undefined
|
|
396
|
+
*/
|
|
397
|
+
getLayer(name: LayerName): Container | undefined;
|
|
398
|
+
/**
|
|
399
|
+
* 向指定层添加元素
|
|
400
|
+
* @param name 层名称
|
|
401
|
+
* @param element 要添加的元素
|
|
402
|
+
* @param zIndex 可选的元素z索引
|
|
403
|
+
* @returns 是否添加成功
|
|
404
|
+
*/
|
|
405
|
+
addToLayer(name: LayerName, element: Container, zIndex?: number): boolean;
|
|
406
|
+
/**
|
|
407
|
+
* 从指定层移除元素
|
|
408
|
+
* @param name 层名称
|
|
409
|
+
* @param element 要移除的元素
|
|
410
|
+
* @returns 是否移除成功
|
|
411
|
+
*/
|
|
412
|
+
removeFromLayer(name: LayerName, element: Container): boolean;
|
|
413
|
+
/**
|
|
414
|
+
* 清空指定层的所有内容
|
|
415
|
+
* @param name 层名称
|
|
416
|
+
* @returns 是否清空成功
|
|
417
|
+
*/
|
|
418
|
+
clearLayer(name: LayerName): boolean;
|
|
419
|
+
/**
|
|
420
|
+
* 设置指定层的可见性
|
|
421
|
+
* @param name 层名称
|
|
422
|
+
* @param visible 是否可见
|
|
423
|
+
* @returns 是否设置成功
|
|
424
|
+
*/
|
|
425
|
+
setLayerVisibility(name: LayerName, visible: boolean): boolean;
|
|
426
|
+
/**
|
|
427
|
+
* 获取指定层的可见性
|
|
428
|
+
* @param name 层名称
|
|
429
|
+
* @returns 层的可见性状态,不存在则返回false
|
|
430
|
+
*/
|
|
431
|
+
getLayerVisibility(name: LayerName): boolean;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* 应用上下文管理 - 基于 React Context 思想
|
|
436
|
+
* 通过组件树的层级关系来传播上下文,每个组件都能自动获取到最近的 Provider 提供的值
|
|
437
|
+
*/
|
|
438
|
+
export declare class AppContext {
|
|
439
|
+
private static contextStack;
|
|
440
|
+
private static instanceMap;
|
|
441
|
+
private static serviceCache;
|
|
442
|
+
/**
|
|
443
|
+
* 类似 React.createContext() - 注册实例
|
|
444
|
+
*/
|
|
445
|
+
static registerInstance(instanceKey: string, app: AppInstance): void;
|
|
446
|
+
/**
|
|
447
|
+
* 取消注册实例
|
|
448
|
+
*/
|
|
449
|
+
static unregisterInstance(instanceKey: string): void;
|
|
450
|
+
/**
|
|
451
|
+
* 获取 AppService 实例
|
|
452
|
+
* @returns AppService 实例
|
|
453
|
+
*/
|
|
454
|
+
static getService(): AppService;
|
|
455
|
+
/**
|
|
456
|
+
* 类似 <Context.Provider value={app}> - 提供上下文
|
|
457
|
+
*/
|
|
458
|
+
static provide<T>(app: AppInstance, fn: () => T): T;
|
|
459
|
+
/**
|
|
460
|
+
* 异步版本的 provide
|
|
461
|
+
*/
|
|
462
|
+
static provideAsync<T>(app: AppInstance, fn: () => Promise<T>): Promise<T>;
|
|
463
|
+
/**
|
|
464
|
+
* 类似 useContext(Context) - 获取当前上下文
|
|
465
|
+
*/
|
|
466
|
+
static useContext(): AppInstance;
|
|
467
|
+
/**
|
|
468
|
+
* 检查是否有活跃的上下文
|
|
469
|
+
*/
|
|
470
|
+
static hasContext(): boolean;
|
|
471
|
+
/**
|
|
472
|
+
* 清空所有上下文(主要用于测试)
|
|
473
|
+
*/
|
|
474
|
+
static clear(): void;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
declare type AppInstance = MapApplication;
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* 应用程序选项配置
|
|
481
|
+
* 包含事件回调、配置和运行时状态
|
|
482
|
+
*/
|
|
483
|
+
export declare type AppOptions = {
|
|
484
|
+
/** 事件回调配置 */
|
|
485
|
+
events?: MapCallbacks
|
|
486
|
+
/** 应用配置 */
|
|
487
|
+
config: DeepPartialAppConfig
|
|
488
|
+
/** 运行时配置 */
|
|
489
|
+
runtime: DeepPartialRuntimeConfig
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
declare class AppService {
|
|
493
|
+
getApp(): MapApplication;
|
|
494
|
+
getConfig(): AppConfig;
|
|
495
|
+
getRoomProperty(roomId: number): RoomData_2 | undefined;
|
|
496
|
+
/**
|
|
497
|
+
* 将米转换为像素(委托给 MapApplication)
|
|
498
|
+
*/
|
|
499
|
+
metersToPixels(meters: number): number;
|
|
500
|
+
/**
|
|
501
|
+
* 将像素转换为米(委托给 MapApplication)
|
|
502
|
+
*/
|
|
503
|
+
pixelsToMeters(pixels: number): number;
|
|
504
|
+
get ticker(): Ticker;
|
|
505
|
+
get mapState(): MapState_2 | null;
|
|
506
|
+
get gloalConfig(): {
|
|
507
|
+
containerTop: string;
|
|
508
|
+
containerLeft: string;
|
|
509
|
+
containerWidth: string;
|
|
510
|
+
containerHeight: string;
|
|
511
|
+
backgroundColor: ColorSource;
|
|
512
|
+
};
|
|
513
|
+
get mapConfig(): {
|
|
514
|
+
autoPaddingPercent: number;
|
|
515
|
+
obstacleColor: ColorSource;
|
|
516
|
+
};
|
|
517
|
+
get roomConfig(): {
|
|
518
|
+
colors: {
|
|
519
|
+
active: string[];
|
|
520
|
+
inactive: string[];
|
|
521
|
+
name: string[];
|
|
522
|
+
propertyTheme: string[];
|
|
523
|
+
selectionIndicatorBackground: string[];
|
|
524
|
+
selectionIndicatorIcon: string[];
|
|
525
|
+
NO_ROOM_DATA: string;
|
|
526
|
+
ROOM_GAP: string;
|
|
527
|
+
OBSTACLE_ROOM: string;
|
|
528
|
+
UNKNOWN_ROOM: string;
|
|
529
|
+
};
|
|
530
|
+
nameLabel: {
|
|
531
|
+
fontSize: number;
|
|
532
|
+
fontFamily: string;
|
|
533
|
+
fontWeight: TextStyleFontWeight;
|
|
534
|
+
};
|
|
535
|
+
property: {
|
|
536
|
+
displayOrders: ("cleanMode" | "suction" | "cistern" | "cleanTimes")[];
|
|
537
|
+
iconWidth: number;
|
|
538
|
+
iconHeight: number;
|
|
539
|
+
foldable: boolean;
|
|
540
|
+
offsetX: number;
|
|
541
|
+
offsetY: number;
|
|
542
|
+
iconGap: number;
|
|
543
|
+
container: {
|
|
544
|
+
backgroundColor: ColorSource;
|
|
545
|
+
paddingVertical: number;
|
|
546
|
+
paddingHorizontal: number;
|
|
547
|
+
borderRadius: number;
|
|
548
|
+
tailHeight: number;
|
|
549
|
+
tailWidth: number;
|
|
550
|
+
};
|
|
551
|
+
suction: {
|
|
552
|
+
assets: string[];
|
|
553
|
+
};
|
|
554
|
+
cistern: {
|
|
555
|
+
assets: string[];
|
|
556
|
+
};
|
|
557
|
+
cleanMode: {
|
|
558
|
+
assets: string[];
|
|
559
|
+
};
|
|
560
|
+
cleanTimes: {
|
|
561
|
+
assets: string[];
|
|
562
|
+
};
|
|
563
|
+
cleanOrder: {
|
|
564
|
+
color: ColorSource;
|
|
565
|
+
fontFamily: string;
|
|
566
|
+
fontWeight: TextStyleFontWeight;
|
|
567
|
+
fontSize: number;
|
|
568
|
+
gapRight: number;
|
|
569
|
+
};
|
|
570
|
+
};
|
|
571
|
+
selectionIndicator: {
|
|
572
|
+
iconSrc: string;
|
|
573
|
+
iconWidth: number;
|
|
574
|
+
iconHeight: number;
|
|
575
|
+
containerWidth: number;
|
|
576
|
+
containerHeight: number;
|
|
577
|
+
strokeWidth: number;
|
|
578
|
+
strokeColor: ColorSource;
|
|
579
|
+
borderRadius: number;
|
|
580
|
+
offsetX: number;
|
|
581
|
+
offsetY: number;
|
|
582
|
+
tailHeight: number;
|
|
583
|
+
tailWidth: number;
|
|
584
|
+
};
|
|
585
|
+
floorType: {
|
|
586
|
+
assets: string[];
|
|
587
|
+
opacity: number;
|
|
588
|
+
scale: number;
|
|
589
|
+
};
|
|
590
|
+
};
|
|
591
|
+
get heatMapConfig(): {
|
|
592
|
+
cellSize: number;
|
|
593
|
+
maxDistance: number;
|
|
594
|
+
smoothIterations: number;
|
|
595
|
+
heatmapAlpha: number;
|
|
596
|
+
colorGradients: [ColorSource, ColorSource, ColorSource, ColorSource, ColorSource, ColorSource, ColorSource, ColorSource];
|
|
597
|
+
};
|
|
598
|
+
get pathConfig(): {
|
|
599
|
+
lineWidthFixed: boolean;
|
|
600
|
+
incrementalThreshold: number;
|
|
601
|
+
commonPath: {
|
|
602
|
+
color: ColorSource;
|
|
603
|
+
width: number;
|
|
604
|
+
};
|
|
605
|
+
transitionPath: {
|
|
606
|
+
color: ColorSource;
|
|
607
|
+
width: number;
|
|
608
|
+
};
|
|
609
|
+
chargePath: {
|
|
610
|
+
color: ColorSource;
|
|
611
|
+
width: number;
|
|
612
|
+
};
|
|
613
|
+
};
|
|
614
|
+
get carpetConfig(): {
|
|
615
|
+
src: string;
|
|
616
|
+
opacity: number;
|
|
617
|
+
scale: number;
|
|
618
|
+
};
|
|
619
|
+
get robotConfig(): {
|
|
620
|
+
icon: {
|
|
621
|
+
sizeFixed: boolean;
|
|
622
|
+
width: number;
|
|
623
|
+
height: number;
|
|
624
|
+
src: string;
|
|
625
|
+
};
|
|
626
|
+
speed: number;
|
|
627
|
+
rotationCorrection: number;
|
|
628
|
+
sleepAnimation: {
|
|
629
|
+
jsonSrc: string;
|
|
630
|
+
framePrefix: string;
|
|
631
|
+
width: number;
|
|
632
|
+
height: number;
|
|
633
|
+
sizeFixed: boolean;
|
|
634
|
+
frameCount: number;
|
|
635
|
+
offsetX: number;
|
|
636
|
+
offsetY: number;
|
|
637
|
+
};
|
|
638
|
+
} & RingConfig_2;
|
|
639
|
+
get chargingStationConfig(): {
|
|
640
|
+
icon: {
|
|
641
|
+
sizeFixed: boolean;
|
|
642
|
+
width: number;
|
|
643
|
+
height: number;
|
|
644
|
+
src: string;
|
|
645
|
+
};
|
|
646
|
+
rotationCorrection: number;
|
|
647
|
+
} & RingConfig_2;
|
|
648
|
+
get interactionConfig(): {
|
|
649
|
+
zoomRange: {
|
|
650
|
+
min: number;
|
|
651
|
+
max: number;
|
|
652
|
+
};
|
|
653
|
+
enableDoubleTapZoom: boolean;
|
|
654
|
+
};
|
|
655
|
+
get controlsConfig(): ControlsConfig_2;
|
|
656
|
+
get dividerConfig(): DividerConfig_2;
|
|
657
|
+
get detectedObjectConfig(): {
|
|
658
|
+
height: number;
|
|
659
|
+
width: number;
|
|
660
|
+
interactive: boolean;
|
|
661
|
+
};
|
|
662
|
+
get snapshotConfig(): {
|
|
663
|
+
format: "png" | "jpg" | "webp";
|
|
664
|
+
quality: number;
|
|
665
|
+
antialias: boolean;
|
|
666
|
+
resolution: number;
|
|
667
|
+
};
|
|
668
|
+
get appContainer(): AppContainer_2;
|
|
669
|
+
get interaction(): Interaction_2;
|
|
670
|
+
get viewportContainer(): ViewportContainer_2;
|
|
671
|
+
get mapManager(): MapManager_2;
|
|
672
|
+
get pathManager(): PathManager_2;
|
|
673
|
+
get heatmapManager(): HeatmapManager_2;
|
|
674
|
+
get controlsManager(): ControlsManager_2;
|
|
675
|
+
get detectedObjectManager(): DetectedObjectManager_2;
|
|
676
|
+
get customElementsManager(): CustomElementsManager_2;
|
|
677
|
+
get roomsManager(): RoomManager_2;
|
|
678
|
+
get runtime(): RuntimeConfig_2;
|
|
679
|
+
get runtimeSnapshot(): {
|
|
680
|
+
readonly dividingRoomId: number | null | undefined;
|
|
681
|
+
readonly enableRoomSelection: boolean;
|
|
682
|
+
readonly editingForbiddenSweepZoneIds: readonly string[];
|
|
683
|
+
readonly editingForbiddenMopZoneIds: readonly string[];
|
|
684
|
+
readonly editingCleanZoneIds: readonly string[];
|
|
685
|
+
readonly editingVirtualWallIds: readonly string[];
|
|
686
|
+
readonly editingSpotIds: readonly string[];
|
|
687
|
+
readonly roomPropertyFoldIds: readonly number[];
|
|
688
|
+
readonly roomSelectionMode: "checkmark" | "order";
|
|
689
|
+
readonly showRoomName: boolean;
|
|
690
|
+
readonly showRoomProperty: boolean;
|
|
691
|
+
readonly showRoomOrder: boolean;
|
|
692
|
+
readonly showPath: boolean;
|
|
693
|
+
readonly showChargingStation: boolean;
|
|
694
|
+
readonly showRoomFloorType: boolean;
|
|
695
|
+
readonly showCarpet: boolean;
|
|
696
|
+
readonly selectRoomIds: readonly number[];
|
|
697
|
+
readonly showChargingStationRing: boolean;
|
|
698
|
+
readonly showRobotRing: boolean;
|
|
699
|
+
readonly showRobotSleepAnimation: boolean;
|
|
700
|
+
};
|
|
701
|
+
get events(): MapCallbacks_2 | undefined;
|
|
702
|
+
get baseScale(): number;
|
|
703
|
+
get currentScale(): number;
|
|
704
|
+
get emitter(): Emitter< {
|
|
705
|
+
antiScale: number;
|
|
706
|
+
cacheAsTexture: number;
|
|
707
|
+
gestureHijackStart: FederatedPointerEvent;
|
|
708
|
+
gestureHijackPointerMove: FederatedPointerEvent;
|
|
709
|
+
gestureHijackPointerUp: FederatedPointerEvent;
|
|
710
|
+
gestureHijackCancel: void;
|
|
711
|
+
robotPositionUpdate: {
|
|
712
|
+
x: number;
|
|
713
|
+
y: number;
|
|
714
|
+
pathType?: string;
|
|
715
|
+
};
|
|
716
|
+
robotAnimationComplete: void;
|
|
717
|
+
pathSegmentComplete: {
|
|
718
|
+
fromX: number;
|
|
719
|
+
fromY: number;
|
|
720
|
+
toX: number;
|
|
721
|
+
toY: number;
|
|
722
|
+
pathType?: string;
|
|
723
|
+
};
|
|
724
|
+
}>;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
/**
|
|
728
|
+
* 基础自定义元素参数(所有类型共享)
|
|
729
|
+
*/
|
|
730
|
+
export declare type BaseCustomElementParam = {
|
|
731
|
+
/** ID */
|
|
732
|
+
id: string
|
|
733
|
+
/** X坐标 */
|
|
734
|
+
x: number
|
|
735
|
+
/** Y坐标 */
|
|
736
|
+
y: number
|
|
737
|
+
/** 旋转角度 */
|
|
738
|
+
rotation?: number
|
|
739
|
+
/** 透明度 */
|
|
740
|
+
opacity?: number
|
|
741
|
+
/** 是否可交互 */
|
|
742
|
+
interactive?: boolean
|
|
743
|
+
/** 自定义数据 */
|
|
744
|
+
customData?: Record<string, unknown>
|
|
745
|
+
/** 尺寸是否固定 */
|
|
746
|
+
sizeFixed?: boolean
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
/** 边界框 */
|
|
750
|
+
export declare type Bounds = {
|
|
751
|
+
/** 最小X坐标 */
|
|
752
|
+
minX: number
|
|
753
|
+
/** 最小Y坐标 */
|
|
754
|
+
minY: number
|
|
755
|
+
/** 最大X坐标 */
|
|
756
|
+
maxX: number
|
|
757
|
+
/** 最大Y坐标 */
|
|
758
|
+
maxY: number
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
declare class Carpet extends Container {
|
|
762
|
+
private carpetSprite;
|
|
763
|
+
private carpetMask;
|
|
764
|
+
constructor();
|
|
765
|
+
/**
|
|
766
|
+
* 创建地毯纹理覆盖(栅格数据)
|
|
767
|
+
* @param carpetPixels 地毯像素数据
|
|
768
|
+
* @param mapWidth 地图宽度
|
|
769
|
+
*/
|
|
770
|
+
createCarpetFromRasterData(carpetPixels: Uint32Array, mapWidth: number): Promise<void>;
|
|
771
|
+
/**
|
|
772
|
+
* 创建地毯的Graphics作为mask
|
|
773
|
+
* @param carpetPixels 地毯像素数据
|
|
774
|
+
* @param mapWidth 地图宽度
|
|
775
|
+
* @returns Graphics对象
|
|
776
|
+
*/
|
|
777
|
+
private createCarpetGraphics;
|
|
778
|
+
/**
|
|
779
|
+
* 清除地毯
|
|
780
|
+
*/
|
|
781
|
+
clearCarpet(): void;
|
|
782
|
+
/**
|
|
783
|
+
* 创建地毯纹理覆盖(结构化数据)
|
|
784
|
+
* @param carpetData 结构化地毯数据数组
|
|
785
|
+
*/
|
|
786
|
+
createCarpetFromStructuredData(carpetData: Array<{
|
|
787
|
+
coordinates: number[];
|
|
788
|
+
}>): Promise<void>;
|
|
789
|
+
/**
|
|
790
|
+
* 创建地毯的Graphics作为mask(结构化数据)
|
|
791
|
+
* @param carpetData 结构化地毯数据数组
|
|
792
|
+
* @returns Graphics对象
|
|
793
|
+
*/
|
|
794
|
+
private createCarpetGraphicsFromStructuredData;
|
|
795
|
+
/**
|
|
796
|
+
* 销毁时清理资源
|
|
797
|
+
*/
|
|
798
|
+
destroy(): void;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
declare class ChargingStation extends Container {
|
|
802
|
+
chargingStation: ChargingStationIcon;
|
|
803
|
+
ring: Ring;
|
|
804
|
+
private unsubscribeFns;
|
|
805
|
+
constructor();
|
|
806
|
+
draw({ x, y, rotation }: IconPoint): Promise<void>;
|
|
807
|
+
destroy(): void;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
declare class ChargingStationIcon extends EnhancedSprite {
|
|
811
|
+
constructor();
|
|
812
|
+
initializeSprite(): Promise<void>;
|
|
813
|
+
draw({ x, y, rotation }: IconPoint): Promise<void>;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
/** 组件属性类型 */
|
|
817
|
+
export declare type ComponentPropsApp = {
|
|
818
|
+
/** 地图应用实例 */
|
|
819
|
+
app: MapApplication
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
/** 组件类型定义 */
|
|
823
|
+
declare type Components = {
|
|
824
|
+
viewportContainer: ViewportContainer;
|
|
825
|
+
appContainer: AppContainer;
|
|
826
|
+
interaction: Interaction;
|
|
827
|
+
};
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* 控制元素配置
|
|
831
|
+
*/
|
|
832
|
+
export declare type ControlsConfig = {
|
|
833
|
+
/** 图标容器宽度 */
|
|
834
|
+
iconWrapperWidth: number
|
|
835
|
+
/** 图标容器高度 */
|
|
836
|
+
iconWrapperHeight: number
|
|
837
|
+
/** 图标容器边框圆角 */
|
|
838
|
+
iconWrapperBorderRadius: number
|
|
839
|
+
/** 图标宽度 */
|
|
840
|
+
iconWidth: number
|
|
841
|
+
/** 图标高度 */
|
|
842
|
+
iconHeight: number
|
|
843
|
+
/** 删除图标资源路径 */
|
|
844
|
+
deleteIconSrc: string
|
|
845
|
+
/** 旋转图标资源路径 */
|
|
846
|
+
rotateIconSrc: string
|
|
847
|
+
/** 缩放图标资源路径 */
|
|
848
|
+
scaleIconSrc: string
|
|
849
|
+
/** 移动图标资源路径 */
|
|
850
|
+
moveIconSrc: string
|
|
851
|
+
/** 移动按钮偏移 */
|
|
852
|
+
moveButtonOffset: number
|
|
853
|
+
/** 文本字体大小 */
|
|
854
|
+
textFontSize: number
|
|
855
|
+
/** 文本字体名称 */
|
|
856
|
+
textFontFamily: string
|
|
857
|
+
/** 文本字体粗细 */
|
|
858
|
+
textFontWeight: TextStyleFontWeight
|
|
859
|
+
/** 单位标签 */
|
|
860
|
+
unitLabel: string
|
|
861
|
+
/** 禁扫区域配置 */
|
|
862
|
+
forbiddenSweepZone: ZoneConfig
|
|
863
|
+
/** 禁拖区域配置 */
|
|
864
|
+
forbiddenMopZone: ZoneConfig
|
|
865
|
+
/** 清扫区域配置 */
|
|
866
|
+
cleanZone: ZoneConfig
|
|
867
|
+
/** 虚拟墙配置 */
|
|
868
|
+
virtualWall: VirtualWallConfig
|
|
869
|
+
/** 定点清扫配置 */
|
|
870
|
+
spot: SpotConfig
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
declare class ControlsManager {
|
|
874
|
+
private forbiddenSweepZoneMap;
|
|
875
|
+
private forbiddenMopZoneMap;
|
|
876
|
+
private cleanZoneMap;
|
|
877
|
+
private virtualWallMap;
|
|
878
|
+
private spotMap;
|
|
879
|
+
private divider;
|
|
880
|
+
private unsubscribeFns;
|
|
881
|
+
constructor();
|
|
882
|
+
/**
|
|
883
|
+
* 根据地图原点更新所有区域位置
|
|
884
|
+
*/
|
|
885
|
+
updatePositionByOrigin(x: number, y: number): void;
|
|
886
|
+
/**
|
|
887
|
+
* 绘制扫地禁区
|
|
888
|
+
*/
|
|
889
|
+
drawForbiddenSweepZones(zones: ZoneParam[]): void;
|
|
890
|
+
/**
|
|
891
|
+
* 获取所有扫地禁区数据
|
|
892
|
+
*/
|
|
893
|
+
getForbiddenSweepZones(): ZoneParam[];
|
|
894
|
+
/**
|
|
895
|
+
* 清除所有扫地禁区
|
|
896
|
+
*/
|
|
897
|
+
clearAllForbiddenSweepZones(): void;
|
|
898
|
+
/**
|
|
899
|
+
* 绘制拖地禁区
|
|
900
|
+
*/
|
|
901
|
+
drawForbiddenMopZones(zones: ZoneParam[]): void;
|
|
902
|
+
/**
|
|
903
|
+
* 获取所有拖地禁区数据
|
|
904
|
+
*/
|
|
905
|
+
getForbiddenMopZones(): ZoneParam[];
|
|
906
|
+
/**
|
|
907
|
+
* 清除所有拖地禁区
|
|
908
|
+
*/
|
|
909
|
+
clearAllForbiddenMopZones(): void;
|
|
910
|
+
/**
|
|
911
|
+
* 绘制清扫区域
|
|
912
|
+
*/
|
|
913
|
+
drawCleanZones(zones: ZoneParam[]): void;
|
|
914
|
+
/**
|
|
915
|
+
* 获取所有清扫区域数据
|
|
916
|
+
*/
|
|
917
|
+
getCleanZones(): ZoneParam[];
|
|
918
|
+
/**
|
|
919
|
+
* 清除所有清扫区域
|
|
920
|
+
*/
|
|
921
|
+
clearAllCleanZones(): void;
|
|
922
|
+
/**
|
|
923
|
+
* 绘制虚拟墙
|
|
924
|
+
*/
|
|
925
|
+
drawVirtualWalls(walls: VirtualWallParam[]): void;
|
|
926
|
+
/**
|
|
927
|
+
* 获取所有虚拟墙数据
|
|
928
|
+
*/
|
|
929
|
+
getVirtualWalls(): VirtualWallParam[];
|
|
930
|
+
/**
|
|
931
|
+
* 清除所有虚拟墙
|
|
932
|
+
*/
|
|
933
|
+
clearAllVirtualWalls(): void;
|
|
934
|
+
/**
|
|
935
|
+
* 绘制定点清扫
|
|
936
|
+
*/
|
|
937
|
+
drawSpots(spots: SpotParam[]): void;
|
|
938
|
+
/**
|
|
939
|
+
* 获取所有定点清扫数据
|
|
940
|
+
*/
|
|
941
|
+
getSpots(): SpotParam[];
|
|
942
|
+
/**
|
|
943
|
+
* 清除所有定点清扫
|
|
944
|
+
*/
|
|
945
|
+
clearAllSpots(): void;
|
|
946
|
+
/**
|
|
947
|
+
* 通用的绘制区域方法
|
|
948
|
+
*/
|
|
949
|
+
private drawZones;
|
|
950
|
+
/**
|
|
951
|
+
* 添加新区域到 LAYER_CONTROLS
|
|
952
|
+
*/
|
|
953
|
+
private addNewZone;
|
|
954
|
+
/**
|
|
955
|
+
* 移除区域
|
|
956
|
+
*/
|
|
957
|
+
private removeZone;
|
|
958
|
+
/**
|
|
959
|
+
* 获取区域数据
|
|
960
|
+
*/
|
|
961
|
+
private getZonesData;
|
|
962
|
+
/**
|
|
963
|
+
* 清除所有区域
|
|
964
|
+
*/
|
|
965
|
+
private clearAllZones;
|
|
966
|
+
/**
|
|
967
|
+
* 更新区域编辑状态
|
|
968
|
+
*/
|
|
969
|
+
private updateZonesEditState;
|
|
970
|
+
/**
|
|
971
|
+
* 更新虚拟墙编辑状态
|
|
972
|
+
*/
|
|
973
|
+
private updateVirtualWallsEditState;
|
|
974
|
+
/**
|
|
975
|
+
* 比较两个区域数据是否相等
|
|
976
|
+
*/
|
|
977
|
+
private isZoneDataEqual;
|
|
978
|
+
/**
|
|
979
|
+
* 获取虚拟墙数据
|
|
980
|
+
*/
|
|
981
|
+
private getWallsData;
|
|
982
|
+
/**
|
|
983
|
+
* 清除所有虚拟墙
|
|
984
|
+
*/
|
|
985
|
+
private clearAllWalls;
|
|
986
|
+
/**
|
|
987
|
+
* 比较两个虚拟墙是否相同
|
|
988
|
+
*/
|
|
989
|
+
private isWallDataEqual;
|
|
990
|
+
/**
|
|
991
|
+
* 添加新定点清扫到 LAYER_CONTROLS
|
|
992
|
+
*/
|
|
993
|
+
private addNewSpot;
|
|
994
|
+
/**
|
|
995
|
+
* 移除定点清扫
|
|
996
|
+
*/
|
|
997
|
+
private removeSpot;
|
|
998
|
+
/**
|
|
999
|
+
* 获取定点清扫数据
|
|
1000
|
+
*/
|
|
1001
|
+
private getSpotsData;
|
|
1002
|
+
/**
|
|
1003
|
+
* 清除所有定点清扫
|
|
1004
|
+
*/
|
|
1005
|
+
private clearAllSpotsInternal;
|
|
1006
|
+
/**
|
|
1007
|
+
* 更新定点清扫编辑状态
|
|
1008
|
+
*/
|
|
1009
|
+
private updateSpotsEditState;
|
|
1010
|
+
/**
|
|
1011
|
+
* 比较两个定点清扫数据是否相等
|
|
1012
|
+
*/
|
|
1013
|
+
private isSpotDataEqual;
|
|
1014
|
+
/**
|
|
1015
|
+
* 处理分割房间ID变化
|
|
1016
|
+
*/
|
|
1017
|
+
private handleDividingRoomIdChange;
|
|
1018
|
+
/**
|
|
1019
|
+
* 获取房间几何信息
|
|
1020
|
+
*/
|
|
1021
|
+
private getRoomGeometry;
|
|
1022
|
+
/**
|
|
1023
|
+
* 创建默认分割线
|
|
1024
|
+
*/
|
|
1025
|
+
private createDefaultDivider;
|
|
1026
|
+
/**
|
|
1027
|
+
* 清除分割线
|
|
1028
|
+
*/
|
|
1029
|
+
private clearDivider;
|
|
1030
|
+
/**
|
|
1031
|
+
* 获取分割线数据
|
|
1032
|
+
*/
|
|
1033
|
+
getDividerEndPoints(): Point[] | null;
|
|
1034
|
+
/**
|
|
1035
|
+
* 获取分割线有效端点
|
|
1036
|
+
*/
|
|
1037
|
+
getEffectiveDividerPoints(): Point[] | null;
|
|
1038
|
+
/**
|
|
1039
|
+
* 销毁管理器
|
|
1040
|
+
*/
|
|
1041
|
+
destroy(): void;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
/**
|
|
1045
|
+
* 自定义元素参数
|
|
1046
|
+
*/
|
|
1047
|
+
export declare type CustomElementParam =
|
|
1048
|
+
| ImageCustomElementParam
|
|
1049
|
+
| GifCustomElementParam
|
|
1050
|
+
| HtmlCustomElementParam
|
|
1051
|
+
|
|
1052
|
+
declare class CustomElementsManager {
|
|
1053
|
+
private customElementsMap;
|
|
1054
|
+
private gifTicker;
|
|
1055
|
+
private gifElements;
|
|
1056
|
+
constructor();
|
|
1057
|
+
/**
|
|
1058
|
+
* 根据地图原点更新所有自定义元素位置
|
|
1059
|
+
*/
|
|
1060
|
+
updatePositionByOrigin(x: number, y: number): void;
|
|
1061
|
+
/**
|
|
1062
|
+
* 绘制自定义元素
|
|
1063
|
+
*/
|
|
1064
|
+
drawCustomElements(elements: CustomElementParam[]): Promise<void>;
|
|
1065
|
+
/**
|
|
1066
|
+
* 清除所有自定义元素
|
|
1067
|
+
*/
|
|
1068
|
+
clearAllCustomElements(): void;
|
|
1069
|
+
/**
|
|
1070
|
+
* 添加新的自定义元素
|
|
1071
|
+
*/
|
|
1072
|
+
private addNewCustomElement;
|
|
1073
|
+
/**
|
|
1074
|
+
* 移除自定义元素
|
|
1075
|
+
*/
|
|
1076
|
+
private removeCustomElement;
|
|
1077
|
+
/**
|
|
1078
|
+
* 检查数据是否相同(类型安全的辅助方法)
|
|
1079
|
+
*/
|
|
1080
|
+
private isSameData;
|
|
1081
|
+
/**
|
|
1082
|
+
* 更新元素数据(类型安全的辅助方法)
|
|
1083
|
+
*/
|
|
1084
|
+
private updateElementData;
|
|
1085
|
+
/**
|
|
1086
|
+
* 更新 GIF Ticker 状态
|
|
1087
|
+
*/
|
|
1088
|
+
private updateGifTicker;
|
|
1089
|
+
/**
|
|
1090
|
+
* 启动 GIF Ticker
|
|
1091
|
+
*/
|
|
1092
|
+
private startGifTicker;
|
|
1093
|
+
/**
|
|
1094
|
+
* 停止 GIF Ticker
|
|
1095
|
+
*/
|
|
1096
|
+
private stopGifTicker;
|
|
1097
|
+
/**
|
|
1098
|
+
* 渲染 GIF 容器
|
|
1099
|
+
*/
|
|
1100
|
+
private renderGifContainer;
|
|
1101
|
+
/**
|
|
1102
|
+
* 销毁管理器
|
|
1103
|
+
*/
|
|
1104
|
+
destroy(): void;
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
/**
|
|
1108
|
+
* 递归地将类型的所有属性变为可选的
|
|
1109
|
+
* @template T - 要处理的类型
|
|
1110
|
+
*/
|
|
1111
|
+
export declare type DeepPartial<T> =
|
|
1112
|
+
T extends Array<infer U>
|
|
1113
|
+
? Array<DeepPartial<U>>
|
|
1114
|
+
: T extends object
|
|
1115
|
+
? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
1116
|
+
: T
|
|
1117
|
+
|
|
1118
|
+
/** 深度可选的应用配置类型 */
|
|
1119
|
+
export declare type DeepPartialAppConfig = DeepPartial<AppConfig>
|
|
1120
|
+
|
|
1121
|
+
/** 深度可选的运行时配置类型 */
|
|
1122
|
+
export declare type DeepPartialRuntimeConfig = DeepPartial<RuntimeConfig>
|
|
1123
|
+
|
|
1124
|
+
declare class DetectedObjectManager {
|
|
1125
|
+
private detectedObjectMap;
|
|
1126
|
+
/**
|
|
1127
|
+
* 根据地图原点更新所有检测物体位置
|
|
1128
|
+
*/
|
|
1129
|
+
updatePositionByOrigin(x: number, y: number): void;
|
|
1130
|
+
/**
|
|
1131
|
+
* 绘制检测物体
|
|
1132
|
+
*/
|
|
1133
|
+
drawDetectedObjects(objects: DetectedObjectParam[]): Promise<void>;
|
|
1134
|
+
/**
|
|
1135
|
+
* 清除所有检测物体
|
|
1136
|
+
*/
|
|
1137
|
+
clearAllDetectedObjects(): void;
|
|
1138
|
+
/**
|
|
1139
|
+
* 添加新的检测物体
|
|
1140
|
+
*/
|
|
1141
|
+
private addNewDetectedObject;
|
|
1142
|
+
/**
|
|
1143
|
+
* 移除检测物体
|
|
1144
|
+
*/
|
|
1145
|
+
private removeDetectedObject;
|
|
1146
|
+
/**
|
|
1147
|
+
* 销毁管理器
|
|
1148
|
+
*/
|
|
1149
|
+
destroy(): void;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
/**
|
|
1153
|
+
* 检测物体参数
|
|
1154
|
+
*/
|
|
1155
|
+
export declare type DetectedObjectParam = {
|
|
1156
|
+
/** ID */
|
|
1157
|
+
id: string
|
|
1158
|
+
/** 图片资源路径 */
|
|
1159
|
+
src: string
|
|
1160
|
+
/** X坐标 */
|
|
1161
|
+
x: number
|
|
1162
|
+
/** Y坐标 */
|
|
1163
|
+
y: number
|
|
1164
|
+
/** 高度 */
|
|
1165
|
+
height?: number
|
|
1166
|
+
/** 宽度 */
|
|
1167
|
+
width?: number
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
/** 方向 */
|
|
1171
|
+
export declare type Direction = 'horizontal' | 'vertical'
|
|
1172
|
+
|
|
1173
|
+
/** 分割线配置 */
|
|
1174
|
+
export declare type DividerConfig = {
|
|
1175
|
+
/** 线条颜色 */
|
|
1176
|
+
lineColor: ColorSource
|
|
1177
|
+
/** 虚线线条宽度 */
|
|
1178
|
+
dashLineWidth: number
|
|
1179
|
+
/** 虚线线条配置 */
|
|
1180
|
+
dashLineDashArray: [number, number]
|
|
1181
|
+
/** 实线线条宽度 */
|
|
1182
|
+
solidLineWidth: number
|
|
1183
|
+
/** 端点大小 */
|
|
1184
|
+
endPointSize: number
|
|
1185
|
+
/** 端点颜色 */
|
|
1186
|
+
endPointColor: ColorSource
|
|
1187
|
+
/** 端点描边颜色 */
|
|
1188
|
+
endPointStrokeColor: ColorSource
|
|
1189
|
+
/** 端点描边宽度 */
|
|
1190
|
+
endPointStrokeWidth: number
|
|
1191
|
+
/** 热区厚度 */
|
|
1192
|
+
hitAreaThickness: number
|
|
1193
|
+
/** 当分割线完全处在房间外的时候是否重置分割线 */
|
|
1194
|
+
resetDividerWhenOutOfRoom: boolean
|
|
1195
|
+
/** 默认生成的分割线超出房间包围盒的像素值 */
|
|
1196
|
+
defaultExtension: number
|
|
1197
|
+
/** 默认生成的分割线方向 */
|
|
1198
|
+
defaultDirection: Direction
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
/**
|
|
1202
|
+
* 固定大小动画精灵基类
|
|
1203
|
+
* 基于 EnhancedSprite 扩展,支持帧动画播放
|
|
1204
|
+
*
|
|
1205
|
+
* 两种模式:
|
|
1206
|
+
* 1. sizeFixed: true - 固定屏幕像素大小,不受地图缩放影响
|
|
1207
|
+
* 2. sizeFixed: false - 以地图scale=1为基准,跟随地图缩放
|
|
1208
|
+
*/
|
|
1209
|
+
declare class EnhancedAnimatedSprite extends AnimatedSprite {
|
|
1210
|
+
private throttledUpdateScale;
|
|
1211
|
+
private fixedWidth;
|
|
1212
|
+
private fixedHeight;
|
|
1213
|
+
private isFixedSizeSet;
|
|
1214
|
+
private sizeFixed;
|
|
1215
|
+
private baselineScale;
|
|
1216
|
+
private static animationTicker;
|
|
1217
|
+
private static animatedSprites;
|
|
1218
|
+
constructor(textures?: Texture[]);
|
|
1219
|
+
/**
|
|
1220
|
+
* 设置固定的屏幕像素大小
|
|
1221
|
+
* @param width 屏幕上显示的固定宽度(像素)
|
|
1222
|
+
* @param height 屏幕上显示的固定高度(像素)
|
|
1223
|
+
*/
|
|
1224
|
+
setFixedSize(width: number, height: number): void;
|
|
1225
|
+
/**
|
|
1226
|
+
* 设置是否启用固定大小模式
|
|
1227
|
+
* @param enabled 是否启用固定大小模式
|
|
1228
|
+
*/
|
|
1229
|
+
setSizeFixed(enabled: boolean): void;
|
|
1230
|
+
/**
|
|
1231
|
+
* 重写 width setter,确保使用固定大小逻辑
|
|
1232
|
+
*/
|
|
1233
|
+
set width(value: number);
|
|
1234
|
+
/**
|
|
1235
|
+
* 重写 height setter,确保使用固定大小逻辑
|
|
1236
|
+
*/
|
|
1237
|
+
set height(value: number);
|
|
1238
|
+
/**
|
|
1239
|
+
* 重写 width getter,返回固定宽度
|
|
1240
|
+
*/
|
|
1241
|
+
get width(): number;
|
|
1242
|
+
/**
|
|
1243
|
+
* 重写 height getter,返回固定高度
|
|
1244
|
+
*/
|
|
1245
|
+
get height(): number;
|
|
1246
|
+
/**
|
|
1247
|
+
* 注册缩放事件监听
|
|
1248
|
+
*/
|
|
1249
|
+
private registerScaleListener;
|
|
1250
|
+
/**
|
|
1251
|
+
* 应用大小(统一处理两种模式)
|
|
1252
|
+
*/
|
|
1253
|
+
private applySize;
|
|
1254
|
+
/**
|
|
1255
|
+
* 更新元素缩放,以保持正确大小
|
|
1256
|
+
*/
|
|
1257
|
+
protected updateScale(scale: number): void;
|
|
1258
|
+
/**
|
|
1259
|
+
* 静态方法:加载动画纹理
|
|
1260
|
+
* @param jsonSrc 动画JSON资源路径
|
|
1261
|
+
* @param framePrefix 帧名称前缀,例如 "sleep_"
|
|
1262
|
+
* @param frameCount 帧数量
|
|
1263
|
+
* @returns Promise<Texture[]> 纹理数组
|
|
1264
|
+
*/
|
|
1265
|
+
static loadAnimationTextures(jsonSrc: string, framePrefix?: string, frameCount?: number): Promise<Texture[]>;
|
|
1266
|
+
/**
|
|
1267
|
+
* 设置动画配置
|
|
1268
|
+
* @param iconConfig 图标配置
|
|
1269
|
+
*/
|
|
1270
|
+
setupAnimation(iconConfig: IconConfig): void;
|
|
1271
|
+
/**
|
|
1272
|
+
* 通用绘制方法
|
|
1273
|
+
* @param params 绘制参数
|
|
1274
|
+
* @param visibilityCondition 可选的可见性条件函数
|
|
1275
|
+
*/
|
|
1276
|
+
draw(params: IconPoint, visibilityCondition?: () => boolean): void;
|
|
1277
|
+
/**
|
|
1278
|
+
* 开始播放动画
|
|
1279
|
+
*/
|
|
1280
|
+
play(): void;
|
|
1281
|
+
/**
|
|
1282
|
+
* 停止播放动画
|
|
1283
|
+
*/
|
|
1284
|
+
stop(): void;
|
|
1285
|
+
/**
|
|
1286
|
+
* 重写 textures setter,在设置新纹理后重新应用固定大小
|
|
1287
|
+
*/
|
|
1288
|
+
set textures(value: Texture[]);
|
|
1289
|
+
/**
|
|
1290
|
+
* 重写 textures getter
|
|
1291
|
+
*/
|
|
1292
|
+
get textures(): Texture[];
|
|
1293
|
+
/**
|
|
1294
|
+
* 启动动画 Ticker
|
|
1295
|
+
*/
|
|
1296
|
+
private static startAnimationTicker;
|
|
1297
|
+
/**
|
|
1298
|
+
* 更新动画 Ticker 状态
|
|
1299
|
+
*/
|
|
1300
|
+
private static updateAnimationTicker;
|
|
1301
|
+
/**
|
|
1302
|
+
* 停止动画 Ticker
|
|
1303
|
+
*/
|
|
1304
|
+
private static stopAnimationTicker;
|
|
1305
|
+
/**
|
|
1306
|
+
* 更新所有动画
|
|
1307
|
+
*/
|
|
1308
|
+
private static updateAnimations;
|
|
1309
|
+
/**
|
|
1310
|
+
* 组件销毁时清理资源
|
|
1311
|
+
*/
|
|
1312
|
+
destroy(options?: {
|
|
1313
|
+
children?: boolean;
|
|
1314
|
+
texture?: boolean;
|
|
1315
|
+
baseTexture?: boolean;
|
|
1316
|
+
}): void;
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
/**
|
|
1320
|
+
* 固定大小精灵基类
|
|
1321
|
+
* 用于创建在地图缩放时保持固定视觉大小的精灵元素
|
|
1322
|
+
*
|
|
1323
|
+
* 两种模式:
|
|
1324
|
+
* 1. sizeFixed: true - 固定屏幕像素大小,不受地图缩放影响
|
|
1325
|
+
* 2. sizeFixed: false - 以地图scale=1为基准,跟随地图缩放
|
|
1326
|
+
*/
|
|
1327
|
+
declare class EnhancedSprite extends Sprite {
|
|
1328
|
+
private throttledUpdateScale;
|
|
1329
|
+
private fixedWidth;
|
|
1330
|
+
private fixedHeight;
|
|
1331
|
+
private isFixedSizeSet;
|
|
1332
|
+
private sizeFixed;
|
|
1333
|
+
private baselineScale;
|
|
1334
|
+
constructor(texture?: Texture);
|
|
1335
|
+
/**
|
|
1336
|
+
* 设置固定的屏幕像素大小
|
|
1337
|
+
* @param width 屏幕上显示的固定宽度(像素)
|
|
1338
|
+
* @param height 屏幕上显示的固定高度(像素)
|
|
1339
|
+
*/
|
|
1340
|
+
setFixedSize(width: number, height: number): void;
|
|
1341
|
+
/**
|
|
1342
|
+
* 设置是否启用固定大小模式
|
|
1343
|
+
* @param enabled 是否启用固定大小模式
|
|
1344
|
+
*/
|
|
1345
|
+
setSizeFixed(enabled: boolean): void;
|
|
1346
|
+
/**
|
|
1347
|
+
* 重写 width setter,确保使用固定大小逻辑
|
|
1348
|
+
*/
|
|
1349
|
+
set width(value: number);
|
|
1350
|
+
/**
|
|
1351
|
+
* 重写 height setter,确保使用固定大小逻辑
|
|
1352
|
+
*/
|
|
1353
|
+
set height(value: number);
|
|
1354
|
+
/**
|
|
1355
|
+
* 重写 width getter,返回固定宽度
|
|
1356
|
+
*/
|
|
1357
|
+
get width(): number;
|
|
1358
|
+
/**
|
|
1359
|
+
* 重写 height getter,返回固定高度
|
|
1360
|
+
*/
|
|
1361
|
+
get height(): number;
|
|
1362
|
+
/**
|
|
1363
|
+
* 注册缩放事件监听
|
|
1364
|
+
*/
|
|
1365
|
+
private registerScaleListener;
|
|
1366
|
+
/**
|
|
1367
|
+
* 应用大小(统一处理两种模式)
|
|
1368
|
+
*/
|
|
1369
|
+
private applySize;
|
|
1370
|
+
/**
|
|
1371
|
+
* 更新元素缩放,以保持正确大小
|
|
1372
|
+
*/
|
|
1373
|
+
protected updateScale(scale: number): void;
|
|
1374
|
+
/**
|
|
1375
|
+
* 异步加载纹理并设置大小
|
|
1376
|
+
* @param assetKey 资源键名 或 资源src
|
|
1377
|
+
* @param iconConfig 图标配置(需要包含sizeFixed属性)
|
|
1378
|
+
*/
|
|
1379
|
+
loadTextureAndSetSize(src: string, iconConfig: IconConfig): Promise<void>;
|
|
1380
|
+
/**
|
|
1381
|
+
* 通用绘制方法
|
|
1382
|
+
* @param params 绘制参数
|
|
1383
|
+
* @param visibilityCondition 可选的可见性条件函数
|
|
1384
|
+
*/
|
|
1385
|
+
draw(params: IconPoint, visibilityCondition?: () => boolean): void;
|
|
1386
|
+
/**
|
|
1387
|
+
* 重写 texture setter,在设置新纹理后重新应用固定大小
|
|
1388
|
+
*/
|
|
1389
|
+
set texture(value: Texture);
|
|
1390
|
+
/**
|
|
1391
|
+
* 重写 texture getter
|
|
1392
|
+
*/
|
|
1393
|
+
get texture(): Texture;
|
|
1394
|
+
/**
|
|
1395
|
+
* 组件销毁时清理资源
|
|
1396
|
+
*/
|
|
1397
|
+
destroy(options?: {
|
|
1398
|
+
children?: boolean;
|
|
1399
|
+
texture?: boolean;
|
|
1400
|
+
baseTexture?: boolean;
|
|
1401
|
+
}): void;
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
/**
|
|
1405
|
+
* GIF 类型自定义元素参数
|
|
1406
|
+
* 保持现有逻辑
|
|
1407
|
+
*/
|
|
1408
|
+
export declare type GifCustomElementParam = BaseCustomElementParam & {
|
|
1409
|
+
/** 元素类型 */
|
|
1410
|
+
type: 'gif'
|
|
1411
|
+
/** GIF资源路径 */
|
|
1412
|
+
src: string
|
|
1413
|
+
/** GIF宽度(必需 - GIF 需要明确尺寸) */
|
|
1414
|
+
width: number
|
|
1415
|
+
/** GIF高度(必需 - GIF 需要明确尺寸) */
|
|
1416
|
+
height: number
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
declare class Heatmap extends Container {
|
|
1420
|
+
colorGradients: Array<string>;
|
|
1421
|
+
cellSize: number;
|
|
1422
|
+
constructor();
|
|
1423
|
+
/**
|
|
1424
|
+
* 绘制热力图
|
|
1425
|
+
* @param grid 处理好的热力数据 每个网格的信号强度 和 坐标
|
|
1426
|
+
* @param useGradient 是否使用渐变绘制
|
|
1427
|
+
*/
|
|
1428
|
+
draw(grid: Array<Array<{
|
|
1429
|
+
x: number;
|
|
1430
|
+
y: number;
|
|
1431
|
+
signal: number;
|
|
1432
|
+
hasPoint: boolean;
|
|
1433
|
+
}>>, useGradient?: boolean, heatmapAlpha?: number): void;
|
|
1434
|
+
/**
|
|
1435
|
+
* 裁剪热力图 仅显示房间区域
|
|
1436
|
+
* 根据roomFill图层的子元素 组合Graphics生成大Graphics裁剪
|
|
1437
|
+
* @param heatmap 热力图mesh
|
|
1438
|
+
*/
|
|
1439
|
+
private croppingHeatmap;
|
|
1440
|
+
/**
|
|
1441
|
+
* 网格绘制热力图 我网格模式
|
|
1442
|
+
* @param grid 处理好的热力数据 每个网格的信号强度 和 坐标
|
|
1443
|
+
* @returns 网格热力图mesh
|
|
1444
|
+
*/
|
|
1445
|
+
private gridDrawing;
|
|
1446
|
+
/**
|
|
1447
|
+
* 渐变绘制热力图
|
|
1448
|
+
* @param grid 处理好的热力数据 每个网格的信号强度 和 坐标
|
|
1449
|
+
* @returns 渐变热力图mesh
|
|
1450
|
+
*/
|
|
1451
|
+
private gradientDrawing;
|
|
1452
|
+
/**
|
|
1453
|
+
* 关闭纹理缓存
|
|
1454
|
+
*/
|
|
1455
|
+
closeCacheAsTexture(): void;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
declare class HeatmapManager {
|
|
1459
|
+
heatmap: Heatmap;
|
|
1460
|
+
pointsTopLeftOrigin: HeatmapPoint[];
|
|
1461
|
+
signalGrid: Array<Array<{
|
|
1462
|
+
x: number;
|
|
1463
|
+
y: number;
|
|
1464
|
+
signal: number;
|
|
1465
|
+
hasPoint: boolean;
|
|
1466
|
+
}>>;
|
|
1467
|
+
cellSize: number;
|
|
1468
|
+
maxDistance: number;
|
|
1469
|
+
smoothIterations: number;
|
|
1470
|
+
heatmapAlpha: number;
|
|
1471
|
+
constructor();
|
|
1472
|
+
/**
|
|
1473
|
+
* 绘制热力图
|
|
1474
|
+
* @param mapData 地图数据
|
|
1475
|
+
* @param heatmapPoints 热力图点
|
|
1476
|
+
* @param useGradient 是否使用渐变绘制
|
|
1477
|
+
* @returns
|
|
1478
|
+
*/
|
|
1479
|
+
draw({ mapData, heatmapPoints, useGradient, }: {
|
|
1480
|
+
mapData: MapDataSource;
|
|
1481
|
+
heatmapPoints: HeatmapPoint[];
|
|
1482
|
+
useGradient?: boolean;
|
|
1483
|
+
}): void;
|
|
1484
|
+
/**
|
|
1485
|
+
* 插值计算信号网格
|
|
1486
|
+
* @param pointsTopLeftOrigin 热力图路径点
|
|
1487
|
+
* @returns 信号网格
|
|
1488
|
+
*/
|
|
1489
|
+
calculateInterpolatedSignal(pointsTopLeftOrigin: HeatmapPoint[]): {
|
|
1490
|
+
x: number;
|
|
1491
|
+
y: number;
|
|
1492
|
+
signal: number;
|
|
1493
|
+
hasPoint: boolean;
|
|
1494
|
+
}[][];
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
/** 热力图点 */
|
|
1498
|
+
export declare type HeatmapPoint = Point & {
|
|
1499
|
+
/** 信号强度 */
|
|
1500
|
+
signal: number
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
/**
|
|
1504
|
+
* HTML 类型自定义元素参数
|
|
1505
|
+
* 支持动态尺寸
|
|
1506
|
+
*/
|
|
1507
|
+
export declare type HtmlCustomElementParam = BaseCustomElementParam & {
|
|
1508
|
+
/** 元素类型 */
|
|
1509
|
+
type: 'html'
|
|
1510
|
+
/** HTML内容 */
|
|
1511
|
+
htmlContent: string
|
|
1512
|
+
/** 宽度 */
|
|
1513
|
+
width?: number
|
|
1514
|
+
/** 高度 */
|
|
1515
|
+
height?: number
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
/** 图标配置 */
|
|
1519
|
+
export declare type IconConfig = IconSize & {
|
|
1520
|
+
/** 尺寸是否固定 */
|
|
1521
|
+
sizeFixed?: boolean
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
/**
|
|
1525
|
+
* 图标坐标点
|
|
1526
|
+
* 包含位置和可选的旋转角度
|
|
1527
|
+
*/
|
|
1528
|
+
export declare type IconPoint = Point & {
|
|
1529
|
+
/** 旋转角度(度) */
|
|
1530
|
+
rotation?: number
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
/** 图标尺寸 */
|
|
1534
|
+
export declare type IconSize = {
|
|
1535
|
+
/** 宽度 */
|
|
1536
|
+
width: number
|
|
1537
|
+
/** 高度 */
|
|
1538
|
+
height: number
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
/**
|
|
1542
|
+
* Image 类型自定义元素参数
|
|
1543
|
+
* 保持现有逻辑
|
|
1544
|
+
*/
|
|
1545
|
+
export declare type ImageCustomElementParam = BaseCustomElementParam & {
|
|
1546
|
+
/** 元素类型 */
|
|
1547
|
+
type: 'image'
|
|
1548
|
+
/** 图片资源路径 */
|
|
1549
|
+
src: string
|
|
1550
|
+
/** 图片宽度(必需 - 图片需要明确尺寸) */
|
|
1551
|
+
width: number
|
|
1552
|
+
/** 图片高度(必需 - 图片需要明确尺寸) */
|
|
1553
|
+
height: number
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
/* Excluded from this release type: InstanceEvents */
|
|
1557
|
+
|
|
1558
|
+
declare class Interaction extends Container {
|
|
1559
|
+
dragStart: {
|
|
1560
|
+
x: number;
|
|
1561
|
+
y: number;
|
|
1562
|
+
} | null;
|
|
1563
|
+
initialTouchDistance: number | null;
|
|
1564
|
+
initialScale: {
|
|
1565
|
+
x: number;
|
|
1566
|
+
y: number;
|
|
1567
|
+
} | null;
|
|
1568
|
+
activeTouches: Map<number, {
|
|
1569
|
+
x: number;
|
|
1570
|
+
y: number;
|
|
1571
|
+
}>;
|
|
1572
|
+
firstTouchId: number | null;
|
|
1573
|
+
secondTouchId: number | null;
|
|
1574
|
+
zoomFactor: number;
|
|
1575
|
+
scaleMin: number;
|
|
1576
|
+
scaleMax: number;
|
|
1577
|
+
originalPosition: {
|
|
1578
|
+
x: number;
|
|
1579
|
+
y: number;
|
|
1580
|
+
};
|
|
1581
|
+
targetPosition: {
|
|
1582
|
+
x: number;
|
|
1583
|
+
y: number;
|
|
1584
|
+
};
|
|
1585
|
+
centerPosition: {
|
|
1586
|
+
x: number;
|
|
1587
|
+
y: number;
|
|
1588
|
+
};
|
|
1589
|
+
originalScale: {
|
|
1590
|
+
x: number;
|
|
1591
|
+
y: number;
|
|
1592
|
+
};
|
|
1593
|
+
targetScale: {
|
|
1594
|
+
x: number;
|
|
1595
|
+
y: number;
|
|
1596
|
+
};
|
|
1597
|
+
defaultScale: {
|
|
1598
|
+
x: number;
|
|
1599
|
+
y: number;
|
|
1600
|
+
};
|
|
1601
|
+
transitionDuration: number;
|
|
1602
|
+
transitionStartTime: number | null;
|
|
1603
|
+
initialPinchCenter: Point | null;
|
|
1604
|
+
isGestureValid: boolean;
|
|
1605
|
+
lastTapTime: number;
|
|
1606
|
+
doubleTapDelay: number;
|
|
1607
|
+
doubleTapZoomFactor: number;
|
|
1608
|
+
lastTapPosition: Point | null;
|
|
1609
|
+
tapDistanceThreshold: number;
|
|
1610
|
+
tapDetectionEnabled: boolean;
|
|
1611
|
+
private isGestureHijacked;
|
|
1612
|
+
private hijackedPointerId;
|
|
1613
|
+
private isHijackPaused;
|
|
1614
|
+
private interactionGraphics;
|
|
1615
|
+
private viewportBounds;
|
|
1616
|
+
private boundResetAnimation;
|
|
1617
|
+
private debouncedStopWheelRender;
|
|
1618
|
+
private interactionState;
|
|
1619
|
+
constructor();
|
|
1620
|
+
setupInteraction(): void;
|
|
1621
|
+
resetPan(targetPosition: {
|
|
1622
|
+
x: number;
|
|
1623
|
+
y: number;
|
|
1624
|
+
}): void;
|
|
1625
|
+
/**
|
|
1626
|
+
* 设置地图的位置和缩放,可选择是否使用动画过渡
|
|
1627
|
+
* @param options 缩放和位置选项
|
|
1628
|
+
* @param animate 是否使用动画,默认为 true
|
|
1629
|
+
*/
|
|
1630
|
+
setPanZoom({ targetPosition, targetScale, setCenter, setScale, }?: {
|
|
1631
|
+
targetPosition?: {
|
|
1632
|
+
x: number;
|
|
1633
|
+
y: number;
|
|
1634
|
+
};
|
|
1635
|
+
targetScale?: {
|
|
1636
|
+
x: number;
|
|
1637
|
+
y: number;
|
|
1638
|
+
};
|
|
1639
|
+
setCenter?: boolean;
|
|
1640
|
+
setScale?: boolean;
|
|
1641
|
+
}, animate?: boolean): void;
|
|
1642
|
+
clearTouches(): void;
|
|
1643
|
+
/**
|
|
1644
|
+
* 检查事件监听器状态 - 调试用
|
|
1645
|
+
*/
|
|
1646
|
+
checkEventListeners(): {
|
|
1647
|
+
wheel: number;
|
|
1648
|
+
pointerdown: number;
|
|
1649
|
+
pointerup: number;
|
|
1650
|
+
pointerupoutside: number;
|
|
1651
|
+
pointermove: number;
|
|
1652
|
+
};
|
|
1653
|
+
/**
|
|
1654
|
+
* 销毁时清理事件监听
|
|
1655
|
+
*/
|
|
1656
|
+
destroy(): void;
|
|
1657
|
+
/**
|
|
1658
|
+
* 处理手势劫持
|
|
1659
|
+
*/
|
|
1660
|
+
private handleGestureHijacked;
|
|
1661
|
+
/**
|
|
1662
|
+
* 退出手势劫持模式
|
|
1663
|
+
*/
|
|
1664
|
+
private exitGestureHijacked;
|
|
1665
|
+
/**
|
|
1666
|
+
* 暂停手势劫持(双指模式)
|
|
1667
|
+
*/
|
|
1668
|
+
private pauseGestureHijack;
|
|
1669
|
+
/**
|
|
1670
|
+
* 恢复手势劫持(回到单指模式)
|
|
1671
|
+
*/
|
|
1672
|
+
private resumeGestureHijack;
|
|
1673
|
+
private antiScale;
|
|
1674
|
+
private resetAnimation;
|
|
1675
|
+
private onWheel;
|
|
1676
|
+
private onPointerDown;
|
|
1677
|
+
private onPointerUp;
|
|
1678
|
+
private detectDoubleTap;
|
|
1679
|
+
private handleDoubleTap;
|
|
1680
|
+
private onPointerMove;
|
|
1681
|
+
private applyPan;
|
|
1682
|
+
private applyPinchZoom;
|
|
1683
|
+
private setInitialScaleAndDistance;
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
declare type LayerName = (typeof LAYERS)[number];
|
|
1687
|
+
|
|
1688
|
+
declare const LAYERS: string[];
|
|
1689
|
+
|
|
1690
|
+
/** 管理器类型定义 */
|
|
1691
|
+
declare type Managers = {
|
|
1692
|
+
mapManager: MapManager;
|
|
1693
|
+
heatmapManager: HeatmapManager;
|
|
1694
|
+
pathManager: PathManager;
|
|
1695
|
+
controlsManager: ControlsManager;
|
|
1696
|
+
detectedObjectManager: DetectedObjectManager;
|
|
1697
|
+
customElementsManager: CustomElementsManager;
|
|
1698
|
+
roomsManager: RoomManager;
|
|
1699
|
+
};
|
|
1700
|
+
|
|
1701
|
+
export declare const MAP_API_METHODS: readonly ["resetPanZoom", "getForbiddenSweepZones", "getForbiddenMopZones", "getCleanZones", "getVirtualWalls", "getSpots", "getViewportCenterPoint", "getMapCenterPoint", "getWallPointsByViewportCenter", "getForbiddenSweepZonePointsByViewportCenter", "getForbiddenMopZonePointsByViewportCenter", "getCleanZonePointsByViewportCenter", "getSpotPointByViewportCenter", "getEffectiveDividerPoints", "getDividerEndPoints", "snapshot", "snapshotByData"];
|
|
1702
|
+
|
|
1703
|
+
export declare const MAP_CALLBACK_METHODS: readonly ["onMapFirstDrawed", "onMapDrawed", "onPathDrawed", "onRoomPropertiesDrawed", "onClickRoom", "onClickRoomProperties", "onRemoveForbiddenSweepZone", "onRemoveForbiddenMopZone", "onRemoveCleanZone", "onRemoveVirtualWall", "onUpdateForbiddenSweepZone", "onUpdateForbiddenMopZone", "onUpdateCleanZone", "onUpdateVirtualWall", "onUpdateSpot", "onUpdateDivider", "onClickForbiddenSweepZone", "onClickForbiddenMopZone", "onClickCleanZone", "onClickVirtualWall", "onClickSpot", "onClickDetectedObject", "onClickCustomElement"];
|
|
1704
|
+
|
|
1705
|
+
/**
|
|
1706
|
+
* 地图 API 接口定义
|
|
1707
|
+
*
|
|
1708
|
+
* 这个接口定义了所有可供调用的地图操作方法。
|
|
1709
|
+
*
|
|
1710
|
+
* 通过onMapReady回调获得的 `mapApi` 对象实现了这个接口。
|
|
1711
|
+
*
|
|
1712
|
+
*/
|
|
1713
|
+
export declare interface MapApi {
|
|
1714
|
+
/**
|
|
1715
|
+
* 重置地图的平移和缩放状态
|
|
1716
|
+
*
|
|
1717
|
+
* 将地图的缩放和平移状态重置到初始位置,使地图完整显示在视口中。
|
|
1718
|
+
*/
|
|
1719
|
+
resetPanZoom(): void;
|
|
1720
|
+
/**
|
|
1721
|
+
* 获取当前地图上所有禁扫区域数据
|
|
1722
|
+
*
|
|
1723
|
+
* @returns 区域数据数组
|
|
1724
|
+
*/
|
|
1725
|
+
getForbiddenSweepZones(): ZoneParam[];
|
|
1726
|
+
/**
|
|
1727
|
+
* 获取当前地图上所有禁拖区域数据
|
|
1728
|
+
*
|
|
1729
|
+
* @returns 区域数据数组
|
|
1730
|
+
*/
|
|
1731
|
+
getForbiddenMopZones(): ZoneParam[];
|
|
1732
|
+
/**
|
|
1733
|
+
* 获取当前地图上所有清扫区域数据
|
|
1734
|
+
*
|
|
1735
|
+
* @returns 区域数据数组
|
|
1736
|
+
*/
|
|
1737
|
+
getCleanZones(): ZoneParam[];
|
|
1738
|
+
/**
|
|
1739
|
+
* 获取当前地图上所有虚拟墙数据
|
|
1740
|
+
*
|
|
1741
|
+
* @returns 虚拟墙数据数组
|
|
1742
|
+
*/
|
|
1743
|
+
getVirtualWalls(): VirtualWallParam[];
|
|
1744
|
+
/**
|
|
1745
|
+
* 获取当前地图上所有定点清扫数据
|
|
1746
|
+
*
|
|
1747
|
+
* @returns 定点清扫数据数组
|
|
1748
|
+
*/
|
|
1749
|
+
getSpots(): SpotParam[];
|
|
1750
|
+
/**
|
|
1751
|
+
* 获取分割线有效端点
|
|
1752
|
+
* @returns 分割线有效端点
|
|
1753
|
+
*/
|
|
1754
|
+
getEffectiveDividerPoints(): Point[] | null;
|
|
1755
|
+
/**
|
|
1756
|
+
* 获取分割线端点
|
|
1757
|
+
* @returns 分割线端点
|
|
1758
|
+
*/
|
|
1759
|
+
getDividerEndPoints(): Point[] | null;
|
|
1760
|
+
/**
|
|
1761
|
+
* 获取当前视口中心点坐标
|
|
1762
|
+
*
|
|
1763
|
+
* 返回当前视口中心点在地图坐标系中的位置,坐标相对于地图原点。
|
|
1764
|
+
* 该坐标可以直接用于创建禁区、虚拟墙等控制元素。
|
|
1765
|
+
*
|
|
1766
|
+
* @returns 视口中心的相对坐标,如果地图未初始化则返回 null
|
|
1767
|
+
*/
|
|
1768
|
+
getViewportCenterPoint(): Point | null;
|
|
1769
|
+
/**
|
|
1770
|
+
* 获取地图中心点坐标
|
|
1771
|
+
*
|
|
1772
|
+
* 返回地图包围盒中心点在地图坐标系中的位置,坐标相对于地图原点。
|
|
1773
|
+
* 该坐标基于地图边界计算,可以直接用于创建控制元素。
|
|
1774
|
+
*
|
|
1775
|
+
* @returns 地图中心的相对坐标,如果地图未初始化则返回 null
|
|
1776
|
+
*/
|
|
1777
|
+
getMapCenterPoint(): Point | null;
|
|
1778
|
+
/**
|
|
1779
|
+
* 基于视口中心生成虚拟墙端点坐标
|
|
1780
|
+
*
|
|
1781
|
+
* 根据当前视口中心位置生成虚拟墙的两个端点坐标,支持自定义长度、方向和偏移。
|
|
1782
|
+
*
|
|
1783
|
+
* @param options - 配置选项
|
|
1784
|
+
* @param options.width - 虚拟墙长度,单位米,默认使用配置中的最小宽度
|
|
1785
|
+
* @param options.direction - 虚拟墙方向,'horizontal' 或 'vertical',默认为 'horizontal'
|
|
1786
|
+
* @param options.offsetX - X方向像素偏移,支持负数,默认为 0
|
|
1787
|
+
* @param options.offsetY - Y方向像素偏移,支持负数,默认为 0
|
|
1788
|
+
* @returns 虚拟墙的两个端点坐标数组
|
|
1789
|
+
*/
|
|
1790
|
+
getWallPointsByViewportCenter(options?: {
|
|
1791
|
+
width?: number;
|
|
1792
|
+
direction?: Direction;
|
|
1793
|
+
offsetX?: number;
|
|
1794
|
+
offsetY?: number;
|
|
1795
|
+
}): Point[];
|
|
1796
|
+
/**
|
|
1797
|
+
* 基于视口中心生成禁扫区域顶点坐标
|
|
1798
|
+
*
|
|
1799
|
+
* 根据当前视口中心位置生成禁扫区域的四个顶点坐标。
|
|
1800
|
+
*
|
|
1801
|
+
* @param options - 配置选项
|
|
1802
|
+
* @param options.size - 区域大小,单位米,默认使用配置中的最小尺寸
|
|
1803
|
+
* @param options.offsetX - X方向像素偏移,支持负数,默认为 0
|
|
1804
|
+
* @param options.offsetY - Y方向像素偏移,支持负数,默认为 0
|
|
1805
|
+
* @returns 禁扫区域的四个顶点坐标数组
|
|
1806
|
+
*/
|
|
1807
|
+
getForbiddenSweepZonePointsByViewportCenter(options?: {
|
|
1808
|
+
size?: number;
|
|
1809
|
+
offsetX?: number;
|
|
1810
|
+
offsetY?: number;
|
|
1811
|
+
}): Point[];
|
|
1812
|
+
/**
|
|
1813
|
+
* 基于视口中心生成禁拖区域顶点坐标
|
|
1814
|
+
*
|
|
1815
|
+
* 根据当前视口中心位置生成禁拖区域的四个顶点坐标。
|
|
1816
|
+
*
|
|
1817
|
+
* @param options - 配置选项
|
|
1818
|
+
* @param options.size - 区域大小,单位米,默认使用配置中的最小尺寸
|
|
1819
|
+
* @param options.offsetX - X方向像素偏移,支持负数,默认为 0
|
|
1820
|
+
* @param options.offsetY - Y方向像素偏移,支持负数,默认为 0
|
|
1821
|
+
* @returns 禁拖区域的四个顶点坐标数组
|
|
1822
|
+
*/
|
|
1823
|
+
getForbiddenMopZonePointsByViewportCenter(options?: {
|
|
1824
|
+
size?: number;
|
|
1825
|
+
offsetX?: number;
|
|
1826
|
+
offsetY?: number;
|
|
1827
|
+
}): Point[];
|
|
1828
|
+
/**
|
|
1829
|
+
* 基于视口中心生成清扫区域顶点坐标
|
|
1830
|
+
*
|
|
1831
|
+
* 根据当前视口中心位置生成清扫区域的四个顶点坐标。
|
|
1832
|
+
*
|
|
1833
|
+
* @param options - 配置选项
|
|
1834
|
+
* @param options.size - 区域大小,单位米,默认使用配置中的最小尺寸
|
|
1835
|
+
* @param options.offsetX - X方向像素偏移,支持负数,默认为 0
|
|
1836
|
+
* @param options.offsetY - Y方向像素偏移,支持负数,默认为 0
|
|
1837
|
+
* @returns 清扫区域的四个顶点坐标数组
|
|
1838
|
+
*/
|
|
1839
|
+
getCleanZonePointsByViewportCenter(options?: {
|
|
1840
|
+
size?: number;
|
|
1841
|
+
offsetX?: number;
|
|
1842
|
+
offsetY?: number;
|
|
1843
|
+
}): Point[];
|
|
1844
|
+
/**
|
|
1845
|
+
* 基于视口中心生成定点清扫的点坐标
|
|
1846
|
+
*
|
|
1847
|
+
* 根据当前视口中心位置生成定点清扫的坐标点。
|
|
1848
|
+
*
|
|
1849
|
+
* @param options - 配置选项
|
|
1850
|
+
* @param options.offsetX - X方向像素偏移,支持负数,默认为 0
|
|
1851
|
+
* @param options.offsetY - Y方向像素偏移,支持负数,默认为 0
|
|
1852
|
+
* @returns 定点清扫的坐标点
|
|
1853
|
+
*/
|
|
1854
|
+
getSpotPointByViewportCenter(options?: {
|
|
1855
|
+
offsetX?: number;
|
|
1856
|
+
offsetY?: number;
|
|
1857
|
+
}): Point;
|
|
1858
|
+
/**
|
|
1859
|
+
* 地图截图
|
|
1860
|
+
*
|
|
1861
|
+
* 将当前地图状态导出为图片,支持多种格式和质量设置。
|
|
1862
|
+
*
|
|
1863
|
+
* @returns Promise<string> Base64 格式的图片数据
|
|
1864
|
+
*/
|
|
1865
|
+
snapshot(): Promise<string>;
|
|
1866
|
+
/**
|
|
1867
|
+
* 使用其他地图数据进行截图
|
|
1868
|
+
*
|
|
1869
|
+
* 基于提供的地图数据生成截图,主要用于多地图场景或预览功能。
|
|
1870
|
+
* 不会影响当前地图的显示状态。
|
|
1871
|
+
*
|
|
1872
|
+
* @param data - 地图数据对象
|
|
1873
|
+
* @param data.map - 地图字符串数据
|
|
1874
|
+
* @param data.path - 可选的路径数据
|
|
1875
|
+
* @param data.roomProperties - 可选的房间属性数据
|
|
1876
|
+
* @param data.customElements - 可选的自定义元素数据
|
|
1877
|
+
* @param data.forbiddenSweepZones - 可选的禁扫区域数据
|
|
1878
|
+
* @param data.forbiddenMopZones - 可选的禁拖区域数据
|
|
1879
|
+
* @param data.virtualWalls - 可选的虚拟墙数据
|
|
1880
|
+
* @param data.detectedObjects - 可选的检测物体数据
|
|
1881
|
+
* @param runtime - 可选的运行时配置
|
|
1882
|
+
* @returns Promise<string> Base64 格式的图片数据
|
|
1883
|
+
*/
|
|
1884
|
+
snapshotByData(data: {
|
|
1885
|
+
map: string;
|
|
1886
|
+
path?: string;
|
|
1887
|
+
roomProperties?: RoomProperty[];
|
|
1888
|
+
customElements?: CustomElementParam[];
|
|
1889
|
+
forbiddenSweepZones?: ZoneParam[];
|
|
1890
|
+
forbiddenMopZones?: ZoneParam[];
|
|
1891
|
+
virtualWalls?: VirtualWallParam[];
|
|
1892
|
+
detectedObjects?: DetectedObjectParam[];
|
|
1893
|
+
}, runtime?: DeepPartialRuntimeConfig): Promise<string>;
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
/**
|
|
1897
|
+
* 地图应用核心类
|
|
1898
|
+
*
|
|
1899
|
+
* 地图应用的核心类,继承自 PIXI.Application,提供完整的地图渲染、交互和管理功能。
|
|
1900
|
+
* 支持扫地机器人地图的显示、路径绘制、房间管理、控制元素(禁区、虚拟墙等)等功能。
|
|
1901
|
+
*/
|
|
1902
|
+
export declare class MapApplication extends Application implements MapApi {
|
|
1903
|
+
/** 地图状态对象 */
|
|
1904
|
+
mapState: MapState | null;
|
|
1905
|
+
/* Excluded from this release type: components */
|
|
1906
|
+
/* Excluded from this release type: managers */
|
|
1907
|
+
/* Excluded from this release type: config */
|
|
1908
|
+
/* Excluded from this release type: runtime */
|
|
1909
|
+
/* Excluded from this release type: scaleMin */
|
|
1910
|
+
/* Excluded from this release type: scaleMax */
|
|
1911
|
+
/* Excluded from this release type: events */
|
|
1912
|
+
/* Excluded from this release type: instanceKey */
|
|
1913
|
+
/* Excluded from this release type: emitter */
|
|
1914
|
+
/* Excluded from this release type: tickerState */
|
|
1915
|
+
private pendingAsyncRender;
|
|
1916
|
+
private isFirstMapDraw;
|
|
1917
|
+
/* Excluded from this release type: __constructor */
|
|
1918
|
+
/**
|
|
1919
|
+
* 初始化地图应用
|
|
1920
|
+
*
|
|
1921
|
+
* 设置应用配置、运行时参数、事件处理器,并初始化所有必要的组件和管理器。
|
|
1922
|
+
*
|
|
1923
|
+
* @param options - 初始化选项,包含PIXI应用选项和地图应用选项
|
|
1924
|
+
* @param options.resizeTo - 画布大小调整目标元素
|
|
1925
|
+
* @param options.events - 事件回调
|
|
1926
|
+
* @param options.config - 静态配置
|
|
1927
|
+
* @param options.runtime - 运行时
|
|
1928
|
+
* @returns Promise<void>
|
|
1929
|
+
*
|
|
1930
|
+
*/
|
|
1931
|
+
initialize(options: Partial<ApplicationOptions> & AppOptions): Promise<void>;
|
|
1932
|
+
/**
|
|
1933
|
+
* 绘制结构化地图数据
|
|
1934
|
+
*
|
|
1935
|
+
* 根据结构化的地图数据源绘制地图,包括房间、障碍物、充电桩等元素。
|
|
1936
|
+
*
|
|
1937
|
+
* @param mapData - 结构化地图数据源
|
|
1938
|
+
* @returns Promise<void>
|
|
1939
|
+
*
|
|
1940
|
+
*/
|
|
1941
|
+
drawMap(mapData: MapDataSource): Promise<void>;
|
|
1942
|
+
/**
|
|
1943
|
+
* 绘制栅格地图数据
|
|
1944
|
+
*
|
|
1945
|
+
* 根据点阵地图数据绘制地图,支持点阵格式的地图数据。
|
|
1946
|
+
*
|
|
1947
|
+
* @param rasterMapData - 栅格地图数据对象
|
|
1948
|
+
* @param rasterMapData.mapHeader - 地图头部信息,包含分辨率、原点等
|
|
1949
|
+
* @param rasterMapData.mapData - 地图像素数据
|
|
1950
|
+
* @returns Promise<void>
|
|
1951
|
+
*
|
|
1952
|
+
*/
|
|
1953
|
+
drawRasterMap(rasterMapData: {
|
|
1954
|
+
mapHeader: MapHeader;
|
|
1955
|
+
mapData: MapData;
|
|
1956
|
+
}): Promise<void>;
|
|
1957
|
+
/**
|
|
1958
|
+
* 绘制机器人路径
|
|
1959
|
+
*
|
|
1960
|
+
* 根据路径数据绘制机器人的移动轨迹,包括普通路径、充电路径等不同类型。
|
|
1961
|
+
*
|
|
1962
|
+
* @param pathData - 路径数据对象
|
|
1963
|
+
* @returns void
|
|
1964
|
+
*
|
|
1965
|
+
*/
|
|
1966
|
+
drawPath(pathData: PathData): void;
|
|
1967
|
+
/**
|
|
1968
|
+
* 绘制房间属性信息
|
|
1969
|
+
*
|
|
1970
|
+
* 绘制房间的详细属性信息,如吸力、水量、清扫次数等。
|
|
1971
|
+
*
|
|
1972
|
+
* @param roomInfos - 房间属性信息数组
|
|
1973
|
+
* @returns void
|
|
1974
|
+
*
|
|
1975
|
+
*/
|
|
1976
|
+
drawRoomProperty(roomInfos: RoomProperty[]): Promise<void>;
|
|
1977
|
+
/**
|
|
1978
|
+
* 绘制热力图
|
|
1979
|
+
* @param param - 绘制参数
|
|
1980
|
+
* @returns void
|
|
1981
|
+
*
|
|
1982
|
+
*/
|
|
1983
|
+
drawHeatmap({ mapData, heatmapPoints, useGradient, }: {
|
|
1984
|
+
mapData: MapDataSource;
|
|
1985
|
+
heatmapPoints: HeatmapPoint[];
|
|
1986
|
+
useGradient?: boolean;
|
|
1987
|
+
}): void;
|
|
1988
|
+
/**
|
|
1989
|
+
* 绘制禁扫区域
|
|
1990
|
+
* @param zones - 禁扫区域参数数组
|
|
1991
|
+
*/
|
|
1992
|
+
drawForbiddenSweepZones(zones: ZoneParam[]): void;
|
|
1993
|
+
/**
|
|
1994
|
+
* 绘制禁拖区域
|
|
1995
|
+
* @param zones - 禁拖区域参数数组
|
|
1996
|
+
*/
|
|
1997
|
+
drawForbiddenMopZones(zones: ZoneParam[]): void;
|
|
1998
|
+
/**
|
|
1999
|
+
* 绘制清扫区域
|
|
2000
|
+
* @param zones - 清扫区域参数数组
|
|
2001
|
+
*/
|
|
2002
|
+
drawCleanZones(zones: ZoneParam[]): void;
|
|
2003
|
+
/**
|
|
2004
|
+
* 绘制虚拟墙
|
|
2005
|
+
* @param walls - 虚拟墙参数数组
|
|
2006
|
+
*/
|
|
2007
|
+
drawVirtualWalls(walls: VirtualWallParam[]): void;
|
|
2008
|
+
/**
|
|
2009
|
+
* 绘制定点清扫点
|
|
2010
|
+
* @param spots - 定点清扫参数数组
|
|
2011
|
+
*/
|
|
2012
|
+
drawSpots(spots: SpotParam[]): void;
|
|
2013
|
+
/**
|
|
2014
|
+
* 绘制检测到的物体
|
|
2015
|
+
* @param objects - 检测物体参数数组
|
|
2016
|
+
*/
|
|
2017
|
+
drawDetectedObjects(objects: DetectedObjectParam[]): Promise<void>;
|
|
2018
|
+
/**
|
|
2019
|
+
* 绘制自定义元素
|
|
2020
|
+
* @param elements - 自定义元素参数数组
|
|
2021
|
+
*/
|
|
2022
|
+
drawCustomElements(elements: CustomElementParam[]): Promise<void>;
|
|
2023
|
+
/**
|
|
2024
|
+
* 获取当前地图上所有禁扫区域数据
|
|
2025
|
+
*
|
|
2026
|
+
* @returns 区域数据数组
|
|
2027
|
+
*/
|
|
2028
|
+
getForbiddenSweepZones(): ZoneParam[];
|
|
2029
|
+
/**
|
|
2030
|
+
* 获取当前地图上所有禁拖区域数据
|
|
2031
|
+
*
|
|
2032
|
+
* @returns 区域数据数组
|
|
2033
|
+
*/
|
|
2034
|
+
getForbiddenMopZones(): ZoneParam[];
|
|
2035
|
+
/**
|
|
2036
|
+
* 获取当前地图上所有清扫区域数据
|
|
2037
|
+
*
|
|
2038
|
+
* @returns 区域数据数组
|
|
2039
|
+
*/
|
|
2040
|
+
getCleanZones(): ZoneParam[];
|
|
2041
|
+
/**
|
|
2042
|
+
* 获取当前地图上所有虚拟墙数据
|
|
2043
|
+
*
|
|
2044
|
+
* @returns 虚拟墙数据数组
|
|
2045
|
+
*/
|
|
2046
|
+
getVirtualWalls(): VirtualWallParam[];
|
|
2047
|
+
/**
|
|
2048
|
+
* 获取当前地图上所有定点清扫数据
|
|
2049
|
+
*
|
|
2050
|
+
* @returns 定点清扫数据数组
|
|
2051
|
+
*/
|
|
2052
|
+
getSpots(): SpotParam[];
|
|
2053
|
+
/**
|
|
2054
|
+
* 获取分割线有效端点
|
|
2055
|
+
* @returns 分割线有效端点
|
|
2056
|
+
*/
|
|
2057
|
+
getEffectiveDividerPoints(): Point[] | null;
|
|
2058
|
+
/**
|
|
2059
|
+
* 获取分割线端点
|
|
2060
|
+
* @returns 分割线端点
|
|
2061
|
+
*
|
|
2062
|
+
*/
|
|
2063
|
+
getDividerEndPoints(): Point[] | null;
|
|
2064
|
+
/**
|
|
2065
|
+
* 重置地图的平移和缩放状态
|
|
2066
|
+
*
|
|
2067
|
+
* 将地图的缩放和平移状态重置到初始位置,使地图完整显示在视口中。
|
|
2068
|
+
*/
|
|
2069
|
+
resetPanZoom(): void;
|
|
2070
|
+
/**
|
|
2071
|
+
* 将地图适配到视图中,居中并缩放
|
|
2072
|
+
* @param mapBounds 地图边界信息
|
|
2073
|
+
* @param animate 是否使用动画过渡,默认为 false
|
|
2074
|
+
* @param shouldCache 是否缓存为纹理,默认为 true
|
|
2075
|
+
*/
|
|
2076
|
+
fitMapToView(mapBounds: Bounds, animate?: boolean, shouldCache?: boolean): void;
|
|
2077
|
+
/**
|
|
2078
|
+
* 获取视口边界(供 Interaction 等组件使用)
|
|
2079
|
+
*/
|
|
2080
|
+
getViewportBounds(): {
|
|
2081
|
+
x: number;
|
|
2082
|
+
y: number;
|
|
2083
|
+
width: number;
|
|
2084
|
+
height: number;
|
|
2085
|
+
};
|
|
2086
|
+
/**
|
|
2087
|
+
* 更新运行时配置
|
|
2088
|
+
*
|
|
2089
|
+
* 动态更新地图应用的运行时配置,如显示设置、交互模式等。
|
|
2090
|
+
*
|
|
2091
|
+
* @param runtime - 要更新的运行时配置
|
|
2092
|
+
*/
|
|
2093
|
+
updateRuntime(runtime: DeepPartialRuntimeConfig): void;
|
|
2094
|
+
/**
|
|
2095
|
+
* 将米转换为像素
|
|
2096
|
+
*
|
|
2097
|
+
* 根据地图分辨率将米单位转换为像素单位。
|
|
2098
|
+
*
|
|
2099
|
+
* @param meters - 米数值
|
|
2100
|
+
* @returns 像素值
|
|
2101
|
+
*/
|
|
2102
|
+
metersToPixels(meters: number): number;
|
|
2103
|
+
/**
|
|
2104
|
+
* 将像素转换为米
|
|
2105
|
+
*
|
|
2106
|
+
* 根据地图分辨率将像素单位转换为米单位。
|
|
2107
|
+
*
|
|
2108
|
+
* @param pixels - 像素值
|
|
2109
|
+
* @returns 米数值
|
|
2110
|
+
*/
|
|
2111
|
+
pixelsToMeters(pixels: number): number;
|
|
2112
|
+
/**
|
|
2113
|
+
* 将基础尺寸转换为固定显示尺寸(不受缩放影响)
|
|
2114
|
+
*
|
|
2115
|
+
* 基础尺寸是基于 scale=1 的标准尺寸,需要根据当前缩放级别进行调整。
|
|
2116
|
+
*
|
|
2117
|
+
* @param baseSize - 基础尺寸
|
|
2118
|
+
* @param currentScale - 当前缩放级别,不传则自动获取
|
|
2119
|
+
* @returns 固定显示尺寸
|
|
2120
|
+
*/
|
|
2121
|
+
toFixedSize(baseSize: number, currentScale?: number): number;
|
|
2122
|
+
/**
|
|
2123
|
+
* 将固定显示尺寸转换为基础尺寸(反向转换)
|
|
2124
|
+
*
|
|
2125
|
+
* @param fixedSize - 固定显示尺寸
|
|
2126
|
+
* @param currentScale - 当前缩放级别,不传则自动获取
|
|
2127
|
+
* @returns 基础尺寸
|
|
2128
|
+
*/
|
|
2129
|
+
fromFixedSize(fixedSize: number, currentScale?: number): number;
|
|
2130
|
+
/**
|
|
2131
|
+
* 获取当前视口中心点坐标
|
|
2132
|
+
*
|
|
2133
|
+
* 返回当前视口中心点在地图坐标系中的位置,坐标相对于地图原点。
|
|
2134
|
+
* 该坐标可以直接用于创建禁区、虚拟墙等控制元素。
|
|
2135
|
+
*
|
|
2136
|
+
* @returns 视口中心的相对坐标,如果地图未初始化则返回 null
|
|
2137
|
+
*/
|
|
2138
|
+
getViewportCenterPoint(): Point | null;
|
|
2139
|
+
/**
|
|
2140
|
+
* 获取地图中心点坐标
|
|
2141
|
+
*
|
|
2142
|
+
* 返回地图包围盒中心点在地图坐标系中的位置,坐标相对于地图原点。
|
|
2143
|
+
* 该坐标基于地图边界计算,可以直接用于创建控制元素。
|
|
2144
|
+
*
|
|
2145
|
+
* @returns 地图中心的相对坐标,如果地图未初始化则返回 null
|
|
2146
|
+
*/
|
|
2147
|
+
getMapCenterPoint(): Point | null;
|
|
2148
|
+
/**
|
|
2149
|
+
* 基于视口中心生成虚拟墙端点坐标
|
|
2150
|
+
*
|
|
2151
|
+
* 根据当前视口中心位置生成虚拟墙的两个端点坐标,支持自定义长度、方向和偏移。
|
|
2152
|
+
*
|
|
2153
|
+
* @param options - 配置选项
|
|
2154
|
+
* @param options.width - 虚拟墙长度,单位米,默认使用配置中的最小宽度
|
|
2155
|
+
* @param options.direction - 虚拟墙方向,'horizontal' 或 'vertical',默认为 'horizontal'
|
|
2156
|
+
* @param options.offsetX - X方向像素偏移,支持负数,默认为 0
|
|
2157
|
+
* @param options.offsetY - Y方向像素偏移,支持负数,默认为 0
|
|
2158
|
+
* @returns 虚拟墙的两个端点坐标数组
|
|
2159
|
+
*/
|
|
2160
|
+
getWallPointsByViewportCenter(options?: {
|
|
2161
|
+
width?: number;
|
|
2162
|
+
direction?: Direction;
|
|
2163
|
+
offsetX?: number;
|
|
2164
|
+
offsetY?: number;
|
|
2165
|
+
}): Point[];
|
|
2166
|
+
/**
|
|
2167
|
+
* 基于视口中心生成禁扫区域顶点坐标
|
|
2168
|
+
*
|
|
2169
|
+
* 根据当前视口中心位置生成禁扫区域的四个顶点坐标。
|
|
2170
|
+
*
|
|
2171
|
+
* @param options - 配置选项
|
|
2172
|
+
* @param options.size - 区域大小,单位米,默认使用配置中的最小尺寸
|
|
2173
|
+
* @param options.offsetX - X方向像素偏移,支持负数,默认为 0
|
|
2174
|
+
* @param options.offsetY - Y方向像素偏移,支持负数,默认为 0
|
|
2175
|
+
* @returns 禁扫区域的四个顶点坐标数组
|
|
2176
|
+
*/
|
|
2177
|
+
getForbiddenSweepZonePointsByViewportCenter(options?: {
|
|
2178
|
+
size?: number;
|
|
2179
|
+
offsetX?: number;
|
|
2180
|
+
offsetY?: number;
|
|
2181
|
+
}): Point[];
|
|
2182
|
+
/**
|
|
2183
|
+
* 基于视口中心生成禁拖区域顶点坐标
|
|
2184
|
+
*
|
|
2185
|
+
* 根据当前视口中心位置生成禁拖区域的四个顶点坐标。
|
|
2186
|
+
*
|
|
2187
|
+
* @param options - 配置选项
|
|
2188
|
+
* @param options.size - 区域大小,单位米,默认使用配置中的最小尺寸
|
|
2189
|
+
* @param options.offsetX - X方向像素偏移,支持负数,默认为 0
|
|
2190
|
+
* @param options.offsetY - Y方向像素偏移,支持负数,默认为 0
|
|
2191
|
+
* @returns 禁拖区域的四个顶点坐标数组
|
|
2192
|
+
*/
|
|
2193
|
+
getForbiddenMopZonePointsByViewportCenter(options?: {
|
|
2194
|
+
size?: number;
|
|
2195
|
+
offsetX?: number;
|
|
2196
|
+
offsetY?: number;
|
|
2197
|
+
}): Point[];
|
|
2198
|
+
/**
|
|
2199
|
+
* 基于视口中心生成清扫区域顶点坐标
|
|
2200
|
+
*
|
|
2201
|
+
* 根据当前视口中心位置生成清扫区域的四个顶点坐标。
|
|
2202
|
+
*
|
|
2203
|
+
* @param options - 配置选项
|
|
2204
|
+
* @param options.size - 区域大小,单位米,默认使用配置中的最小尺寸
|
|
2205
|
+
* @param options.offsetX - X方向像素偏移,支持负数,默认为 0
|
|
2206
|
+
* @param options.offsetY - Y方向像素偏移,支持负数,默认为 0
|
|
2207
|
+
* @returns 清扫区域的四个顶点坐标数组
|
|
2208
|
+
*/
|
|
2209
|
+
getCleanZonePointsByViewportCenter(options?: {
|
|
2210
|
+
size?: number;
|
|
2211
|
+
offsetX?: number;
|
|
2212
|
+
offsetY?: number;
|
|
2213
|
+
}): Point[];
|
|
2214
|
+
/**
|
|
2215
|
+
* 基于视口中心生成定点清扫的点坐标
|
|
2216
|
+
*
|
|
2217
|
+
* 根据当前视口中心位置生成定点清扫的坐标点。
|
|
2218
|
+
*
|
|
2219
|
+
* @param options - 配置选项
|
|
2220
|
+
* @param options.offsetX - X方向像素偏移,支持负数,默认为 0
|
|
2221
|
+
* @param options.offsetY - Y方向像素偏移,支持负数,默认为 0
|
|
2222
|
+
* @returns 定点清扫的坐标点
|
|
2223
|
+
*/
|
|
2224
|
+
getSpotPointByViewportCenter(options?: {
|
|
2225
|
+
offsetX?: number;
|
|
2226
|
+
offsetY?: number;
|
|
2227
|
+
}): Point;
|
|
2228
|
+
/**
|
|
2229
|
+
* 地图截图
|
|
2230
|
+
*
|
|
2231
|
+
* 将当前地图状态导出为图片,支持多种格式和质量设置。
|
|
2232
|
+
*
|
|
2233
|
+
* @returns Promise<string> Base64 格式的图片数据
|
|
2234
|
+
*
|
|
2235
|
+
*/
|
|
2236
|
+
snapshot(): Promise<string>;
|
|
2237
|
+
/**
|
|
2238
|
+
* 使用其他地图数据进行截图
|
|
2239
|
+
*
|
|
2240
|
+
* 基于提供的地图数据生成截图,主要用于多地图场景或预览功能。
|
|
2241
|
+
* 不会影响当前地图的显示状态。
|
|
2242
|
+
*
|
|
2243
|
+
* @param data - 地图数据对象
|
|
2244
|
+
* @param data.map - 地图字符串数据
|
|
2245
|
+
* @param data.path - 可选的路径数据
|
|
2246
|
+
* @param data.roomProperties - 可选的房间属性数据
|
|
2247
|
+
* @param data.customElements - 可选的自定义元素数据
|
|
2248
|
+
* @param data.forbiddenSweepZones - 可选的禁扫区域数据
|
|
2249
|
+
* @param data.forbiddenMopZones - 可选的禁拖区域数据
|
|
2250
|
+
* @param data.virtualWalls - 可选的虚拟墙数据
|
|
2251
|
+
* @param data.detectedObjects - 可选的检测物体数据
|
|
2252
|
+
* @param runtime - 可选的运行时配置
|
|
2253
|
+
* @returns Promise<string> Base64 格式的图片数据
|
|
2254
|
+
*
|
|
2255
|
+
*/
|
|
2256
|
+
snapshotByData({ map, path, roomProperties, customElements, forbiddenSweepZones, forbiddenMopZones, virtualWalls, detectedObjects, }: {
|
|
2257
|
+
map: string;
|
|
2258
|
+
path?: string;
|
|
2259
|
+
roomProperties?: RoomProperty[];
|
|
2260
|
+
customElements?: CustomElementParam[];
|
|
2261
|
+
forbiddenSweepZones?: ZoneParam[];
|
|
2262
|
+
forbiddenMopZones?: ZoneParam[];
|
|
2263
|
+
virtualWalls?: VirtualWallParam[];
|
|
2264
|
+
detectedObjects?: DetectedObjectParam[];
|
|
2265
|
+
}, runtime?: DeepPartialRuntimeConfig): Promise<string>;
|
|
2266
|
+
/* Excluded from this release type: renderOnce */
|
|
2267
|
+
/* Excluded from this release type: renderOnceNextFrame */
|
|
2268
|
+
/* Excluded from this release type: requestRender */
|
|
2269
|
+
/* Excluded from this release type: stopRender */
|
|
2270
|
+
/**
|
|
2271
|
+
* 销毁地图应用实例
|
|
2272
|
+
*
|
|
2273
|
+
* 清理所有资源、事件监听器和管理器,确保内存不泄漏。
|
|
2274
|
+
*/
|
|
2275
|
+
destroy(): void;
|
|
2276
|
+
/**
|
|
2277
|
+
* 初始化视口容器
|
|
2278
|
+
*/
|
|
2279
|
+
private initializeViewportContainer;
|
|
2280
|
+
/**
|
|
2281
|
+
* 初始化应用容器
|
|
2282
|
+
*/
|
|
2283
|
+
private initializeAppContainer;
|
|
2284
|
+
private initializeInteraction;
|
|
2285
|
+
/**
|
|
2286
|
+
* 智能 Ticker 管理 - 延迟停止渲染
|
|
2287
|
+
*/
|
|
2288
|
+
private scheduleStopRender;
|
|
2289
|
+
/**
|
|
2290
|
+
* 通用的Zone点生成逻辑
|
|
2291
|
+
*/
|
|
2292
|
+
private generateZonePoints;
|
|
2293
|
+
/**
|
|
2294
|
+
* 预加载应用所需的资源
|
|
2295
|
+
*/
|
|
2296
|
+
private preloadAssets;
|
|
2297
|
+
private onVisibilityChange;
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2300
|
+
/**
|
|
2301
|
+
* 地图事件回调接口
|
|
2302
|
+
*
|
|
2303
|
+
* 定义了地图组件的所有事件回调函数,用于处理地图的各种交互和状态变化。
|
|
2304
|
+
* 开发者可以通过传入这些回调函数来响应地图的各种事件。
|
|
2305
|
+
*
|
|
2306
|
+
*/
|
|
2307
|
+
export declare interface MapCallbacks {
|
|
2308
|
+
/**
|
|
2309
|
+
* 地图首次绘制完成回调
|
|
2310
|
+
*
|
|
2311
|
+
* 当地图首次加载并绘制完成后触发,通常用于移除Loading状态。
|
|
2312
|
+
* 与 onMapDrawed 不同,此回调只在首次绘制时触发一次。
|
|
2313
|
+
*
|
|
2314
|
+
* @param mapState - 地图状态信息,包含地图ID、原点、尺寸等信息
|
|
2315
|
+
*/
|
|
2316
|
+
onMapFirstDrawed?: (mapState: MapState) => void;
|
|
2317
|
+
/**
|
|
2318
|
+
* 地图绘制完成回调
|
|
2319
|
+
*
|
|
2320
|
+
* 当地图数据解析并绘制完成后触发。
|
|
2321
|
+
*
|
|
2322
|
+
* @param mapState - 地图状态信息,包含地图ID、原点、尺寸等信息
|
|
2323
|
+
*
|
|
2324
|
+
*/
|
|
2325
|
+
onMapDrawed?: (mapState: MapState) => void;
|
|
2326
|
+
/**
|
|
2327
|
+
* 路径绘制完成回调
|
|
2328
|
+
*
|
|
2329
|
+
* 当机器人路径数据绘制完成后触发。
|
|
2330
|
+
*
|
|
2331
|
+
* @param pathState - 路径状态信息,包含路径ID、类型、机器人位置等
|
|
2332
|
+
*
|
|
2333
|
+
*/
|
|
2334
|
+
onPathDrawed?: (pathState: PathState) => void;
|
|
2335
|
+
/**
|
|
2336
|
+
* 房间信息绘制完成回调
|
|
2337
|
+
*
|
|
2338
|
+
* 当房间属性信息绘制完成后触发。
|
|
2339
|
+
*
|
|
2340
|
+
* @param rooms - 房间属性信息数组
|
|
2341
|
+
*
|
|
2342
|
+
*/
|
|
2343
|
+
onRoomPropertiesDrawed?: (rooms: RoomProperty[]) => void;
|
|
2344
|
+
/**
|
|
2345
|
+
* 点击房间回调
|
|
2346
|
+
*
|
|
2347
|
+
* 当用户点击地图上的房间区域时触发。
|
|
2348
|
+
*
|
|
2349
|
+
* @param room - 被点击的房间信息
|
|
2350
|
+
*
|
|
2351
|
+
*/
|
|
2352
|
+
onClickRoom?: (room: Partial<RoomData>) => void;
|
|
2353
|
+
/**
|
|
2354
|
+
* 点击房间信息回调
|
|
2355
|
+
*
|
|
2356
|
+
* 当用户点击房间的属性信息图标时触发。
|
|
2357
|
+
*
|
|
2358
|
+
* @param room - 被点击的房间信息
|
|
2359
|
+
*
|
|
2360
|
+
*/
|
|
2361
|
+
onClickRoomProperties?: (room: Partial<RoomData>) => void;
|
|
2362
|
+
/**
|
|
2363
|
+
* 点击禁扫区域删除按钮的回调
|
|
2364
|
+
*
|
|
2365
|
+
* 当用户点击禁扫区域删除按钮时触发。
|
|
2366
|
+
*
|
|
2367
|
+
* @param id - 被删除的禁扫区域ID
|
|
2368
|
+
*
|
|
2369
|
+
*/
|
|
2370
|
+
onRemoveForbiddenSweepZone?: (id: string) => void;
|
|
2371
|
+
/**
|
|
2372
|
+
* 点击禁拖区域删除按钮的回调
|
|
2373
|
+
*
|
|
2374
|
+
* 当用户点击禁拖区域删除按钮时触发。
|
|
2375
|
+
*
|
|
2376
|
+
* @param id - 被删除的禁拖区域ID
|
|
2377
|
+
*
|
|
2378
|
+
*/
|
|
2379
|
+
onRemoveForbiddenMopZone?: (id: string) => void;
|
|
2380
|
+
/**
|
|
2381
|
+
* 点击清扫区域删除按钮的回调
|
|
2382
|
+
*
|
|
2383
|
+
* 当用户点击清扫区域删除按钮时触发。
|
|
2384
|
+
*
|
|
2385
|
+
* @param id - 被删除的清扫区域ID
|
|
2386
|
+
*
|
|
2387
|
+
*/
|
|
2388
|
+
onRemoveCleanZone?: (id: string) => void;
|
|
2389
|
+
/**
|
|
2390
|
+
* 点击虚拟墙删除按钮的回调
|
|
2391
|
+
*
|
|
2392
|
+
* 当用户点击虚拟墙删除按钮时触发。
|
|
2393
|
+
*
|
|
2394
|
+
* @param id - 被删除的虚拟墙ID
|
|
2395
|
+
*
|
|
2396
|
+
*/
|
|
2397
|
+
onRemoveVirtualWall?: (id: string) => void;
|
|
2398
|
+
/**
|
|
2399
|
+
* 更新禁扫区域的回调
|
|
2400
|
+
*
|
|
2401
|
+
* 当用户操作禁扫区域(如拖拽、缩放)后触发。
|
|
2402
|
+
*
|
|
2403
|
+
* @param zone - 更新后的禁扫区域数据
|
|
2404
|
+
*
|
|
2405
|
+
*/
|
|
2406
|
+
onUpdateForbiddenSweepZone?: (zone: ZoneParam) => void;
|
|
2407
|
+
/**
|
|
2408
|
+
* 更新禁拖区域的回调
|
|
2409
|
+
*
|
|
2410
|
+
* 当用户操作禁拖区域(如拖拽、缩放)后触发。
|
|
2411
|
+
*
|
|
2412
|
+
* @param zone - 更新后的禁拖区域数据
|
|
2413
|
+
*
|
|
2414
|
+
*/
|
|
2415
|
+
onUpdateForbiddenMopZone?: (zone: ZoneParam) => void;
|
|
2416
|
+
/**
|
|
2417
|
+
* 更新清扫区域的回调
|
|
2418
|
+
*
|
|
2419
|
+
* 当用户操作清扫区域(如拖拽、缩放)后触发。
|
|
2420
|
+
*
|
|
2421
|
+
* @param zone - 更新后的清扫区域数据
|
|
2422
|
+
*
|
|
2423
|
+
*/
|
|
2424
|
+
onUpdateCleanZone?: (zone: ZoneParam) => void;
|
|
2425
|
+
/**
|
|
2426
|
+
* 更新虚拟墙的回调
|
|
2427
|
+
*
|
|
2428
|
+
* 当用户操作虚拟墙(如拖拽、旋转)后触发。
|
|
2429
|
+
*
|
|
2430
|
+
* @param wall - 更新后的虚拟墙数据
|
|
2431
|
+
*
|
|
2432
|
+
*/
|
|
2433
|
+
onUpdateVirtualWall?: (wall: VirtualWallParam) => void;
|
|
2434
|
+
/**
|
|
2435
|
+
* 更新定点清扫的回调
|
|
2436
|
+
*
|
|
2437
|
+
* 当用户操作定点清扫位置后触发。
|
|
2438
|
+
*
|
|
2439
|
+
* @param spot - 更新后的定点清扫数据
|
|
2440
|
+
*
|
|
2441
|
+
*/
|
|
2442
|
+
onUpdateSpot?: (spot: SpotParam) => void;
|
|
2443
|
+
/**
|
|
2444
|
+
* 点击禁扫区域回调
|
|
2445
|
+
*
|
|
2446
|
+
* 当用户点击禁扫区域时触发。
|
|
2447
|
+
*
|
|
2448
|
+
* @param zone - 被点击的禁扫区域数据
|
|
2449
|
+
*
|
|
2450
|
+
*/
|
|
2451
|
+
onClickForbiddenSweepZone?: (zone: ZoneParam) => void;
|
|
2452
|
+
/**
|
|
2453
|
+
* 点击禁拖区域回调
|
|
2454
|
+
*
|
|
2455
|
+
* 当用户点击禁拖区域时触发。
|
|
2456
|
+
*
|
|
2457
|
+
* @param zone - 被点击的禁拖区域数据
|
|
2458
|
+
*
|
|
2459
|
+
*/
|
|
2460
|
+
onClickForbiddenMopZone?: (zone: ZoneParam) => void;
|
|
2461
|
+
/**
|
|
2462
|
+
* 点击清扫区域回调
|
|
2463
|
+
*
|
|
2464
|
+
* 当用户点击清扫区域时触发。
|
|
2465
|
+
*
|
|
2466
|
+
* @param zone - 被点击的清扫区域数据
|
|
2467
|
+
*
|
|
2468
|
+
*/
|
|
2469
|
+
onClickCleanZone?: (zone: ZoneParam) => void;
|
|
2470
|
+
/**
|
|
2471
|
+
* 点击虚拟墙回调
|
|
2472
|
+
*
|
|
2473
|
+
* 当用户点击虚拟墙时触发。
|
|
2474
|
+
*
|
|
2475
|
+
* @param wall - 被点击的虚拟墙数据
|
|
2476
|
+
*
|
|
2477
|
+
*/
|
|
2478
|
+
onClickVirtualWall?: (wall: VirtualWallParam) => void;
|
|
2479
|
+
/**
|
|
2480
|
+
* 点击定点清扫回调
|
|
2481
|
+
*
|
|
2482
|
+
* 当用户点击定点清扫点时触发。
|
|
2483
|
+
*
|
|
2484
|
+
* @param spot - 被点击的定点清扫数据
|
|
2485
|
+
*
|
|
2486
|
+
*/
|
|
2487
|
+
onClickSpot?: (spot: SpotParam) => void;
|
|
2488
|
+
/**
|
|
2489
|
+
* 点击检测物体回调
|
|
2490
|
+
*
|
|
2491
|
+
* 当用户点击地图上的检测物体时触发。
|
|
2492
|
+
*
|
|
2493
|
+
* @param object - 被点击的检测物体数据
|
|
2494
|
+
*
|
|
2495
|
+
*/
|
|
2496
|
+
onClickDetectedObject?: (object: DetectedObjectParam) => void;
|
|
2497
|
+
/**
|
|
2498
|
+
* 点击自定义元素回调
|
|
2499
|
+
*
|
|
2500
|
+
* 当用户点击自定义元素时触发。
|
|
2501
|
+
*
|
|
2502
|
+
* @param element - 被点击的自定义元素数据
|
|
2503
|
+
*
|
|
2504
|
+
*/
|
|
2505
|
+
onClickCustomElement?: (element: CustomElementParam) => void;
|
|
2506
|
+
/**
|
|
2507
|
+
* 更新分割线回调
|
|
2508
|
+
*
|
|
2509
|
+
* 当用户操作分割线(如拖拽端点、移动整条线)后触发。
|
|
2510
|
+
*
|
|
2511
|
+
* @param divider - 更新后的分割线数据
|
|
2512
|
+
*
|
|
2513
|
+
*/
|
|
2514
|
+
onUpdateDivider?: (divider: Point[]) => void;
|
|
2515
|
+
}
|
|
2516
|
+
|
|
2517
|
+
/**
|
|
2518
|
+
* 结构化协议地图原始数据
|
|
2519
|
+
*/
|
|
2520
|
+
export declare type MapDataSource = {
|
|
2521
|
+
/** 地图ID */
|
|
2522
|
+
id: number
|
|
2523
|
+
/** 状态 */
|
|
2524
|
+
status: number
|
|
2525
|
+
/** 分辨率 */
|
|
2526
|
+
resolution: number
|
|
2527
|
+
/** 尺寸 [宽度, 高度] */
|
|
2528
|
+
size: [number, number]
|
|
2529
|
+
/** 原点坐标 [x, y] */
|
|
2530
|
+
origin: [number, number]
|
|
2531
|
+
/** 充电桩信息 */
|
|
2532
|
+
charger: {
|
|
2533
|
+
/** 坐标 [x, y] */
|
|
2534
|
+
coordinate: [number, number]
|
|
2535
|
+
/** 充电桩朝向 */
|
|
2536
|
+
angle: number
|
|
2537
|
+
}
|
|
2538
|
+
/** 地毯数据 */
|
|
2539
|
+
carpet: Array<{
|
|
2540
|
+
/** 坐标数组 */
|
|
2541
|
+
coordinates: number[]
|
|
2542
|
+
/** 类型 */
|
|
2543
|
+
types: number
|
|
2544
|
+
}>
|
|
2545
|
+
/** 障碍物数据 */
|
|
2546
|
+
obstacles: Array<{
|
|
2547
|
+
/** 坐标数组 */
|
|
2548
|
+
coordinates: number[]
|
|
2549
|
+
/** 类型 */
|
|
2550
|
+
types: number
|
|
2551
|
+
}>
|
|
2552
|
+
/** 自由区域数据 */
|
|
2553
|
+
free: Array<{
|
|
2554
|
+
/** 坐标数组 */
|
|
2555
|
+
coordinates: number[]
|
|
2556
|
+
/** 类型 */
|
|
2557
|
+
types: number
|
|
2558
|
+
}>
|
|
2559
|
+
/** 房间数据 */
|
|
2560
|
+
rooms: {
|
|
2561
|
+
[roomId: string]: {
|
|
2562
|
+
/** 坐标数组 */
|
|
2563
|
+
coordinates: number[]
|
|
2564
|
+
}
|
|
2565
|
+
}
|
|
2566
|
+
/** 版本 */
|
|
2567
|
+
version: string
|
|
2568
|
+
}
|
|
2569
|
+
|
|
2570
|
+
declare class MapManager {
|
|
2571
|
+
obstacle: Obstacle;
|
|
2572
|
+
roomFill: RoomFill;
|
|
2573
|
+
carpet: Carpet;
|
|
2574
|
+
chargingStation: ChargingStation;
|
|
2575
|
+
mapBounds: Bounds;
|
|
2576
|
+
private hasAutoFitted;
|
|
2577
|
+
private roomGeometryMap;
|
|
2578
|
+
private carpetData;
|
|
2579
|
+
private unsubscribeFns;
|
|
2580
|
+
constructor();
|
|
2581
|
+
/**
|
|
2582
|
+
* 处理结构化地图数据(房间形状、障碍物等)
|
|
2583
|
+
*/
|
|
2584
|
+
drawMap(mapData: MapDataSource): Promise<boolean>;
|
|
2585
|
+
/**
|
|
2586
|
+
* 处理栅格地图数据
|
|
2587
|
+
* @param mapPointsStr 栅格数据字符串
|
|
2588
|
+
* @param width 地图宽度
|
|
2589
|
+
* @param height 地图高度
|
|
2590
|
+
* @param charger 充电桩信息
|
|
2591
|
+
*/
|
|
2592
|
+
drawRasterMap(mapPointsStr: string, mapState: MapState): Promise<boolean>;
|
|
2593
|
+
/**
|
|
2594
|
+
* 重置几何数据和边界
|
|
2595
|
+
*/
|
|
2596
|
+
private resetGeometryData;
|
|
2597
|
+
/**
|
|
2598
|
+
* 更新地毯显示
|
|
2599
|
+
* 类似于RoomFloorType的模式,根据当前状态决定是否重建地毯
|
|
2600
|
+
*/
|
|
2601
|
+
private createCarpet;
|
|
2602
|
+
/**
|
|
2603
|
+
* 处理房间几何数据,计算所有需要的几何信息
|
|
2604
|
+
*/
|
|
2605
|
+
private processRoomsGeometry;
|
|
2606
|
+
/**
|
|
2607
|
+
* 合并所有图层的边界
|
|
2608
|
+
*/
|
|
2609
|
+
private mergeLayerBounds;
|
|
2610
|
+
/**
|
|
2611
|
+
* 根据ID查找房间几何信息
|
|
2612
|
+
*/
|
|
2613
|
+
getRoomById(id: number): Room | undefined;
|
|
2614
|
+
/**
|
|
2615
|
+
* 清空地图组件
|
|
2616
|
+
*/
|
|
2617
|
+
private clearComponents;
|
|
2618
|
+
/**
|
|
2619
|
+
* 处理栅格数据,统一处理排序和颜色分配
|
|
2620
|
+
* @param rasterData 原始栅格数据
|
|
2621
|
+
* @returns 处理后的栅格数据,包含排序和颜色信息
|
|
2622
|
+
*/
|
|
2623
|
+
private processRasterData;
|
|
2624
|
+
/**
|
|
2625
|
+
* 为栅格地图生成房间几何信息供 RoomManager 使用
|
|
2626
|
+
* @param rasterData 解析后的栅格数据
|
|
2627
|
+
*/
|
|
2628
|
+
private generateRoomGeometryFromRaster;
|
|
2629
|
+
destroy(): void;
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2632
|
+
/**
|
|
2633
|
+
* 地图状态对象
|
|
2634
|
+
*
|
|
2635
|
+
* 描述地图的基本信息和状态
|
|
2636
|
+
*/
|
|
2637
|
+
export declare type MapState = {
|
|
2638
|
+
/** 地图ID */
|
|
2639
|
+
id: number
|
|
2640
|
+
/** 地图状态 */
|
|
2641
|
+
status: boolean
|
|
2642
|
+
/** 分辨率 */
|
|
2643
|
+
resolution: number
|
|
2644
|
+
/** 宽度 */
|
|
2645
|
+
width: number
|
|
2646
|
+
/** 高度 */
|
|
2647
|
+
height: number
|
|
2648
|
+
/** 原点坐标 */
|
|
2649
|
+
origin: Point
|
|
2650
|
+
/** 充电桩坐标 */
|
|
2651
|
+
charger: Point
|
|
2652
|
+
/** 充电桩方向 */
|
|
2653
|
+
chargerDirection: number
|
|
2654
|
+
/**
|
|
2655
|
+
* 地图协议版本号
|
|
2656
|
+
*/
|
|
2657
|
+
version?: number
|
|
2658
|
+
}
|
|
2659
|
+
|
|
2660
|
+
declare class Obstacle extends Graphics {
|
|
2661
|
+
constructor();
|
|
2662
|
+
/**
|
|
2663
|
+
* 绘制结构化障碍物数据
|
|
2664
|
+
* @param obstacles 障碍物数据数组
|
|
2665
|
+
*/
|
|
2666
|
+
draw(obstacles: {
|
|
2667
|
+
coordinates: number[];
|
|
2668
|
+
}[]): void;
|
|
2669
|
+
/**
|
|
2670
|
+
* 绘制栅格障碍物数据
|
|
2671
|
+
* @param obstacleIndices 障碍物像素点索引数组
|
|
2672
|
+
* @param width 地图宽度
|
|
2673
|
+
*/
|
|
2674
|
+
drawRaster(obstacleIndices: Uint32Array, width: number): void;
|
|
2675
|
+
}
|
|
2676
|
+
|
|
2677
|
+
/**
|
|
2678
|
+
* 解析后的点阵地图数据
|
|
2679
|
+
*/
|
|
2680
|
+
export declare type ParsedRasterMapData = {
|
|
2681
|
+
/** 障碍物像素点索引数组 */
|
|
2682
|
+
obstacles: Uint32Array
|
|
2683
|
+
/** 地毯像素点索引数组 */
|
|
2684
|
+
carpet: Uint32Array
|
|
2685
|
+
/** 房间ID -> 像素点索引数组(支持特殊房间ID) */
|
|
2686
|
+
rooms: Map<number | SpecialRoomId, Uint32Array>
|
|
2687
|
+
/** 地图宽度 */
|
|
2688
|
+
width: number
|
|
2689
|
+
/** 地图高度 */
|
|
2690
|
+
height: number
|
|
2691
|
+
/** 总像素数 */
|
|
2692
|
+
totalPixels: number
|
|
2693
|
+
}
|
|
2694
|
+
|
|
2695
|
+
declare class Path extends Container {
|
|
2696
|
+
private commonPath;
|
|
2697
|
+
private chargePath;
|
|
2698
|
+
private transitionsPath;
|
|
2699
|
+
private mopPath;
|
|
2700
|
+
private pathData;
|
|
2701
|
+
private lastPointCount;
|
|
2702
|
+
private lastDrawnPosition;
|
|
2703
|
+
private isRealTimeDrawing;
|
|
2704
|
+
private throttledUpdateLineWidth;
|
|
2705
|
+
private throttledHandleRobotPosition;
|
|
2706
|
+
constructor();
|
|
2707
|
+
/**
|
|
2708
|
+
* 注册事件监听
|
|
2709
|
+
*/
|
|
2710
|
+
private registerEventListeners;
|
|
2711
|
+
/**
|
|
2712
|
+
* 处理机器人动画完成事件
|
|
2713
|
+
*/
|
|
2714
|
+
private handleRobotAnimationComplete;
|
|
2715
|
+
/**
|
|
2716
|
+
* 实际处理机器人位置更新的方法
|
|
2717
|
+
*/
|
|
2718
|
+
private handleRobotPositionUpdate;
|
|
2719
|
+
/**
|
|
2720
|
+
* 更新线宽以响应缩放变化
|
|
2721
|
+
*/
|
|
2722
|
+
private updateLineWidth;
|
|
2723
|
+
/**
|
|
2724
|
+
* 重新绘制路径,应用适当的线宽
|
|
2725
|
+
* @param pathData 路径数据
|
|
2726
|
+
*/
|
|
2727
|
+
private redrawPaths;
|
|
2728
|
+
/**
|
|
2729
|
+
* 设置各类路径的样式
|
|
2730
|
+
*/
|
|
2731
|
+
private setupPathStyles;
|
|
2732
|
+
/**
|
|
2733
|
+
* 绘制路径线段
|
|
2734
|
+
* @param pathPoints 路径点数组
|
|
2735
|
+
*/
|
|
2736
|
+
private drawPathSegments;
|
|
2737
|
+
updatePositionByOrigin(x: number, y: number): void;
|
|
2738
|
+
/**
|
|
2739
|
+
* 全量绘制路径
|
|
2740
|
+
* @param pathData 路径数据
|
|
2741
|
+
*/
|
|
2742
|
+
drawFull(pathData: PathData): void;
|
|
2743
|
+
/**
|
|
2744
|
+
* 增量绘制路径(启用实时绘制模式)
|
|
2745
|
+
* @param pathData 路径数据
|
|
2746
|
+
*/
|
|
2747
|
+
drawIncremental(pathData: PathData): void;
|
|
2748
|
+
/**
|
|
2749
|
+
* 直接绘制新增的路径段(用于速度为0的情况)
|
|
2750
|
+
* @param newPoints 新增的路径点
|
|
2751
|
+
* @param lastCount 上次绘制的点数
|
|
2752
|
+
* @param allPoints 所有路径点
|
|
2753
|
+
*/
|
|
2754
|
+
private drawNewPathSegments;
|
|
2755
|
+
/**
|
|
2756
|
+
* 停止实时绘制模式
|
|
2757
|
+
*/
|
|
2758
|
+
stopRealTimeDrawing(): void;
|
|
2759
|
+
destroy(options?: {
|
|
2760
|
+
children?: boolean;
|
|
2761
|
+
texture?: boolean;
|
|
2762
|
+
baseTexture?: boolean;
|
|
2763
|
+
}): void;
|
|
2764
|
+
}
|
|
2765
|
+
|
|
2766
|
+
declare class PathManager {
|
|
2767
|
+
path: Path;
|
|
2768
|
+
robot: Robot;
|
|
2769
|
+
private unsubscribeFns;
|
|
2770
|
+
private lastDrawnPathData;
|
|
2771
|
+
constructor();
|
|
2772
|
+
/**
|
|
2773
|
+
* 绘制路径和机器人
|
|
2774
|
+
*/
|
|
2775
|
+
draw(pathData: PathData): void;
|
|
2776
|
+
/**
|
|
2777
|
+
* 判断是否应该使用增量绘制
|
|
2778
|
+
*/
|
|
2779
|
+
private shouldUseIncrementalDraw;
|
|
2780
|
+
/**
|
|
2781
|
+
* 全量绘制模式:完整绘制路径和机器人(初始绘制和不满足增量条件时使用)
|
|
2782
|
+
*/
|
|
2783
|
+
private fullDraw;
|
|
2784
|
+
/**
|
|
2785
|
+
* 转换PathPoint为RobotPoint
|
|
2786
|
+
*/
|
|
2787
|
+
private convertToRobotPoint;
|
|
2788
|
+
/**
|
|
2789
|
+
* 处理机器人移动到指定点
|
|
2790
|
+
*/
|
|
2791
|
+
private moveRobotToPoint;
|
|
2792
|
+
/**
|
|
2793
|
+
* 增量绘制模式:只绘制新增部分,机器人平滑动画到新位置
|
|
2794
|
+
*/
|
|
2795
|
+
private incrementalDraw;
|
|
2796
|
+
/**
|
|
2797
|
+
* 批量处理机器人动画队列(用于快速跳转)
|
|
2798
|
+
*/
|
|
2799
|
+
batchProcessRobotQueue(jumpToLatest?: boolean): void;
|
|
2800
|
+
updatePositionByOrigin(x: number, y: number): void;
|
|
2801
|
+
destroy(): void;
|
|
2802
|
+
}
|
|
2803
|
+
|
|
2804
|
+
/**
|
|
2805
|
+
* 路径状态对象
|
|
2806
|
+
* 描述机器人路径的状态信息
|
|
2807
|
+
*/
|
|
2808
|
+
export declare type PathState = {
|
|
2809
|
+
/** 路径ID */
|
|
2810
|
+
id: number
|
|
2811
|
+
/** 路径类型 */
|
|
2812
|
+
type: number
|
|
2813
|
+
/** 机器人朝向 */
|
|
2814
|
+
direction: number
|
|
2815
|
+
/** 路径点数量 */
|
|
2816
|
+
count: number
|
|
2817
|
+
/** 初始化标志 */
|
|
2818
|
+
initFlag: number
|
|
2819
|
+
/** 机器人当前位置 */
|
|
2820
|
+
robotPosition: Point | null
|
|
2821
|
+
}
|
|
2822
|
+
|
|
2823
|
+
/**
|
|
2824
|
+
* 二维坐标点
|
|
2825
|
+
*/
|
|
2826
|
+
export declare type Point = {
|
|
2827
|
+
/** X坐标 */
|
|
2828
|
+
x: number
|
|
2829
|
+
/** Y坐标 */
|
|
2830
|
+
y: number
|
|
2831
|
+
}
|
|
2832
|
+
|
|
2833
|
+
/**
|
|
2834
|
+
* 处理后的点阵数据
|
|
2835
|
+
*/
|
|
2836
|
+
export declare type ProcessedRasterData = {
|
|
2837
|
+
/** 障碍物像素点索引数组 */
|
|
2838
|
+
obstacles: Uint32Array
|
|
2839
|
+
/** 地毯像素点索引数组 */
|
|
2840
|
+
carpet: Uint32Array
|
|
2841
|
+
/** 已排序的房间数据,包含颜色信息 */
|
|
2842
|
+
sortedRooms: RasterRoomData[]
|
|
2843
|
+
/** 地图宽度 */
|
|
2844
|
+
width: number
|
|
2845
|
+
/** 地图高度 */
|
|
2846
|
+
height: number
|
|
2847
|
+
/** 总像素数 */
|
|
2848
|
+
totalPixels: number
|
|
2849
|
+
}
|
|
2850
|
+
|
|
2851
|
+
/**
|
|
2852
|
+
* 点阵房间数据
|
|
2853
|
+
*/
|
|
2854
|
+
export declare type RasterRoomData = {
|
|
2855
|
+
/** 房间ID */
|
|
2856
|
+
roomId: number | SpecialRoomId
|
|
2857
|
+
/** 像素点索引数组 */
|
|
2858
|
+
pixelIndices: Uint32Array
|
|
2859
|
+
/** 激活状态颜色 */
|
|
2860
|
+
activeColor: string
|
|
2861
|
+
/** 非激活状态颜色 */
|
|
2862
|
+
inactiveColor: string
|
|
2863
|
+
}
|
|
2864
|
+
|
|
2865
|
+
declare class Ring extends Graphics {
|
|
2866
|
+
private currentPosition;
|
|
2867
|
+
private config;
|
|
2868
|
+
constructor(options: RingOptions);
|
|
2869
|
+
/**
|
|
2870
|
+
* 设置反向缩放监听,保持描边宽度固定
|
|
2871
|
+
*/
|
|
2872
|
+
private setupAntiScaleListener;
|
|
2873
|
+
/**
|
|
2874
|
+
* 反向缩放事件处理
|
|
2875
|
+
*/
|
|
2876
|
+
private handleScaleChange;
|
|
2877
|
+
/**
|
|
2878
|
+
* 绘制预警圈
|
|
2879
|
+
* @param position 充电桩位置信息
|
|
2880
|
+
*/
|
|
2881
|
+
draw(position: Point): void;
|
|
2882
|
+
/**
|
|
2883
|
+
* 绘制虚线圆形
|
|
2884
|
+
*/
|
|
2885
|
+
private drawDashedCircle;
|
|
2886
|
+
/**
|
|
2887
|
+
* 重新绘制(当配置变化时调用)
|
|
2888
|
+
*/
|
|
2889
|
+
redraw(): void;
|
|
2890
|
+
/**
|
|
2891
|
+
* 销毁组件
|
|
2892
|
+
*/
|
|
2893
|
+
destroy(): void;
|
|
2894
|
+
}
|
|
2895
|
+
|
|
2896
|
+
/** 预警圈配置 */
|
|
2897
|
+
export declare type RingConfig = {
|
|
2898
|
+
/** 大小(米) */
|
|
2899
|
+
ringSize: number
|
|
2900
|
+
/** 填充颜色 */
|
|
2901
|
+
ringColor: ColorSource
|
|
2902
|
+
/** 描边宽度 */
|
|
2903
|
+
ringStrokeWidth: number
|
|
2904
|
+
/** 描边颜色 */
|
|
2905
|
+
ringStrokeColor: ColorSource
|
|
2906
|
+
/** 描边是否虚线 */
|
|
2907
|
+
ringStrokeDashed: boolean
|
|
2908
|
+
/** 描边虚线数组 */
|
|
2909
|
+
ringStrokeDashArray: [number, number]
|
|
2910
|
+
}
|
|
2911
|
+
|
|
2912
|
+
declare type RingOptions = {
|
|
2913
|
+
config: RingConfig;
|
|
2914
|
+
};
|
|
2915
|
+
|
|
2916
|
+
declare class Robot extends Container {
|
|
2917
|
+
robot: RobotIcon;
|
|
2918
|
+
ring: Ring;
|
|
2919
|
+
sleepAnimation: SleepAnimation | null;
|
|
2920
|
+
private unsubscribeFns;
|
|
2921
|
+
private targetPosition;
|
|
2922
|
+
private targetRotation;
|
|
2923
|
+
private isMoving;
|
|
2924
|
+
private pathQueue;
|
|
2925
|
+
private lastPosition;
|
|
2926
|
+
private currentPathType;
|
|
2927
|
+
private lastUpdateTime;
|
|
2928
|
+
constructor();
|
|
2929
|
+
/**
|
|
2930
|
+
* 异步初始化睡眠动画
|
|
2931
|
+
*/
|
|
2932
|
+
private initializeSleepAnimation;
|
|
2933
|
+
updatePositionByOrigin(x: number, y: number): void;
|
|
2934
|
+
/**
|
|
2935
|
+
* 立即绘制到指定位置(无动画)
|
|
2936
|
+
*/
|
|
2937
|
+
draw({ x, y, rotation }: IconPoint): Promise<void>;
|
|
2938
|
+
/**
|
|
2939
|
+
* 添加移动目标到队列(带动画)
|
|
2940
|
+
*/
|
|
2941
|
+
moveTo(point: RobotPoint): void;
|
|
2942
|
+
/**
|
|
2943
|
+
* 批量处理队列(快速跳转)
|
|
2944
|
+
*/
|
|
2945
|
+
batchProcessQueue(jumpToLatest?: boolean): void;
|
|
2946
|
+
/**
|
|
2947
|
+
* 处理队列中的下一个路径点
|
|
2948
|
+
*/
|
|
2949
|
+
private processNextPathPoint;
|
|
2950
|
+
/**
|
|
2951
|
+
* 动画更新循环
|
|
2952
|
+
*/
|
|
2953
|
+
private update;
|
|
2954
|
+
/**
|
|
2955
|
+
* 启动机器人动画渲染(只控制 Ticker start/stop,不 add/remove)
|
|
2956
|
+
*/
|
|
2957
|
+
private startRobotAnimation;
|
|
2958
|
+
/**
|
|
2959
|
+
* 重写 visible setter,确保睡眠动画能响应机器人可见性变化
|
|
2960
|
+
*/
|
|
2961
|
+
set visible(value: boolean);
|
|
2962
|
+
/**
|
|
2963
|
+
* 重写 visible getter
|
|
2964
|
+
*/
|
|
2965
|
+
get visible(): boolean;
|
|
2966
|
+
/**
|
|
2967
|
+
* 停止机器人动画渲染(只控制 Ticker start/stop,不 add/remove)
|
|
2968
|
+
*/
|
|
2969
|
+
private stopRobotAnimation;
|
|
2970
|
+
/**
|
|
2971
|
+
* 清除机器人动画状态
|
|
2972
|
+
*/
|
|
2973
|
+
remove(): void;
|
|
2974
|
+
destroy(options?: {
|
|
2975
|
+
children?: boolean;
|
|
2976
|
+
texture?: boolean;
|
|
2977
|
+
baseTexture?: boolean;
|
|
2978
|
+
}): void;
|
|
2979
|
+
}
|
|
2980
|
+
|
|
2981
|
+
declare class RobotIcon extends EnhancedSprite {
|
|
2982
|
+
constructor();
|
|
2983
|
+
initializeSprite(): Promise<void>;
|
|
2984
|
+
draw({ x, y, rotation }: IconPoint): Promise<void>;
|
|
2985
|
+
}
|
|
2986
|
+
|
|
2987
|
+
/** 机器人点 */
|
|
2988
|
+
export declare type RobotPoint = IconPoint & {
|
|
2989
|
+
/** 点类型 */
|
|
2990
|
+
type: RobotPointType
|
|
2991
|
+
}
|
|
2992
|
+
|
|
2993
|
+
/** 机器人点类型 */
|
|
2994
|
+
export declare type RobotPointType = 'common' | 'charge' | 'transitions' | 'mop'
|
|
2995
|
+
|
|
2996
|
+
/** 房间数据 */
|
|
2997
|
+
export declare type Room = {
|
|
2998
|
+
/** 房间ID */
|
|
2999
|
+
id: number
|
|
3000
|
+
/** 颜色 */
|
|
3001
|
+
color: ColorSource
|
|
3002
|
+
/** 边界框 */
|
|
3003
|
+
boundingBox: Rectangle
|
|
3004
|
+
/** 原始点集 */
|
|
3005
|
+
points: Point[]
|
|
3006
|
+
/** 轮廓点集 */
|
|
3007
|
+
outlinePoints: Point[]
|
|
3008
|
+
/** 轮廓点集(poly绘制格式) */
|
|
3009
|
+
polyPoints: number[]
|
|
3010
|
+
/** 中心点 */
|
|
3011
|
+
centerPoint: Point
|
|
3012
|
+
}
|
|
3013
|
+
|
|
3014
|
+
/**
|
|
3015
|
+
* 房间显示数据
|
|
3016
|
+
* 扩展房间属性,包含显示相关的信息
|
|
3017
|
+
*/
|
|
3018
|
+
export declare type RoomData = RoomProperty & {
|
|
3019
|
+
/** 可选的中心点,用于显示房间名称 */
|
|
3020
|
+
centerPoint: Point | null
|
|
3021
|
+
/** 索引 */
|
|
3022
|
+
index: number
|
|
3023
|
+
}
|
|
3024
|
+
|
|
3025
|
+
declare class RoomFill extends Container {
|
|
3026
|
+
private roomGraphicsMap;
|
|
3027
|
+
private roomContextMap;
|
|
3028
|
+
private roomClickHandlerMap;
|
|
3029
|
+
private unsubscribeFns;
|
|
3030
|
+
private mapWidth;
|
|
3031
|
+
private rasterRoomDataMap;
|
|
3032
|
+
constructor();
|
|
3033
|
+
/**
|
|
3034
|
+
* 绘制结构化协议地图房间
|
|
3035
|
+
* @param rooms 房间数据
|
|
3036
|
+
*/
|
|
3037
|
+
draw(rooms: Room[]): void;
|
|
3038
|
+
/**
|
|
3039
|
+
* 绘制栅格房间数据
|
|
3040
|
+
* @param processedData 处理后的栅格数据,包含排序和颜色信息
|
|
3041
|
+
*/
|
|
3042
|
+
drawRaster(processedData: ProcessedRasterData): void;
|
|
3043
|
+
/**
|
|
3044
|
+
* 绘制栅格房间(统一方法,处理数字房间和特殊房间)
|
|
3045
|
+
*/
|
|
3046
|
+
private drawRasterRoom;
|
|
3047
|
+
/**
|
|
3048
|
+
* 分批绘制像素点
|
|
3049
|
+
*/
|
|
3050
|
+
private drawPixelPointsInBatches;
|
|
3051
|
+
/**
|
|
3052
|
+
* 处理房间点击事件
|
|
3053
|
+
*/
|
|
3054
|
+
private handleRoomClick;
|
|
3055
|
+
/**
|
|
3056
|
+
* 根据选中的房间ID数组设置房间状态
|
|
3057
|
+
* @param selectRoomIds 选中的房间ID数组
|
|
3058
|
+
*/
|
|
3059
|
+
setRoomStateBySelectIds(selectRoomIds: readonly number[]): void;
|
|
3060
|
+
/**
|
|
3061
|
+
* 切换单个房间的状态
|
|
3062
|
+
* @param roomId 房间ID
|
|
3063
|
+
* @param isActive 是否为激活状态
|
|
3064
|
+
*/
|
|
3065
|
+
setRoomState(roomId: number | SpecialRoomId, isActive: boolean): void;
|
|
3066
|
+
/**
|
|
3067
|
+
* 设置所有房间为同一状态
|
|
3068
|
+
* @param isActive 是否为激活状态
|
|
3069
|
+
*/
|
|
3070
|
+
setAllRoomsState(isActive: boolean): void;
|
|
3071
|
+
/**
|
|
3072
|
+
* 获取数字房间的Graphics映射(用于地板材质创建)
|
|
3073
|
+
* @returns 房间ID到Graphics的映射
|
|
3074
|
+
*/
|
|
3075
|
+
getRoomGraphicsMap(): Map<number, Graphics>;
|
|
3076
|
+
/**
|
|
3077
|
+
* 获取栅格房间数据(用于精确碰撞检测)
|
|
3078
|
+
* @param roomId 房间ID
|
|
3079
|
+
* @returns 栅格房间数据或null
|
|
3080
|
+
*/
|
|
3081
|
+
getRasterRoomData(roomId: number | SpecialRoomId): RasterRoomData | null;
|
|
3082
|
+
/**
|
|
3083
|
+
* 获取地图宽度(用于像素索引转换)
|
|
3084
|
+
*/
|
|
3085
|
+
getMapWidth(): number;
|
|
3086
|
+
/**
|
|
3087
|
+
* 清除所有房间
|
|
3088
|
+
*/
|
|
3089
|
+
private clearRooms;
|
|
3090
|
+
/**
|
|
3091
|
+
* 销毁时清理资源
|
|
3092
|
+
*/
|
|
3093
|
+
destroy(): void;
|
|
3094
|
+
}
|
|
3095
|
+
|
|
3096
|
+
declare class RoomManager {
|
|
3097
|
+
private unsubscribeFns;
|
|
3098
|
+
private roomInfoContainer;
|
|
3099
|
+
private roomInfoMap;
|
|
3100
|
+
private roomDisplayMap;
|
|
3101
|
+
private roomFloorType;
|
|
3102
|
+
constructor();
|
|
3103
|
+
/**
|
|
3104
|
+
* 设置房间属性数据(房间名称、清洁模式等)
|
|
3105
|
+
* 一次性获取并存储所有必要的显示数据
|
|
3106
|
+
*/
|
|
3107
|
+
drawRoomProperty(properties: RoomProperty[]): boolean;
|
|
3108
|
+
/**
|
|
3109
|
+
* 更新房间信息显示
|
|
3110
|
+
* 直接使用已存储的完整显示数据
|
|
3111
|
+
*/
|
|
3112
|
+
private updateRoomInfoDisplay;
|
|
3113
|
+
/**
|
|
3114
|
+
* 创建单个房间的信息组件
|
|
3115
|
+
*/
|
|
3116
|
+
private createRoomInfo;
|
|
3117
|
+
/**
|
|
3118
|
+
* 更新特定房间的名称
|
|
3119
|
+
*/
|
|
3120
|
+
updateRoomName(roomId: number, name: string): void;
|
|
3121
|
+
/**
|
|
3122
|
+
* 更新特定房间的位置
|
|
3123
|
+
*/
|
|
3124
|
+
updateRoomPosition(roomId: number, centerPoint: Point): void;
|
|
3125
|
+
/**
|
|
3126
|
+
* 清除所有房间信息
|
|
3127
|
+
*/
|
|
3128
|
+
private clearRoomInfos;
|
|
3129
|
+
/**
|
|
3130
|
+
* 根据ID查找房间显示数据
|
|
3131
|
+
*/
|
|
3132
|
+
getRoomPropertyById(id: number): RoomData | undefined;
|
|
3133
|
+
/**
|
|
3134
|
+
* 当房间几何数据更新时,刷新房间信息显示
|
|
3135
|
+
* 这个方法由 MapManager 在房间几何数据更新后调用
|
|
3136
|
+
*/
|
|
3137
|
+
refresh(): void;
|
|
3138
|
+
/**
|
|
3139
|
+
* 更新地板材质
|
|
3140
|
+
* 在房间几何数据或属性数据更新后调用
|
|
3141
|
+
*/
|
|
3142
|
+
private updateFloorTypes;
|
|
3143
|
+
destroy(): void;
|
|
3144
|
+
}
|
|
3145
|
+
|
|
3146
|
+
/**
|
|
3147
|
+
* 房间属性信息
|
|
3148
|
+
*/
|
|
3149
|
+
export declare type RoomProperty = {
|
|
3150
|
+
/** 房间ID */
|
|
3151
|
+
id: number
|
|
3152
|
+
/**
|
|
3153
|
+
* 吸力等级
|
|
3154
|
+
*
|
|
3155
|
+
* null表示不显示
|
|
3156
|
+
*/
|
|
3157
|
+
suction?: number | null
|
|
3158
|
+
/** 房间名称 */
|
|
3159
|
+
name: string
|
|
3160
|
+
/**
|
|
3161
|
+
* 水量等级
|
|
3162
|
+
*
|
|
3163
|
+
* null表示不显示
|
|
3164
|
+
*/
|
|
3165
|
+
cistern?: number | null
|
|
3166
|
+
/**
|
|
3167
|
+
* 清扫模式
|
|
3168
|
+
*
|
|
3169
|
+
* null表示不显示
|
|
3170
|
+
*/
|
|
3171
|
+
cleanMode?: number | null
|
|
3172
|
+
/**
|
|
3173
|
+
* 清扫次数
|
|
3174
|
+
*/
|
|
3175
|
+
cleanTimes: number
|
|
3176
|
+
/** 清扫顺序 */
|
|
3177
|
+
order: number
|
|
3178
|
+
/** 地板类型 */
|
|
3179
|
+
floorType: number
|
|
3180
|
+
/** 拖地模式 */
|
|
3181
|
+
yMop: number
|
|
3182
|
+
}
|
|
3183
|
+
|
|
3184
|
+
/**
|
|
3185
|
+
* 运行时状态对象
|
|
3186
|
+
*
|
|
3187
|
+
* 控制地图在运行时的各种行为状态
|
|
3188
|
+
*/
|
|
3189
|
+
export declare type RuntimeConfig = {
|
|
3190
|
+
/** 正在分割的房间ID */
|
|
3191
|
+
dividingRoomId: number | null | undefined
|
|
3192
|
+
/**
|
|
3193
|
+
* 是否进入房间选择模式
|
|
3194
|
+
*
|
|
3195
|
+
* 进入房间选择模式后,房间颜色会根据selectRoomIds是否包含该房间ID来变化
|
|
3196
|
+
*/
|
|
3197
|
+
enableRoomSelection: boolean
|
|
3198
|
+
/** 正在编辑的禁扫区域ID列表 */
|
|
3199
|
+
editingForbiddenSweepZoneIds: string[]
|
|
3200
|
+
/** 正在编辑的禁拖区域ID列表 */
|
|
3201
|
+
editingForbiddenMopZoneIds: string[]
|
|
3202
|
+
/** 正在编辑的清洁区域ID列表 */
|
|
3203
|
+
editingCleanZoneIds: string[]
|
|
3204
|
+
/** 正在编辑的虚拟墙ID列表 */
|
|
3205
|
+
editingVirtualWallIds: string[]
|
|
3206
|
+
/** 正在编辑的定点清扫ID列表 */
|
|
3207
|
+
editingSpotIds: string[]
|
|
3208
|
+
/** 房间属性折叠的房间ID列表 */
|
|
3209
|
+
roomPropertyFoldIds: number[]
|
|
3210
|
+
/** 房间选择的气泡显示模式 */
|
|
3211
|
+
roomSelectionMode: 'checkmark' | 'order'
|
|
3212
|
+
/** 是否显示房间名称 */
|
|
3213
|
+
showRoomName: boolean
|
|
3214
|
+
/** 是否显示房间属性 */
|
|
3215
|
+
showRoomProperty: boolean
|
|
3216
|
+
/** 是否显示房间顺序 */
|
|
3217
|
+
showRoomOrder: boolean
|
|
3218
|
+
/** 是否显示路径 */
|
|
3219
|
+
showPath: boolean
|
|
3220
|
+
/** 是否显示充电桩 */
|
|
3221
|
+
showChargingStation: boolean
|
|
3222
|
+
/** 是否显示房间地板材质 */
|
|
3223
|
+
showRoomFloorType: boolean
|
|
3224
|
+
/** 是否显示地毯 */
|
|
3225
|
+
showCarpet: boolean
|
|
3226
|
+
/** 选中的房间ID列表 */
|
|
3227
|
+
selectRoomIds: number[]
|
|
3228
|
+
/** 是否显示充电桩预警圈 */
|
|
3229
|
+
showChargingStationRing: boolean
|
|
3230
|
+
/** 是否显示机器人预警圈 */
|
|
3231
|
+
showRobotRing: boolean
|
|
3232
|
+
/** 是否显示机器人睡眠动画 */
|
|
3233
|
+
showRobotSleepAnimation: boolean
|
|
3234
|
+
}
|
|
3235
|
+
|
|
3236
|
+
/**
|
|
3237
|
+
* 机器人睡眠动画组件
|
|
3238
|
+
* TODO
|
|
3239
|
+
* 暂时不开放这个组件,得找到合适的动画
|
|
3240
|
+
* 基于 FixedSizeAnimatedSprite,显示机器人睡眠状态的动画效果
|
|
3241
|
+
*/
|
|
3242
|
+
declare class SleepAnimation extends EnhancedAnimatedSprite {
|
|
3243
|
+
private unsubscribeFns;
|
|
3244
|
+
private throttledUpdateOffset;
|
|
3245
|
+
private fixedOffsetX;
|
|
3246
|
+
private fixedOffsetY;
|
|
3247
|
+
constructor(textures: Texture[]);
|
|
3248
|
+
/**
|
|
3249
|
+
* 静态创建方法
|
|
3250
|
+
*/
|
|
3251
|
+
static create(): Promise<SleepAnimation>;
|
|
3252
|
+
/**
|
|
3253
|
+
* 初始化睡眠动画
|
|
3254
|
+
*/
|
|
3255
|
+
private initializeAnimation;
|
|
3256
|
+
/**
|
|
3257
|
+
* 判断是否应该显示睡眠动画
|
|
3258
|
+
* 显示条件:
|
|
3259
|
+
* 1. 配置中启用睡眠动画
|
|
3260
|
+
* 2. 机器人容器可见
|
|
3261
|
+
* 3. 机器人图标已经绘制(有位置信息)
|
|
3262
|
+
*/
|
|
3263
|
+
private shouldShow;
|
|
3264
|
+
/**
|
|
3265
|
+
* 更新可见性状态
|
|
3266
|
+
*/
|
|
3267
|
+
private updateVisibility;
|
|
3268
|
+
/**
|
|
3269
|
+
* 更新偏移量以保持固定大小
|
|
3270
|
+
* @param _scale 当前地图缩放比例
|
|
3271
|
+
*/
|
|
3272
|
+
private updateOffset;
|
|
3273
|
+
/**
|
|
3274
|
+
* 绘制睡眠动画
|
|
3275
|
+
* @param params 绘制参数
|
|
3276
|
+
*/
|
|
3277
|
+
draw(params: IconPoint): void;
|
|
3278
|
+
/**
|
|
3279
|
+
* 当机器人图标可见性变化时调用
|
|
3280
|
+
*/
|
|
3281
|
+
onRobotVisibilityChanged(): void;
|
|
3282
|
+
/**
|
|
3283
|
+
* 重写 visible setter,确保动画播放状态与可见性同步
|
|
3284
|
+
*/
|
|
3285
|
+
set visible(value: boolean);
|
|
3286
|
+
/**
|
|
3287
|
+
* 重写 visible getter
|
|
3288
|
+
*/
|
|
3289
|
+
get visible(): boolean;
|
|
3290
|
+
/**
|
|
3291
|
+
* 组件销毁时清理资源
|
|
3292
|
+
*/
|
|
3293
|
+
destroy(options?: {
|
|
3294
|
+
children?: boolean;
|
|
3295
|
+
texture?: boolean;
|
|
3296
|
+
baseTexture?: boolean;
|
|
3297
|
+
}): void;
|
|
3298
|
+
}
|
|
3299
|
+
|
|
3300
|
+
declare const SPECIAL_ROOM_IDS: {
|
|
3301
|
+
readonly NO_ROOM_DATA: "NO_ROOM_DATA";
|
|
3302
|
+
readonly ROOM_GAP: "ROOM_GAP";
|
|
3303
|
+
readonly OBSTACLE_ROOM: "OBSTACLE_ROOM";
|
|
3304
|
+
readonly UNKNOWN_ROOM: "UNKNOWN_ROOM";
|
|
3305
|
+
};
|
|
3306
|
+
|
|
3307
|
+
declare type SpecialRoomId = (typeof SPECIAL_ROOM_IDS)[keyof typeof SPECIAL_ROOM_IDS];
|
|
3308
|
+
|
|
3309
|
+
/** 定点清扫配置 */
|
|
3310
|
+
export declare type SpotConfig = {
|
|
3311
|
+
/** 图标资源路径 */
|
|
3312
|
+
iconSrc: string
|
|
3313
|
+
/** 图标大小 */
|
|
3314
|
+
iconSize: number
|
|
3315
|
+
/** 尺寸 (米) */
|
|
3316
|
+
size: number
|
|
3317
|
+
/** 描边颜色 */
|
|
3318
|
+
strokeColor: ColorSource
|
|
3319
|
+
/** 描边宽度 */
|
|
3320
|
+
strokeWidth: number
|
|
3321
|
+
/** 填充颜色 */
|
|
3322
|
+
fillColor: ColorSource
|
|
3323
|
+
/** 文本颜色 */
|
|
3324
|
+
textColor: ColorSource
|
|
3325
|
+
/** 文本位置 */
|
|
3326
|
+
textPosition: 'top' | 'right' | 'bottom' | 'left'
|
|
3327
|
+
/** 文本偏移 */
|
|
3328
|
+
textOffset: number
|
|
3329
|
+
|
|
3330
|
+
/** 编辑模式样式 */
|
|
3331
|
+
editing: {
|
|
3332
|
+
/** 是否虚线 */
|
|
3333
|
+
isDashed: boolean
|
|
3334
|
+
/** 虚线数组 */
|
|
3335
|
+
dashArray: [number, number]
|
|
3336
|
+
}
|
|
3337
|
+
/** 普通模式样式 */
|
|
3338
|
+
normal: {
|
|
3339
|
+
/** 是否虚线 */
|
|
3340
|
+
isDashed: boolean
|
|
3341
|
+
/** 虚线数组 */
|
|
3342
|
+
dashArray: [number, number]
|
|
3343
|
+
}
|
|
3344
|
+
}
|
|
3345
|
+
|
|
3346
|
+
/** 定点清扫参数 */
|
|
3347
|
+
export declare type SpotParam = {
|
|
3348
|
+
/** 定点清扫ID */
|
|
3349
|
+
id: string
|
|
3350
|
+
/** 点坐标 */
|
|
3351
|
+
point: Point
|
|
3352
|
+
}
|
|
3353
|
+
|
|
3354
|
+
/**
|
|
3355
|
+
* 获取 AppService 实例
|
|
3356
|
+
*/
|
|
3357
|
+
export declare function useAppService(): AppService;
|
|
3358
|
+
|
|
3359
|
+
declare class ViewportContainer extends Container {
|
|
3360
|
+
private viewportBounds;
|
|
3361
|
+
private maskGraphics;
|
|
3362
|
+
constructor(config: AppConfig);
|
|
3363
|
+
/**
|
|
3364
|
+
* 计算视口边界
|
|
3365
|
+
*/
|
|
3366
|
+
private calculateViewportBounds;
|
|
3367
|
+
/**
|
|
3368
|
+
* 创建遮罩限制内容在视口内
|
|
3369
|
+
*/
|
|
3370
|
+
private createMask;
|
|
3371
|
+
/**
|
|
3372
|
+
* 解析尺寸参数
|
|
3373
|
+
*/
|
|
3374
|
+
private parseSize;
|
|
3375
|
+
/**
|
|
3376
|
+
* 获取视口边界
|
|
3377
|
+
*/
|
|
3378
|
+
getViewportBounds(): {
|
|
3379
|
+
x: number;
|
|
3380
|
+
y: number;
|
|
3381
|
+
width: number;
|
|
3382
|
+
height: number;
|
|
3383
|
+
};
|
|
3384
|
+
/**
|
|
3385
|
+
* 更新视口配置
|
|
3386
|
+
*/
|
|
3387
|
+
updateViewport(config: AppConfig): void;
|
|
3388
|
+
/**
|
|
3389
|
+
* 添加内容到视口容器
|
|
3390
|
+
*/
|
|
3391
|
+
addContent(content: Container): void;
|
|
3392
|
+
}
|
|
3393
|
+
|
|
3394
|
+
/** 虚拟墙配置 */
|
|
3395
|
+
export declare type VirtualWallConfig = {
|
|
3396
|
+
/** 图标容器填充颜色 */
|
|
3397
|
+
iconWrapperFillColor: ColorSource
|
|
3398
|
+
/** 线条宽度 */
|
|
3399
|
+
lineWidth: number
|
|
3400
|
+
/** 线条颜色 */
|
|
3401
|
+
lineColor: ColorSource
|
|
3402
|
+
/** 碰撞区域厚度 */
|
|
3403
|
+
hitAreaThickness: number
|
|
3404
|
+
/** 轮廓偏移 */
|
|
3405
|
+
outlineOffset: number
|
|
3406
|
+
/** 轮廓描边颜色 */
|
|
3407
|
+
outlineStrokeColor: ColorSource
|
|
3408
|
+
/** 轮廓描边宽度 */
|
|
3409
|
+
outlineStrokeWidth: number
|
|
3410
|
+
/** 轮廓是否虚线 */
|
|
3411
|
+
outlineDashed: boolean
|
|
3412
|
+
/** 轮廓虚线数组 */
|
|
3413
|
+
outlineDashArray: [number, number]
|
|
3414
|
+
/** 轮廓填充颜色 */
|
|
3415
|
+
outlineFillColor: ColorSource
|
|
3416
|
+
/** 文本颜色 */
|
|
3417
|
+
textColor: ColorSource
|
|
3418
|
+
/** 文本偏移 */
|
|
3419
|
+
textOffset: number
|
|
3420
|
+
/** 最小宽度 (米) */
|
|
3421
|
+
minWidth: number
|
|
3422
|
+
|
|
3423
|
+
/** 编辑模式样式 */
|
|
3424
|
+
editing: {
|
|
3425
|
+
/** 是否虚线 */
|
|
3426
|
+
isDashed: boolean
|
|
3427
|
+
/** 虚线数组 */
|
|
3428
|
+
dashArray: [number, number]
|
|
3429
|
+
}
|
|
3430
|
+
/** 普通模式样式 */
|
|
3431
|
+
normal: {
|
|
3432
|
+
/** 是否虚线 */
|
|
3433
|
+
isDashed: boolean
|
|
3434
|
+
/** 虚线数组 */
|
|
3435
|
+
dashArray: [number, number]
|
|
3436
|
+
}
|
|
3437
|
+
}
|
|
3438
|
+
|
|
3439
|
+
/** 虚拟墙参数 */
|
|
3440
|
+
export declare type VirtualWallParam = {
|
|
3441
|
+
/** 虚拟墙ID */
|
|
3442
|
+
id: string
|
|
3443
|
+
/** 点集合 */
|
|
3444
|
+
points: Point[]
|
|
3445
|
+
}
|
|
3446
|
+
|
|
3447
|
+
/** 区域配置 */
|
|
3448
|
+
export declare type ZoneConfig = {
|
|
3449
|
+
/** 最小尺寸 (米) */
|
|
3450
|
+
minSize: number
|
|
3451
|
+
/** 图标容器填充颜色 */
|
|
3452
|
+
iconWrapperFillColor: ColorSource
|
|
3453
|
+
/** 描边颜色 */
|
|
3454
|
+
strokeColor: ColorSource
|
|
3455
|
+
/** 描边宽度 */
|
|
3456
|
+
strokeWidth: number
|
|
3457
|
+
/** 填充颜色 */
|
|
3458
|
+
fillColor: ColorSource
|
|
3459
|
+
/** 轮廓偏移 */
|
|
3460
|
+
outlineOffset: number
|
|
3461
|
+
/** 轮廓描边颜色 */
|
|
3462
|
+
outlineStrokeColor: ColorSource
|
|
3463
|
+
/** 轮廓描边宽度 */
|
|
3464
|
+
outlineStrokeWidth: number
|
|
3465
|
+
/** 轮廓填充颜色 */
|
|
3466
|
+
outlineFillColor: ColorSource
|
|
3467
|
+
/** 轮廓是否虚线 */
|
|
3468
|
+
outlineDashed: boolean
|
|
3469
|
+
/** 轮廓虚线数组 */
|
|
3470
|
+
outlineDashArray: [number, number]
|
|
3471
|
+
/** 文本颜色 */
|
|
3472
|
+
textColor: ColorSource
|
|
3473
|
+
/** 文本位置 */
|
|
3474
|
+
textPosition: 'top' | 'right' | 'bottom' | 'left'
|
|
3475
|
+
/** 文本偏移 */
|
|
3476
|
+
textOffset: number
|
|
3477
|
+
/** 编辑模式样式 */
|
|
3478
|
+
editing: {
|
|
3479
|
+
/** 是否虚线 */
|
|
3480
|
+
isDashed: boolean
|
|
3481
|
+
/** 虚线数组 */
|
|
3482
|
+
dashArray: [number, number]
|
|
3483
|
+
}
|
|
3484
|
+
/** 普通模式样式 */
|
|
3485
|
+
normal: {
|
|
3486
|
+
/** 是否虚线 */
|
|
3487
|
+
isDashed: boolean
|
|
3488
|
+
/** 虚线数组 */
|
|
3489
|
+
dashArray: [number, number]
|
|
3490
|
+
}
|
|
3491
|
+
}
|
|
3492
|
+
|
|
3493
|
+
/** 区域参数 */
|
|
3494
|
+
export declare type ZoneParam = {
|
|
3495
|
+
/** 区域ID */
|
|
3496
|
+
id: string
|
|
3497
|
+
/** 点集合 */
|
|
3498
|
+
points: Point[]
|
|
3499
|
+
}
|
|
3500
|
+
|
|
3501
|
+
export { }
|