@ray-js/robot-map-sdk 0.0.3-beta-8 → 0.0.3-beta-10
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/MapApplication.js +1 -1
- package/dist/constant/methods.js +1 -1
- package/dist/index.d.ts +1463 -68
- package/dist/index.rjs.js +1 -0
- package/dist/managers/MapManager.js +1 -1
- package/dist/utils/algorithm.js +1 -1
- package/dist-app/assets/{index-C3rjigWj.js → index-zPCor596.js} +1 -1
- package/dist-app/index.html +1 -1
- package/dist-docs/404.html +2 -2
- package/dist-docs/assets/{app.BGQfBD4o.js → app.CWzbsird.js} +1 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.DRAHC9Wk.js +1 -0
- package/dist-docs/assets/chunks/{VPLocalSearchBox.YvMlJA6m.js → VPLocalSearchBox.C1dzEhbA.js} +1 -1
- package/dist-docs/assets/chunks/{theme.1StzhkaW.js → theme.Dh1LIHtb.js} +2 -2
- package/dist-docs/assets/{guide_getting-started.md.B2we0fUv.js → guide_getting-started.md.9TA9iDUN.js} +1 -1
- package/dist-docs/assets/{reference_methods.md.BkU-PXMt.js → reference_methods.md.B71e_LYO.js} +6 -3
- package/dist-docs/assets/{reference_methods.md.BkU-PXMt.lean.js → reference_methods.md.B71e_LYO.lean.js} +1 -1
- package/dist-docs/guide/advanced-usage.html +3 -3
- package/dist-docs/guide/concepts.html +3 -3
- package/dist-docs/guide/getting-started.html +5 -5
- package/dist-docs/hashmap.json +1 -1
- package/dist-docs/index.html +3 -3
- package/dist-docs/reference/callbacks.html +3 -3
- package/dist-docs/reference/config.html +3 -3
- package/dist-docs/reference/data.html +3 -3
- package/dist-docs/reference/methods.html +9 -6
- 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-docs/assets/chunks/@localSearchIndexroot.CSdgg9Q0.js +0 -1
- /package/dist-docs/assets/{guide_getting-started.md.B2we0fUv.lean.js → guide_getting-started.md.9TA9iDUN.lean.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,26 +1,40 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AnimatedSprite } from 'pixi.js';
|
|
2
|
+
import { AppContainer as AppContainer_2 } from './AppContainer';
|
|
2
3
|
import { Application } from 'pixi.js';
|
|
3
4
|
import { ApplicationOptions } from 'pixi.js';
|
|
4
5
|
import { ColorSource } from 'pixi.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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 { DestroyOptions } from 'pixi.js';
|
|
11
|
+
import { DetectedObjectManager as DetectedObjectManager_2 } from '../managers/DetectedObjectManager';
|
|
12
|
+
import { DividerConfig as DividerConfig_2 } from '..';
|
|
8
13
|
import { Emitter } from 'mitt';
|
|
9
14
|
import { FederatedPointerEvent } from 'pixi.js';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
15
|
+
import { Graphics } from 'pixi.js';
|
|
16
|
+
import { HeatmapManager as HeatmapManager_2 } from '../managers/HeatmapManager';
|
|
17
|
+
import { Interaction as Interaction_2 } from './Interaction';
|
|
18
|
+
import { MapCallbacks as MapCallbacks_2 } from '..';
|
|
12
19
|
import { MapData } from '@ray-js/robot-protocol';
|
|
13
20
|
import { MapHeader } from '@ray-js/robot-protocol';
|
|
14
|
-
import { MapManager } from '../managers/MapManager';
|
|
21
|
+
import { MapManager as MapManager_2 } from '../managers/MapManager';
|
|
22
|
+
import { MapState as MapState_2 } from '..';
|
|
23
|
+
import { ParsedRasterMapData as ParsedRasterMapData_2 } from '@ray-js/robot-protocol';
|
|
15
24
|
import { PathData } from '@ray-js/robot-protocol';
|
|
16
|
-
import { PathManager } from '../managers/PathManager';
|
|
25
|
+
import { PathManager as PathManager_2 } from '../managers/PathManager';
|
|
17
26
|
import { Rectangle } from 'pixi.js';
|
|
18
|
-
import {
|
|
27
|
+
import { RingConfig as RingConfig_2 } from '..';
|
|
28
|
+
import { RoomData as RoomData_2 } from '..';
|
|
29
|
+
import { RoomManager as RoomManager_2 } from '../managers/RoomManager';
|
|
30
|
+
import { RuntimeConfig as RuntimeConfig_2 } from '..';
|
|
19
31
|
import { SPECIAL_ROOM_IDS } from '@ray-js/robot-protocol';
|
|
20
32
|
import { SpecialRoomId } from '@ray-js/robot-protocol';
|
|
33
|
+
import { Sprite } from 'pixi.js';
|
|
21
34
|
import { TextStyleFontWeight } from 'pixi.js';
|
|
35
|
+
import { Texture } from 'pixi.js';
|
|
22
36
|
import { Ticker } from 'pixi.js';
|
|
23
|
-
import { ViewportContainer } from './ViewportContainer';
|
|
37
|
+
import { ViewportContainer as ViewportContainer_2 } from './ViewportContainer';
|
|
24
38
|
|
|
25
39
|
/**
|
|
26
40
|
* 地图静态配置
|
|
@@ -374,6 +388,59 @@ export declare type AppConfig = {
|
|
|
374
388
|
}
|
|
375
389
|
}
|
|
376
390
|
|
|
391
|
+
/**
|
|
392
|
+
* AppContainer 同时作为应用的主容器和层级管理器
|
|
393
|
+
* 管理所有地图相关的层级和组件
|
|
394
|
+
*/
|
|
395
|
+
declare class AppContainer extends Container {
|
|
396
|
+
private layers;
|
|
397
|
+
constructor();
|
|
398
|
+
/**
|
|
399
|
+
* 初始化所有预定义的层级
|
|
400
|
+
*/
|
|
401
|
+
private initializeLayers;
|
|
402
|
+
/**
|
|
403
|
+
* 获取指定名称的层容器
|
|
404
|
+
* @param name 层名称
|
|
405
|
+
* @returns 对应的容器,如果不存在则返回undefined
|
|
406
|
+
*/
|
|
407
|
+
getLayer(name: LayerName): Container | undefined;
|
|
408
|
+
/**
|
|
409
|
+
* 向指定层添加元素
|
|
410
|
+
* @param name 层名称
|
|
411
|
+
* @param element 要添加的元素
|
|
412
|
+
* @param zIndex 可选的元素z索引
|
|
413
|
+
* @returns 是否添加成功
|
|
414
|
+
*/
|
|
415
|
+
addToLayer(name: LayerName, element: Container, zIndex?: number): boolean;
|
|
416
|
+
/**
|
|
417
|
+
* 从指定层移除元素
|
|
418
|
+
* @param name 层名称
|
|
419
|
+
* @param element 要移除的元素
|
|
420
|
+
* @returns 是否移除成功
|
|
421
|
+
*/
|
|
422
|
+
removeFromLayer(name: LayerName, element: Container): boolean;
|
|
423
|
+
/**
|
|
424
|
+
* 清空指定层的所有内容
|
|
425
|
+
* @param name 层名称
|
|
426
|
+
* @returns 是否清空成功
|
|
427
|
+
*/
|
|
428
|
+
clearLayer(name: LayerName): boolean;
|
|
429
|
+
/**
|
|
430
|
+
* 设置指定层的可见性
|
|
431
|
+
* @param name 层名称
|
|
432
|
+
* @param visible 是否可见
|
|
433
|
+
* @returns 是否设置成功
|
|
434
|
+
*/
|
|
435
|
+
setLayerVisibility(name: LayerName, visible: boolean): boolean;
|
|
436
|
+
/**
|
|
437
|
+
* 获取指定层的可见性
|
|
438
|
+
* @param name 层名称
|
|
439
|
+
* @returns 层的可见性状态,不存在则返回false
|
|
440
|
+
*/
|
|
441
|
+
getLayerVisibility(name: LayerName): boolean;
|
|
442
|
+
}
|
|
443
|
+
|
|
377
444
|
/**
|
|
378
445
|
* 应用上下文管理 - 基于 React Context 思想
|
|
379
446
|
* 通过组件树的层级关系来传播上下文,每个组件都能自动获取到最近的 Provider 提供的值
|
|
@@ -435,7 +502,7 @@ export declare type AppOptions = {
|
|
|
435
502
|
declare class AppService {
|
|
436
503
|
getApp(): MapApplication;
|
|
437
504
|
getConfig(): AppConfig;
|
|
438
|
-
getRoomData(roomId: number):
|
|
505
|
+
getRoomData(roomId: number): RoomData_2 | undefined;
|
|
439
506
|
/**
|
|
440
507
|
* 将米转换为像素(委托给 MapApplication)
|
|
441
508
|
*/
|
|
@@ -445,7 +512,7 @@ declare class AppService {
|
|
|
445
512
|
*/
|
|
446
513
|
pixelsToMeters(pixels: number): number;
|
|
447
514
|
get ticker(): Ticker;
|
|
448
|
-
get mapState():
|
|
515
|
+
get mapState(): MapState_2 | null;
|
|
449
516
|
get gloalConfig(): {
|
|
450
517
|
containerTop: string;
|
|
451
518
|
containerLeft: string;
|
|
@@ -579,7 +646,7 @@ declare class AppService {
|
|
|
579
646
|
offsetX: number;
|
|
580
647
|
offsetY: number;
|
|
581
648
|
};
|
|
582
|
-
} &
|
|
649
|
+
} & RingConfig_2;
|
|
583
650
|
get chargingStationConfig(): {
|
|
584
651
|
icon: {
|
|
585
652
|
sizeFixed: boolean;
|
|
@@ -588,7 +655,7 @@ declare class AppService {
|
|
|
588
655
|
src: string;
|
|
589
656
|
};
|
|
590
657
|
rotationCorrection: number;
|
|
591
|
-
} &
|
|
658
|
+
} & RingConfig_2;
|
|
592
659
|
get interactionConfig(): {
|
|
593
660
|
zoomRange: {
|
|
594
661
|
min: number;
|
|
@@ -598,8 +665,8 @@ declare class AppService {
|
|
|
598
665
|
fitMaxScale: number;
|
|
599
666
|
enableDoubleTapZoom: boolean;
|
|
600
667
|
};
|
|
601
|
-
get controlsConfig():
|
|
602
|
-
get dividerConfig():
|
|
668
|
+
get controlsConfig(): ControlsConfig_2;
|
|
669
|
+
get dividerConfig(): DividerConfig_2;
|
|
603
670
|
get detectedObjectConfig(): {
|
|
604
671
|
height: number;
|
|
605
672
|
width: number;
|
|
@@ -611,17 +678,17 @@ declare class AppService {
|
|
|
611
678
|
antialias: boolean;
|
|
612
679
|
resolution: number;
|
|
613
680
|
};
|
|
614
|
-
get appContainer():
|
|
615
|
-
get interaction():
|
|
616
|
-
get viewportContainer():
|
|
617
|
-
get mapManager():
|
|
618
|
-
get pathManager():
|
|
619
|
-
get heatmapManager():
|
|
620
|
-
get controlsManager():
|
|
621
|
-
get detectedObjectManager():
|
|
622
|
-
get customElementsManager():
|
|
623
|
-
get roomsManager():
|
|
624
|
-
get runtime():
|
|
681
|
+
get appContainer(): AppContainer_2;
|
|
682
|
+
get interaction(): Interaction_2;
|
|
683
|
+
get viewportContainer(): ViewportContainer_2;
|
|
684
|
+
get mapManager(): MapManager_2;
|
|
685
|
+
get pathManager(): PathManager_2;
|
|
686
|
+
get heatmapManager(): HeatmapManager_2;
|
|
687
|
+
get controlsManager(): ControlsManager_2;
|
|
688
|
+
get detectedObjectManager(): DetectedObjectManager_2;
|
|
689
|
+
get customElementsManager(): CustomElementsManager_2;
|
|
690
|
+
get roomsManager(): RoomManager_2;
|
|
691
|
+
get runtime(): RuntimeConfig_2;
|
|
625
692
|
get runtimeSnapshot(): {
|
|
626
693
|
readonly dividingRoomId: number | null | undefined;
|
|
627
694
|
readonly enableRoomSelection: boolean;
|
|
@@ -644,28 +711,28 @@ declare class AppService {
|
|
|
644
711
|
readonly showRobotRing: boolean;
|
|
645
712
|
readonly showRobotSleepAnimation: boolean;
|
|
646
713
|
};
|
|
647
|
-
get events():
|
|
714
|
+
get events(): MapCallbacks_2 | undefined;
|
|
648
715
|
get baseScale(): number;
|
|
649
716
|
get currentScale(): number;
|
|
650
717
|
get emitter(): Emitter< {
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
718
|
+
antiScale: number;
|
|
719
|
+
gestureHijackStart: FederatedPointerEvent;
|
|
720
|
+
gestureHijackPointerMove: FederatedPointerEvent;
|
|
721
|
+
gestureHijackPointerUp: FederatedPointerEvent;
|
|
722
|
+
gestureHijackCancel: void;
|
|
723
|
+
robotPositionUpdate: {
|
|
724
|
+
x: number;
|
|
725
|
+
y: number;
|
|
726
|
+
pathType?: string;
|
|
727
|
+
};
|
|
728
|
+
robotAnimationComplete: void;
|
|
729
|
+
pathSegmentComplete: {
|
|
730
|
+
fromX: number;
|
|
731
|
+
fromY: number;
|
|
732
|
+
toX: number;
|
|
733
|
+
toY: number;
|
|
734
|
+
pathType?: string;
|
|
735
|
+
};
|
|
669
736
|
}>;
|
|
670
737
|
}
|
|
671
738
|
|
|
@@ -703,12 +770,74 @@ export declare type Bounds = {
|
|
|
703
770
|
maxY: number
|
|
704
771
|
}
|
|
705
772
|
|
|
773
|
+
declare class Carpet extends Container {
|
|
774
|
+
private carpetSprite;
|
|
775
|
+
private carpetMask;
|
|
776
|
+
constructor();
|
|
777
|
+
/**
|
|
778
|
+
* 创建地毯纹理覆盖(栅格数据)
|
|
779
|
+
* @param carpetPixels 地毯像素数据
|
|
780
|
+
* @param mapWidth 地图宽度
|
|
781
|
+
*/
|
|
782
|
+
createCarpetFromRasterData(carpetPixels: Uint32Array, mapWidth: number): Promise<void>;
|
|
783
|
+
/**
|
|
784
|
+
* 创建地毯的Graphics作为mask
|
|
785
|
+
* @param carpetPixels 地毯像素数据
|
|
786
|
+
* @param mapWidth 地图宽度
|
|
787
|
+
* @returns Graphics对象
|
|
788
|
+
*/
|
|
789
|
+
private createCarpetGraphics;
|
|
790
|
+
/**
|
|
791
|
+
* 清除地毯
|
|
792
|
+
*/
|
|
793
|
+
clearCarpet(): void;
|
|
794
|
+
/**
|
|
795
|
+
* 创建地毯纹理覆盖(结构化数据)
|
|
796
|
+
* @param carpetData 结构化地毯数据数组
|
|
797
|
+
*/
|
|
798
|
+
createCarpetFromStructuredData(carpetData: Array<{
|
|
799
|
+
coordinates: number[];
|
|
800
|
+
}>): Promise<void>;
|
|
801
|
+
/**
|
|
802
|
+
* 创建地毯的Graphics作为mask(结构化数据)
|
|
803
|
+
* @param carpetData 结构化地毯数据数组
|
|
804
|
+
* @returns Graphics对象
|
|
805
|
+
*/
|
|
806
|
+
private createCarpetGraphicsFromStructuredData;
|
|
807
|
+
/**
|
|
808
|
+
* 销毁时清理资源
|
|
809
|
+
*/
|
|
810
|
+
destroy(): void;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
declare class ChargingStation extends Container {
|
|
814
|
+
chargingStation: ChargingStationIcon;
|
|
815
|
+
ring: Ring;
|
|
816
|
+
private unsubscribeFns;
|
|
817
|
+
constructor();
|
|
818
|
+
draw({ x, y, rotation }: IconPoint): Promise<void>;
|
|
819
|
+
destroy(): void;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
declare class ChargingStationIcon extends EnhancedSprite {
|
|
823
|
+
constructor();
|
|
824
|
+
initializeSprite(): Promise<void>;
|
|
825
|
+
draw({ x, y, rotation }: IconPoint): Promise<void>;
|
|
826
|
+
}
|
|
827
|
+
|
|
706
828
|
/** 组件属性类型 */
|
|
707
829
|
export declare type ComponentPropsApp = {
|
|
708
830
|
/** 地图应用实例 */
|
|
709
831
|
app: MapApplication
|
|
710
832
|
}
|
|
711
833
|
|
|
834
|
+
/** 组件类型定义 */
|
|
835
|
+
declare type Components = {
|
|
836
|
+
viewportContainer: ViewportContainer;
|
|
837
|
+
appContainer: AppContainer;
|
|
838
|
+
interaction: Interaction;
|
|
839
|
+
};
|
|
840
|
+
|
|
712
841
|
/**
|
|
713
842
|
* 控制元素配置
|
|
714
843
|
*/
|
|
@@ -753,6 +882,177 @@ export declare type ControlsConfig = {
|
|
|
753
882
|
spot: SpotConfig
|
|
754
883
|
}
|
|
755
884
|
|
|
885
|
+
declare class ControlsManager {
|
|
886
|
+
private forbiddenSweepZoneMap;
|
|
887
|
+
private forbiddenMopZoneMap;
|
|
888
|
+
private cleanZoneMap;
|
|
889
|
+
private virtualWallMap;
|
|
890
|
+
private spotMap;
|
|
891
|
+
private divider;
|
|
892
|
+
private unsubscribeFns;
|
|
893
|
+
constructor();
|
|
894
|
+
/**
|
|
895
|
+
* 根据地图原点更新所有区域位置
|
|
896
|
+
*/
|
|
897
|
+
updatePositionByOrigin(x: number, y: number): void;
|
|
898
|
+
/**
|
|
899
|
+
* 绘制扫地禁区
|
|
900
|
+
*/
|
|
901
|
+
drawForbiddenSweepZones(zones: ZoneParam[]): void;
|
|
902
|
+
/**
|
|
903
|
+
* 获取所有扫地禁区数据
|
|
904
|
+
*/
|
|
905
|
+
getForbiddenSweepZones(): ZoneParam[];
|
|
906
|
+
/**
|
|
907
|
+
* 清除所有扫地禁区
|
|
908
|
+
*/
|
|
909
|
+
clearAllForbiddenSweepZones(): void;
|
|
910
|
+
/**
|
|
911
|
+
* 绘制拖地禁区
|
|
912
|
+
*/
|
|
913
|
+
drawForbiddenMopZones(zones: ZoneParam[]): void;
|
|
914
|
+
/**
|
|
915
|
+
* 获取所有拖地禁区数据
|
|
916
|
+
*/
|
|
917
|
+
getForbiddenMopZones(): ZoneParam[];
|
|
918
|
+
/**
|
|
919
|
+
* 清除所有拖地禁区
|
|
920
|
+
*/
|
|
921
|
+
clearAllForbiddenMopZones(): void;
|
|
922
|
+
/**
|
|
923
|
+
* 绘制清扫区域
|
|
924
|
+
*/
|
|
925
|
+
drawCleanZones(zones: ZoneParam[]): void;
|
|
926
|
+
/**
|
|
927
|
+
* 获取所有清扫区域数据
|
|
928
|
+
*/
|
|
929
|
+
getCleanZones(): ZoneParam[];
|
|
930
|
+
/**
|
|
931
|
+
* 清除所有清扫区域
|
|
932
|
+
*/
|
|
933
|
+
clearAllCleanZones(): void;
|
|
934
|
+
/**
|
|
935
|
+
* 绘制虚拟墙
|
|
936
|
+
*/
|
|
937
|
+
drawVirtualWalls(walls: VirtualWallParam[]): void;
|
|
938
|
+
/**
|
|
939
|
+
* 获取所有虚拟墙数据
|
|
940
|
+
*/
|
|
941
|
+
getVirtualWalls(): VirtualWallParam[];
|
|
942
|
+
/**
|
|
943
|
+
* 清除所有虚拟墙
|
|
944
|
+
*/
|
|
945
|
+
clearAllVirtualWalls(): void;
|
|
946
|
+
/**
|
|
947
|
+
* 绘制定点清扫
|
|
948
|
+
*/
|
|
949
|
+
drawSpots(spots: SpotParam[]): void;
|
|
950
|
+
/**
|
|
951
|
+
* 获取所有定点清扫数据
|
|
952
|
+
*/
|
|
953
|
+
getSpots(): SpotParam[];
|
|
954
|
+
/**
|
|
955
|
+
* 清除所有定点清扫
|
|
956
|
+
*/
|
|
957
|
+
clearAllSpots(): void;
|
|
958
|
+
/**
|
|
959
|
+
* 通用的绘制区域方法
|
|
960
|
+
*/
|
|
961
|
+
private drawZones;
|
|
962
|
+
/**
|
|
963
|
+
* 添加新区域到 LAYER_CONTROLS
|
|
964
|
+
*/
|
|
965
|
+
private addNewZone;
|
|
966
|
+
/**
|
|
967
|
+
* 移除区域
|
|
968
|
+
*/
|
|
969
|
+
private removeZone;
|
|
970
|
+
/**
|
|
971
|
+
* 获取区域数据
|
|
972
|
+
*/
|
|
973
|
+
private getZonesData;
|
|
974
|
+
/**
|
|
975
|
+
* 清除所有区域
|
|
976
|
+
*/
|
|
977
|
+
private clearAllZones;
|
|
978
|
+
/**
|
|
979
|
+
* 更新区域编辑状态
|
|
980
|
+
*/
|
|
981
|
+
private updateZonesEditState;
|
|
982
|
+
/**
|
|
983
|
+
* 更新虚拟墙编辑状态
|
|
984
|
+
*/
|
|
985
|
+
private updateVirtualWallsEditState;
|
|
986
|
+
/**
|
|
987
|
+
* 比较两个区域数据是否相等
|
|
988
|
+
*/
|
|
989
|
+
private isZoneDataEqual;
|
|
990
|
+
/**
|
|
991
|
+
* 获取虚拟墙数据
|
|
992
|
+
*/
|
|
993
|
+
private getWallsData;
|
|
994
|
+
/**
|
|
995
|
+
* 清除所有虚拟墙
|
|
996
|
+
*/
|
|
997
|
+
private clearAllWalls;
|
|
998
|
+
/**
|
|
999
|
+
* 比较两个虚拟墙是否相同
|
|
1000
|
+
*/
|
|
1001
|
+
private isWallDataEqual;
|
|
1002
|
+
/**
|
|
1003
|
+
* 添加新定点清扫到 LAYER_CONTROLS
|
|
1004
|
+
*/
|
|
1005
|
+
private addNewSpot;
|
|
1006
|
+
/**
|
|
1007
|
+
* 移除定点清扫
|
|
1008
|
+
*/
|
|
1009
|
+
private removeSpot;
|
|
1010
|
+
/**
|
|
1011
|
+
* 获取定点清扫数据
|
|
1012
|
+
*/
|
|
1013
|
+
private getSpotsData;
|
|
1014
|
+
/**
|
|
1015
|
+
* 清除所有定点清扫
|
|
1016
|
+
*/
|
|
1017
|
+
private clearAllSpotsInternal;
|
|
1018
|
+
/**
|
|
1019
|
+
* 更新定点清扫编辑状态
|
|
1020
|
+
*/
|
|
1021
|
+
private updateSpotsEditState;
|
|
1022
|
+
/**
|
|
1023
|
+
* 比较两个定点清扫数据是否相等
|
|
1024
|
+
*/
|
|
1025
|
+
private isSpotDataEqual;
|
|
1026
|
+
/**
|
|
1027
|
+
* 处理分割房间ID变化
|
|
1028
|
+
*/
|
|
1029
|
+
private handleDividingRoomIdChange;
|
|
1030
|
+
/**
|
|
1031
|
+
* 获取房间几何信息
|
|
1032
|
+
*/
|
|
1033
|
+
private getRoomGeometry;
|
|
1034
|
+
/**
|
|
1035
|
+
* 创建默认分割线
|
|
1036
|
+
*/
|
|
1037
|
+
private createDefaultDivider;
|
|
1038
|
+
/**
|
|
1039
|
+
* 清除分割线
|
|
1040
|
+
*/
|
|
1041
|
+
private clearDivider;
|
|
1042
|
+
/**
|
|
1043
|
+
* 获取分割线数据
|
|
1044
|
+
*/
|
|
1045
|
+
getDividerEndPoints(): Point[] | null;
|
|
1046
|
+
/**
|
|
1047
|
+
* 获取分割线有效端点
|
|
1048
|
+
*/
|
|
1049
|
+
getEffectiveDividerPoints(): Point[] | null;
|
|
1050
|
+
/**
|
|
1051
|
+
* 销毁管理器
|
|
1052
|
+
*/
|
|
1053
|
+
destroy(): void;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
756
1056
|
/**
|
|
757
1057
|
* 自定义元素参数
|
|
758
1058
|
*/
|
|
@@ -761,6 +1061,61 @@ export declare type CustomElementParam =
|
|
|
761
1061
|
| GifCustomElementParam
|
|
762
1062
|
| HtmlCustomElementParam
|
|
763
1063
|
|
|
1064
|
+
declare class CustomElementsManager {
|
|
1065
|
+
private customElementsMap;
|
|
1066
|
+
private gifTicker;
|
|
1067
|
+
private gifElements;
|
|
1068
|
+
constructor();
|
|
1069
|
+
/**
|
|
1070
|
+
* 根据地图原点更新所有自定义元素位置
|
|
1071
|
+
*/
|
|
1072
|
+
updatePositionByOrigin(x: number, y: number): void;
|
|
1073
|
+
/**
|
|
1074
|
+
* 绘制自定义元素
|
|
1075
|
+
*/
|
|
1076
|
+
drawCustomElements(elements: CustomElementParam[]): Promise<void>;
|
|
1077
|
+
/**
|
|
1078
|
+
* 清除所有自定义元素
|
|
1079
|
+
*/
|
|
1080
|
+
clearAllCustomElements(): void;
|
|
1081
|
+
/**
|
|
1082
|
+
* 添加新的自定义元素
|
|
1083
|
+
*/
|
|
1084
|
+
private addNewCustomElement;
|
|
1085
|
+
/**
|
|
1086
|
+
* 移除自定义元素
|
|
1087
|
+
*/
|
|
1088
|
+
private removeCustomElement;
|
|
1089
|
+
/**
|
|
1090
|
+
* 检查数据是否相同(类型安全的辅助方法)
|
|
1091
|
+
*/
|
|
1092
|
+
private isSameData;
|
|
1093
|
+
/**
|
|
1094
|
+
* 更新元素数据(类型安全的辅助方法)
|
|
1095
|
+
*/
|
|
1096
|
+
private updateElementData;
|
|
1097
|
+
/**
|
|
1098
|
+
* 更新 GIF Ticker 状态
|
|
1099
|
+
*/
|
|
1100
|
+
private updateGifTicker;
|
|
1101
|
+
/**
|
|
1102
|
+
* 启动 GIF Ticker
|
|
1103
|
+
*/
|
|
1104
|
+
private startGifTicker;
|
|
1105
|
+
/**
|
|
1106
|
+
* 停止 GIF Ticker
|
|
1107
|
+
*/
|
|
1108
|
+
private stopGifTicker;
|
|
1109
|
+
/**
|
|
1110
|
+
* 渲染 GIF 容器
|
|
1111
|
+
*/
|
|
1112
|
+
private renderGifContainer;
|
|
1113
|
+
/**
|
|
1114
|
+
* 销毁管理器
|
|
1115
|
+
*/
|
|
1116
|
+
destroy(): void;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
764
1119
|
/**
|
|
765
1120
|
* 解析结构化协议的地图房间属性
|
|
766
1121
|
* @param map 地图数据
|
|
@@ -786,6 +1141,34 @@ export declare type DeepPartialAppConfig = DeepPartial<AppConfig>
|
|
|
786
1141
|
/** 深度可选的运行时配置类型 */
|
|
787
1142
|
export declare type DeepPartialRuntimeConfig = DeepPartial<RuntimeConfig>
|
|
788
1143
|
|
|
1144
|
+
declare class DetectedObjectManager {
|
|
1145
|
+
private detectedObjectMap;
|
|
1146
|
+
/**
|
|
1147
|
+
* 根据地图原点更新所有检测物体位置
|
|
1148
|
+
*/
|
|
1149
|
+
updatePositionByOrigin(x: number, y: number): void;
|
|
1150
|
+
/**
|
|
1151
|
+
* 绘制检测物体
|
|
1152
|
+
*/
|
|
1153
|
+
drawDetectedObjects(objects: DetectedObjectParam[]): Promise<void>;
|
|
1154
|
+
/**
|
|
1155
|
+
* 清除所有检测物体
|
|
1156
|
+
*/
|
|
1157
|
+
clearAllDetectedObjects(): void;
|
|
1158
|
+
/**
|
|
1159
|
+
* 添加新的检测物体
|
|
1160
|
+
*/
|
|
1161
|
+
private addNewDetectedObject;
|
|
1162
|
+
/**
|
|
1163
|
+
* 移除检测物体
|
|
1164
|
+
*/
|
|
1165
|
+
private removeDetectedObject;
|
|
1166
|
+
/**
|
|
1167
|
+
* 销毁管理器
|
|
1168
|
+
*/
|
|
1169
|
+
destroy(): void;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
789
1172
|
/**
|
|
790
1173
|
* 检测物体参数
|
|
791
1174
|
*/
|
|
@@ -835,6 +1218,221 @@ export declare type DividerConfig = {
|
|
|
835
1218
|
defaultDirection: Direction
|
|
836
1219
|
}
|
|
837
1220
|
|
|
1221
|
+
/**
|
|
1222
|
+
* 固定大小动画精灵基类
|
|
1223
|
+
* 基于 EnhancedSprite 扩展,支持帧动画播放
|
|
1224
|
+
*
|
|
1225
|
+
* 两种模式:
|
|
1226
|
+
* 1. sizeFixed: true - 固定屏幕像素大小,不受地图缩放影响
|
|
1227
|
+
* 2. sizeFixed: false - 以地图scale=1为基准,跟随地图缩放
|
|
1228
|
+
*/
|
|
1229
|
+
declare class EnhancedAnimatedSprite extends AnimatedSprite {
|
|
1230
|
+
private throttledUpdateScale;
|
|
1231
|
+
private fixedWidth;
|
|
1232
|
+
private fixedHeight;
|
|
1233
|
+
private isFixedSizeSet;
|
|
1234
|
+
private sizeFixed;
|
|
1235
|
+
private baselineScale;
|
|
1236
|
+
private static animationTicker;
|
|
1237
|
+
private static animatedSprites;
|
|
1238
|
+
constructor(textures?: Texture[]);
|
|
1239
|
+
/**
|
|
1240
|
+
* 设置固定的屏幕像素大小
|
|
1241
|
+
* @param width 屏幕上显示的固定宽度(像素)
|
|
1242
|
+
* @param height 屏幕上显示的固定高度(像素)
|
|
1243
|
+
*/
|
|
1244
|
+
setFixedSize(width: number, height: number): void;
|
|
1245
|
+
/**
|
|
1246
|
+
* 设置是否启用固定大小模式
|
|
1247
|
+
* @param enabled 是否启用固定大小模式
|
|
1248
|
+
*/
|
|
1249
|
+
setSizeFixed(enabled: boolean): void;
|
|
1250
|
+
/**
|
|
1251
|
+
* 重写 width setter,确保使用固定大小逻辑
|
|
1252
|
+
*/
|
|
1253
|
+
set width(value: number);
|
|
1254
|
+
/**
|
|
1255
|
+
* 重写 height setter,确保使用固定大小逻辑
|
|
1256
|
+
*/
|
|
1257
|
+
set height(value: number);
|
|
1258
|
+
/**
|
|
1259
|
+
* 重写 width getter,返回固定宽度
|
|
1260
|
+
*/
|
|
1261
|
+
get width(): number;
|
|
1262
|
+
/**
|
|
1263
|
+
* 重写 height getter,返回固定高度
|
|
1264
|
+
*/
|
|
1265
|
+
get height(): number;
|
|
1266
|
+
/**
|
|
1267
|
+
* 注册缩放事件监听
|
|
1268
|
+
*/
|
|
1269
|
+
private registerScaleListener;
|
|
1270
|
+
/**
|
|
1271
|
+
* 应用大小(统一处理两种模式)
|
|
1272
|
+
*/
|
|
1273
|
+
private applySize;
|
|
1274
|
+
/**
|
|
1275
|
+
* 更新元素缩放,以保持正确大小
|
|
1276
|
+
*/
|
|
1277
|
+
protected updateScale(scale: number): void;
|
|
1278
|
+
/**
|
|
1279
|
+
* 静态方法:加载动画纹理
|
|
1280
|
+
* @param jsonSrc 动画JSON资源路径
|
|
1281
|
+
* @param framePrefix 帧名称前缀,例如 "sleep_"
|
|
1282
|
+
* @param frameCount 帧数量
|
|
1283
|
+
* @returns Promise<Texture[]> 纹理数组
|
|
1284
|
+
*/
|
|
1285
|
+
static loadAnimationTextures(jsonSrc: string, framePrefix?: string, frameCount?: number): Promise<Texture[]>;
|
|
1286
|
+
/**
|
|
1287
|
+
* 设置动画配置
|
|
1288
|
+
* @param iconConfig 图标配置
|
|
1289
|
+
*/
|
|
1290
|
+
setupAnimation(iconConfig: IconConfig): void;
|
|
1291
|
+
/**
|
|
1292
|
+
* 通用绘制方法
|
|
1293
|
+
* @param params 绘制参数
|
|
1294
|
+
* @param visibilityCondition 可选的可见性条件函数
|
|
1295
|
+
*/
|
|
1296
|
+
draw(params: IconPoint, visibilityCondition?: () => boolean): void;
|
|
1297
|
+
/**
|
|
1298
|
+
* 开始播放动画
|
|
1299
|
+
*/
|
|
1300
|
+
play(): void;
|
|
1301
|
+
/**
|
|
1302
|
+
* 停止播放动画
|
|
1303
|
+
*/
|
|
1304
|
+
stop(): void;
|
|
1305
|
+
/**
|
|
1306
|
+
* 重写 textures setter,在设置新纹理后重新应用固定大小
|
|
1307
|
+
*/
|
|
1308
|
+
set textures(value: Texture[]);
|
|
1309
|
+
/**
|
|
1310
|
+
* 重写 textures getter
|
|
1311
|
+
*/
|
|
1312
|
+
get textures(): Texture[];
|
|
1313
|
+
/**
|
|
1314
|
+
* 启动动画 Ticker
|
|
1315
|
+
*/
|
|
1316
|
+
private static startAnimationTicker;
|
|
1317
|
+
/**
|
|
1318
|
+
* 更新动画 Ticker 状态
|
|
1319
|
+
*/
|
|
1320
|
+
private static updateAnimationTicker;
|
|
1321
|
+
/**
|
|
1322
|
+
* 停止动画 Ticker
|
|
1323
|
+
*/
|
|
1324
|
+
private static stopAnimationTicker;
|
|
1325
|
+
/**
|
|
1326
|
+
* 更新所有动画
|
|
1327
|
+
*/
|
|
1328
|
+
private static updateAnimations;
|
|
1329
|
+
/**
|
|
1330
|
+
* 组件销毁时清理资源
|
|
1331
|
+
*/
|
|
1332
|
+
destroy(options?: {
|
|
1333
|
+
children?: boolean;
|
|
1334
|
+
texture?: boolean;
|
|
1335
|
+
baseTexture?: boolean;
|
|
1336
|
+
}): void;
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
/**
|
|
1340
|
+
* 固定大小精灵基类
|
|
1341
|
+
* 用于创建在地图缩放时保持固定视觉大小的精灵元素
|
|
1342
|
+
*
|
|
1343
|
+
* 两种模式:
|
|
1344
|
+
* 1. sizeFixed: true - 固定屏幕像素大小,不受地图缩放影响
|
|
1345
|
+
* 2. sizeFixed: false - 以地图scale=1为基准,跟随地图缩放
|
|
1346
|
+
*/
|
|
1347
|
+
declare class EnhancedSprite extends Sprite {
|
|
1348
|
+
private throttledUpdateScale;
|
|
1349
|
+
private fixedWidth;
|
|
1350
|
+
private fixedHeight;
|
|
1351
|
+
private isFixedSizeSet;
|
|
1352
|
+
private sizeFixed;
|
|
1353
|
+
private baselineScale;
|
|
1354
|
+
constructor(texture?: Texture);
|
|
1355
|
+
/**
|
|
1356
|
+
* 设置固定的屏幕像素大小
|
|
1357
|
+
* @param width 屏幕上显示的固定宽度(像素)
|
|
1358
|
+
* @param height 屏幕上显示的固定高度(像素)
|
|
1359
|
+
*/
|
|
1360
|
+
setFixedSize(width: number, height: number): void;
|
|
1361
|
+
/**
|
|
1362
|
+
* 设置是否启用固定大小模式
|
|
1363
|
+
* @param enabled 是否启用固定大小模式
|
|
1364
|
+
*/
|
|
1365
|
+
setSizeFixed(enabled: boolean): void;
|
|
1366
|
+
/**
|
|
1367
|
+
* 重写 width setter,确保使用固定大小逻辑
|
|
1368
|
+
*/
|
|
1369
|
+
set width(value: number);
|
|
1370
|
+
/**
|
|
1371
|
+
* 重写 height setter,确保使用固定大小逻辑
|
|
1372
|
+
*/
|
|
1373
|
+
set height(value: number);
|
|
1374
|
+
/**
|
|
1375
|
+
* 重写 width getter,返回固定宽度
|
|
1376
|
+
*/
|
|
1377
|
+
get width(): number;
|
|
1378
|
+
/**
|
|
1379
|
+
* 重写 height getter,返回固定高度
|
|
1380
|
+
*/
|
|
1381
|
+
get height(): number;
|
|
1382
|
+
/**
|
|
1383
|
+
* 注册缩放事件监听
|
|
1384
|
+
*/
|
|
1385
|
+
private registerScaleListener;
|
|
1386
|
+
/**
|
|
1387
|
+
* 应用大小(统一处理两种模式)
|
|
1388
|
+
*/
|
|
1389
|
+
private applySize;
|
|
1390
|
+
/**
|
|
1391
|
+
* 更新元素缩放,以保持正确大小
|
|
1392
|
+
*/
|
|
1393
|
+
protected updateScale(scale: number): void;
|
|
1394
|
+
/**
|
|
1395
|
+
* 异步加载纹理并设置大小
|
|
1396
|
+
* @param assetKey 资源键名 或 资源src
|
|
1397
|
+
* @param iconConfig 图标配置(需要包含sizeFixed属性)
|
|
1398
|
+
*/
|
|
1399
|
+
loadTextureAndSetSize(src: string, iconConfig: IconConfig): Promise<void>;
|
|
1400
|
+
/**
|
|
1401
|
+
* 通用绘制方法
|
|
1402
|
+
* @param params 绘制参数
|
|
1403
|
+
* @param visibilityCondition 可选的可见性条件函数
|
|
1404
|
+
*/
|
|
1405
|
+
draw(params: IconPoint, visibilityCondition?: () => boolean): void;
|
|
1406
|
+
/**
|
|
1407
|
+
* 重写 texture setter,在设置新纹理后重新应用固定大小
|
|
1408
|
+
*/
|
|
1409
|
+
set texture(value: Texture);
|
|
1410
|
+
/**
|
|
1411
|
+
* 重写 texture getter
|
|
1412
|
+
*/
|
|
1413
|
+
get texture(): Texture;
|
|
1414
|
+
/**
|
|
1415
|
+
* 组件销毁时清理资源
|
|
1416
|
+
*/
|
|
1417
|
+
destroy(options?: {
|
|
1418
|
+
children?: boolean;
|
|
1419
|
+
texture?: boolean;
|
|
1420
|
+
baseTexture?: boolean;
|
|
1421
|
+
}): void;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
declare class Free extends Graphics {
|
|
1425
|
+
constructor();
|
|
1426
|
+
/**
|
|
1427
|
+
* 绘制结构化自由区域数据
|
|
1428
|
+
* @param free 自由区域数据数组
|
|
1429
|
+
*/
|
|
1430
|
+
draw(free: {
|
|
1431
|
+
coordinates: number[];
|
|
1432
|
+
}[]): void;
|
|
1433
|
+
destroy(options?: DestroyOptions | boolean): void;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
838
1436
|
/**
|
|
839
1437
|
* GIF 类型自定义元素参数
|
|
840
1438
|
* 保持现有逻辑
|
|
@@ -850,6 +1448,80 @@ export declare type GifCustomElementParam = BaseCustomElementParam & {
|
|
|
850
1448
|
height: number
|
|
851
1449
|
}
|
|
852
1450
|
|
|
1451
|
+
declare class Heatmap extends Container {
|
|
1452
|
+
colorGradients: Array<string>;
|
|
1453
|
+
cellSize: number;
|
|
1454
|
+
constructor();
|
|
1455
|
+
/**
|
|
1456
|
+
* 绘制热力图
|
|
1457
|
+
* @param grid 处理好的热力数据 每个网格的信号强度 和 坐标
|
|
1458
|
+
* @param useGradient 是否使用渐变绘制
|
|
1459
|
+
*/
|
|
1460
|
+
draw(grid: Array<Array<{
|
|
1461
|
+
x: number;
|
|
1462
|
+
y: number;
|
|
1463
|
+
signal: number;
|
|
1464
|
+
hasPoint: boolean;
|
|
1465
|
+
}>>, useGradient?: boolean, heatmapAlpha?: number): void;
|
|
1466
|
+
/**
|
|
1467
|
+
* 裁剪热力图 仅显示房间区域
|
|
1468
|
+
* 根据roomFill图层的子元素 组合Graphics生成大Graphics裁剪
|
|
1469
|
+
* @param heatmap 热力图mesh
|
|
1470
|
+
*/
|
|
1471
|
+
private croppingHeatmap;
|
|
1472
|
+
/**
|
|
1473
|
+
* 网格绘制热力图 我网格模式
|
|
1474
|
+
* @param grid 处理好的热力数据 每个网格的信号强度 和 坐标
|
|
1475
|
+
* @returns 网格热力图mesh
|
|
1476
|
+
*/
|
|
1477
|
+
private gridDrawing;
|
|
1478
|
+
/**
|
|
1479
|
+
* 渐变绘制热力图
|
|
1480
|
+
* @param grid 处理好的热力数据 每个网格的信号强度 和 坐标
|
|
1481
|
+
* @returns 渐变热力图mesh
|
|
1482
|
+
*/
|
|
1483
|
+
private gradientDrawing;
|
|
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
|
+
|
|
853
1525
|
/** 热力图点 */
|
|
854
1526
|
export declare type HeatmapPoint = Point & {
|
|
855
1527
|
/** 信号强度 */
|
|
@@ -886,30 +1558,176 @@ export declare type IconPoint = Point & {
|
|
|
886
1558
|
rotation?: number
|
|
887
1559
|
}
|
|
888
1560
|
|
|
889
|
-
/** 图标尺寸 */
|
|
890
|
-
export declare type IconSize = {
|
|
891
|
-
/** 宽度 */
|
|
892
|
-
width: number
|
|
893
|
-
/** 高度 */
|
|
894
|
-
height: number
|
|
895
|
-
}
|
|
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;
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
declare type LayerName = (typeof LAYERS)[number];
|
|
896
1716
|
|
|
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
|
-
}
|
|
1717
|
+
declare const LAYERS: string[];
|
|
911
1718
|
|
|
912
|
-
|
|
1719
|
+
/** 管理器类型定义 */
|
|
1720
|
+
declare type Managers = {
|
|
1721
|
+
mapManager: MapManager;
|
|
1722
|
+
heatmapManager: HeatmapManager;
|
|
1723
|
+
pathManager: PathManager;
|
|
1724
|
+
controlsManager: ControlsManager;
|
|
1725
|
+
detectedObjectManager: DetectedObjectManager;
|
|
1726
|
+
customElementsManager: CustomElementsManager;
|
|
1727
|
+
roomsManager: RoomManager;
|
|
1728
|
+
};
|
|
1729
|
+
|
|
1730
|
+
export declare const MAP_API_METHODS: readonly ["areRoomsAdjacent", "resetPanZoom", "getForbiddenSweepZones", "getForbiddenMopZones", "getCleanZones", "getVirtualWalls", "getSpots", "getViewportCenterPoint", "getMapCenterPoint", "getWallPointsByViewportCenter", "getForbiddenSweepZonePointsByViewportCenter", "getForbiddenMopZonePointsByViewportCenter", "getCleanZonePointsByViewportCenter", "getSpotPointByViewportCenter", "getEffectiveDividerPoints", "getDividerEndPoints", "snapshot", "snapshotByData"];
|
|
913
1731
|
|
|
914
1732
|
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"];
|
|
915
1733
|
|
|
@@ -1066,6 +1884,18 @@ export declare interface MapApi {
|
|
|
1066
1884
|
offsetX?: number;
|
|
1067
1885
|
offsetY?: number;
|
|
1068
1886
|
}): Point;
|
|
1887
|
+
/**
|
|
1888
|
+
* 判断指定的房间是否相邻(连通)
|
|
1889
|
+
*
|
|
1890
|
+
* 支持结构化地图和点阵地图两种协议。对于多个房间,使用连通性算法判断:
|
|
1891
|
+
* 只要房间之间能通过相邻关系连接起来,就认为它们是相邻的。
|
|
1892
|
+
* 例如:房间A和B相邻,房间B和C相邻,则认为A、B、C三个房间都相邻。
|
|
1893
|
+
*
|
|
1894
|
+
* @param roomIds - 要检测的房间ID数组
|
|
1895
|
+
* @param threshold - 距离阈值(像素),默认为5。两个房间的边界点距离小于等于此阈值时认为相邻
|
|
1896
|
+
* @returns 是否所有指定的房间都相邻(连通)
|
|
1897
|
+
*/
|
|
1898
|
+
areRoomsAdjacent(roomIds: number[], threshold?: number): boolean;
|
|
1069
1899
|
/**
|
|
1070
1900
|
* 地图截图
|
|
1071
1901
|
*
|
|
@@ -1436,6 +2266,29 @@ export declare class MapApplication extends Application implements MapApi {
|
|
|
1436
2266
|
offsetX?: number;
|
|
1437
2267
|
offsetY?: number;
|
|
1438
2268
|
}): Point;
|
|
2269
|
+
/**
|
|
2270
|
+
* 判断指定的房间是否相邻(连通)
|
|
2271
|
+
*
|
|
2272
|
+
* 支持结构化地图和点阵地图两种协议。对于多个房间,使用连通性算法判断:
|
|
2273
|
+
* 只要房间之间能通过相邻关系连接起来,就认为它们是相邻的。
|
|
2274
|
+
* 例如:房间A和B相邻,房间B和C相邻,则认为A、B、C三个房间都相邻。
|
|
2275
|
+
*
|
|
2276
|
+
* @param roomIds - 要检测的房间ID数组
|
|
2277
|
+
* @param threshold - 距离阈值(像素),默认为3。两个房间的边界点距离小于等于此阈值时认为相邻
|
|
2278
|
+
* @returns 是否所有指定的房间都相邻(连通)
|
|
2279
|
+
*
|
|
2280
|
+
* @example
|
|
2281
|
+
* ```typescript
|
|
2282
|
+
* // 判断两个房间是否相邻
|
|
2283
|
+
* const isAdjacent = mapApi.areRoomsAdjacent([1, 2])
|
|
2284
|
+
*
|
|
2285
|
+
* // 判断三个房间是否相邻(连通),使用自定义阈值
|
|
2286
|
+
* const isAdjacent = mapApi.areRoomsAdjacent([1, 2, 3], 8)
|
|
2287
|
+
* ```
|
|
2288
|
+
*/
|
|
2289
|
+
areRoomsAdjacent(roomIds: number[], threshold?: number): boolean;
|
|
2290
|
+
/* Excluded from this release type: areStructuredRoomsAdjacentInternal */
|
|
2291
|
+
/* Excluded from this release type: areRasterRoomsAdjacentInternal */
|
|
1439
2292
|
/**
|
|
1440
2293
|
* 地图截图
|
|
1441
2294
|
*
|
|
@@ -1778,6 +2631,77 @@ export declare type MapDataSource = {
|
|
|
1778
2631
|
version: string
|
|
1779
2632
|
}
|
|
1780
2633
|
|
|
2634
|
+
declare class MapManager {
|
|
2635
|
+
obstacle: Obstacle;
|
|
2636
|
+
free: Free;
|
|
2637
|
+
roomFill: RoomFill;
|
|
2638
|
+
carpet: Carpet;
|
|
2639
|
+
chargingStation: ChargingStation;
|
|
2640
|
+
mapBounds: Bounds;
|
|
2641
|
+
private lastMapId;
|
|
2642
|
+
private roomGeometryMap;
|
|
2643
|
+
private rasterRoomPixelsMap;
|
|
2644
|
+
private carpetData;
|
|
2645
|
+
private unsubscribeFns;
|
|
2646
|
+
constructor();
|
|
2647
|
+
/**
|
|
2648
|
+
* 处理结构化地图数据(房间形状、障碍物等)
|
|
2649
|
+
*/
|
|
2650
|
+
drawMap(mapData: MapDataSource): Promise<boolean>;
|
|
2651
|
+
/**
|
|
2652
|
+
* 处理栅格地图数据
|
|
2653
|
+
* @param mapPointsStr 栅格数据字符串
|
|
2654
|
+
* @param width 地图宽度
|
|
2655
|
+
* @param height 地图高度
|
|
2656
|
+
* @param charger 充电桩信息
|
|
2657
|
+
*/
|
|
2658
|
+
drawRasterMap(rasterData: ParsedRasterMapData_2, mapState: MapState): Promise<boolean>;
|
|
2659
|
+
/**
|
|
2660
|
+
* 重置几何数据和边界
|
|
2661
|
+
*/
|
|
2662
|
+
private resetGeometryData;
|
|
2663
|
+
/**
|
|
2664
|
+
* 更新地毯显示
|
|
2665
|
+
* 类似于RoomFloorType的模式,根据当前状态决定是否重建地毯
|
|
2666
|
+
*/
|
|
2667
|
+
private createCarpet;
|
|
2668
|
+
/**
|
|
2669
|
+
* 处理房间几何数据,计算所有需要的几何信息
|
|
2670
|
+
* 返回所有房间的几何数据(包括正常房间和未知房间)
|
|
2671
|
+
*/
|
|
2672
|
+
private processRoomsGeometry;
|
|
2673
|
+
/**
|
|
2674
|
+
* 合并所有图层的边界
|
|
2675
|
+
*/
|
|
2676
|
+
private mergeLayerBounds;
|
|
2677
|
+
/**
|
|
2678
|
+
* 根据ID查找房间几何信息
|
|
2679
|
+
*/
|
|
2680
|
+
getRoomById(id: number): Room | undefined;
|
|
2681
|
+
/**
|
|
2682
|
+
* 清空地图组件
|
|
2683
|
+
*/
|
|
2684
|
+
private clearComponents;
|
|
2685
|
+
/**
|
|
2686
|
+
* 处理栅格数据,统一处理排序和颜色分配
|
|
2687
|
+
* @param rasterData 原始栅格数据
|
|
2688
|
+
* @returns 处理后的栅格数据,包含排序和颜色信息
|
|
2689
|
+
*/
|
|
2690
|
+
private processRasterData;
|
|
2691
|
+
/**
|
|
2692
|
+
* 为栅格地图生成房间几何信息供 RoomManager 使用
|
|
2693
|
+
* @param rasterData 解析后的栅格数据
|
|
2694
|
+
*/
|
|
2695
|
+
private generateRoomGeometryFromRaster;
|
|
2696
|
+
/**
|
|
2697
|
+
* 获取点阵房间的像素数据
|
|
2698
|
+
* @param roomId 房间ID
|
|
2699
|
+
* @returns 像素索引数组,如果不存在则返回 undefined
|
|
2700
|
+
*/
|
|
2701
|
+
getRasterRoomPixels(roomId: number): Uint32Array | undefined;
|
|
2702
|
+
destroy(): void;
|
|
2703
|
+
}
|
|
2704
|
+
|
|
1781
2705
|
/**
|
|
1782
2706
|
* 地图状态对象
|
|
1783
2707
|
*
|
|
@@ -1806,6 +2730,24 @@ export declare type MapState = {
|
|
|
1806
2730
|
version?: number
|
|
1807
2731
|
}
|
|
1808
2732
|
|
|
2733
|
+
declare class Obstacle extends Graphics {
|
|
2734
|
+
constructor();
|
|
2735
|
+
/**
|
|
2736
|
+
* 绘制结构化障碍物数据
|
|
2737
|
+
* @param obstacles 障碍物数据数组
|
|
2738
|
+
*/
|
|
2739
|
+
draw(obstacles: {
|
|
2740
|
+
coordinates: number[];
|
|
2741
|
+
}[]): void;
|
|
2742
|
+
/**
|
|
2743
|
+
* 绘制栅格障碍物数据
|
|
2744
|
+
* @param obstacleIndices 障碍物像素点索引数组
|
|
2745
|
+
* @param width 地图宽度
|
|
2746
|
+
*/
|
|
2747
|
+
drawRaster(obstacleIndices: Uint32Array, width: number): void;
|
|
2748
|
+
destroy(options?: DestroyOptions | boolean): void;
|
|
2749
|
+
}
|
|
2750
|
+
|
|
1809
2751
|
/**
|
|
1810
2752
|
* 解析后的点阵地图数据
|
|
1811
2753
|
*/
|
|
@@ -1824,6 +2766,116 @@ export declare type ParsedRasterMapData = {
|
|
|
1824
2766
|
totalPixels: number
|
|
1825
2767
|
}
|
|
1826
2768
|
|
|
2769
|
+
declare class Path extends Container {
|
|
2770
|
+
private commonPath;
|
|
2771
|
+
private chargePath;
|
|
2772
|
+
private transitionsPath;
|
|
2773
|
+
private mopPath;
|
|
2774
|
+
private pathData;
|
|
2775
|
+
private lastPointCount;
|
|
2776
|
+
private lastDrawnPosition;
|
|
2777
|
+
private isRealTimeDrawing;
|
|
2778
|
+
private throttledUpdateLineWidth;
|
|
2779
|
+
private throttledHandleRobotPosition;
|
|
2780
|
+
constructor();
|
|
2781
|
+
/**
|
|
2782
|
+
* 注册事件监听
|
|
2783
|
+
*/
|
|
2784
|
+
private registerEventListeners;
|
|
2785
|
+
/**
|
|
2786
|
+
* 处理机器人动画完成事件
|
|
2787
|
+
*/
|
|
2788
|
+
private handleRobotAnimationComplete;
|
|
2789
|
+
/**
|
|
2790
|
+
* 实际处理机器人位置更新的方法
|
|
2791
|
+
*/
|
|
2792
|
+
private handleRobotPositionUpdate;
|
|
2793
|
+
/**
|
|
2794
|
+
* 更新线宽以响应缩放变化
|
|
2795
|
+
*/
|
|
2796
|
+
private updateLineWidth;
|
|
2797
|
+
/**
|
|
2798
|
+
* 重新绘制路径,应用适当的线宽
|
|
2799
|
+
* @param pathData 路径数据
|
|
2800
|
+
*/
|
|
2801
|
+
private redrawPaths;
|
|
2802
|
+
/**
|
|
2803
|
+
* 设置各类路径的样式
|
|
2804
|
+
*/
|
|
2805
|
+
private setupPathStyles;
|
|
2806
|
+
/**
|
|
2807
|
+
* 绘制路径线段
|
|
2808
|
+
* @param pathPoints 路径点数组
|
|
2809
|
+
*/
|
|
2810
|
+
private drawPathSegments;
|
|
2811
|
+
updatePositionByOrigin(x: number, y: number): void;
|
|
2812
|
+
/**
|
|
2813
|
+
* 全量绘制路径
|
|
2814
|
+
* @param pathData 路径数据
|
|
2815
|
+
*/
|
|
2816
|
+
drawFull(pathData: PathData): void;
|
|
2817
|
+
/**
|
|
2818
|
+
* 增量绘制路径(启用实时绘制模式)
|
|
2819
|
+
* @param pathData 路径数据
|
|
2820
|
+
*/
|
|
2821
|
+
drawIncremental(pathData: PathData): void;
|
|
2822
|
+
/**
|
|
2823
|
+
* 直接绘制新增的路径段(用于速度为0的情况)
|
|
2824
|
+
* @param newPoints 新增的路径点
|
|
2825
|
+
* @param lastCount 上次绘制的点数
|
|
2826
|
+
* @param allPoints 所有路径点(新数据)
|
|
2827
|
+
* @param oldPoints 旧的路径点数据(用于获取连接点)
|
|
2828
|
+
*/
|
|
2829
|
+
private drawNewPathSegments;
|
|
2830
|
+
/**
|
|
2831
|
+
* 停止实时绘制模式
|
|
2832
|
+
*/
|
|
2833
|
+
stopRealTimeDrawing(): void;
|
|
2834
|
+
destroy(options?: {
|
|
2835
|
+
children?: boolean;
|
|
2836
|
+
texture?: boolean;
|
|
2837
|
+
baseTexture?: boolean;
|
|
2838
|
+
}): void;
|
|
2839
|
+
}
|
|
2840
|
+
|
|
2841
|
+
declare class PathManager {
|
|
2842
|
+
path: Path;
|
|
2843
|
+
robot: Robot;
|
|
2844
|
+
private unsubscribeFns;
|
|
2845
|
+
private lastDrawnPathData;
|
|
2846
|
+
constructor();
|
|
2847
|
+
/**
|
|
2848
|
+
* 绘制路径和机器人
|
|
2849
|
+
*/
|
|
2850
|
+
draw(pathData: PathData): void;
|
|
2851
|
+
/**
|
|
2852
|
+
* 判断是否应该使用增量绘制
|
|
2853
|
+
*/
|
|
2854
|
+
private shouldUseIncrementalDraw;
|
|
2855
|
+
/**
|
|
2856
|
+
* 全量绘制模式:完整绘制路径和机器人(初始绘制和不满足增量条件时使用)
|
|
2857
|
+
*/
|
|
2858
|
+
private fullDraw;
|
|
2859
|
+
/**
|
|
2860
|
+
* 转换PathPoint为RobotPoint
|
|
2861
|
+
*/
|
|
2862
|
+
private convertToRobotPoint;
|
|
2863
|
+
/**
|
|
2864
|
+
* 处理机器人移动到指定点
|
|
2865
|
+
*/
|
|
2866
|
+
private moveRobotToPoint;
|
|
2867
|
+
/**
|
|
2868
|
+
* 增量绘制模式:只绘制新增部分,机器人平滑动画到新位置
|
|
2869
|
+
*/
|
|
2870
|
+
private incrementalDraw;
|
|
2871
|
+
/**
|
|
2872
|
+
* 批量处理机器人动画队列(用于快速跳转)
|
|
2873
|
+
*/
|
|
2874
|
+
batchProcessRobotQueue(jumpToLatest?: boolean): void;
|
|
2875
|
+
updatePositionByOrigin(x: number, y: number): void;
|
|
2876
|
+
destroy(): void;
|
|
2877
|
+
}
|
|
2878
|
+
|
|
1827
2879
|
/**
|
|
1828
2880
|
* 路径状态对象
|
|
1829
2881
|
* 描述机器人路径的状态信息
|
|
@@ -1885,6 +2937,37 @@ export declare type RasterRoomData = {
|
|
|
1885
2937
|
inactiveColor: string
|
|
1886
2938
|
}
|
|
1887
2939
|
|
|
2940
|
+
declare class Ring extends Graphics {
|
|
2941
|
+
private currentPosition;
|
|
2942
|
+
private config;
|
|
2943
|
+
constructor(options: RingOptions);
|
|
2944
|
+
/**
|
|
2945
|
+
* 设置反向缩放监听,保持描边宽度固定
|
|
2946
|
+
*/
|
|
2947
|
+
private setupAntiScaleListener;
|
|
2948
|
+
/**
|
|
2949
|
+
* 反向缩放事件处理
|
|
2950
|
+
*/
|
|
2951
|
+
private handleScaleChange;
|
|
2952
|
+
/**
|
|
2953
|
+
* 绘制预警圈
|
|
2954
|
+
* @param position 充电桩位置信息
|
|
2955
|
+
*/
|
|
2956
|
+
draw(position: Point): void;
|
|
2957
|
+
/**
|
|
2958
|
+
* 绘制虚线圆形
|
|
2959
|
+
*/
|
|
2960
|
+
private drawDashedCircle;
|
|
2961
|
+
/**
|
|
2962
|
+
* 重新绘制(当配置变化时调用)
|
|
2963
|
+
*/
|
|
2964
|
+
redraw(): void;
|
|
2965
|
+
/**
|
|
2966
|
+
* 销毁组件
|
|
2967
|
+
*/
|
|
2968
|
+
destroy(): void;
|
|
2969
|
+
}
|
|
2970
|
+
|
|
1888
2971
|
/** 预警圈配置 */
|
|
1889
2972
|
export declare type RingConfig = {
|
|
1890
2973
|
/** 大小(米) */
|
|
@@ -1901,6 +2984,81 @@ export declare type RingConfig = {
|
|
|
1901
2984
|
ringStrokeDashArray: [number, number]
|
|
1902
2985
|
}
|
|
1903
2986
|
|
|
2987
|
+
declare type RingOptions = {
|
|
2988
|
+
config: RingConfig;
|
|
2989
|
+
};
|
|
2990
|
+
|
|
2991
|
+
declare class Robot extends Container {
|
|
2992
|
+
robot: RobotIcon;
|
|
2993
|
+
ring: Ring;
|
|
2994
|
+
sleepAnimation: SleepAnimation | null;
|
|
2995
|
+
private unsubscribeFns;
|
|
2996
|
+
private targetPosition;
|
|
2997
|
+
private targetRotation;
|
|
2998
|
+
private isMoving;
|
|
2999
|
+
private pathQueue;
|
|
3000
|
+
private lastPosition;
|
|
3001
|
+
private currentPathType;
|
|
3002
|
+
private lastUpdateTime;
|
|
3003
|
+
constructor();
|
|
3004
|
+
/**
|
|
3005
|
+
* 异步初始化睡眠动画
|
|
3006
|
+
*/
|
|
3007
|
+
private initializeSleepAnimation;
|
|
3008
|
+
updatePositionByOrigin(x: number, y: number): void;
|
|
3009
|
+
/**
|
|
3010
|
+
* 立即绘制到指定位置(无动画)
|
|
3011
|
+
*/
|
|
3012
|
+
draw({ x, y, rotation }: IconPoint): Promise<void>;
|
|
3013
|
+
/**
|
|
3014
|
+
* 添加移动目标到队列(带动画)
|
|
3015
|
+
*/
|
|
3016
|
+
moveTo(point: RobotPoint): void;
|
|
3017
|
+
/**
|
|
3018
|
+
* 批量处理队列(快速跳转)
|
|
3019
|
+
*/
|
|
3020
|
+
batchProcessQueue(jumpToLatest?: boolean): void;
|
|
3021
|
+
/**
|
|
3022
|
+
* 处理队列中的下一个路径点
|
|
3023
|
+
*/
|
|
3024
|
+
private processNextPathPoint;
|
|
3025
|
+
/**
|
|
3026
|
+
* 动画更新循环
|
|
3027
|
+
*/
|
|
3028
|
+
private update;
|
|
3029
|
+
/**
|
|
3030
|
+
* 启动机器人动画渲染(只控制 Ticker start/stop,不 add/remove)
|
|
3031
|
+
*/
|
|
3032
|
+
private startRobotAnimation;
|
|
3033
|
+
/**
|
|
3034
|
+
* 重写 visible setter,确保睡眠动画能响应机器人可见性变化
|
|
3035
|
+
*/
|
|
3036
|
+
set visible(value: boolean);
|
|
3037
|
+
/**
|
|
3038
|
+
* 重写 visible getter
|
|
3039
|
+
*/
|
|
3040
|
+
get visible(): boolean;
|
|
3041
|
+
/**
|
|
3042
|
+
* 停止机器人动画渲染(只控制 Ticker start/stop,不 add/remove)
|
|
3043
|
+
*/
|
|
3044
|
+
private stopRobotAnimation;
|
|
3045
|
+
/**
|
|
3046
|
+
* 清除机器人动画状态
|
|
3047
|
+
*/
|
|
3048
|
+
remove(): void;
|
|
3049
|
+
destroy(options?: {
|
|
3050
|
+
children?: boolean;
|
|
3051
|
+
texture?: boolean;
|
|
3052
|
+
baseTexture?: boolean;
|
|
3053
|
+
}): void;
|
|
3054
|
+
}
|
|
3055
|
+
|
|
3056
|
+
declare class RobotIcon extends EnhancedSprite {
|
|
3057
|
+
constructor();
|
|
3058
|
+
initializeSprite(): Promise<void>;
|
|
3059
|
+
draw({ x, y, rotation }: IconPoint): Promise<void>;
|
|
3060
|
+
}
|
|
3061
|
+
|
|
1904
3062
|
/** 机器人点 */
|
|
1905
3063
|
export declare type RobotPoint = IconPoint & {
|
|
1906
3064
|
/** 点类型 */
|
|
@@ -1939,6 +3097,139 @@ export declare type RoomData = RoomProperty & {
|
|
|
1939
3097
|
index: number
|
|
1940
3098
|
}
|
|
1941
3099
|
|
|
3100
|
+
declare class RoomFill extends Container {
|
|
3101
|
+
private roomGraphicsMap;
|
|
3102
|
+
private roomContextMap;
|
|
3103
|
+
private roomClickHandlerMap;
|
|
3104
|
+
private unsubscribeFns;
|
|
3105
|
+
private mapWidth;
|
|
3106
|
+
private rasterRoomDataMap;
|
|
3107
|
+
constructor();
|
|
3108
|
+
/**
|
|
3109
|
+
* 绘制结构化协议地图房间
|
|
3110
|
+
* @param rooms 房间数据
|
|
3111
|
+
*/
|
|
3112
|
+
draw(rooms: Room[]): void;
|
|
3113
|
+
/**
|
|
3114
|
+
* 绘制栅格房间数据
|
|
3115
|
+
* @param processedData 处理后的栅格数据,包含排序和颜色信息
|
|
3116
|
+
*/
|
|
3117
|
+
drawRaster(processedData: ProcessedRasterData): void;
|
|
3118
|
+
/**
|
|
3119
|
+
* 绘制栅格房间(统一方法,处理数字房间和特殊房间)
|
|
3120
|
+
*/
|
|
3121
|
+
private drawRasterRoom;
|
|
3122
|
+
/**
|
|
3123
|
+
* 分批绘制像素点
|
|
3124
|
+
*/
|
|
3125
|
+
private drawPixelPointsInBatches;
|
|
3126
|
+
/**
|
|
3127
|
+
* 处理房间点击事件
|
|
3128
|
+
*/
|
|
3129
|
+
private handleRoomClick;
|
|
3130
|
+
/**
|
|
3131
|
+
* 根据选中的房间ID数组设置房间状态
|
|
3132
|
+
* @param selectRoomIds 选中的房间ID数组
|
|
3133
|
+
*/
|
|
3134
|
+
setRoomStateBySelectIds(selectRoomIds: readonly number[]): void;
|
|
3135
|
+
/**
|
|
3136
|
+
* 切换单个房间的状态
|
|
3137
|
+
* @param roomId 房间ID
|
|
3138
|
+
* @param isActive 是否为激活状态
|
|
3139
|
+
*/
|
|
3140
|
+
setRoomState(roomId: number | SpecialRoomId, isActive: boolean): void;
|
|
3141
|
+
/**
|
|
3142
|
+
* 设置所有房间为同一状态
|
|
3143
|
+
* @param isActive 是否为激活状态
|
|
3144
|
+
*/
|
|
3145
|
+
setAllRoomsState(isActive: boolean): void;
|
|
3146
|
+
/**
|
|
3147
|
+
* 获取数字房间的Graphics映射(用于地板材质创建)
|
|
3148
|
+
* @returns 房间ID到Graphics的映射
|
|
3149
|
+
*/
|
|
3150
|
+
getRoomGraphicsMap(): Map<number, Graphics>;
|
|
3151
|
+
/**
|
|
3152
|
+
* 获取栅格房间数据(用于精确碰撞检测)
|
|
3153
|
+
* @param roomId 房间ID
|
|
3154
|
+
* @returns 栅格房间数据或null
|
|
3155
|
+
*/
|
|
3156
|
+
getRasterRoomData(roomId: number | SpecialRoomId): RasterRoomData | null;
|
|
3157
|
+
/**
|
|
3158
|
+
* 获取地图宽度(用于像素索引转换)
|
|
3159
|
+
*/
|
|
3160
|
+
getMapWidth(): number;
|
|
3161
|
+
/**
|
|
3162
|
+
* 清除所有房间
|
|
3163
|
+
*/
|
|
3164
|
+
private clearRooms;
|
|
3165
|
+
/**
|
|
3166
|
+
* 销毁时清理资源
|
|
3167
|
+
*/
|
|
3168
|
+
destroy(): void;
|
|
3169
|
+
}
|
|
3170
|
+
|
|
3171
|
+
declare class RoomManager {
|
|
3172
|
+
private unsubscribeFns;
|
|
3173
|
+
private roomInfoContainer;
|
|
3174
|
+
private roomInfoMap;
|
|
3175
|
+
private roomDisplayMap;
|
|
3176
|
+
private roomFloorType;
|
|
3177
|
+
constructor();
|
|
3178
|
+
/**
|
|
3179
|
+
* 设置房间属性数据(房间名称、清洁模式等)
|
|
3180
|
+
* 一次性获取并存储所有必要的显示数据
|
|
3181
|
+
*/
|
|
3182
|
+
drawRoomProperty(properties: RoomProperty[]): boolean;
|
|
3183
|
+
/**
|
|
3184
|
+
* 更新房间信息显示
|
|
3185
|
+
* 直接使用已存储的完整显示数据
|
|
3186
|
+
*/
|
|
3187
|
+
private updateRoomInfoDisplay;
|
|
3188
|
+
/**
|
|
3189
|
+
* 创建单个房间的信息组件
|
|
3190
|
+
*/
|
|
3191
|
+
private createRoomInfo;
|
|
3192
|
+
/**
|
|
3193
|
+
* 更新特定房间的名称
|
|
3194
|
+
*/
|
|
3195
|
+
updateRoomName(roomId: number, name: string): void;
|
|
3196
|
+
/**
|
|
3197
|
+
* 更新特定房间的位置
|
|
3198
|
+
*/
|
|
3199
|
+
updateRoomPosition(roomId: number, centerPoint: Point): void;
|
|
3200
|
+
/**
|
|
3201
|
+
* 清除所有房间信息
|
|
3202
|
+
*/
|
|
3203
|
+
private clearRoomInfos;
|
|
3204
|
+
/**
|
|
3205
|
+
* 根据ID查找房间显示数据
|
|
3206
|
+
*/
|
|
3207
|
+
getRoomPropertyById(id: number): RoomData | undefined;
|
|
3208
|
+
/**
|
|
3209
|
+
* 当房间几何数据更新时,刷新房间信息显示
|
|
3210
|
+
* 这个方法由 MapManager 在房间几何数据更新后调用
|
|
3211
|
+
*/
|
|
3212
|
+
refresh(): void;
|
|
3213
|
+
/**
|
|
3214
|
+
* 更新所有房间属性的可见性
|
|
3215
|
+
*/
|
|
3216
|
+
private updateAllRoomPropertyVisibility;
|
|
3217
|
+
/**
|
|
3218
|
+
* 更新所有房间名称的可见性
|
|
3219
|
+
*/
|
|
3220
|
+
private updateAllRoomNameVisibility;
|
|
3221
|
+
/**
|
|
3222
|
+
* 更新所有房间选择指示器的可见性
|
|
3223
|
+
*/
|
|
3224
|
+
private updateAllRoomSelectionIndicatorVisibility;
|
|
3225
|
+
/**
|
|
3226
|
+
* 更新地板材质
|
|
3227
|
+
* 在房间几何数据或属性数据更新后调用
|
|
3228
|
+
*/
|
|
3229
|
+
private updateFloorTypes;
|
|
3230
|
+
destroy(): void;
|
|
3231
|
+
}
|
|
3232
|
+
|
|
1942
3233
|
/**
|
|
1943
3234
|
* 房间属性信息
|
|
1944
3235
|
*/
|
|
@@ -2032,6 +3323,70 @@ export declare type RuntimeConfig = {
|
|
|
2032
3323
|
showRobotSleepAnimation: boolean
|
|
2033
3324
|
}
|
|
2034
3325
|
|
|
3326
|
+
/**
|
|
3327
|
+
* 机器人睡眠动画组件
|
|
3328
|
+
* TODO
|
|
3329
|
+
* 暂时不开放这个组件,得找到合适的动画
|
|
3330
|
+
* 基于 FixedSizeAnimatedSprite,显示机器人睡眠状态的动画效果
|
|
3331
|
+
*/
|
|
3332
|
+
declare class SleepAnimation extends EnhancedAnimatedSprite {
|
|
3333
|
+
private unsubscribeFns;
|
|
3334
|
+
private throttledUpdateOffset;
|
|
3335
|
+
private fixedOffsetX;
|
|
3336
|
+
private fixedOffsetY;
|
|
3337
|
+
constructor(textures: Texture[]);
|
|
3338
|
+
/**
|
|
3339
|
+
* 静态创建方法
|
|
3340
|
+
*/
|
|
3341
|
+
static create(): Promise<SleepAnimation>;
|
|
3342
|
+
/**
|
|
3343
|
+
* 初始化睡眠动画
|
|
3344
|
+
*/
|
|
3345
|
+
private initializeAnimation;
|
|
3346
|
+
/**
|
|
3347
|
+
* 判断是否应该显示睡眠动画
|
|
3348
|
+
* 显示条件:
|
|
3349
|
+
* 1. 配置中启用睡眠动画
|
|
3350
|
+
* 2. 机器人容器可见
|
|
3351
|
+
* 3. 机器人图标已经绘制(有位置信息)
|
|
3352
|
+
*/
|
|
3353
|
+
private shouldShow;
|
|
3354
|
+
/**
|
|
3355
|
+
* 更新可见性状态
|
|
3356
|
+
*/
|
|
3357
|
+
private updateVisibility;
|
|
3358
|
+
/**
|
|
3359
|
+
* 更新偏移量以保持固定大小
|
|
3360
|
+
* @param _scale 当前地图缩放比例
|
|
3361
|
+
*/
|
|
3362
|
+
private updateOffset;
|
|
3363
|
+
/**
|
|
3364
|
+
* 绘制睡眠动画
|
|
3365
|
+
* @param params 绘制参数
|
|
3366
|
+
*/
|
|
3367
|
+
draw(params: IconPoint): void;
|
|
3368
|
+
/**
|
|
3369
|
+
* 当机器人图标可见性变化时调用
|
|
3370
|
+
*/
|
|
3371
|
+
onRobotVisibilityChanged(): void;
|
|
3372
|
+
/**
|
|
3373
|
+
* 重写 visible setter,确保动画播放状态与可见性同步
|
|
3374
|
+
*/
|
|
3375
|
+
set visible(value: boolean);
|
|
3376
|
+
/**
|
|
3377
|
+
* 重写 visible getter
|
|
3378
|
+
*/
|
|
3379
|
+
get visible(): boolean;
|
|
3380
|
+
/**
|
|
3381
|
+
* 组件销毁时清理资源
|
|
3382
|
+
*/
|
|
3383
|
+
destroy(options?: {
|
|
3384
|
+
children?: boolean;
|
|
3385
|
+
texture?: boolean;
|
|
3386
|
+
baseTexture?: boolean;
|
|
3387
|
+
}): void;
|
|
3388
|
+
}
|
|
3389
|
+
|
|
2035
3390
|
/** 定点清扫配置 */
|
|
2036
3391
|
export declare type SpotConfig = {
|
|
2037
3392
|
/** 图标资源路径 */
|
|
@@ -2082,6 +3437,46 @@ export declare type SpotParam = {
|
|
|
2082
3437
|
*/
|
|
2083
3438
|
export declare function useAppService(): AppService;
|
|
2084
3439
|
|
|
3440
|
+
declare class ViewportContainer extends Container {
|
|
3441
|
+
private viewportBounds;
|
|
3442
|
+
private maskGraphics;
|
|
3443
|
+
private containerElement;
|
|
3444
|
+
constructor(config: AppConfig, containerElement?: HTMLElement | Window);
|
|
3445
|
+
/**
|
|
3446
|
+
* 计算视口边界
|
|
3447
|
+
*/
|
|
3448
|
+
private calculateViewportBounds;
|
|
3449
|
+
/**
|
|
3450
|
+
* 获取容器尺寸
|
|
3451
|
+
*/
|
|
3452
|
+
private getContainerSize;
|
|
3453
|
+
/**
|
|
3454
|
+
* 创建遮罩限制内容在视口内
|
|
3455
|
+
*/
|
|
3456
|
+
private createMask;
|
|
3457
|
+
/**
|
|
3458
|
+
* 解析尺寸参数
|
|
3459
|
+
*/
|
|
3460
|
+
private parseSize;
|
|
3461
|
+
/**
|
|
3462
|
+
* 获取视口边界
|
|
3463
|
+
*/
|
|
3464
|
+
getViewportBounds(): {
|
|
3465
|
+
x: number;
|
|
3466
|
+
y: number;
|
|
3467
|
+
width: number;
|
|
3468
|
+
height: number;
|
|
3469
|
+
};
|
|
3470
|
+
/**
|
|
3471
|
+
* 更新视口配置
|
|
3472
|
+
*/
|
|
3473
|
+
updateViewport(config: AppConfig): void;
|
|
3474
|
+
/**
|
|
3475
|
+
* 添加内容到视口容器
|
|
3476
|
+
*/
|
|
3477
|
+
addContent(content: Container): void;
|
|
3478
|
+
}
|
|
3479
|
+
|
|
2085
3480
|
/** 虚拟墙配置 */
|
|
2086
3481
|
export declare type VirtualWallConfig = {
|
|
2087
3482
|
/** 图标容器填充颜色 */
|