@ray-js/robot-map-sdk 0.0.3-beta-7 → 0.0.3-beta-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application/Interaction.js +1 -1
- package/dist/application/MapApplication.js +1 -1
- package/dist/components/Heatmap/index.js +1 -1
- package/dist/components/Map/Free.js +1 -1
- package/dist/components/Map/Obstacle.js +1 -1
- package/dist/constant/config.js +1 -1
- package/dist/index.d.ts +92 -1447
- package/dist/utils/logger.js +1 -1
- package/dist-app/assets/{index-rWbtFkbX.js → index-C3rjigWj.js} +1 -1
- package/dist-app/index.html +1 -1
- package/dist-docs/404.html +2 -2
- package/dist-docs/assets/{app.C8maVmzs.js → app.BGQfBD4o.js} +1 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.CSdgg9Q0.js +1 -0
- package/dist-docs/assets/chunks/{VPLocalSearchBox.dmVujmrV.js → VPLocalSearchBox.YvMlJA6m.js} +1 -1
- package/dist-docs/assets/chunks/{theme.BkasJq65.js → theme.1StzhkaW.js} +2 -2
- package/dist-docs/assets/{guide_getting-started.md.CSvzbjhl.js → guide_getting-started.md.B2we0fUv.js} +1 -1
- package/dist-docs/assets/reference_config.md.h1LczQ1s.js +41 -0
- package/dist-docs/assets/reference_config.md.h1LczQ1s.lean.js +1 -0
- package/dist-docs/guide/advanced-usage.html +3 -3
- package/dist-docs/guide/concepts.html +3 -3
- package/dist-docs/guide/getting-started.html +5 -5
- package/dist-docs/hashmap.json +1 -1
- package/dist-docs/index.html +3 -3
- package/dist-docs/reference/callbacks.html +3 -3
- package/dist-docs/reference/config.html +5 -5
- package/dist-docs/reference/data.html +3 -3
- package/dist-docs/reference/methods.html +3 -3
- package/dist-docs/reference/runtime.html +3 -3
- package/dist-docs/reference/types.html +3 -3
- package/dist-docs/reference/utils.html +3 -3
- package/package.json +1 -1
- package/dist/index.rjs.js +0 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.BEPmfEXB.js +0 -1
- package/dist-docs/assets/reference_config.md.BOXwJsHq.js +0 -41
- package/dist-docs/assets/reference_config.md.BOXwJsHq.lean.js +0 -1
- /package/dist-docs/assets/{guide_getting-started.md.CSvzbjhl.lean.js → guide_getting-started.md.B2we0fUv.lean.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,40 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AppContainer as AppContainer_2 } from './AppContainer';
|
|
1
|
+
import { AppContainer } from './AppContainer';
|
|
3
2
|
import { Application } from 'pixi.js';
|
|
4
3
|
import { ApplicationOptions } from 'pixi.js';
|
|
5
4
|
import { ColorSource } from 'pixi.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { CustomElementsManager as CustomElementsManager_2 } from '../managers/CustomElementsManager';
|
|
10
|
-
import { DestroyOptions } from 'pixi.js';
|
|
11
|
-
import { DetectedObjectManager as DetectedObjectManager_2 } from '../managers/DetectedObjectManager';
|
|
12
|
-
import { DividerConfig as DividerConfig_2 } from '..';
|
|
5
|
+
import { ControlsManager } from '../managers/ControlsManager';
|
|
6
|
+
import { CustomElementsManager } from '../managers/CustomElementsManager';
|
|
7
|
+
import { DetectedObjectManager } from '../managers/DetectedObjectManager';
|
|
13
8
|
import { Emitter } from 'mitt';
|
|
14
9
|
import { FederatedPointerEvent } from 'pixi.js';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { Interaction as Interaction_2 } from './Interaction';
|
|
18
|
-
import { MapCallbacks as MapCallbacks_2 } from '..';
|
|
10
|
+
import { HeatmapManager } from '../managers/HeatmapManager';
|
|
11
|
+
import { Interaction } from './Interaction';
|
|
19
12
|
import { MapData } from '@ray-js/robot-protocol';
|
|
20
13
|
import { MapHeader } from '@ray-js/robot-protocol';
|
|
21
|
-
import { MapManager
|
|
22
|
-
import { MapState as MapState_2 } from '..';
|
|
23
|
-
import { ParsedRasterMapData as ParsedRasterMapData_2 } from '@ray-js/robot-protocol';
|
|
14
|
+
import { MapManager } from '../managers/MapManager';
|
|
24
15
|
import { PathData } from '@ray-js/robot-protocol';
|
|
25
|
-
import { PathManager
|
|
16
|
+
import { PathManager } from '../managers/PathManager';
|
|
26
17
|
import { Rectangle } from 'pixi.js';
|
|
27
|
-
import {
|
|
28
|
-
import { RoomData as RoomData_2 } from '..';
|
|
29
|
-
import { RoomManager as RoomManager_2 } from '../managers/RoomManager';
|
|
30
|
-
import { RuntimeConfig as RuntimeConfig_2 } from '..';
|
|
18
|
+
import { RoomManager } from '../managers/RoomManager';
|
|
31
19
|
import { SPECIAL_ROOM_IDS } from '@ray-js/robot-protocol';
|
|
32
20
|
import { SpecialRoomId } from '@ray-js/robot-protocol';
|
|
33
|
-
import { Sprite } from 'pixi.js';
|
|
34
21
|
import { TextStyleFontWeight } from 'pixi.js';
|
|
35
|
-
import { Texture } from 'pixi.js';
|
|
36
22
|
import { Ticker } from 'pixi.js';
|
|
37
|
-
import { ViewportContainer
|
|
23
|
+
import { ViewportContainer } from './ViewportContainer';
|
|
38
24
|
|
|
39
25
|
/**
|
|
40
26
|
* 地图静态配置
|
|
@@ -351,6 +337,10 @@ export declare type AppConfig = {
|
|
|
351
337
|
/** 最大缩放比例 */
|
|
352
338
|
max: number
|
|
353
339
|
}
|
|
340
|
+
/** 自适应缩放时的最小比例,避免超大地图缩太小 */
|
|
341
|
+
fitMinScale: number
|
|
342
|
+
/** 自适应缩放时的最大比例,避免超小地图放太大 */
|
|
343
|
+
fitMaxScale: number
|
|
354
344
|
/** 是否启用双击缩放功能 */
|
|
355
345
|
enableDoubleTapZoom: boolean
|
|
356
346
|
}
|
|
@@ -384,59 +374,6 @@ export declare type AppConfig = {
|
|
|
384
374
|
}
|
|
385
375
|
}
|
|
386
376
|
|
|
387
|
-
/**
|
|
388
|
-
* AppContainer 同时作为应用的主容器和层级管理器
|
|
389
|
-
* 管理所有地图相关的层级和组件
|
|
390
|
-
*/
|
|
391
|
-
declare class AppContainer extends Container {
|
|
392
|
-
private layers;
|
|
393
|
-
constructor();
|
|
394
|
-
/**
|
|
395
|
-
* 初始化所有预定义的层级
|
|
396
|
-
*/
|
|
397
|
-
private initializeLayers;
|
|
398
|
-
/**
|
|
399
|
-
* 获取指定名称的层容器
|
|
400
|
-
* @param name 层名称
|
|
401
|
-
* @returns 对应的容器,如果不存在则返回undefined
|
|
402
|
-
*/
|
|
403
|
-
getLayer(name: LayerName): Container | undefined;
|
|
404
|
-
/**
|
|
405
|
-
* 向指定层添加元素
|
|
406
|
-
* @param name 层名称
|
|
407
|
-
* @param element 要添加的元素
|
|
408
|
-
* @param zIndex 可选的元素z索引
|
|
409
|
-
* @returns 是否添加成功
|
|
410
|
-
*/
|
|
411
|
-
addToLayer(name: LayerName, element: Container, zIndex?: number): boolean;
|
|
412
|
-
/**
|
|
413
|
-
* 从指定层移除元素
|
|
414
|
-
* @param name 层名称
|
|
415
|
-
* @param element 要移除的元素
|
|
416
|
-
* @returns 是否移除成功
|
|
417
|
-
*/
|
|
418
|
-
removeFromLayer(name: LayerName, element: Container): boolean;
|
|
419
|
-
/**
|
|
420
|
-
* 清空指定层的所有内容
|
|
421
|
-
* @param name 层名称
|
|
422
|
-
* @returns 是否清空成功
|
|
423
|
-
*/
|
|
424
|
-
clearLayer(name: LayerName): boolean;
|
|
425
|
-
/**
|
|
426
|
-
* 设置指定层的可见性
|
|
427
|
-
* @param name 层名称
|
|
428
|
-
* @param visible 是否可见
|
|
429
|
-
* @returns 是否设置成功
|
|
430
|
-
*/
|
|
431
|
-
setLayerVisibility(name: LayerName, visible: boolean): boolean;
|
|
432
|
-
/**
|
|
433
|
-
* 获取指定层的可见性
|
|
434
|
-
* @param name 层名称
|
|
435
|
-
* @returns 层的可见性状态,不存在则返回false
|
|
436
|
-
*/
|
|
437
|
-
getLayerVisibility(name: LayerName): boolean;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
377
|
/**
|
|
441
378
|
* 应用上下文管理 - 基于 React Context 思想
|
|
442
379
|
* 通过组件树的层级关系来传播上下文,每个组件都能自动获取到最近的 Provider 提供的值
|
|
@@ -498,7 +435,7 @@ export declare type AppOptions = {
|
|
|
498
435
|
declare class AppService {
|
|
499
436
|
getApp(): MapApplication;
|
|
500
437
|
getConfig(): AppConfig;
|
|
501
|
-
getRoomData(roomId: number):
|
|
438
|
+
getRoomData(roomId: number): RoomData | undefined;
|
|
502
439
|
/**
|
|
503
440
|
* 将米转换为像素(委托给 MapApplication)
|
|
504
441
|
*/
|
|
@@ -508,7 +445,7 @@ declare class AppService {
|
|
|
508
445
|
*/
|
|
509
446
|
pixelsToMeters(pixels: number): number;
|
|
510
447
|
get ticker(): Ticker;
|
|
511
|
-
get mapState():
|
|
448
|
+
get mapState(): MapState | null;
|
|
512
449
|
get gloalConfig(): {
|
|
513
450
|
containerTop: string;
|
|
514
451
|
containerLeft: string;
|
|
@@ -642,7 +579,7 @@ declare class AppService {
|
|
|
642
579
|
offsetX: number;
|
|
643
580
|
offsetY: number;
|
|
644
581
|
};
|
|
645
|
-
} &
|
|
582
|
+
} & RingConfig;
|
|
646
583
|
get chargingStationConfig(): {
|
|
647
584
|
icon: {
|
|
648
585
|
sizeFixed: boolean;
|
|
@@ -651,16 +588,18 @@ declare class AppService {
|
|
|
651
588
|
src: string;
|
|
652
589
|
};
|
|
653
590
|
rotationCorrection: number;
|
|
654
|
-
} &
|
|
591
|
+
} & RingConfig;
|
|
655
592
|
get interactionConfig(): {
|
|
656
593
|
zoomRange: {
|
|
657
594
|
min: number;
|
|
658
595
|
max: number;
|
|
659
596
|
};
|
|
597
|
+
fitMinScale: number;
|
|
598
|
+
fitMaxScale: number;
|
|
660
599
|
enableDoubleTapZoom: boolean;
|
|
661
600
|
};
|
|
662
|
-
get controlsConfig():
|
|
663
|
-
get dividerConfig():
|
|
601
|
+
get controlsConfig(): ControlsConfig;
|
|
602
|
+
get dividerConfig(): DividerConfig;
|
|
664
603
|
get detectedObjectConfig(): {
|
|
665
604
|
height: number;
|
|
666
605
|
width: number;
|
|
@@ -672,17 +611,17 @@ declare class AppService {
|
|
|
672
611
|
antialias: boolean;
|
|
673
612
|
resolution: number;
|
|
674
613
|
};
|
|
675
|
-
get appContainer():
|
|
676
|
-
get interaction():
|
|
677
|
-
get viewportContainer():
|
|
678
|
-
get mapManager():
|
|
679
|
-
get pathManager():
|
|
680
|
-
get heatmapManager():
|
|
681
|
-
get controlsManager():
|
|
682
|
-
get detectedObjectManager():
|
|
683
|
-
get customElementsManager():
|
|
684
|
-
get roomsManager():
|
|
685
|
-
get runtime():
|
|
614
|
+
get appContainer(): AppContainer;
|
|
615
|
+
get interaction(): Interaction;
|
|
616
|
+
get viewportContainer(): ViewportContainer;
|
|
617
|
+
get mapManager(): MapManager;
|
|
618
|
+
get pathManager(): PathManager;
|
|
619
|
+
get heatmapManager(): HeatmapManager;
|
|
620
|
+
get controlsManager(): ControlsManager;
|
|
621
|
+
get detectedObjectManager(): DetectedObjectManager;
|
|
622
|
+
get customElementsManager(): CustomElementsManager;
|
|
623
|
+
get roomsManager(): RoomManager;
|
|
624
|
+
get runtime(): RuntimeConfig;
|
|
686
625
|
get runtimeSnapshot(): {
|
|
687
626
|
readonly dividingRoomId: number | null | undefined;
|
|
688
627
|
readonly enableRoomSelection: boolean;
|
|
@@ -705,29 +644,28 @@ declare class AppService {
|
|
|
705
644
|
readonly showRobotRing: boolean;
|
|
706
645
|
readonly showRobotSleepAnimation: boolean;
|
|
707
646
|
};
|
|
708
|
-
get events():
|
|
647
|
+
get events(): MapCallbacks | undefined;
|
|
709
648
|
get baseScale(): number;
|
|
710
649
|
get currentScale(): number;
|
|
711
650
|
get emitter(): Emitter< {
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
};
|
|
651
|
+
antiScale: number;
|
|
652
|
+
gestureHijackStart: FederatedPointerEvent;
|
|
653
|
+
gestureHijackPointerMove: FederatedPointerEvent;
|
|
654
|
+
gestureHijackPointerUp: FederatedPointerEvent;
|
|
655
|
+
gestureHijackCancel: void;
|
|
656
|
+
robotPositionUpdate: {
|
|
657
|
+
x: number;
|
|
658
|
+
y: number;
|
|
659
|
+
pathType?: string;
|
|
660
|
+
};
|
|
661
|
+
robotAnimationComplete: void;
|
|
662
|
+
pathSegmentComplete: {
|
|
663
|
+
fromX: number;
|
|
664
|
+
fromY: number;
|
|
665
|
+
toX: number;
|
|
666
|
+
toY: number;
|
|
667
|
+
pathType?: string;
|
|
668
|
+
};
|
|
731
669
|
}>;
|
|
732
670
|
}
|
|
733
671
|
|
|
@@ -765,74 +703,12 @@ export declare type Bounds = {
|
|
|
765
703
|
maxY: number
|
|
766
704
|
}
|
|
767
705
|
|
|
768
|
-
declare class Carpet extends Container {
|
|
769
|
-
private carpetSprite;
|
|
770
|
-
private carpetMask;
|
|
771
|
-
constructor();
|
|
772
|
-
/**
|
|
773
|
-
* 创建地毯纹理覆盖(栅格数据)
|
|
774
|
-
* @param carpetPixels 地毯像素数据
|
|
775
|
-
* @param mapWidth 地图宽度
|
|
776
|
-
*/
|
|
777
|
-
createCarpetFromRasterData(carpetPixels: Uint32Array, mapWidth: number): Promise<void>;
|
|
778
|
-
/**
|
|
779
|
-
* 创建地毯的Graphics作为mask
|
|
780
|
-
* @param carpetPixels 地毯像素数据
|
|
781
|
-
* @param mapWidth 地图宽度
|
|
782
|
-
* @returns Graphics对象
|
|
783
|
-
*/
|
|
784
|
-
private createCarpetGraphics;
|
|
785
|
-
/**
|
|
786
|
-
* 清除地毯
|
|
787
|
-
*/
|
|
788
|
-
clearCarpet(): void;
|
|
789
|
-
/**
|
|
790
|
-
* 创建地毯纹理覆盖(结构化数据)
|
|
791
|
-
* @param carpetData 结构化地毯数据数组
|
|
792
|
-
*/
|
|
793
|
-
createCarpetFromStructuredData(carpetData: Array<{
|
|
794
|
-
coordinates: number[];
|
|
795
|
-
}>): Promise<void>;
|
|
796
|
-
/**
|
|
797
|
-
* 创建地毯的Graphics作为mask(结构化数据)
|
|
798
|
-
* @param carpetData 结构化地毯数据数组
|
|
799
|
-
* @returns Graphics对象
|
|
800
|
-
*/
|
|
801
|
-
private createCarpetGraphicsFromStructuredData;
|
|
802
|
-
/**
|
|
803
|
-
* 销毁时清理资源
|
|
804
|
-
*/
|
|
805
|
-
destroy(): void;
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
declare class ChargingStation extends Container {
|
|
809
|
-
chargingStation: ChargingStationIcon;
|
|
810
|
-
ring: Ring;
|
|
811
|
-
private unsubscribeFns;
|
|
812
|
-
constructor();
|
|
813
|
-
draw({ x, y, rotation }: IconPoint): Promise<void>;
|
|
814
|
-
destroy(): void;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
declare class ChargingStationIcon extends EnhancedSprite {
|
|
818
|
-
constructor();
|
|
819
|
-
initializeSprite(): Promise<void>;
|
|
820
|
-
draw({ x, y, rotation }: IconPoint): Promise<void>;
|
|
821
|
-
}
|
|
822
|
-
|
|
823
706
|
/** 组件属性类型 */
|
|
824
707
|
export declare type ComponentPropsApp = {
|
|
825
708
|
/** 地图应用实例 */
|
|
826
709
|
app: MapApplication
|
|
827
710
|
}
|
|
828
711
|
|
|
829
|
-
/** 组件类型定义 */
|
|
830
|
-
declare type Components = {
|
|
831
|
-
viewportContainer: ViewportContainer;
|
|
832
|
-
appContainer: AppContainer;
|
|
833
|
-
interaction: Interaction;
|
|
834
|
-
};
|
|
835
|
-
|
|
836
712
|
/**
|
|
837
713
|
* 控制元素配置
|
|
838
714
|
*/
|
|
@@ -877,177 +753,6 @@ export declare type ControlsConfig = {
|
|
|
877
753
|
spot: SpotConfig
|
|
878
754
|
}
|
|
879
755
|
|
|
880
|
-
declare class ControlsManager {
|
|
881
|
-
private forbiddenSweepZoneMap;
|
|
882
|
-
private forbiddenMopZoneMap;
|
|
883
|
-
private cleanZoneMap;
|
|
884
|
-
private virtualWallMap;
|
|
885
|
-
private spotMap;
|
|
886
|
-
private divider;
|
|
887
|
-
private unsubscribeFns;
|
|
888
|
-
constructor();
|
|
889
|
-
/**
|
|
890
|
-
* 根据地图原点更新所有区域位置
|
|
891
|
-
*/
|
|
892
|
-
updatePositionByOrigin(x: number, y: number): void;
|
|
893
|
-
/**
|
|
894
|
-
* 绘制扫地禁区
|
|
895
|
-
*/
|
|
896
|
-
drawForbiddenSweepZones(zones: ZoneParam[]): void;
|
|
897
|
-
/**
|
|
898
|
-
* 获取所有扫地禁区数据
|
|
899
|
-
*/
|
|
900
|
-
getForbiddenSweepZones(): ZoneParam[];
|
|
901
|
-
/**
|
|
902
|
-
* 清除所有扫地禁区
|
|
903
|
-
*/
|
|
904
|
-
clearAllForbiddenSweepZones(): void;
|
|
905
|
-
/**
|
|
906
|
-
* 绘制拖地禁区
|
|
907
|
-
*/
|
|
908
|
-
drawForbiddenMopZones(zones: ZoneParam[]): void;
|
|
909
|
-
/**
|
|
910
|
-
* 获取所有拖地禁区数据
|
|
911
|
-
*/
|
|
912
|
-
getForbiddenMopZones(): ZoneParam[];
|
|
913
|
-
/**
|
|
914
|
-
* 清除所有拖地禁区
|
|
915
|
-
*/
|
|
916
|
-
clearAllForbiddenMopZones(): void;
|
|
917
|
-
/**
|
|
918
|
-
* 绘制清扫区域
|
|
919
|
-
*/
|
|
920
|
-
drawCleanZones(zones: ZoneParam[]): void;
|
|
921
|
-
/**
|
|
922
|
-
* 获取所有清扫区域数据
|
|
923
|
-
*/
|
|
924
|
-
getCleanZones(): ZoneParam[];
|
|
925
|
-
/**
|
|
926
|
-
* 清除所有清扫区域
|
|
927
|
-
*/
|
|
928
|
-
clearAllCleanZones(): void;
|
|
929
|
-
/**
|
|
930
|
-
* 绘制虚拟墙
|
|
931
|
-
*/
|
|
932
|
-
drawVirtualWalls(walls: VirtualWallParam[]): void;
|
|
933
|
-
/**
|
|
934
|
-
* 获取所有虚拟墙数据
|
|
935
|
-
*/
|
|
936
|
-
getVirtualWalls(): VirtualWallParam[];
|
|
937
|
-
/**
|
|
938
|
-
* 清除所有虚拟墙
|
|
939
|
-
*/
|
|
940
|
-
clearAllVirtualWalls(): void;
|
|
941
|
-
/**
|
|
942
|
-
* 绘制定点清扫
|
|
943
|
-
*/
|
|
944
|
-
drawSpots(spots: SpotParam[]): void;
|
|
945
|
-
/**
|
|
946
|
-
* 获取所有定点清扫数据
|
|
947
|
-
*/
|
|
948
|
-
getSpots(): SpotParam[];
|
|
949
|
-
/**
|
|
950
|
-
* 清除所有定点清扫
|
|
951
|
-
*/
|
|
952
|
-
clearAllSpots(): void;
|
|
953
|
-
/**
|
|
954
|
-
* 通用的绘制区域方法
|
|
955
|
-
*/
|
|
956
|
-
private drawZones;
|
|
957
|
-
/**
|
|
958
|
-
* 添加新区域到 LAYER_CONTROLS
|
|
959
|
-
*/
|
|
960
|
-
private addNewZone;
|
|
961
|
-
/**
|
|
962
|
-
* 移除区域
|
|
963
|
-
*/
|
|
964
|
-
private removeZone;
|
|
965
|
-
/**
|
|
966
|
-
* 获取区域数据
|
|
967
|
-
*/
|
|
968
|
-
private getZonesData;
|
|
969
|
-
/**
|
|
970
|
-
* 清除所有区域
|
|
971
|
-
*/
|
|
972
|
-
private clearAllZones;
|
|
973
|
-
/**
|
|
974
|
-
* 更新区域编辑状态
|
|
975
|
-
*/
|
|
976
|
-
private updateZonesEditState;
|
|
977
|
-
/**
|
|
978
|
-
* 更新虚拟墙编辑状态
|
|
979
|
-
*/
|
|
980
|
-
private updateVirtualWallsEditState;
|
|
981
|
-
/**
|
|
982
|
-
* 比较两个区域数据是否相等
|
|
983
|
-
*/
|
|
984
|
-
private isZoneDataEqual;
|
|
985
|
-
/**
|
|
986
|
-
* 获取虚拟墙数据
|
|
987
|
-
*/
|
|
988
|
-
private getWallsData;
|
|
989
|
-
/**
|
|
990
|
-
* 清除所有虚拟墙
|
|
991
|
-
*/
|
|
992
|
-
private clearAllWalls;
|
|
993
|
-
/**
|
|
994
|
-
* 比较两个虚拟墙是否相同
|
|
995
|
-
*/
|
|
996
|
-
private isWallDataEqual;
|
|
997
|
-
/**
|
|
998
|
-
* 添加新定点清扫到 LAYER_CONTROLS
|
|
999
|
-
*/
|
|
1000
|
-
private addNewSpot;
|
|
1001
|
-
/**
|
|
1002
|
-
* 移除定点清扫
|
|
1003
|
-
*/
|
|
1004
|
-
private removeSpot;
|
|
1005
|
-
/**
|
|
1006
|
-
* 获取定点清扫数据
|
|
1007
|
-
*/
|
|
1008
|
-
private getSpotsData;
|
|
1009
|
-
/**
|
|
1010
|
-
* 清除所有定点清扫
|
|
1011
|
-
*/
|
|
1012
|
-
private clearAllSpotsInternal;
|
|
1013
|
-
/**
|
|
1014
|
-
* 更新定点清扫编辑状态
|
|
1015
|
-
*/
|
|
1016
|
-
private updateSpotsEditState;
|
|
1017
|
-
/**
|
|
1018
|
-
* 比较两个定点清扫数据是否相等
|
|
1019
|
-
*/
|
|
1020
|
-
private isSpotDataEqual;
|
|
1021
|
-
/**
|
|
1022
|
-
* 处理分割房间ID变化
|
|
1023
|
-
*/
|
|
1024
|
-
private handleDividingRoomIdChange;
|
|
1025
|
-
/**
|
|
1026
|
-
* 获取房间几何信息
|
|
1027
|
-
*/
|
|
1028
|
-
private getRoomGeometry;
|
|
1029
|
-
/**
|
|
1030
|
-
* 创建默认分割线
|
|
1031
|
-
*/
|
|
1032
|
-
private createDefaultDivider;
|
|
1033
|
-
/**
|
|
1034
|
-
* 清除分割线
|
|
1035
|
-
*/
|
|
1036
|
-
private clearDivider;
|
|
1037
|
-
/**
|
|
1038
|
-
* 获取分割线数据
|
|
1039
|
-
*/
|
|
1040
|
-
getDividerEndPoints(): Point[] | null;
|
|
1041
|
-
/**
|
|
1042
|
-
* 获取分割线有效端点
|
|
1043
|
-
*/
|
|
1044
|
-
getEffectiveDividerPoints(): Point[] | null;
|
|
1045
|
-
/**
|
|
1046
|
-
* 销毁管理器
|
|
1047
|
-
*/
|
|
1048
|
-
destroy(): void;
|
|
1049
|
-
}
|
|
1050
|
-
|
|
1051
756
|
/**
|
|
1052
757
|
* 自定义元素参数
|
|
1053
758
|
*/
|
|
@@ -1056,61 +761,6 @@ export declare type CustomElementParam =
|
|
|
1056
761
|
| GifCustomElementParam
|
|
1057
762
|
| HtmlCustomElementParam
|
|
1058
763
|
|
|
1059
|
-
declare class CustomElementsManager {
|
|
1060
|
-
private customElementsMap;
|
|
1061
|
-
private gifTicker;
|
|
1062
|
-
private gifElements;
|
|
1063
|
-
constructor();
|
|
1064
|
-
/**
|
|
1065
|
-
* 根据地图原点更新所有自定义元素位置
|
|
1066
|
-
*/
|
|
1067
|
-
updatePositionByOrigin(x: number, y: number): void;
|
|
1068
|
-
/**
|
|
1069
|
-
* 绘制自定义元素
|
|
1070
|
-
*/
|
|
1071
|
-
drawCustomElements(elements: CustomElementParam[]): Promise<void>;
|
|
1072
|
-
/**
|
|
1073
|
-
* 清除所有自定义元素
|
|
1074
|
-
*/
|
|
1075
|
-
clearAllCustomElements(): void;
|
|
1076
|
-
/**
|
|
1077
|
-
* 添加新的自定义元素
|
|
1078
|
-
*/
|
|
1079
|
-
private addNewCustomElement;
|
|
1080
|
-
/**
|
|
1081
|
-
* 移除自定义元素
|
|
1082
|
-
*/
|
|
1083
|
-
private removeCustomElement;
|
|
1084
|
-
/**
|
|
1085
|
-
* 检查数据是否相同(类型安全的辅助方法)
|
|
1086
|
-
*/
|
|
1087
|
-
private isSameData;
|
|
1088
|
-
/**
|
|
1089
|
-
* 更新元素数据(类型安全的辅助方法)
|
|
1090
|
-
*/
|
|
1091
|
-
private updateElementData;
|
|
1092
|
-
/**
|
|
1093
|
-
* 更新 GIF Ticker 状态
|
|
1094
|
-
*/
|
|
1095
|
-
private updateGifTicker;
|
|
1096
|
-
/**
|
|
1097
|
-
* 启动 GIF Ticker
|
|
1098
|
-
*/
|
|
1099
|
-
private startGifTicker;
|
|
1100
|
-
/**
|
|
1101
|
-
* 停止 GIF Ticker
|
|
1102
|
-
*/
|
|
1103
|
-
private stopGifTicker;
|
|
1104
|
-
/**
|
|
1105
|
-
* 渲染 GIF 容器
|
|
1106
|
-
*/
|
|
1107
|
-
private renderGifContainer;
|
|
1108
|
-
/**
|
|
1109
|
-
* 销毁管理器
|
|
1110
|
-
*/
|
|
1111
|
-
destroy(): void;
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
764
|
/**
|
|
1115
765
|
* 解析结构化协议的地图房间属性
|
|
1116
766
|
* @param map 地图数据
|
|
@@ -1136,34 +786,6 @@ export declare type DeepPartialAppConfig = DeepPartial<AppConfig>
|
|
|
1136
786
|
/** 深度可选的运行时配置类型 */
|
|
1137
787
|
export declare type DeepPartialRuntimeConfig = DeepPartial<RuntimeConfig>
|
|
1138
788
|
|
|
1139
|
-
declare class DetectedObjectManager {
|
|
1140
|
-
private detectedObjectMap;
|
|
1141
|
-
/**
|
|
1142
|
-
* 根据地图原点更新所有检测物体位置
|
|
1143
|
-
*/
|
|
1144
|
-
updatePositionByOrigin(x: number, y: number): void;
|
|
1145
|
-
/**
|
|
1146
|
-
* 绘制检测物体
|
|
1147
|
-
*/
|
|
1148
|
-
drawDetectedObjects(objects: DetectedObjectParam[]): Promise<void>;
|
|
1149
|
-
/**
|
|
1150
|
-
* 清除所有检测物体
|
|
1151
|
-
*/
|
|
1152
|
-
clearAllDetectedObjects(): void;
|
|
1153
|
-
/**
|
|
1154
|
-
* 添加新的检测物体
|
|
1155
|
-
*/
|
|
1156
|
-
private addNewDetectedObject;
|
|
1157
|
-
/**
|
|
1158
|
-
* 移除检测物体
|
|
1159
|
-
*/
|
|
1160
|
-
private removeDetectedObject;
|
|
1161
|
-
/**
|
|
1162
|
-
* 销毁管理器
|
|
1163
|
-
*/
|
|
1164
|
-
destroy(): void;
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
789
|
/**
|
|
1168
790
|
* 检测物体参数
|
|
1169
791
|
*/
|
|
@@ -1213,222 +835,6 @@ export declare type DividerConfig = {
|
|
|
1213
835
|
defaultDirection: Direction
|
|
1214
836
|
}
|
|
1215
837
|
|
|
1216
|
-
/**
|
|
1217
|
-
* 固定大小动画精灵基类
|
|
1218
|
-
* 基于 EnhancedSprite 扩展,支持帧动画播放
|
|
1219
|
-
*
|
|
1220
|
-
* 两种模式:
|
|
1221
|
-
* 1. sizeFixed: true - 固定屏幕像素大小,不受地图缩放影响
|
|
1222
|
-
* 2. sizeFixed: false - 以地图scale=1为基准,跟随地图缩放
|
|
1223
|
-
*/
|
|
1224
|
-
declare class EnhancedAnimatedSprite extends AnimatedSprite {
|
|
1225
|
-
private throttledUpdateScale;
|
|
1226
|
-
private fixedWidth;
|
|
1227
|
-
private fixedHeight;
|
|
1228
|
-
private isFixedSizeSet;
|
|
1229
|
-
private sizeFixed;
|
|
1230
|
-
private baselineScale;
|
|
1231
|
-
private static animationTicker;
|
|
1232
|
-
private static animatedSprites;
|
|
1233
|
-
constructor(textures?: Texture[]);
|
|
1234
|
-
/**
|
|
1235
|
-
* 设置固定的屏幕像素大小
|
|
1236
|
-
* @param width 屏幕上显示的固定宽度(像素)
|
|
1237
|
-
* @param height 屏幕上显示的固定高度(像素)
|
|
1238
|
-
*/
|
|
1239
|
-
setFixedSize(width: number, height: number): void;
|
|
1240
|
-
/**
|
|
1241
|
-
* 设置是否启用固定大小模式
|
|
1242
|
-
* @param enabled 是否启用固定大小模式
|
|
1243
|
-
*/
|
|
1244
|
-
setSizeFixed(enabled: boolean): void;
|
|
1245
|
-
/**
|
|
1246
|
-
* 重写 width setter,确保使用固定大小逻辑
|
|
1247
|
-
*/
|
|
1248
|
-
set width(value: number);
|
|
1249
|
-
/**
|
|
1250
|
-
* 重写 height setter,确保使用固定大小逻辑
|
|
1251
|
-
*/
|
|
1252
|
-
set height(value: number);
|
|
1253
|
-
/**
|
|
1254
|
-
* 重写 width getter,返回固定宽度
|
|
1255
|
-
*/
|
|
1256
|
-
get width(): number;
|
|
1257
|
-
/**
|
|
1258
|
-
* 重写 height getter,返回固定高度
|
|
1259
|
-
*/
|
|
1260
|
-
get height(): number;
|
|
1261
|
-
/**
|
|
1262
|
-
* 注册缩放事件监听
|
|
1263
|
-
*/
|
|
1264
|
-
private registerScaleListener;
|
|
1265
|
-
/**
|
|
1266
|
-
* 应用大小(统一处理两种模式)
|
|
1267
|
-
*/
|
|
1268
|
-
private applySize;
|
|
1269
|
-
/**
|
|
1270
|
-
* 更新元素缩放,以保持正确大小
|
|
1271
|
-
*/
|
|
1272
|
-
protected updateScale(scale: number): void;
|
|
1273
|
-
/**
|
|
1274
|
-
* 静态方法:加载动画纹理
|
|
1275
|
-
* @param jsonSrc 动画JSON资源路径
|
|
1276
|
-
* @param framePrefix 帧名称前缀,例如 "sleep_"
|
|
1277
|
-
* @param frameCount 帧数量
|
|
1278
|
-
* @returns Promise<Texture[]> 纹理数组
|
|
1279
|
-
*/
|
|
1280
|
-
static loadAnimationTextures(jsonSrc: string, framePrefix?: string, frameCount?: number): Promise<Texture[]>;
|
|
1281
|
-
/**
|
|
1282
|
-
* 设置动画配置
|
|
1283
|
-
* @param iconConfig 图标配置
|
|
1284
|
-
*/
|
|
1285
|
-
setupAnimation(iconConfig: IconConfig): void;
|
|
1286
|
-
/**
|
|
1287
|
-
* 通用绘制方法
|
|
1288
|
-
* @param params 绘制参数
|
|
1289
|
-
* @param visibilityCondition 可选的可见性条件函数
|
|
1290
|
-
*/
|
|
1291
|
-
draw(params: IconPoint, visibilityCondition?: () => boolean): void;
|
|
1292
|
-
/**
|
|
1293
|
-
* 开始播放动画
|
|
1294
|
-
*/
|
|
1295
|
-
play(): void;
|
|
1296
|
-
/**
|
|
1297
|
-
* 停止播放动画
|
|
1298
|
-
*/
|
|
1299
|
-
stop(): void;
|
|
1300
|
-
/**
|
|
1301
|
-
* 重写 textures setter,在设置新纹理后重新应用固定大小
|
|
1302
|
-
*/
|
|
1303
|
-
set textures(value: Texture[]);
|
|
1304
|
-
/**
|
|
1305
|
-
* 重写 textures getter
|
|
1306
|
-
*/
|
|
1307
|
-
get textures(): Texture[];
|
|
1308
|
-
/**
|
|
1309
|
-
* 启动动画 Ticker
|
|
1310
|
-
*/
|
|
1311
|
-
private static startAnimationTicker;
|
|
1312
|
-
/**
|
|
1313
|
-
* 更新动画 Ticker 状态
|
|
1314
|
-
*/
|
|
1315
|
-
private static updateAnimationTicker;
|
|
1316
|
-
/**
|
|
1317
|
-
* 停止动画 Ticker
|
|
1318
|
-
*/
|
|
1319
|
-
private static stopAnimationTicker;
|
|
1320
|
-
/**
|
|
1321
|
-
* 更新所有动画
|
|
1322
|
-
*/
|
|
1323
|
-
private static updateAnimations;
|
|
1324
|
-
/**
|
|
1325
|
-
* 组件销毁时清理资源
|
|
1326
|
-
*/
|
|
1327
|
-
destroy(options?: {
|
|
1328
|
-
children?: boolean;
|
|
1329
|
-
texture?: boolean;
|
|
1330
|
-
baseTexture?: boolean;
|
|
1331
|
-
}): void;
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
/**
|
|
1335
|
-
* 固定大小精灵基类
|
|
1336
|
-
* 用于创建在地图缩放时保持固定视觉大小的精灵元素
|
|
1337
|
-
*
|
|
1338
|
-
* 两种模式:
|
|
1339
|
-
* 1. sizeFixed: true - 固定屏幕像素大小,不受地图缩放影响
|
|
1340
|
-
* 2. sizeFixed: false - 以地图scale=1为基准,跟随地图缩放
|
|
1341
|
-
*/
|
|
1342
|
-
declare class EnhancedSprite extends Sprite {
|
|
1343
|
-
private throttledUpdateScale;
|
|
1344
|
-
private fixedWidth;
|
|
1345
|
-
private fixedHeight;
|
|
1346
|
-
private isFixedSizeSet;
|
|
1347
|
-
private sizeFixed;
|
|
1348
|
-
private baselineScale;
|
|
1349
|
-
constructor(texture?: Texture);
|
|
1350
|
-
/**
|
|
1351
|
-
* 设置固定的屏幕像素大小
|
|
1352
|
-
* @param width 屏幕上显示的固定宽度(像素)
|
|
1353
|
-
* @param height 屏幕上显示的固定高度(像素)
|
|
1354
|
-
*/
|
|
1355
|
-
setFixedSize(width: number, height: number): void;
|
|
1356
|
-
/**
|
|
1357
|
-
* 设置是否启用固定大小模式
|
|
1358
|
-
* @param enabled 是否启用固定大小模式
|
|
1359
|
-
*/
|
|
1360
|
-
setSizeFixed(enabled: boolean): void;
|
|
1361
|
-
/**
|
|
1362
|
-
* 重写 width setter,确保使用固定大小逻辑
|
|
1363
|
-
*/
|
|
1364
|
-
set width(value: number);
|
|
1365
|
-
/**
|
|
1366
|
-
* 重写 height setter,确保使用固定大小逻辑
|
|
1367
|
-
*/
|
|
1368
|
-
set height(value: number);
|
|
1369
|
-
/**
|
|
1370
|
-
* 重写 width getter,返回固定宽度
|
|
1371
|
-
*/
|
|
1372
|
-
get width(): number;
|
|
1373
|
-
/**
|
|
1374
|
-
* 重写 height getter,返回固定高度
|
|
1375
|
-
*/
|
|
1376
|
-
get height(): number;
|
|
1377
|
-
/**
|
|
1378
|
-
* 注册缩放事件监听
|
|
1379
|
-
*/
|
|
1380
|
-
private registerScaleListener;
|
|
1381
|
-
/**
|
|
1382
|
-
* 应用大小(统一处理两种模式)
|
|
1383
|
-
*/
|
|
1384
|
-
private applySize;
|
|
1385
|
-
/**
|
|
1386
|
-
* 更新元素缩放,以保持正确大小
|
|
1387
|
-
*/
|
|
1388
|
-
protected updateScale(scale: number): void;
|
|
1389
|
-
/**
|
|
1390
|
-
* 异步加载纹理并设置大小
|
|
1391
|
-
* @param assetKey 资源键名 或 资源src
|
|
1392
|
-
* @param iconConfig 图标配置(需要包含sizeFixed属性)
|
|
1393
|
-
*/
|
|
1394
|
-
loadTextureAndSetSize(src: string, iconConfig: IconConfig): Promise<void>;
|
|
1395
|
-
/**
|
|
1396
|
-
* 通用绘制方法
|
|
1397
|
-
* @param params 绘制参数
|
|
1398
|
-
* @param visibilityCondition 可选的可见性条件函数
|
|
1399
|
-
*/
|
|
1400
|
-
draw(params: IconPoint, visibilityCondition?: () => boolean): void;
|
|
1401
|
-
/**
|
|
1402
|
-
* 重写 texture setter,在设置新纹理后重新应用固定大小
|
|
1403
|
-
*/
|
|
1404
|
-
set texture(value: Texture);
|
|
1405
|
-
/**
|
|
1406
|
-
* 重写 texture getter
|
|
1407
|
-
*/
|
|
1408
|
-
get texture(): Texture;
|
|
1409
|
-
/**
|
|
1410
|
-
* 组件销毁时清理资源
|
|
1411
|
-
*/
|
|
1412
|
-
destroy(options?: {
|
|
1413
|
-
children?: boolean;
|
|
1414
|
-
texture?: boolean;
|
|
1415
|
-
baseTexture?: boolean;
|
|
1416
|
-
}): void;
|
|
1417
|
-
}
|
|
1418
|
-
|
|
1419
|
-
declare class Free extends Graphics {
|
|
1420
|
-
private cacheAsTextureHandler;
|
|
1421
|
-
constructor();
|
|
1422
|
-
/**
|
|
1423
|
-
* 绘制结构化自由区域数据
|
|
1424
|
-
* @param free 自由区域数据数组
|
|
1425
|
-
*/
|
|
1426
|
-
draw(free: {
|
|
1427
|
-
coordinates: number[];
|
|
1428
|
-
}[]): void;
|
|
1429
|
-
destroy(options?: DestroyOptions | boolean): void;
|
|
1430
|
-
}
|
|
1431
|
-
|
|
1432
838
|
/**
|
|
1433
839
|
* GIF 类型自定义元素参数
|
|
1434
840
|
* 保持现有逻辑
|
|
@@ -1444,84 +850,6 @@ export declare type GifCustomElementParam = BaseCustomElementParam & {
|
|
|
1444
850
|
height: number
|
|
1445
851
|
}
|
|
1446
852
|
|
|
1447
|
-
declare class Heatmap extends Container {
|
|
1448
|
-
colorGradients: Array<string>;
|
|
1449
|
-
cellSize: number;
|
|
1450
|
-
constructor();
|
|
1451
|
-
/**
|
|
1452
|
-
* 绘制热力图
|
|
1453
|
-
* @param grid 处理好的热力数据 每个网格的信号强度 和 坐标
|
|
1454
|
-
* @param useGradient 是否使用渐变绘制
|
|
1455
|
-
*/
|
|
1456
|
-
draw(grid: Array<Array<{
|
|
1457
|
-
x: number;
|
|
1458
|
-
y: number;
|
|
1459
|
-
signal: number;
|
|
1460
|
-
hasPoint: boolean;
|
|
1461
|
-
}>>, useGradient?: boolean, heatmapAlpha?: number): void;
|
|
1462
|
-
/**
|
|
1463
|
-
* 裁剪热力图 仅显示房间区域
|
|
1464
|
-
* 根据roomFill图层的子元素 组合Graphics生成大Graphics裁剪
|
|
1465
|
-
* @param heatmap 热力图mesh
|
|
1466
|
-
*/
|
|
1467
|
-
private croppingHeatmap;
|
|
1468
|
-
/**
|
|
1469
|
-
* 网格绘制热力图 我网格模式
|
|
1470
|
-
* @param grid 处理好的热力数据 每个网格的信号强度 和 坐标
|
|
1471
|
-
* @returns 网格热力图mesh
|
|
1472
|
-
*/
|
|
1473
|
-
private gridDrawing;
|
|
1474
|
-
/**
|
|
1475
|
-
* 渐变绘制热力图
|
|
1476
|
-
* @param grid 处理好的热力数据 每个网格的信号强度 和 坐标
|
|
1477
|
-
* @returns 渐变热力图mesh
|
|
1478
|
-
*/
|
|
1479
|
-
private gradientDrawing;
|
|
1480
|
-
/**
|
|
1481
|
-
* 关闭纹理缓存
|
|
1482
|
-
*/
|
|
1483
|
-
closeCacheAsTexture(): void;
|
|
1484
|
-
}
|
|
1485
|
-
|
|
1486
|
-
declare class HeatmapManager {
|
|
1487
|
-
heatmap: Heatmap;
|
|
1488
|
-
pointsTopLeftOrigin: HeatmapPoint[];
|
|
1489
|
-
signalGrid: Array<Array<{
|
|
1490
|
-
x: number;
|
|
1491
|
-
y: number;
|
|
1492
|
-
signal: number;
|
|
1493
|
-
hasPoint: boolean;
|
|
1494
|
-
}>>;
|
|
1495
|
-
cellSize: number;
|
|
1496
|
-
maxDistance: number;
|
|
1497
|
-
smoothIterations: number;
|
|
1498
|
-
heatmapAlpha: number;
|
|
1499
|
-
constructor();
|
|
1500
|
-
/**
|
|
1501
|
-
* 绘制热力图
|
|
1502
|
-
* @param mapData 地图数据
|
|
1503
|
-
* @param heatmapPoints 热力图点
|
|
1504
|
-
* @param useGradient 是否使用渐变绘制
|
|
1505
|
-
* @returns
|
|
1506
|
-
*/
|
|
1507
|
-
draw({ mapData, heatmapPoints, useGradient, }: {
|
|
1508
|
-
mapData: MapDataSource;
|
|
1509
|
-
heatmapPoints: HeatmapPoint[];
|
|
1510
|
-
useGradient?: boolean;
|
|
1511
|
-
}): void;
|
|
1512
|
-
/**
|
|
1513
|
-
* 插值计算信号网格
|
|
1514
|
-
* @param pointsTopLeftOrigin 热力图路径点
|
|
1515
|
-
* @returns 信号网格
|
|
1516
|
-
*/
|
|
1517
|
-
calculateInterpolatedSignal(pointsTopLeftOrigin: HeatmapPoint[]): {
|
|
1518
|
-
x: number;
|
|
1519
|
-
y: number;
|
|
1520
|
-
signal: number;
|
|
1521
|
-
hasPoint: boolean;
|
|
1522
|
-
}[][];
|
|
1523
|
-
}
|
|
1524
|
-
|
|
1525
853
|
/** 热力图点 */
|
|
1526
854
|
export declare type HeatmapPoint = Point & {
|
|
1527
855
|
/** 信号强度 */
|
|
@@ -1537,195 +865,49 @@ export declare type HtmlCustomElementParam = BaseCustomElementParam & {
|
|
|
1537
865
|
type: 'html'
|
|
1538
866
|
/** HTML内容 */
|
|
1539
867
|
htmlContent: string
|
|
1540
|
-
/** 宽度 */
|
|
1541
|
-
width?: number
|
|
1542
|
-
/** 高度 */
|
|
1543
|
-
height?: number
|
|
1544
|
-
}
|
|
1545
|
-
|
|
1546
|
-
/** 图标配置 */
|
|
1547
|
-
export declare type IconConfig = IconSize & {
|
|
1548
|
-
/** 尺寸是否固定 */
|
|
1549
|
-
sizeFixed?: boolean
|
|
1550
|
-
}
|
|
1551
|
-
|
|
1552
|
-
/**
|
|
1553
|
-
* 图标坐标点
|
|
1554
|
-
* 包含位置和可选的旋转角度
|
|
1555
|
-
*/
|
|
1556
|
-
export declare type IconPoint = Point & {
|
|
1557
|
-
/** 旋转角度(度) */
|
|
1558
|
-
rotation?: number
|
|
1559
|
-
}
|
|
1560
|
-
|
|
1561
|
-
/** 图标尺寸 */
|
|
1562
|
-
export declare type IconSize = {
|
|
1563
|
-
/** 宽度 */
|
|
1564
|
-
width: number
|
|
1565
|
-
/** 高度 */
|
|
1566
|
-
height: number
|
|
1567
|
-
}
|
|
1568
|
-
|
|
1569
|
-
/**
|
|
1570
|
-
* Image 类型自定义元素参数
|
|
1571
|
-
* 保持现有逻辑
|
|
1572
|
-
*/
|
|
1573
|
-
export declare type ImageCustomElementParam = BaseCustomElementParam & {
|
|
1574
|
-
/** 元素类型 */
|
|
1575
|
-
type: 'image'
|
|
1576
|
-
/** 图片资源路径 */
|
|
1577
|
-
src: string
|
|
1578
|
-
/** 图片宽度(必需 - 图片需要明确尺寸) */
|
|
1579
|
-
width: number
|
|
1580
|
-
/** 图片高度(必需 - 图片需要明确尺寸) */
|
|
1581
|
-
height: number
|
|
1582
|
-
}
|
|
1583
|
-
|
|
1584
|
-
/* Excluded from this release type: InstanceEvents */
|
|
1585
|
-
|
|
1586
|
-
declare class Interaction extends Container {
|
|
1587
|
-
dragStart: {
|
|
1588
|
-
x: number;
|
|
1589
|
-
y: number;
|
|
1590
|
-
} | null;
|
|
1591
|
-
initialTouchDistance: number | null;
|
|
1592
|
-
initialScale: {
|
|
1593
|
-
x: number;
|
|
1594
|
-
y: number;
|
|
1595
|
-
} | null;
|
|
1596
|
-
activeTouches: Map<number, {
|
|
1597
|
-
x: number;
|
|
1598
|
-
y: number;
|
|
1599
|
-
}>;
|
|
1600
|
-
firstTouchId: number | null;
|
|
1601
|
-
secondTouchId: number | null;
|
|
1602
|
-
zoomFactor: number;
|
|
1603
|
-
scaleMin: number;
|
|
1604
|
-
scaleMax: number;
|
|
1605
|
-
originalPosition: {
|
|
1606
|
-
x: number;
|
|
1607
|
-
y: number;
|
|
1608
|
-
};
|
|
1609
|
-
targetPosition: {
|
|
1610
|
-
x: number;
|
|
1611
|
-
y: number;
|
|
1612
|
-
};
|
|
1613
|
-
centerPosition: {
|
|
1614
|
-
x: number;
|
|
1615
|
-
y: number;
|
|
1616
|
-
};
|
|
1617
|
-
originalScale: {
|
|
1618
|
-
x: number;
|
|
1619
|
-
y: number;
|
|
1620
|
-
};
|
|
1621
|
-
targetScale: {
|
|
1622
|
-
x: number;
|
|
1623
|
-
y: number;
|
|
1624
|
-
};
|
|
1625
|
-
defaultScale: {
|
|
1626
|
-
x: number;
|
|
1627
|
-
y: number;
|
|
1628
|
-
};
|
|
1629
|
-
transitionDuration: number;
|
|
1630
|
-
transitionStartTime: number | null;
|
|
1631
|
-
initialPinchCenter: Point | null;
|
|
1632
|
-
isGestureValid: boolean;
|
|
1633
|
-
lastTapTime: number;
|
|
1634
|
-
doubleTapDelay: number;
|
|
1635
|
-
doubleTapZoomFactor: number;
|
|
1636
|
-
lastTapPosition: Point | null;
|
|
1637
|
-
tapDistanceThreshold: number;
|
|
1638
|
-
tapDetectionEnabled: boolean;
|
|
1639
|
-
private isGestureHijacked;
|
|
1640
|
-
private hijackedPointerId;
|
|
1641
|
-
private isHijackPaused;
|
|
1642
|
-
private interactionGraphics;
|
|
1643
|
-
private viewportBounds;
|
|
1644
|
-
private boundResetAnimation;
|
|
1645
|
-
private debouncedStopWheelRender;
|
|
1646
|
-
private interactionState;
|
|
1647
|
-
private throttledAntiScale;
|
|
1648
|
-
constructor();
|
|
1649
|
-
setupInteraction(): void;
|
|
1650
|
-
resetPan(targetPosition: {
|
|
1651
|
-
x: number;
|
|
1652
|
-
y: number;
|
|
1653
|
-
}): void;
|
|
1654
|
-
/**
|
|
1655
|
-
* 设置地图的位置和缩放,可选择是否使用动画过渡
|
|
1656
|
-
* @param options 缩放和位置选项
|
|
1657
|
-
* @param animate 是否使用动画,默认为 true
|
|
1658
|
-
*/
|
|
1659
|
-
setPanZoom({ targetPosition, targetScale, setCenter, setScale, }?: {
|
|
1660
|
-
targetPosition?: {
|
|
1661
|
-
x: number;
|
|
1662
|
-
y: number;
|
|
1663
|
-
};
|
|
1664
|
-
targetScale?: {
|
|
1665
|
-
x: number;
|
|
1666
|
-
y: number;
|
|
1667
|
-
};
|
|
1668
|
-
setCenter?: boolean;
|
|
1669
|
-
setScale?: boolean;
|
|
1670
|
-
}, animate?: boolean): void;
|
|
1671
|
-
clearTouches(): void;
|
|
1672
|
-
/**
|
|
1673
|
-
* 检查事件监听器状态 - 调试用
|
|
1674
|
-
*/
|
|
1675
|
-
checkEventListeners(): {
|
|
1676
|
-
wheel: number;
|
|
1677
|
-
pointerdown: number;
|
|
1678
|
-
pointerup: number;
|
|
1679
|
-
pointerupoutside: number;
|
|
1680
|
-
pointermove: number;
|
|
1681
|
-
};
|
|
1682
|
-
/**
|
|
1683
|
-
* 销毁时清理事件监听
|
|
1684
|
-
*/
|
|
1685
|
-
destroy(): void;
|
|
1686
|
-
/**
|
|
1687
|
-
* 处理手势劫持
|
|
1688
|
-
*/
|
|
1689
|
-
private handleGestureHijacked;
|
|
1690
|
-
/**
|
|
1691
|
-
* 退出手势劫持模式
|
|
1692
|
-
*/
|
|
1693
|
-
private exitGestureHijacked;
|
|
1694
|
-
/**
|
|
1695
|
-
* 暂停手势劫持(双指模式)
|
|
1696
|
-
*/
|
|
1697
|
-
private pauseGestureHijack;
|
|
1698
|
-
/**
|
|
1699
|
-
* 恢复手势劫持(回到单指模式)
|
|
1700
|
-
*/
|
|
1701
|
-
private resumeGestureHijack;
|
|
1702
|
-
private antiScale;
|
|
1703
|
-
private resetAnimation;
|
|
1704
|
-
private onWheel;
|
|
1705
|
-
private onPointerDown;
|
|
1706
|
-
private onPointerUp;
|
|
1707
|
-
private detectDoubleTap;
|
|
1708
|
-
private handleDoubleTap;
|
|
1709
|
-
private onPointerMove;
|
|
1710
|
-
private applyPan;
|
|
1711
|
-
private applyPinchZoom;
|
|
1712
|
-
private setInitialScaleAndDistance;
|
|
868
|
+
/** 宽度 */
|
|
869
|
+
width?: number
|
|
870
|
+
/** 高度 */
|
|
871
|
+
height?: number
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
/** 图标配置 */
|
|
875
|
+
export declare type IconConfig = IconSize & {
|
|
876
|
+
/** 尺寸是否固定 */
|
|
877
|
+
sizeFixed?: boolean
|
|
1713
878
|
}
|
|
1714
879
|
|
|
1715
|
-
|
|
880
|
+
/**
|
|
881
|
+
* 图标坐标点
|
|
882
|
+
* 包含位置和可选的旋转角度
|
|
883
|
+
*/
|
|
884
|
+
export declare type IconPoint = Point & {
|
|
885
|
+
/** 旋转角度(度) */
|
|
886
|
+
rotation?: number
|
|
887
|
+
}
|
|
1716
888
|
|
|
1717
|
-
|
|
889
|
+
/** 图标尺寸 */
|
|
890
|
+
export declare type IconSize = {
|
|
891
|
+
/** 宽度 */
|
|
892
|
+
width: number
|
|
893
|
+
/** 高度 */
|
|
894
|
+
height: number
|
|
895
|
+
}
|
|
1718
896
|
|
|
1719
|
-
/**
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
897
|
+
/**
|
|
898
|
+
* Image 类型自定义元素参数
|
|
899
|
+
* 保持现有逻辑
|
|
900
|
+
*/
|
|
901
|
+
export declare type ImageCustomElementParam = BaseCustomElementParam & {
|
|
902
|
+
/** 元素类型 */
|
|
903
|
+
type: 'image'
|
|
904
|
+
/** 图片资源路径 */
|
|
905
|
+
src: string
|
|
906
|
+
/** 图片宽度(必需 - 图片需要明确尺寸) */
|
|
907
|
+
width: number
|
|
908
|
+
/** 图片高度(必需 - 图片需要明确尺寸) */
|
|
909
|
+
height: number
|
|
910
|
+
}
|
|
1729
911
|
|
|
1730
912
|
export declare const MAP_API_METHODS: readonly ["resetPanZoom", "getForbiddenSweepZones", "getForbiddenMopZones", "getCleanZones", "getVirtualWalls", "getSpots", "getViewportCenterPoint", "getMapCenterPoint", "getWallPointsByViewportCenter", "getForbiddenSweepZonePointsByViewportCenter", "getForbiddenMopZonePointsByViewportCenter", "getCleanZonePointsByViewportCenter", "getSpotPointByViewportCenter", "getEffectiveDividerPoints", "getDividerEndPoints", "snapshot", "snapshotByData"];
|
|
1731
913
|
|
|
@@ -2101,9 +1283,8 @@ export declare class MapApplication extends Application implements MapApi {
|
|
|
2101
1283
|
* 将地图适配到视图中,居中并缩放
|
|
2102
1284
|
* @param mapBounds 地图边界信息
|
|
2103
1285
|
* @param animate 是否使用动画过渡,默认为 false
|
|
2104
|
-
* @param shouldCache 是否缓存为纹理,默认为 true
|
|
2105
1286
|
*/
|
|
2106
|
-
fitMapToView(mapBounds: Bounds, animate?: boolean
|
|
1287
|
+
fitMapToView(mapBounds: Bounds, animate?: boolean): void;
|
|
2107
1288
|
/**
|
|
2108
1289
|
* 获取视口边界(供 Interaction 等组件使用)
|
|
2109
1290
|
*/
|
|
@@ -2597,70 +1778,6 @@ export declare type MapDataSource = {
|
|
|
2597
1778
|
version: string
|
|
2598
1779
|
}
|
|
2599
1780
|
|
|
2600
|
-
declare class MapManager {
|
|
2601
|
-
obstacle: Obstacle;
|
|
2602
|
-
free: Free;
|
|
2603
|
-
roomFill: RoomFill;
|
|
2604
|
-
carpet: Carpet;
|
|
2605
|
-
chargingStation: ChargingStation;
|
|
2606
|
-
mapBounds: Bounds;
|
|
2607
|
-
private lastMapId;
|
|
2608
|
-
private roomGeometryMap;
|
|
2609
|
-
private carpetData;
|
|
2610
|
-
private unsubscribeFns;
|
|
2611
|
-
constructor();
|
|
2612
|
-
/**
|
|
2613
|
-
* 处理结构化地图数据(房间形状、障碍物等)
|
|
2614
|
-
*/
|
|
2615
|
-
drawMap(mapData: MapDataSource): Promise<boolean>;
|
|
2616
|
-
/**
|
|
2617
|
-
* 处理栅格地图数据
|
|
2618
|
-
* @param mapPointsStr 栅格数据字符串
|
|
2619
|
-
* @param width 地图宽度
|
|
2620
|
-
* @param height 地图高度
|
|
2621
|
-
* @param charger 充电桩信息
|
|
2622
|
-
*/
|
|
2623
|
-
drawRasterMap(rasterData: ParsedRasterMapData_2, mapState: MapState): Promise<boolean>;
|
|
2624
|
-
/**
|
|
2625
|
-
* 重置几何数据和边界
|
|
2626
|
-
*/
|
|
2627
|
-
private resetGeometryData;
|
|
2628
|
-
/**
|
|
2629
|
-
* 更新地毯显示
|
|
2630
|
-
* 类似于RoomFloorType的模式,根据当前状态决定是否重建地毯
|
|
2631
|
-
*/
|
|
2632
|
-
private createCarpet;
|
|
2633
|
-
/**
|
|
2634
|
-
* 处理房间几何数据,计算所有需要的几何信息
|
|
2635
|
-
* 返回所有房间的几何数据(包括正常房间和未知房间)
|
|
2636
|
-
*/
|
|
2637
|
-
private processRoomsGeometry;
|
|
2638
|
-
/**
|
|
2639
|
-
* 合并所有图层的边界
|
|
2640
|
-
*/
|
|
2641
|
-
private mergeLayerBounds;
|
|
2642
|
-
/**
|
|
2643
|
-
* 根据ID查找房间几何信息
|
|
2644
|
-
*/
|
|
2645
|
-
getRoomById(id: number): Room | undefined;
|
|
2646
|
-
/**
|
|
2647
|
-
* 清空地图组件
|
|
2648
|
-
*/
|
|
2649
|
-
private clearComponents;
|
|
2650
|
-
/**
|
|
2651
|
-
* 处理栅格数据,统一处理排序和颜色分配
|
|
2652
|
-
* @param rasterData 原始栅格数据
|
|
2653
|
-
* @returns 处理后的栅格数据,包含排序和颜色信息
|
|
2654
|
-
*/
|
|
2655
|
-
private processRasterData;
|
|
2656
|
-
/**
|
|
2657
|
-
* 为栅格地图生成房间几何信息供 RoomManager 使用
|
|
2658
|
-
* @param rasterData 解析后的栅格数据
|
|
2659
|
-
*/
|
|
2660
|
-
private generateRoomGeometryFromRaster;
|
|
2661
|
-
destroy(): void;
|
|
2662
|
-
}
|
|
2663
|
-
|
|
2664
1781
|
/**
|
|
2665
1782
|
* 地图状态对象
|
|
2666
1783
|
*
|
|
@@ -2689,25 +1806,6 @@ export declare type MapState = {
|
|
|
2689
1806
|
version?: number
|
|
2690
1807
|
}
|
|
2691
1808
|
|
|
2692
|
-
declare class Obstacle extends Graphics {
|
|
2693
|
-
private cacheAsTextureHandler;
|
|
2694
|
-
constructor();
|
|
2695
|
-
/**
|
|
2696
|
-
* 绘制结构化障碍物数据
|
|
2697
|
-
* @param obstacles 障碍物数据数组
|
|
2698
|
-
*/
|
|
2699
|
-
draw(obstacles: {
|
|
2700
|
-
coordinates: number[];
|
|
2701
|
-
}[]): void;
|
|
2702
|
-
/**
|
|
2703
|
-
* 绘制栅格障碍物数据
|
|
2704
|
-
* @param obstacleIndices 障碍物像素点索引数组
|
|
2705
|
-
* @param width 地图宽度
|
|
2706
|
-
*/
|
|
2707
|
-
drawRaster(obstacleIndices: Uint32Array, width: number): void;
|
|
2708
|
-
destroy(options?: DestroyOptions | boolean): void;
|
|
2709
|
-
}
|
|
2710
|
-
|
|
2711
1809
|
/**
|
|
2712
1810
|
* 解析后的点阵地图数据
|
|
2713
1811
|
*/
|
|
@@ -2726,116 +1824,6 @@ export declare type ParsedRasterMapData = {
|
|
|
2726
1824
|
totalPixels: number
|
|
2727
1825
|
}
|
|
2728
1826
|
|
|
2729
|
-
declare class Path extends Container {
|
|
2730
|
-
private commonPath;
|
|
2731
|
-
private chargePath;
|
|
2732
|
-
private transitionsPath;
|
|
2733
|
-
private mopPath;
|
|
2734
|
-
private pathData;
|
|
2735
|
-
private lastPointCount;
|
|
2736
|
-
private lastDrawnPosition;
|
|
2737
|
-
private isRealTimeDrawing;
|
|
2738
|
-
private throttledUpdateLineWidth;
|
|
2739
|
-
private throttledHandleRobotPosition;
|
|
2740
|
-
constructor();
|
|
2741
|
-
/**
|
|
2742
|
-
* 注册事件监听
|
|
2743
|
-
*/
|
|
2744
|
-
private registerEventListeners;
|
|
2745
|
-
/**
|
|
2746
|
-
* 处理机器人动画完成事件
|
|
2747
|
-
*/
|
|
2748
|
-
private handleRobotAnimationComplete;
|
|
2749
|
-
/**
|
|
2750
|
-
* 实际处理机器人位置更新的方法
|
|
2751
|
-
*/
|
|
2752
|
-
private handleRobotPositionUpdate;
|
|
2753
|
-
/**
|
|
2754
|
-
* 更新线宽以响应缩放变化
|
|
2755
|
-
*/
|
|
2756
|
-
private updateLineWidth;
|
|
2757
|
-
/**
|
|
2758
|
-
* 重新绘制路径,应用适当的线宽
|
|
2759
|
-
* @param pathData 路径数据
|
|
2760
|
-
*/
|
|
2761
|
-
private redrawPaths;
|
|
2762
|
-
/**
|
|
2763
|
-
* 设置各类路径的样式
|
|
2764
|
-
*/
|
|
2765
|
-
private setupPathStyles;
|
|
2766
|
-
/**
|
|
2767
|
-
* 绘制路径线段
|
|
2768
|
-
* @param pathPoints 路径点数组
|
|
2769
|
-
*/
|
|
2770
|
-
private drawPathSegments;
|
|
2771
|
-
updatePositionByOrigin(x: number, y: number): void;
|
|
2772
|
-
/**
|
|
2773
|
-
* 全量绘制路径
|
|
2774
|
-
* @param pathData 路径数据
|
|
2775
|
-
*/
|
|
2776
|
-
drawFull(pathData: PathData): void;
|
|
2777
|
-
/**
|
|
2778
|
-
* 增量绘制路径(启用实时绘制模式)
|
|
2779
|
-
* @param pathData 路径数据
|
|
2780
|
-
*/
|
|
2781
|
-
drawIncremental(pathData: PathData): void;
|
|
2782
|
-
/**
|
|
2783
|
-
* 直接绘制新增的路径段(用于速度为0的情况)
|
|
2784
|
-
* @param newPoints 新增的路径点
|
|
2785
|
-
* @param lastCount 上次绘制的点数
|
|
2786
|
-
* @param allPoints 所有路径点(新数据)
|
|
2787
|
-
* @param oldPoints 旧的路径点数据(用于获取连接点)
|
|
2788
|
-
*/
|
|
2789
|
-
private drawNewPathSegments;
|
|
2790
|
-
/**
|
|
2791
|
-
* 停止实时绘制模式
|
|
2792
|
-
*/
|
|
2793
|
-
stopRealTimeDrawing(): void;
|
|
2794
|
-
destroy(options?: {
|
|
2795
|
-
children?: boolean;
|
|
2796
|
-
texture?: boolean;
|
|
2797
|
-
baseTexture?: boolean;
|
|
2798
|
-
}): void;
|
|
2799
|
-
}
|
|
2800
|
-
|
|
2801
|
-
declare class PathManager {
|
|
2802
|
-
path: Path;
|
|
2803
|
-
robot: Robot;
|
|
2804
|
-
private unsubscribeFns;
|
|
2805
|
-
private lastDrawnPathData;
|
|
2806
|
-
constructor();
|
|
2807
|
-
/**
|
|
2808
|
-
* 绘制路径和机器人
|
|
2809
|
-
*/
|
|
2810
|
-
draw(pathData: PathData): void;
|
|
2811
|
-
/**
|
|
2812
|
-
* 判断是否应该使用增量绘制
|
|
2813
|
-
*/
|
|
2814
|
-
private shouldUseIncrementalDraw;
|
|
2815
|
-
/**
|
|
2816
|
-
* 全量绘制模式:完整绘制路径和机器人(初始绘制和不满足增量条件时使用)
|
|
2817
|
-
*/
|
|
2818
|
-
private fullDraw;
|
|
2819
|
-
/**
|
|
2820
|
-
* 转换PathPoint为RobotPoint
|
|
2821
|
-
*/
|
|
2822
|
-
private convertToRobotPoint;
|
|
2823
|
-
/**
|
|
2824
|
-
* 处理机器人移动到指定点
|
|
2825
|
-
*/
|
|
2826
|
-
private moveRobotToPoint;
|
|
2827
|
-
/**
|
|
2828
|
-
* 增量绘制模式:只绘制新增部分,机器人平滑动画到新位置
|
|
2829
|
-
*/
|
|
2830
|
-
private incrementalDraw;
|
|
2831
|
-
/**
|
|
2832
|
-
* 批量处理机器人动画队列(用于快速跳转)
|
|
2833
|
-
*/
|
|
2834
|
-
batchProcessRobotQueue(jumpToLatest?: boolean): void;
|
|
2835
|
-
updatePositionByOrigin(x: number, y: number): void;
|
|
2836
|
-
destroy(): void;
|
|
2837
|
-
}
|
|
2838
|
-
|
|
2839
1827
|
/**
|
|
2840
1828
|
* 路径状态对象
|
|
2841
1829
|
* 描述机器人路径的状态信息
|
|
@@ -2897,37 +1885,6 @@ export declare type RasterRoomData = {
|
|
|
2897
1885
|
inactiveColor: string
|
|
2898
1886
|
}
|
|
2899
1887
|
|
|
2900
|
-
declare class Ring extends Graphics {
|
|
2901
|
-
private currentPosition;
|
|
2902
|
-
private config;
|
|
2903
|
-
constructor(options: RingOptions);
|
|
2904
|
-
/**
|
|
2905
|
-
* 设置反向缩放监听,保持描边宽度固定
|
|
2906
|
-
*/
|
|
2907
|
-
private setupAntiScaleListener;
|
|
2908
|
-
/**
|
|
2909
|
-
* 反向缩放事件处理
|
|
2910
|
-
*/
|
|
2911
|
-
private handleScaleChange;
|
|
2912
|
-
/**
|
|
2913
|
-
* 绘制预警圈
|
|
2914
|
-
* @param position 充电桩位置信息
|
|
2915
|
-
*/
|
|
2916
|
-
draw(position: Point): void;
|
|
2917
|
-
/**
|
|
2918
|
-
* 绘制虚线圆形
|
|
2919
|
-
*/
|
|
2920
|
-
private drawDashedCircle;
|
|
2921
|
-
/**
|
|
2922
|
-
* 重新绘制(当配置变化时调用)
|
|
2923
|
-
*/
|
|
2924
|
-
redraw(): void;
|
|
2925
|
-
/**
|
|
2926
|
-
* 销毁组件
|
|
2927
|
-
*/
|
|
2928
|
-
destroy(): void;
|
|
2929
|
-
}
|
|
2930
|
-
|
|
2931
1888
|
/** 预警圈配置 */
|
|
2932
1889
|
export declare type RingConfig = {
|
|
2933
1890
|
/** 大小(米) */
|
|
@@ -2944,81 +1901,6 @@ export declare type RingConfig = {
|
|
|
2944
1901
|
ringStrokeDashArray: [number, number]
|
|
2945
1902
|
}
|
|
2946
1903
|
|
|
2947
|
-
declare type RingOptions = {
|
|
2948
|
-
config: RingConfig;
|
|
2949
|
-
};
|
|
2950
|
-
|
|
2951
|
-
declare class Robot extends Container {
|
|
2952
|
-
robot: RobotIcon;
|
|
2953
|
-
ring: Ring;
|
|
2954
|
-
sleepAnimation: SleepAnimation | null;
|
|
2955
|
-
private unsubscribeFns;
|
|
2956
|
-
private targetPosition;
|
|
2957
|
-
private targetRotation;
|
|
2958
|
-
private isMoving;
|
|
2959
|
-
private pathQueue;
|
|
2960
|
-
private lastPosition;
|
|
2961
|
-
private currentPathType;
|
|
2962
|
-
private lastUpdateTime;
|
|
2963
|
-
constructor();
|
|
2964
|
-
/**
|
|
2965
|
-
* 异步初始化睡眠动画
|
|
2966
|
-
*/
|
|
2967
|
-
private initializeSleepAnimation;
|
|
2968
|
-
updatePositionByOrigin(x: number, y: number): void;
|
|
2969
|
-
/**
|
|
2970
|
-
* 立即绘制到指定位置(无动画)
|
|
2971
|
-
*/
|
|
2972
|
-
draw({ x, y, rotation }: IconPoint): Promise<void>;
|
|
2973
|
-
/**
|
|
2974
|
-
* 添加移动目标到队列(带动画)
|
|
2975
|
-
*/
|
|
2976
|
-
moveTo(point: RobotPoint): void;
|
|
2977
|
-
/**
|
|
2978
|
-
* 批量处理队列(快速跳转)
|
|
2979
|
-
*/
|
|
2980
|
-
batchProcessQueue(jumpToLatest?: boolean): void;
|
|
2981
|
-
/**
|
|
2982
|
-
* 处理队列中的下一个路径点
|
|
2983
|
-
*/
|
|
2984
|
-
private processNextPathPoint;
|
|
2985
|
-
/**
|
|
2986
|
-
* 动画更新循环
|
|
2987
|
-
*/
|
|
2988
|
-
private update;
|
|
2989
|
-
/**
|
|
2990
|
-
* 启动机器人动画渲染(只控制 Ticker start/stop,不 add/remove)
|
|
2991
|
-
*/
|
|
2992
|
-
private startRobotAnimation;
|
|
2993
|
-
/**
|
|
2994
|
-
* 重写 visible setter,确保睡眠动画能响应机器人可见性变化
|
|
2995
|
-
*/
|
|
2996
|
-
set visible(value: boolean);
|
|
2997
|
-
/**
|
|
2998
|
-
* 重写 visible getter
|
|
2999
|
-
*/
|
|
3000
|
-
get visible(): boolean;
|
|
3001
|
-
/**
|
|
3002
|
-
* 停止机器人动画渲染(只控制 Ticker start/stop,不 add/remove)
|
|
3003
|
-
*/
|
|
3004
|
-
private stopRobotAnimation;
|
|
3005
|
-
/**
|
|
3006
|
-
* 清除机器人动画状态
|
|
3007
|
-
*/
|
|
3008
|
-
remove(): void;
|
|
3009
|
-
destroy(options?: {
|
|
3010
|
-
children?: boolean;
|
|
3011
|
-
texture?: boolean;
|
|
3012
|
-
baseTexture?: boolean;
|
|
3013
|
-
}): void;
|
|
3014
|
-
}
|
|
3015
|
-
|
|
3016
|
-
declare class RobotIcon extends EnhancedSprite {
|
|
3017
|
-
constructor();
|
|
3018
|
-
initializeSprite(): Promise<void>;
|
|
3019
|
-
draw({ x, y, rotation }: IconPoint): Promise<void>;
|
|
3020
|
-
}
|
|
3021
|
-
|
|
3022
1904
|
/** 机器人点 */
|
|
3023
1905
|
export declare type RobotPoint = IconPoint & {
|
|
3024
1906
|
/** 点类型 */
|
|
@@ -3057,139 +1939,6 @@ export declare type RoomData = RoomProperty & {
|
|
|
3057
1939
|
index: number
|
|
3058
1940
|
}
|
|
3059
1941
|
|
|
3060
|
-
declare class RoomFill extends Container {
|
|
3061
|
-
private roomGraphicsMap;
|
|
3062
|
-
private roomContextMap;
|
|
3063
|
-
private roomClickHandlerMap;
|
|
3064
|
-
private unsubscribeFns;
|
|
3065
|
-
private mapWidth;
|
|
3066
|
-
private rasterRoomDataMap;
|
|
3067
|
-
constructor();
|
|
3068
|
-
/**
|
|
3069
|
-
* 绘制结构化协议地图房间
|
|
3070
|
-
* @param rooms 房间数据
|
|
3071
|
-
*/
|
|
3072
|
-
draw(rooms: Room[]): void;
|
|
3073
|
-
/**
|
|
3074
|
-
* 绘制栅格房间数据
|
|
3075
|
-
* @param processedData 处理后的栅格数据,包含排序和颜色信息
|
|
3076
|
-
*/
|
|
3077
|
-
drawRaster(processedData: ProcessedRasterData): void;
|
|
3078
|
-
/**
|
|
3079
|
-
* 绘制栅格房间(统一方法,处理数字房间和特殊房间)
|
|
3080
|
-
*/
|
|
3081
|
-
private drawRasterRoom;
|
|
3082
|
-
/**
|
|
3083
|
-
* 分批绘制像素点
|
|
3084
|
-
*/
|
|
3085
|
-
private drawPixelPointsInBatches;
|
|
3086
|
-
/**
|
|
3087
|
-
* 处理房间点击事件
|
|
3088
|
-
*/
|
|
3089
|
-
private handleRoomClick;
|
|
3090
|
-
/**
|
|
3091
|
-
* 根据选中的房间ID数组设置房间状态
|
|
3092
|
-
* @param selectRoomIds 选中的房间ID数组
|
|
3093
|
-
*/
|
|
3094
|
-
setRoomStateBySelectIds(selectRoomIds: readonly number[]): void;
|
|
3095
|
-
/**
|
|
3096
|
-
* 切换单个房间的状态
|
|
3097
|
-
* @param roomId 房间ID
|
|
3098
|
-
* @param isActive 是否为激活状态
|
|
3099
|
-
*/
|
|
3100
|
-
setRoomState(roomId: number | SpecialRoomId, isActive: boolean): void;
|
|
3101
|
-
/**
|
|
3102
|
-
* 设置所有房间为同一状态
|
|
3103
|
-
* @param isActive 是否为激活状态
|
|
3104
|
-
*/
|
|
3105
|
-
setAllRoomsState(isActive: boolean): void;
|
|
3106
|
-
/**
|
|
3107
|
-
* 获取数字房间的Graphics映射(用于地板材质创建)
|
|
3108
|
-
* @returns 房间ID到Graphics的映射
|
|
3109
|
-
*/
|
|
3110
|
-
getRoomGraphicsMap(): Map<number, Graphics>;
|
|
3111
|
-
/**
|
|
3112
|
-
* 获取栅格房间数据(用于精确碰撞检测)
|
|
3113
|
-
* @param roomId 房间ID
|
|
3114
|
-
* @returns 栅格房间数据或null
|
|
3115
|
-
*/
|
|
3116
|
-
getRasterRoomData(roomId: number | SpecialRoomId): RasterRoomData | null;
|
|
3117
|
-
/**
|
|
3118
|
-
* 获取地图宽度(用于像素索引转换)
|
|
3119
|
-
*/
|
|
3120
|
-
getMapWidth(): number;
|
|
3121
|
-
/**
|
|
3122
|
-
* 清除所有房间
|
|
3123
|
-
*/
|
|
3124
|
-
private clearRooms;
|
|
3125
|
-
/**
|
|
3126
|
-
* 销毁时清理资源
|
|
3127
|
-
*/
|
|
3128
|
-
destroy(): void;
|
|
3129
|
-
}
|
|
3130
|
-
|
|
3131
|
-
declare class RoomManager {
|
|
3132
|
-
private unsubscribeFns;
|
|
3133
|
-
private roomInfoContainer;
|
|
3134
|
-
private roomInfoMap;
|
|
3135
|
-
private roomDisplayMap;
|
|
3136
|
-
private roomFloorType;
|
|
3137
|
-
constructor();
|
|
3138
|
-
/**
|
|
3139
|
-
* 设置房间属性数据(房间名称、清洁模式等)
|
|
3140
|
-
* 一次性获取并存储所有必要的显示数据
|
|
3141
|
-
*/
|
|
3142
|
-
drawRoomProperty(properties: RoomProperty[]): boolean;
|
|
3143
|
-
/**
|
|
3144
|
-
* 更新房间信息显示
|
|
3145
|
-
* 直接使用已存储的完整显示数据
|
|
3146
|
-
*/
|
|
3147
|
-
private updateRoomInfoDisplay;
|
|
3148
|
-
/**
|
|
3149
|
-
* 创建单个房间的信息组件
|
|
3150
|
-
*/
|
|
3151
|
-
private createRoomInfo;
|
|
3152
|
-
/**
|
|
3153
|
-
* 更新特定房间的名称
|
|
3154
|
-
*/
|
|
3155
|
-
updateRoomName(roomId: number, name: string): void;
|
|
3156
|
-
/**
|
|
3157
|
-
* 更新特定房间的位置
|
|
3158
|
-
*/
|
|
3159
|
-
updateRoomPosition(roomId: number, centerPoint: Point): void;
|
|
3160
|
-
/**
|
|
3161
|
-
* 清除所有房间信息
|
|
3162
|
-
*/
|
|
3163
|
-
private clearRoomInfos;
|
|
3164
|
-
/**
|
|
3165
|
-
* 根据ID查找房间显示数据
|
|
3166
|
-
*/
|
|
3167
|
-
getRoomPropertyById(id: number): RoomData | undefined;
|
|
3168
|
-
/**
|
|
3169
|
-
* 当房间几何数据更新时,刷新房间信息显示
|
|
3170
|
-
* 这个方法由 MapManager 在房间几何数据更新后调用
|
|
3171
|
-
*/
|
|
3172
|
-
refresh(): void;
|
|
3173
|
-
/**
|
|
3174
|
-
* 更新所有房间属性的可见性
|
|
3175
|
-
*/
|
|
3176
|
-
private updateAllRoomPropertyVisibility;
|
|
3177
|
-
/**
|
|
3178
|
-
* 更新所有房间名称的可见性
|
|
3179
|
-
*/
|
|
3180
|
-
private updateAllRoomNameVisibility;
|
|
3181
|
-
/**
|
|
3182
|
-
* 更新所有房间选择指示器的可见性
|
|
3183
|
-
*/
|
|
3184
|
-
private updateAllRoomSelectionIndicatorVisibility;
|
|
3185
|
-
/**
|
|
3186
|
-
* 更新地板材质
|
|
3187
|
-
* 在房间几何数据或属性数据更新后调用
|
|
3188
|
-
*/
|
|
3189
|
-
private updateFloorTypes;
|
|
3190
|
-
destroy(): void;
|
|
3191
|
-
}
|
|
3192
|
-
|
|
3193
1942
|
/**
|
|
3194
1943
|
* 房间属性信息
|
|
3195
1944
|
*/
|
|
@@ -3283,70 +2032,6 @@ export declare type RuntimeConfig = {
|
|
|
3283
2032
|
showRobotSleepAnimation: boolean
|
|
3284
2033
|
}
|
|
3285
2034
|
|
|
3286
|
-
/**
|
|
3287
|
-
* 机器人睡眠动画组件
|
|
3288
|
-
* TODO
|
|
3289
|
-
* 暂时不开放这个组件,得找到合适的动画
|
|
3290
|
-
* 基于 FixedSizeAnimatedSprite,显示机器人睡眠状态的动画效果
|
|
3291
|
-
*/
|
|
3292
|
-
declare class SleepAnimation extends EnhancedAnimatedSprite {
|
|
3293
|
-
private unsubscribeFns;
|
|
3294
|
-
private throttledUpdateOffset;
|
|
3295
|
-
private fixedOffsetX;
|
|
3296
|
-
private fixedOffsetY;
|
|
3297
|
-
constructor(textures: Texture[]);
|
|
3298
|
-
/**
|
|
3299
|
-
* 静态创建方法
|
|
3300
|
-
*/
|
|
3301
|
-
static create(): Promise<SleepAnimation>;
|
|
3302
|
-
/**
|
|
3303
|
-
* 初始化睡眠动画
|
|
3304
|
-
*/
|
|
3305
|
-
private initializeAnimation;
|
|
3306
|
-
/**
|
|
3307
|
-
* 判断是否应该显示睡眠动画
|
|
3308
|
-
* 显示条件:
|
|
3309
|
-
* 1. 配置中启用睡眠动画
|
|
3310
|
-
* 2. 机器人容器可见
|
|
3311
|
-
* 3. 机器人图标已经绘制(有位置信息)
|
|
3312
|
-
*/
|
|
3313
|
-
private shouldShow;
|
|
3314
|
-
/**
|
|
3315
|
-
* 更新可见性状态
|
|
3316
|
-
*/
|
|
3317
|
-
private updateVisibility;
|
|
3318
|
-
/**
|
|
3319
|
-
* 更新偏移量以保持固定大小
|
|
3320
|
-
* @param _scale 当前地图缩放比例
|
|
3321
|
-
*/
|
|
3322
|
-
private updateOffset;
|
|
3323
|
-
/**
|
|
3324
|
-
* 绘制睡眠动画
|
|
3325
|
-
* @param params 绘制参数
|
|
3326
|
-
*/
|
|
3327
|
-
draw(params: IconPoint): void;
|
|
3328
|
-
/**
|
|
3329
|
-
* 当机器人图标可见性变化时调用
|
|
3330
|
-
*/
|
|
3331
|
-
onRobotVisibilityChanged(): void;
|
|
3332
|
-
/**
|
|
3333
|
-
* 重写 visible setter,确保动画播放状态与可见性同步
|
|
3334
|
-
*/
|
|
3335
|
-
set visible(value: boolean);
|
|
3336
|
-
/**
|
|
3337
|
-
* 重写 visible getter
|
|
3338
|
-
*/
|
|
3339
|
-
get visible(): boolean;
|
|
3340
|
-
/**
|
|
3341
|
-
* 组件销毁时清理资源
|
|
3342
|
-
*/
|
|
3343
|
-
destroy(options?: {
|
|
3344
|
-
children?: boolean;
|
|
3345
|
-
texture?: boolean;
|
|
3346
|
-
baseTexture?: boolean;
|
|
3347
|
-
}): void;
|
|
3348
|
-
}
|
|
3349
|
-
|
|
3350
2035
|
/** 定点清扫配置 */
|
|
3351
2036
|
export declare type SpotConfig = {
|
|
3352
2037
|
/** 图标资源路径 */
|
|
@@ -3397,46 +2082,6 @@ export declare type SpotParam = {
|
|
|
3397
2082
|
*/
|
|
3398
2083
|
export declare function useAppService(): AppService;
|
|
3399
2084
|
|
|
3400
|
-
declare class ViewportContainer extends Container {
|
|
3401
|
-
private viewportBounds;
|
|
3402
|
-
private maskGraphics;
|
|
3403
|
-
private containerElement;
|
|
3404
|
-
constructor(config: AppConfig, containerElement?: HTMLElement | Window);
|
|
3405
|
-
/**
|
|
3406
|
-
* 计算视口边界
|
|
3407
|
-
*/
|
|
3408
|
-
private calculateViewportBounds;
|
|
3409
|
-
/**
|
|
3410
|
-
* 获取容器尺寸
|
|
3411
|
-
*/
|
|
3412
|
-
private getContainerSize;
|
|
3413
|
-
/**
|
|
3414
|
-
* 创建遮罩限制内容在视口内
|
|
3415
|
-
*/
|
|
3416
|
-
private createMask;
|
|
3417
|
-
/**
|
|
3418
|
-
* 解析尺寸参数
|
|
3419
|
-
*/
|
|
3420
|
-
private parseSize;
|
|
3421
|
-
/**
|
|
3422
|
-
* 获取视口边界
|
|
3423
|
-
*/
|
|
3424
|
-
getViewportBounds(): {
|
|
3425
|
-
x: number;
|
|
3426
|
-
y: number;
|
|
3427
|
-
width: number;
|
|
3428
|
-
height: number;
|
|
3429
|
-
};
|
|
3430
|
-
/**
|
|
3431
|
-
* 更新视口配置
|
|
3432
|
-
*/
|
|
3433
|
-
updateViewport(config: AppConfig): void;
|
|
3434
|
-
/**
|
|
3435
|
-
* 添加内容到视口容器
|
|
3436
|
-
*/
|
|
3437
|
-
addContent(content: Container): void;
|
|
3438
|
-
}
|
|
3439
|
-
|
|
3440
2085
|
/** 虚拟墙配置 */
|
|
3441
2086
|
export declare type VirtualWallConfig = {
|
|
3442
2087
|
/** 图标容器填充颜色 */
|