@ray-js/robot-map-sdk 0.0.9-beta.3 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constant/methods.js +1 -1
- package/dist/index.d.ts +177 -6
- package/dist/index.rjs.js +1 -1
- package/dist-app/assets/doubleBed-CzextF6m.png +0 -0
- package/dist-app/assets/index-BzBtiwcY.js +1 -0
- package/dist-app/index.html +1 -1
- package/dist-docs/404.html +2 -2
- package/dist-docs/assets/{app.BhvJYn39.js → app.BJnAJzet.js} +1 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.HZmZuAtg.js +1 -0
- package/dist-docs/assets/chunks/{VPLocalSearchBox.B8QXL3Iw.js → VPLocalSearchBox.D9iYIKMO.js} +1 -1
- package/dist-docs/assets/chunks/{theme.Nx563P9F.js → theme.D78lSkQK.js} +2 -2
- package/dist-docs/assets/{guide_advanced-usage.md.BQuNyTwG.js → guide_advanced-usage.md.BPrKHNKt.js} +81 -3
- package/dist-docs/assets/{guide_advanced-usage.md.BQuNyTwG.lean.js → guide_advanced-usage.md.BPrKHNKt.lean.js} +1 -1
- package/dist-docs/assets/{guide_getting-started.md.COeLD2eD.js → guide_getting-started.md.Zvm4buzY.js} +1 -1
- package/dist-docs/assets/plans_2026-03-04-detected-objects-visibility-design.md.530AI9zE.js +1 -0
- package/dist-docs/assets/plans_2026-03-04-detected-objects-visibility-design.md.530AI9zE.lean.js +1 -0
- package/dist-docs/assets/plans_2026-03-04-show-detected-objects-implementation-plan.md.foeG7qiK.js +34 -0
- package/dist-docs/assets/plans_2026-03-04-show-detected-objects-implementation-plan.md.foeG7qiK.lean.js +1 -0
- package/dist-docs/assets/records_bugs_2026-02-28-fix-pixi-bindgroup-webgpu-snapshot-whitescreen-bugfix.md.BT3816jW.js +2 -0
- package/dist-docs/assets/records_bugs_2026-02-28-fix-pixi-bindgroup-webgpu-snapshot-whitescreen-bugfix.md.BT3816jW.lean.js +1 -0
- package/dist-docs/assets/records_plans_2026-03-02-furniture-feature-plan.md.DkXKivuL.js +1 -0
- package/dist-docs/assets/records_plans_2026-03-02-furniture-feature-plan.md.DkXKivuL.lean.js +1 -0
- package/dist-docs/assets/{reference_callbacks.md.CZ8IiuH-.js → reference_callbacks.md.CwvDSJWk.js} +2 -2
- package/dist-docs/assets/{reference_callbacks.md.CZ8IiuH-.lean.js → reference_callbacks.md.CwvDSJWk.lean.js} +1 -1
- package/dist-docs/assets/{reference_config.md.B0jHOsqG.js → reference_config.md.CK4ueBig.js} +24 -3
- package/dist-docs/assets/reference_config.md.CK4ueBig.lean.js +1 -0
- package/dist-docs/assets/{reference_methods.md.CEJFnJJg.js → reference_methods.md.CL2sjTJ7.js} +8 -3
- package/dist-docs/assets/reference_methods.md.CL2sjTJ7.lean.js +1 -0
- package/dist-docs/assets/{reference_runtime.md.BnT09w_m.js → reference_runtime.md.aDpGKfHs.js} +3 -2
- package/dist-docs/assets/{reference_runtime.md.BnT09w_m.lean.js → reference_runtime.md.aDpGKfHs.lean.js} +1 -1
- package/dist-docs/assets/{reference_types.md.CL_VFfB8.js → reference_types.md.D2IglsHQ.js} +9 -2
- package/dist-docs/assets/{reference_types.md.CL_VFfB8.lean.js → reference_types.md.D2IglsHQ.lean.js} +1 -1
- package/dist-docs/guide/advanced-usage.html +84 -6
- package/dist-docs/guide/concepts.html +3 -3
- package/dist-docs/guide/getting-started.html +5 -5
- package/dist-docs/guide/mcp.html +3 -3
- package/dist-docs/hashmap.json +1 -1
- package/dist-docs/index.html +3 -3
- package/dist-docs/plans/2026-03-04-detected-objects-visibility-design.html +25 -0
- package/dist-docs/plans/2026-03-04-show-detected-objects-implementation-plan.html +58 -0
- package/dist-docs/records/bugs/2026-02-28-fix-pixi-bindgroup-webgpu-snapshot-whitescreen-bugfix.html +26 -0
- package/dist-docs/records/plans/2026-03-02-furniture-feature-plan.html +25 -0
- package/dist-docs/reference/callbacks.html +5 -5
- package/dist-docs/reference/config.html +27 -6
- package/dist-docs/reference/data.html +3 -3
- package/dist-docs/reference/methods.html +11 -6
- package/dist-docs/reference/runtime.html +6 -5
- package/dist-docs/reference/types.html +12 -5
- package/dist-docs/reference/utils.html +3 -3
- package/package.json +2 -2
- package/dist-app/assets/index-B29F5iw3.js +0 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.BcHnsGL-.js +0 -1
- package/dist-docs/assets/reference_config.md.B0jHOsqG.lean.js +0 -1
- package/dist-docs/assets/reference_methods.md.CEJFnJJg.lean.js +0 -1
- /package/dist-docs/assets/{guide_getting-started.md.COeLD2eD.lean.js → guide_getting-started.md.Zvm4buzY.lean.js} +0 -0
package/dist/constant/methods.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=["areRoomsAdjacent","getForbiddenSweepZones","getForbiddenMopZones","getCleanZones","getVirtualWalls","getSpots","getWayPoints","getViewportCenterPoint","getMapCenterPoint","getWallPointsByViewportCenter","getForbiddenSweepZonePointsByViewportCenter","getForbiddenMopZonePointsByViewportCenter","getCleanZonePointsByViewportCenter","getSpotPointByViewportCenter","getEffectiveDividerPoints","getDividerEndPoints","isNearChargerOrRobot","isPointInAnyRoom","isWallIntersectsAnyRoom","isZoneIntersectsAnyRoom","resetPanZoom","snapshot","snapshotByData","getCustomCarpets","forceEndGesture"],o=["onMapFirstDrawed","onMapDrawed","onPathDrawed","onRoomPropertiesDrawed","onClickRoom","onClickRoomProperties","onRemoveForbiddenSweepZone","onRemoveForbiddenMopZone","onRemoveCleanZone","onRemoveVirtualWall","onUpdateForbiddenSweepZone","onUpdateForbiddenMopZone","onUpdateCleanZone","onUpdateVirtualWall","onUpdateSpot","onUpdateWayPoint","onUpdateDivider","onClickForbiddenSweepZone","onClickForbiddenMopZone","onClickCleanZone","onClickVirtualWall","onClickSpot","onClickWayPoint","onClickDetectedObject","onClickCustomElement","onClickMap","onClickCarpet","onDeleteCarpet","onUpdateCustomCarpet","onDeleteCustomCarpet","onGestureStart","onGestureEnd","onClickRobot","onClickChargingStation"];export{e as MAP_API_METHODS,o as MAP_CALLBACK_METHODS};
|
|
1
|
+
const e=["areRoomsAdjacent","getForbiddenSweepZones","getForbiddenMopZones","getCleanZones","getVirtualWalls","getSpots","getWayPoints","getViewportCenterPoint","getMapCenterPoint","getWallPointsByViewportCenter","getForbiddenSweepZonePointsByViewportCenter","getForbiddenMopZonePointsByViewportCenter","getCleanZonePointsByViewportCenter","getSpotPointByViewportCenter","getEffectiveDividerPoints","getDividerEndPoints","isNearChargerOrRobot","isPointInAnyRoom","isWallIntersectsAnyRoom","isZoneIntersectsAnyRoom","resetPanZoom","snapshot","snapshotByData","getCustomCarpets","forceEndGesture","getFurniturePointsByViewportCenter"],o=["onMapFirstDrawed","onMapDrawed","onPathDrawed","onRoomPropertiesDrawed","onClickRoom","onClickRoomProperties","onRemoveForbiddenSweepZone","onRemoveForbiddenMopZone","onRemoveCleanZone","onRemoveVirtualWall","onUpdateForbiddenSweepZone","onUpdateForbiddenMopZone","onUpdateCleanZone","onUpdateVirtualWall","onUpdateSpot","onUpdateWayPoint","onUpdateDivider","onClickForbiddenSweepZone","onClickForbiddenMopZone","onClickCleanZone","onClickVirtualWall","onClickSpot","onClickWayPoint","onClickDetectedObject","onClickCustomElement","onClickMap","onClickCarpet","onDeleteCarpet","onUpdateCustomCarpet","onDeleteCustomCarpet","onGestureStart","onGestureEnd","onClickRobot","onClickChargingStation","onRemoveFurniture","onUpdateFurniture","onClickFurniture"];export{e as MAP_API_METHODS,o as MAP_CALLBACK_METHODS};
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ import { DividerConfig as DividerConfig_2 } from '..';
|
|
|
15
15
|
import { EditControlManager } from '../managers/EditControlManager';
|
|
16
16
|
import { Emitter } from 'mitt';
|
|
17
17
|
import { FederatedPointerEvent } from 'pixi.js';
|
|
18
|
+
import { FurnitureConfig as FurnitureConfig_2 } from '..';
|
|
19
|
+
import { FurnitureManager } from '../managers/FurnitureManager';
|
|
18
20
|
import { Graphics } from 'pixi.js';
|
|
19
21
|
import { HeatmapManager } from '../managers/HeatmapManager';
|
|
20
22
|
import { Interaction } from './Interaction';
|
|
@@ -536,6 +538,9 @@ export declare type AppConfig = {
|
|
|
536
538
|
/** 控制元素配置 */
|
|
537
539
|
controls: ControlsConfig
|
|
538
540
|
|
|
541
|
+
/** 家具配置 */
|
|
542
|
+
furniture: FurnitureConfig
|
|
543
|
+
|
|
539
544
|
/** 分割线配置 */
|
|
540
545
|
divider: DividerConfig
|
|
541
546
|
|
|
@@ -923,6 +928,7 @@ declare class AppService {
|
|
|
923
928
|
enableChargingStationClick?: boolean;
|
|
924
929
|
};
|
|
925
930
|
get controlsConfig(): ControlsConfig_2;
|
|
931
|
+
get furnitureConfig(): FurnitureConfig_2;
|
|
926
932
|
get dividerConfig(): DividerConfig_2;
|
|
927
933
|
get detectedObjectConfig(): {
|
|
928
934
|
height: number;
|
|
@@ -947,6 +953,7 @@ declare class AppService {
|
|
|
947
953
|
get customElementsManager(): CustomElementsManager;
|
|
948
954
|
get roomsManager(): RoomManager;
|
|
949
955
|
get editControlManager(): EditControlManager;
|
|
956
|
+
get furnitureManager(): FurnitureManager;
|
|
950
957
|
get runtime(): RuntimeConfig_2;
|
|
951
958
|
get runtimeSnapshot(): {
|
|
952
959
|
readonly dividingRoomId: number;
|
|
@@ -960,6 +967,7 @@ declare class AppService {
|
|
|
960
967
|
readonly editingSpotIds: readonly string[];
|
|
961
968
|
readonly editingWayPointIds: readonly string[];
|
|
962
969
|
readonly editingCarpetIds: readonly string[];
|
|
970
|
+
readonly editingFurnitureIds: readonly string[];
|
|
963
971
|
readonly mapRotation: number;
|
|
964
972
|
readonly roomPropertyFoldIds: readonly number[];
|
|
965
973
|
readonly roomSelectionMode: "checkmark" | "order";
|
|
@@ -974,6 +982,7 @@ declare class AppService {
|
|
|
974
982
|
readonly showChargingStation: boolean;
|
|
975
983
|
readonly showRoomFloorType: boolean;
|
|
976
984
|
readonly showCarpet: boolean;
|
|
985
|
+
readonly showDetectedObjects: boolean;
|
|
977
986
|
readonly selectRoomIds: readonly number[];
|
|
978
987
|
readonly showChargingStationRing: boolean;
|
|
979
988
|
readonly showRobotRing: boolean;
|
|
@@ -1338,6 +1347,16 @@ declare type Components = {
|
|
|
1338
1347
|
interaction: Interaction_2;
|
|
1339
1348
|
};
|
|
1340
1349
|
|
|
1350
|
+
/** 控制层内可排序元素 */
|
|
1351
|
+
export declare type ControlRenderItem =
|
|
1352
|
+
| 'forbiddenSweepZone'
|
|
1353
|
+
| 'forbiddenMopZone'
|
|
1354
|
+
| 'cleanZone'
|
|
1355
|
+
| 'virtualWall'
|
|
1356
|
+
| 'spot'
|
|
1357
|
+
| 'wayPoint'
|
|
1358
|
+
| 'divider'
|
|
1359
|
+
|
|
1341
1360
|
/**
|
|
1342
1361
|
* 控制元素配置
|
|
1343
1362
|
*/
|
|
@@ -1372,6 +1391,8 @@ export declare type ControlsConfig = {
|
|
|
1372
1391
|
textFontFamily: string
|
|
1373
1392
|
/** 文本字体粗细 */
|
|
1374
1393
|
textFontWeight: TextStyleFontWeight
|
|
1394
|
+
/** 控制层内部渲染顺序(从下到上) */
|
|
1395
|
+
renderOrder: ControlRenderItem[]
|
|
1375
1396
|
/** 禁扫区域配置 */
|
|
1376
1397
|
forbiddenSweepZone: ZoneConfig
|
|
1377
1398
|
/** 禁拖区域配置 */
|
|
@@ -1396,12 +1417,17 @@ declare class ControlsManager_2 {
|
|
|
1396
1417
|
private spotMap;
|
|
1397
1418
|
private wayPointMap;
|
|
1398
1419
|
private divider;
|
|
1420
|
+
private controlContainers;
|
|
1399
1421
|
private unsubscribeFns;
|
|
1400
1422
|
constructor(appService: AppService);
|
|
1401
1423
|
/**
|
|
1402
1424
|
* 根据地图原点更新所有区域位置
|
|
1403
1425
|
*/
|
|
1404
1426
|
updatePositionByOrigin(x: number, y: number): void;
|
|
1427
|
+
updateRenderOrder(): void;
|
|
1428
|
+
private initializeControlContainers;
|
|
1429
|
+
private applyRenderOrder;
|
|
1430
|
+
private addToControlLayer;
|
|
1405
1431
|
/**
|
|
1406
1432
|
* 绘制扫地禁区
|
|
1407
1433
|
*/
|
|
@@ -1467,7 +1493,7 @@ declare class ControlsManager_2 {
|
|
|
1467
1493
|
*/
|
|
1468
1494
|
private drawZones;
|
|
1469
1495
|
/**
|
|
1470
|
-
* 添加新区域到
|
|
1496
|
+
* 添加新区域到 controls 子容器
|
|
1471
1497
|
*/
|
|
1472
1498
|
private addNewZone;
|
|
1473
1499
|
/**
|
|
@@ -1507,7 +1533,7 @@ declare class ControlsManager_2 {
|
|
|
1507
1533
|
*/
|
|
1508
1534
|
private isWallDataEqual;
|
|
1509
1535
|
/**
|
|
1510
|
-
* 添加新定点清扫到
|
|
1536
|
+
* 添加新定点清扫到 controls 子容器
|
|
1511
1537
|
*/
|
|
1512
1538
|
private addNewSpot;
|
|
1513
1539
|
/**
|
|
@@ -1544,7 +1570,7 @@ declare class ControlsManager_2 {
|
|
|
1544
1570
|
*/
|
|
1545
1571
|
getWayPoints(): WayPointParam[];
|
|
1546
1572
|
/**
|
|
1547
|
-
* 添加新途径点到
|
|
1573
|
+
* 添加新途径点到 controls 子容器
|
|
1548
1574
|
*/
|
|
1549
1575
|
private addNewWayPoint;
|
|
1550
1576
|
/**
|
|
@@ -1966,6 +1992,7 @@ export declare type DeepPartialRuntimeConfig = DeepPartial<RuntimeConfig>
|
|
|
1966
1992
|
declare class DetectedObjectManager_2 {
|
|
1967
1993
|
private appService;
|
|
1968
1994
|
private detectedObjectMap;
|
|
1995
|
+
private unsubscribeShowDetectedObjects;
|
|
1969
1996
|
constructor(appService: AppService);
|
|
1970
1997
|
/**
|
|
1971
1998
|
* 根据地图原点更新所有检测物体位置
|
|
@@ -1975,6 +2002,7 @@ declare class DetectedObjectManager_2 {
|
|
|
1975
2002
|
* 绘制检测物体
|
|
1976
2003
|
*/
|
|
1977
2004
|
drawDetectedObjects(objects: DetectedObjectParam[]): Promise<void>;
|
|
2005
|
+
private applyLayerVisibility;
|
|
1978
2006
|
/**
|
|
1979
2007
|
* 清除所有检测物体
|
|
1980
2008
|
*/
|
|
@@ -2640,6 +2668,79 @@ declare class Free extends Graphics {
|
|
|
2640
2668
|
destroy(options?: DestroyOptions | boolean): void;
|
|
2641
2669
|
}
|
|
2642
2670
|
|
|
2671
|
+
/** 家具素材配置 */
|
|
2672
|
+
export declare type FurnitureAsset = {
|
|
2673
|
+
/** 家具类型编号,匹配 FurnitureParam.furnitureType */
|
|
2674
|
+
type: number
|
|
2675
|
+
/** 图片 URL */
|
|
2676
|
+
src: string
|
|
2677
|
+
/** 默认宽度 (米,用于生成初始 points,内部根据 resolution 转换为像素) */
|
|
2678
|
+
width: number
|
|
2679
|
+
/** 默认高度 (米,用于生成初始 points,内部根据 resolution 转换为像素) */
|
|
2680
|
+
height: number
|
|
2681
|
+
}
|
|
2682
|
+
|
|
2683
|
+
/** 家具配置 */
|
|
2684
|
+
export declare type FurnitureConfig = {
|
|
2685
|
+
/** 家具素材列表 */
|
|
2686
|
+
assets: FurnitureAsset[]
|
|
2687
|
+
/** 全局透明度 (0-1, 默认 1) */
|
|
2688
|
+
opacity: number
|
|
2689
|
+
/** 图标容器填充颜色 */
|
|
2690
|
+
iconWrapperFillColor: ColorSource
|
|
2691
|
+
/** 轮廓偏移 */
|
|
2692
|
+
outlineOffset: number
|
|
2693
|
+
/** 轮廓描边颜色 */
|
|
2694
|
+
outlineStrokeColor: ColorSource
|
|
2695
|
+
/** 轮廓描边宽度 */
|
|
2696
|
+
outlineStrokeWidth: number
|
|
2697
|
+
/** 轮廓填充颜色 */
|
|
2698
|
+
outlineFillColor: ColorSource
|
|
2699
|
+
/** 轮廓是否虚线 */
|
|
2700
|
+
outlineDashed: boolean
|
|
2701
|
+
/** 轮廓虚线数组 */
|
|
2702
|
+
outlineDashArray: [number, number]
|
|
2703
|
+
/** 是否显示尺寸文本 */
|
|
2704
|
+
showSizeText: boolean
|
|
2705
|
+
/** 文本颜色 */
|
|
2706
|
+
textColor: ColorSource
|
|
2707
|
+
/** 文本位置 */
|
|
2708
|
+
textPosition: 'top' | 'right' | 'bottom' | 'left'
|
|
2709
|
+
/** 文本偏移 */
|
|
2710
|
+
textOffset: number
|
|
2711
|
+
/** 缩放按钮允许的最小缩放倍数 (相对初始尺寸, 默认 0.5; 设为 0 表示不限制最小) */
|
|
2712
|
+
minScaleRatio: number
|
|
2713
|
+
/** 缩放按钮允许的最大缩放倍数 (相对初始尺寸, 默认 2; 设为 Infinity 表示不限制最大) */
|
|
2714
|
+
maxScaleRatio: number
|
|
2715
|
+
/** 点击旋转方向: 'cw' 顺时针 | 'ccw' 逆时针 (默认 'cw') */
|
|
2716
|
+
rotateDirection: 'cw' | 'ccw'
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
declare class FurnitureManager_2 {
|
|
2720
|
+
private appService;
|
|
2721
|
+
private furnitureMap;
|
|
2722
|
+
private unsubscribeFns;
|
|
2723
|
+
constructor(appService: AppService);
|
|
2724
|
+
updatePositionByOrigin(x: number, y: number): void;
|
|
2725
|
+
drawFurnitures(items: FurnitureParam[]): Promise<void>;
|
|
2726
|
+
private addFurniture;
|
|
2727
|
+
private removeFurniture;
|
|
2728
|
+
private clearAll;
|
|
2729
|
+
private updateEditState;
|
|
2730
|
+
private isDataEqual;
|
|
2731
|
+
destroy(): void;
|
|
2732
|
+
}
|
|
2733
|
+
|
|
2734
|
+
/** 家具参数 */
|
|
2735
|
+
export declare type FurnitureParam = {
|
|
2736
|
+
/** 家具ID */
|
|
2737
|
+
id: string
|
|
2738
|
+
/** 家具类型编号,匹配 config.furniture.assets 中的 type */
|
|
2739
|
+
furnitureType: number
|
|
2740
|
+
/** 四个顶点坐标 (顺时针: 左上→右上→右下→左下) */
|
|
2741
|
+
points: Point[]
|
|
2742
|
+
}
|
|
2743
|
+
|
|
2643
2744
|
/**
|
|
2644
2745
|
* GIF 类型自定义元素参数
|
|
2645
2746
|
* 保持现有逻辑
|
|
@@ -3010,12 +3111,13 @@ declare type Managers = {
|
|
|
3010
3111
|
customElementsManager: CustomElementsManager_2;
|
|
3011
3112
|
roomsManager: RoomManager_2;
|
|
3012
3113
|
customCarpetManager: CustomCarpetManager;
|
|
3114
|
+
furnitureManager: FurnitureManager_2;
|
|
3013
3115
|
editControlManager: EditControlManager_2;
|
|
3014
3116
|
};
|
|
3015
3117
|
|
|
3016
|
-
export declare const MAP_API_METHODS: readonly ["areRoomsAdjacent", "getForbiddenSweepZones", "getForbiddenMopZones", "getCleanZones", "getVirtualWalls", "getSpots", "getWayPoints", "getViewportCenterPoint", "getMapCenterPoint", "getWallPointsByViewportCenter", "getForbiddenSweepZonePointsByViewportCenter", "getForbiddenMopZonePointsByViewportCenter", "getCleanZonePointsByViewportCenter", "getSpotPointByViewportCenter", "getEffectiveDividerPoints", "getDividerEndPoints", "isNearChargerOrRobot", "isPointInAnyRoom", "isWallIntersectsAnyRoom", "isZoneIntersectsAnyRoom", "resetPanZoom", "snapshot", "snapshotByData", "getCustomCarpets", "forceEndGesture"];
|
|
3118
|
+
export declare const MAP_API_METHODS: readonly ["areRoomsAdjacent", "getForbiddenSweepZones", "getForbiddenMopZones", "getCleanZones", "getVirtualWalls", "getSpots", "getWayPoints", "getViewportCenterPoint", "getMapCenterPoint", "getWallPointsByViewportCenter", "getForbiddenSweepZonePointsByViewportCenter", "getForbiddenMopZonePointsByViewportCenter", "getCleanZonePointsByViewportCenter", "getSpotPointByViewportCenter", "getEffectiveDividerPoints", "getDividerEndPoints", "isNearChargerOrRobot", "isPointInAnyRoom", "isWallIntersectsAnyRoom", "isZoneIntersectsAnyRoom", "resetPanZoom", "snapshot", "snapshotByData", "getCustomCarpets", "forceEndGesture", "getFurniturePointsByViewportCenter"];
|
|
3017
3119
|
|
|
3018
|
-
export declare const MAP_CALLBACK_METHODS: readonly ["onMapFirstDrawed", "onMapDrawed", "onPathDrawed", "onRoomPropertiesDrawed", "onClickRoom", "onClickRoomProperties", "onRemoveForbiddenSweepZone", "onRemoveForbiddenMopZone", "onRemoveCleanZone", "onRemoveVirtualWall", "onUpdateForbiddenSweepZone", "onUpdateForbiddenMopZone", "onUpdateCleanZone", "onUpdateVirtualWall", "onUpdateSpot", "onUpdateWayPoint", "onUpdateDivider", "onClickForbiddenSweepZone", "onClickForbiddenMopZone", "onClickCleanZone", "onClickVirtualWall", "onClickSpot", "onClickWayPoint", "onClickDetectedObject", "onClickCustomElement", "onClickMap", "onClickCarpet", "onDeleteCarpet", "onUpdateCustomCarpet", "onDeleteCustomCarpet", "onGestureStart", "onGestureEnd", "onClickRobot", "onClickChargingStation"];
|
|
3120
|
+
export declare const MAP_CALLBACK_METHODS: readonly ["onMapFirstDrawed", "onMapDrawed", "onPathDrawed", "onRoomPropertiesDrawed", "onClickRoom", "onClickRoomProperties", "onRemoveForbiddenSweepZone", "onRemoveForbiddenMopZone", "onRemoveCleanZone", "onRemoveVirtualWall", "onUpdateForbiddenSweepZone", "onUpdateForbiddenMopZone", "onUpdateCleanZone", "onUpdateVirtualWall", "onUpdateSpot", "onUpdateWayPoint", "onUpdateDivider", "onClickForbiddenSweepZone", "onClickForbiddenMopZone", "onClickCleanZone", "onClickVirtualWall", "onClickSpot", "onClickWayPoint", "onClickDetectedObject", "onClickCustomElement", "onClickMap", "onClickCarpet", "onDeleteCarpet", "onUpdateCustomCarpet", "onDeleteCustomCarpet", "onGestureStart", "onGestureEnd", "onClickRobot", "onClickChargingStation", "onRemoveFurniture", "onUpdateFurniture", "onClickFurniture"];
|
|
3019
3121
|
|
|
3020
3122
|
/**
|
|
3021
3123
|
* 地图 API 接口定义
|
|
@@ -3254,6 +3356,35 @@ export declare interface MapApi {
|
|
|
3254
3356
|
offsetX?: number;
|
|
3255
3357
|
offsetY?: number;
|
|
3256
3358
|
}): Point[];
|
|
3359
|
+
/**
|
|
3360
|
+
* 绘制家具
|
|
3361
|
+
*
|
|
3362
|
+
* 通过 diff 机制驱动家具的增删改:
|
|
3363
|
+
* - 新 ID 会被添加
|
|
3364
|
+
* - 已有 ID 的数据变化会被更新
|
|
3365
|
+
* - 不在列表中的已有 ID 会被移除
|
|
3366
|
+
* - 传入空数组即清空所有家具
|
|
3367
|
+
*
|
|
3368
|
+
* @param items - 家具数据数组
|
|
3369
|
+
*/
|
|
3370
|
+
drawFurnitures(items: FurnitureParam[]): void;
|
|
3371
|
+
/**
|
|
3372
|
+
* 基于视口中心生成家具顶点坐标
|
|
3373
|
+
*
|
|
3374
|
+
* 根据当前视口中心位置和指定的家具类型,生成家具的四个顶点坐标。
|
|
3375
|
+
* 初始尺寸来源于 config.furniture.assets 中对应类型的 width/height。
|
|
3376
|
+
*
|
|
3377
|
+
* @param options - 配置选项
|
|
3378
|
+
* @param options.furnitureType - 家具类型编号,匹配 config.furniture.assets 中的 type
|
|
3379
|
+
* @param options.offsetX - X方向像素偏移,默认为 0
|
|
3380
|
+
* @param options.offsetY - Y方向像素偏移,默认为 0
|
|
3381
|
+
* @returns 家具的四个顶点坐标数组
|
|
3382
|
+
*/
|
|
3383
|
+
getFurniturePointsByViewportCenter(options?: {
|
|
3384
|
+
furnitureType?: number;
|
|
3385
|
+
offsetX?: number;
|
|
3386
|
+
offsetY?: number;
|
|
3387
|
+
}): Point[];
|
|
3257
3388
|
/**
|
|
3258
3389
|
* 基于视口中心生成定点清扫的点坐标
|
|
3259
3390
|
*
|
|
@@ -3354,6 +3485,7 @@ export declare interface MapApi {
|
|
|
3354
3485
|
* @param data.forbiddenMopZones - 可选的禁拖区域数组
|
|
3355
3486
|
* @param data.virtualWalls - 可选的虚拟墙数组
|
|
3356
3487
|
* @param data.detectedObjects - 可选的 AI 物体检测数据数组
|
|
3488
|
+
* @param data.furnitures - 可选的家具数据数组
|
|
3357
3489
|
* @param runtime - 可选的运行时配置 (如是否显示机器人、充电桩等状态)
|
|
3358
3490
|
* @param options - 截图配置选项
|
|
3359
3491
|
* @param options.backgroundColor - 指定生成截图时的背景颜色。若不指定,将默认使用 `global.config.backgroundColor`。
|
|
@@ -3368,6 +3500,7 @@ export declare interface MapApi {
|
|
|
3368
3500
|
forbiddenMopZones?: ZoneParam[];
|
|
3369
3501
|
virtualWalls?: VirtualWallParam[];
|
|
3370
3502
|
detectedObjects?: DetectedObjectParam[];
|
|
3503
|
+
furnitures?: FurnitureParam[];
|
|
3371
3504
|
}, runtime?: DeepPartialRuntimeConfig, options?: {
|
|
3372
3505
|
backgroundColor?: ColorSource;
|
|
3373
3506
|
}): Promise<string>;
|
|
@@ -3464,6 +3597,11 @@ declare class MapApplication extends Application implements MapApi {
|
|
|
3464
3597
|
* @returns void
|
|
3465
3598
|
*/
|
|
3466
3599
|
drawCustomCarpets(carpets: CustomCarpetParam[]): Promise<void>;
|
|
3600
|
+
/**
|
|
3601
|
+
* 绘制家具
|
|
3602
|
+
* @param items - 家具参数数组
|
|
3603
|
+
*/
|
|
3604
|
+
drawFurnitures(items: FurnitureParam[]): Promise<void>;
|
|
3467
3605
|
/**
|
|
3468
3606
|
* 绘制热力图
|
|
3469
3607
|
* @param param - 绘制参数
|
|
@@ -3747,6 +3885,14 @@ declare class MapApplication extends Application implements MapApi {
|
|
|
3747
3885
|
offsetX?: number;
|
|
3748
3886
|
offsetY?: number;
|
|
3749
3887
|
}): Point;
|
|
3888
|
+
/**
|
|
3889
|
+
* 基于视口中心生成家具顶点坐标
|
|
3890
|
+
*/
|
|
3891
|
+
getFurniturePointsByViewportCenter(options?: {
|
|
3892
|
+
furnitureType?: number;
|
|
3893
|
+
offsetX?: number;
|
|
3894
|
+
offsetY?: number;
|
|
3895
|
+
}): Point[];
|
|
3750
3896
|
/**
|
|
3751
3897
|
* 判断指定的房间是否相邻(连通)
|
|
3752
3898
|
*
|
|
@@ -3846,7 +3992,7 @@ declare class MapApplication extends Application implements MapApi {
|
|
|
3846
3992
|
* @returns Promise<string> Base64 格式的图片数据
|
|
3847
3993
|
*
|
|
3848
3994
|
*/
|
|
3849
|
-
snapshotByData({ map, path, roomProperties, customElements, forbiddenSweepZones, forbiddenMopZones, virtualWalls, detectedObjects, }: {
|
|
3995
|
+
snapshotByData({ map, path, roomProperties, customElements, forbiddenSweepZones, forbiddenMopZones, virtualWalls, detectedObjects, furnitures, }: {
|
|
3850
3996
|
map: string;
|
|
3851
3997
|
path?: string;
|
|
3852
3998
|
roomProperties?: RoomProperty[];
|
|
@@ -3855,6 +4001,7 @@ declare class MapApplication extends Application implements MapApi {
|
|
|
3855
4001
|
forbiddenMopZones?: ZoneParam[];
|
|
3856
4002
|
virtualWalls?: VirtualWallParam[];
|
|
3857
4003
|
detectedObjects?: DetectedObjectParam[];
|
|
4004
|
+
furnitures?: FurnitureParam[];
|
|
3858
4005
|
}, runtime?: DeepPartialRuntimeConfig, options?: {
|
|
3859
4006
|
backgroundColor?: ColorSource;
|
|
3860
4007
|
}): Promise<string>;
|
|
@@ -4179,6 +4326,26 @@ export declare interface MapCallbacks {
|
|
|
4179
4326
|
*
|
|
4180
4327
|
*/
|
|
4181
4328
|
onUpdateCustomCarpet?: (carpet: CustomCarpetParam) => void;
|
|
4329
|
+
/**
|
|
4330
|
+
* 点击家具删除按钮的回调
|
|
4331
|
+
*
|
|
4332
|
+
* @param id - 被删除的家具ID
|
|
4333
|
+
*/
|
|
4334
|
+
onRemoveFurniture?: (id: string) => void;
|
|
4335
|
+
/**
|
|
4336
|
+
* 更新家具的回调
|
|
4337
|
+
*
|
|
4338
|
+
* 当用户操作家具(如拖拽、缩放、旋转)后触发。
|
|
4339
|
+
*
|
|
4340
|
+
* @param furniture - 更新后的家具数据
|
|
4341
|
+
*/
|
|
4342
|
+
onUpdateFurniture?: (furniture: FurnitureParam) => void;
|
|
4343
|
+
/**
|
|
4344
|
+
* 点击家具回调
|
|
4345
|
+
*
|
|
4346
|
+
* @param furniture - 被点击的家具数据
|
|
4347
|
+
*/
|
|
4348
|
+
onClickFurniture?: (furniture: FurnitureParam) => void;
|
|
4182
4349
|
onGestureStart?: () => void;
|
|
4183
4350
|
/**
|
|
4184
4351
|
* 手势交互结束回调
|
|
@@ -5240,6 +5407,8 @@ export declare type RuntimeConfig = {
|
|
|
5240
5407
|
editingWayPointIds: string[]
|
|
5241
5408
|
/** 正在编辑的地毯ID列表 */
|
|
5242
5409
|
editingCarpetIds: string[]
|
|
5410
|
+
/** 正在编辑的家具ID列表 */
|
|
5411
|
+
editingFurnitureIds: string[]
|
|
5243
5412
|
/** 地图旋转角度(度) */
|
|
5244
5413
|
mapRotation: number
|
|
5245
5414
|
/** 房间属性折叠的房间ID列表 */
|
|
@@ -5268,6 +5437,8 @@ export declare type RuntimeConfig = {
|
|
|
5268
5437
|
showRoomFloorType: boolean
|
|
5269
5438
|
/** 是否显示地毯 */
|
|
5270
5439
|
showCarpet: boolean
|
|
5440
|
+
/** 是否显示 AI 检测物体 */
|
|
5441
|
+
showDetectedObjects: boolean
|
|
5271
5442
|
/** 选中的房间ID列表 */
|
|
5272
5443
|
selectRoomIds: number[]
|
|
5273
5444
|
/** 是否显示充电桩预警圈 */
|