@ray-js/robot-map-sdk 0.0.3-beta-19 → 0.0.3-beta-21
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/components/Base/FixedSizeDOMContainer.js +1 -1
- package/dist/components/Base/Zone.js +1 -1
- package/dist/components/ChargingStation/index.js +1 -1
- package/dist/components/Controls/Divider.js +1 -1
- package/dist/components/Controls/Spot.js +1 -1
- package/dist/components/Controls/VirtualWall.js +1 -1
- package/dist/components/CustomElements/CustomHTML.js +1 -1
- package/dist/components/Robot/index.js +1 -1
- package/dist/components/RoomInfo/RoomProperty.js +1 -1
- package/dist/components/RoomInfo/RoomSelectionIndicator.js +1 -1
- package/dist/constant/config.js +1 -1
- package/dist/constant/methods.js +1 -1
- package/dist/index.d.ts +57 -8
- package/dist/index.js +1 -1
- package/dist/index.rjs.js +1 -1
- package/dist/managers/CustomElementsManager.js +1 -1
- package/dist/managers/MapManager.js +1 -1
- package/dist/utils/algorithm.js +1 -1
- package/dist/utils/index.js +1 -1
- package/dist-app/assets/index-ClwjZGGG.js +1 -0
- package/dist-app/index.html +1 -1
- package/dist-docs/404.html +2 -2
- package/dist-docs/assets/{app.C1hdwNGd.js → app.njd2Grwy.js} +1 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.Cpumpeyn.js +1 -0
- package/dist-docs/assets/chunks/{VPLocalSearchBox.D7RLqunb.js → VPLocalSearchBox.DLqsv7AQ.js} +1 -1
- package/dist-docs/assets/chunks/{theme.Bgk1r3C0.js → theme.DtLjeu0B.js} +2 -2
- package/dist-docs/assets/{guide_getting-started.md.8wgboX-g.js → guide_getting-started.md.DW55F3eC.js} +1 -1
- package/dist-docs/assets/{reference_config.md.DKXC2aOe.js → reference_config.md.zb-n1yzx.js} +2 -2
- package/dist-docs/assets/{reference_config.md.DKXC2aOe.lean.js → reference_config.md.zb-n1yzx.lean.js} +1 -1
- package/dist-docs/assets/{reference_methods.md.Cw2UFl8i.js → reference_methods.md.D1VYgciC.js} +10 -4
- package/dist-docs/assets/{reference_methods.md.Cw2UFl8i.lean.js → reference_methods.md.D1VYgciC.lean.js} +1 -1
- package/dist-docs/assets/{reference_types.md.CteNuaxc.js → reference_types.md.BP8Uwg9a.js} +72 -15
- package/dist-docs/assets/{reference_types.md.CteNuaxc.lean.js → reference_types.md.BP8Uwg9a.lean.js} +1 -1
- package/dist-docs/assets/{reference_utils.md.DU5CMWXW.js → reference_utils.md.C5spobZN.js} +6 -2
- package/dist-docs/assets/reference_utils.md.C5spobZN.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 +13 -7
- package/dist-docs/reference/runtime.html +3 -3
- package/dist-docs/reference/types.html +75 -18
- package/dist-docs/reference/utils.html +9 -5
- package/package.json +2 -2
- package/dist-app/assets/index-DFAEtWgf.js +0 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.BNXBBbhn.js +0 -1
- package/dist-docs/assets/reference_utils.md.DU5CMWXW.lean.js +0 -1
- /package/dist-docs/assets/{guide_getting-started.md.8wgboX-g.lean.js → guide_getting-started.md.DW55F3eC.lean.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -765,7 +765,8 @@ export declare type BaseCustomElementParam = {
|
|
|
765
765
|
/** 是否可交互 */
|
|
766
766
|
interactive?: boolean
|
|
767
767
|
/** 自定义数据 */
|
|
768
|
-
|
|
768
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
769
|
+
customData?: Record<string, any>
|
|
769
770
|
/** 尺寸是否固定 */
|
|
770
771
|
sizeFixed?: boolean
|
|
771
772
|
}
|
|
@@ -1197,6 +1198,9 @@ export declare type DetectedObjectParam = {
|
|
|
1197
1198
|
height?: number
|
|
1198
1199
|
/** 宽度 */
|
|
1199
1200
|
width?: number
|
|
1201
|
+
/** 自定义数据 */
|
|
1202
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1203
|
+
customData?: Record<string, any>
|
|
1200
1204
|
}
|
|
1201
1205
|
|
|
1202
1206
|
/** 方向 */
|
|
@@ -1739,7 +1743,7 @@ declare type Managers = {
|
|
|
1739
1743
|
roomsManager: RoomManager;
|
|
1740
1744
|
};
|
|
1741
1745
|
|
|
1742
|
-
export declare const MAP_API_METHODS: readonly ["areRoomsAdjacent", "
|
|
1746
|
+
export declare const MAP_API_METHODS: readonly ["areRoomsAdjacent", "getForbiddenSweepZones", "getForbiddenMopZones", "getCleanZones", "getVirtualWalls", "getSpots", "getViewportCenterPoint", "getMapCenterPoint", "getWallPointsByViewportCenter", "getForbiddenSweepZonePointsByViewportCenter", "getForbiddenMopZonePointsByViewportCenter", "getCleanZonePointsByViewportCenter", "getSpotPointByViewportCenter", "getEffectiveDividerPoints", "getDividerEndPoints", "isPointInAnyRoom", "resetPanZoom", "snapshot", "snapshotByData"];
|
|
1743
1747
|
|
|
1744
1748
|
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"];
|
|
1745
1749
|
|
|
@@ -1907,6 +1911,17 @@ export declare interface MapApi {
|
|
|
1907
1911
|
* @returns 是否所有指定的房间都相邻(连通)
|
|
1908
1912
|
*/
|
|
1909
1913
|
areRoomsAdjacent(roomIds: number[]): boolean;
|
|
1914
|
+
/**
|
|
1915
|
+
* 判断一个点是否在任意房间内
|
|
1916
|
+
*
|
|
1917
|
+
* 接受原点坐标系的点(相对于origin的坐标),遍历所有房间,
|
|
1918
|
+
* 判断该点是否在某个房间内。支持结构化地图和点阵地图两种协议。
|
|
1919
|
+
* 方法内部会自动将原点坐标系转换为地图坐标系进行检测。
|
|
1920
|
+
*
|
|
1921
|
+
* @param point - 待检测的点坐标(原点坐标系,与Zone、VirtualWall等使用相同的坐标系)
|
|
1922
|
+
* @returns 如果点在某个房间内,返回该房间的RoomData;否则返回null
|
|
1923
|
+
*/
|
|
1924
|
+
isPointInAnyRoom(point: Point): RoomData | null;
|
|
1910
1925
|
/**
|
|
1911
1926
|
* 地图截图
|
|
1912
1927
|
*
|
|
@@ -2287,14 +2302,22 @@ export declare class MapApplication extends Application implements MapApi {
|
|
|
2287
2302
|
* @param roomIds - 要检测的房间ID数组
|
|
2288
2303
|
* @returns 是否所有指定的房间都相邻(连通)
|
|
2289
2304
|
*
|
|
2290
|
-
* @example
|
|
2291
|
-
* ```typescript
|
|
2292
|
-
* // 判断两个房间是否相邻
|
|
2293
|
-
* const isAdjacent = mapApi.areRoomsAdjacent([1, 2])
|
|
2294
|
-
*
|
|
2295
|
-
* ```
|
|
2296
2305
|
*/
|
|
2297
2306
|
areRoomsAdjacent(roomIds: number[]): boolean;
|
|
2307
|
+
/**
|
|
2308
|
+
* 判断一个点是否在任意房间内
|
|
2309
|
+
*
|
|
2310
|
+
* 接受原点坐标系的点(相对于origin的坐标),遍历所有房间,
|
|
2311
|
+
* 判断该点是否在某个房间内。支持结构化地图和点阵地图两种协议。
|
|
2312
|
+
* 方法内部会自动将原点坐标系转换为地图坐标系进行检测。
|
|
2313
|
+
*
|
|
2314
|
+
* @param point - 待检测的点坐标(原点坐标系,与Zone、VirtualWall等使用相同的坐标系)
|
|
2315
|
+
* @returns 如果点在某个房间内,返回该房间的RoomData;否则返回null
|
|
2316
|
+
*
|
|
2317
|
+
*/
|
|
2318
|
+
isPointInAnyRoom(point: Point): RoomData | null;
|
|
2319
|
+
/* Excluded from this release type: isPointInAnyRoomStructuredInternal */
|
|
2320
|
+
/* Excluded from this release type: isPointInAnyRoomRasterInternal */
|
|
2298
2321
|
/* Excluded from this release type: areStructuredRoomsAdjacentInternal */
|
|
2299
2322
|
/* Excluded from this release type: areRasterRoomsAdjacentInternal */
|
|
2300
2323
|
/**
|
|
@@ -2687,6 +2710,10 @@ declare class MapManager {
|
|
|
2687
2710
|
* 根据ID查找房间几何信息
|
|
2688
2711
|
*/
|
|
2689
2712
|
getRoomById(id: number): Room | undefined;
|
|
2713
|
+
/**
|
|
2714
|
+
* 获取所有房间的几何信息
|
|
2715
|
+
*/
|
|
2716
|
+
getAllRooms(): Room[];
|
|
2690
2717
|
/**
|
|
2691
2718
|
* 清空地图组件
|
|
2692
2719
|
*/
|
|
@@ -2751,8 +2778,19 @@ export declare type MapState = {
|
|
|
2751
2778
|
* 地图协议版本号
|
|
2752
2779
|
*/
|
|
2753
2780
|
version?: number
|
|
2781
|
+
/**
|
|
2782
|
+
* 地图类型
|
|
2783
|
+
* - 'structured': 结构化地图(基于轮廓点)
|
|
2784
|
+
* - 'raster': 点阵地图(基于像素)
|
|
2785
|
+
*/
|
|
2786
|
+
mapType: MapType
|
|
2754
2787
|
}
|
|
2755
2788
|
|
|
2789
|
+
/**
|
|
2790
|
+
* 地图类型
|
|
2791
|
+
*/
|
|
2792
|
+
export declare type MapType = 'structured' | 'raster'
|
|
2793
|
+
|
|
2756
2794
|
declare class Obstacle extends Graphics {
|
|
2757
2795
|
constructor();
|
|
2758
2796
|
/**
|
|
@@ -2771,6 +2809,15 @@ declare class Obstacle extends Graphics {
|
|
|
2771
2809
|
destroy(options?: DestroyOptions | boolean): void;
|
|
2772
2810
|
}
|
|
2773
2811
|
|
|
2812
|
+
/**
|
|
2813
|
+
* 对点位进行偏移,避免与已存在的点位重叠
|
|
2814
|
+
* 使用递增偏移策略,每次偏移5个单位,直到找到不重叠的位置
|
|
2815
|
+
* @param points 需要偏移的点位数组
|
|
2816
|
+
* @param existingPointsArray 已存在的点位数组
|
|
2817
|
+
* @param maxAttempts 最大尝试次数,默认20次(最多偏移100个单位)
|
|
2818
|
+
*/
|
|
2819
|
+
export declare const offsetPointsToAvoidOverlap: (points: Point[], existingPointsArray: Point[][], maxAttempts?: number) => Point[];
|
|
2820
|
+
|
|
2774
2821
|
/**
|
|
2775
2822
|
* 解析后的点阵地图数据
|
|
2776
2823
|
*/
|
|
@@ -3583,6 +3630,8 @@ export declare type ZoneConfig = {
|
|
|
3583
3630
|
outlineDashed: boolean
|
|
3584
3631
|
/** 轮廓虚线数组 */
|
|
3585
3632
|
outlineDashArray: [number, number]
|
|
3633
|
+
/** 是否显示旋转图标 */
|
|
3634
|
+
showRotateButton: boolean
|
|
3586
3635
|
/** 文本颜色 */
|
|
3587
3636
|
textColor: ColorSource
|
|
3588
3637
|
/** 文本位置 */
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{decodeRoomProperties as o}from"./utils/index.js";import{MapApplication as
|
|
1
|
+
import{decodeRoomProperties as o,offsetPointsToAvoidOverlap as p}from"./utils/index.js";import{MapApplication as i}from"./application/MapApplication.js";import{AppContext as t,useAppService as r}from"./application/AppService.js";import{MAP_API_METHODS as m,MAP_CALLBACK_METHODS as a}from"./constant/methods.js";export{t as AppContext,m as MAP_API_METHODS,a as MAP_CALLBACK_METHODS,i as MapApplication,o as decodeRoomProperties,p as offsetPointsToAvoidOverlap,r as useAppService};
|