@ray-js/robot-map-sdk 0.0.17-beta.3 → 0.0.17-beta.5
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 +199 -5
- package/dist/index.rjs.js +1 -1
- package/dist-app/assets/index-DvodeBV_.js +1 -0
- package/dist-app/index.html +1 -1
- package/dist-docs/404.html +2 -2
- package/dist-docs/assets/{app.C3BeeaYd.js → app.CQ3J50so.js} +1 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.cQ0R9xid.js +1 -0
- package/dist-docs/assets/chunks/{BitmapFont.BQzmxL0v.js → BitmapFont.DC5iaxzi.js} +1 -1
- package/dist-docs/assets/chunks/{BufferResource.CNdzQT3n.js → BufferResource.iapJrccg.js} +1 -1
- package/dist-docs/assets/chunks/{CanvasRenderer.BfEovjEl.js → CanvasRenderer.Dw0DOupC.js} +1 -1
- package/dist-docs/assets/chunks/{RenderTargetSystem.BsnW3px2.js → RenderTargetSystem.D9ItB3vp.js} +1 -1
- package/dist-docs/assets/chunks/{VPLocalSearchBox.BV6OAhiI.js → VPLocalSearchBox.DN_rVIfF.js} +1 -1
- package/dist-docs/assets/chunks/{WebGLRenderer.BziWi5pK.js → WebGLRenderer.CQRlVC-j.js} +1 -1
- package/dist-docs/assets/chunks/{WebGPURenderer.bELKl5QM.js → WebGPURenderer.Bp_eIH__.js} +1 -1
- package/dist-docs/assets/chunks/{browserAll.Cbwmm72I.js → browserAll.Cbj4PL_h.js} +1 -1
- package/dist-docs/assets/chunks/index.BhQxRjKz.js +744 -0
- package/dist-docs/assets/chunks/theme.XPkZi7-q.js +4 -0
- package/dist-docs/assets/chunks/{webworkerAll.BqQ8oBVT.js → webworkerAll.LONCU5Cb.js} +1 -1
- package/dist-docs/assets/{guide_advanced-usage.md.BsGRhEuG.js → guide_advanced-usage.md.BrP4iZb-.js} +141 -79
- package/dist-docs/assets/{guide_advanced-usage.md.BsGRhEuG.lean.js → guide_advanced-usage.md.BrP4iZb-.lean.js} +1 -1
- package/dist-docs/assets/{guide_getting-started.md.DQIIL6ql.js → guide_getting-started.md.rQfH2m10.js} +1 -1
- package/dist-docs/assets/reference_callbacks.md.BP78Z1wN.js +33 -0
- package/dist-docs/assets/{reference_callbacks.md.Cm_LNx97.lean.js → reference_callbacks.md.BP78Z1wN.lean.js} +1 -1
- package/dist-docs/assets/{reference_config.md.BslTlkKM.js → reference_config.md.DHyraAQF.js} +4 -4
- package/dist-docs/assets/reference_config.md.DHyraAQF.lean.js +1 -0
- package/dist-docs/assets/{reference_data.md.jnSR7326.js → reference_data.md.f7vBtzcn.js} +15 -3
- package/dist-docs/assets/{reference_data.md.jnSR7326.lean.js → reference_data.md.f7vBtzcn.lean.js} +1 -1
- package/dist-docs/assets/{reference_methods.md.Cv8q9vtz.js → reference_methods.md.D2L6f98h.js} +9 -4
- package/dist-docs/assets/{reference_methods.md.Cv8q9vtz.lean.js → reference_methods.md.D2L6f98h.lean.js} +1 -1
- package/dist-docs/assets/reference_runtime.md.g-NWJXS6.js +20 -0
- package/dist-docs/assets/{reference_runtime.md.BFQ83m1B.lean.js → reference_runtime.md.g-NWJXS6.lean.js} +1 -1
- package/dist-docs/assets/{reference_types.md.ifmL7IbS.js → reference_types.md.B2PPyukT.js} +18 -3
- package/dist-docs/assets/{reference_types.md.ifmL7IbS.lean.js → reference_types.md.B2PPyukT.lean.js} +1 -1
- package/dist-docs/guide/advanced-usage.html +144 -82
- 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/guide/spot-room-binding.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 +3 -3
- package/dist-docs/plans/2026-03-04-show-detected-objects-implementation-plan.html +3 -3
- package/dist-docs/plans/2026-03-10-simulator-debug-design.html +3 -3
- package/dist-docs/plans/2026-03-10-simulator-events-console-design.html +3 -3
- package/dist-docs/plans/2026-03-10-simulator-events-console-implementation-plan.html +3 -3
- package/dist-docs/plans/2026-03-10-simulator-runtime-controls-design.html +3 -3
- package/dist-docs/plans/2026-03-10-simulator-runtime-controls-implementation-plan.html +3 -3
- package/dist-docs/plans/2026-03-10-testing-rollout-next-steps-plan.html +3 -3
- package/dist-docs/plans/2026-03-11-simulator-logger-dump-implementation-plan.html +3 -3
- package/dist-docs/reference/callbacks.html +5 -5
- package/dist-docs/reference/config.html +7 -7
- package/dist-docs/reference/data.html +18 -6
- package/dist-docs/reference/methods.html +12 -7
- package/dist-docs/reference/runtime.html +5 -5
- package/dist-docs/reference/types.html +21 -6
- package/dist-docs/reference/utils.html +3 -3
- package/dist-docs/simulator/index.html +3 -3
- package/package.json +1 -1
- package/dist-app/assets/index-BVLfQBTu.js +0 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.BMKcHG_i.js +0 -1
- package/dist-docs/assets/chunks/index.CsLbOa5r.js +0 -744
- package/dist-docs/assets/chunks/theme.BItp-bTH.js +0 -4
- package/dist-docs/assets/reference_callbacks.md.Cm_LNx97.js +0 -33
- package/dist-docs/assets/reference_config.md.BslTlkKM.lean.js +0 -1
- package/dist-docs/assets/reference_runtime.md.BFQ83m1B.js +0 -20
- /package/dist-docs/assets/{guide_getting-started.md.DQIIL6ql.lean.js → guide_getting-started.md.rQfH2m10.lean.js} +0 -0
package/dist/constant/methods.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=["areRoomsAdjacent","getForbiddenSweepZones","getForbiddenMopZones","getCleanZones","getVirtualWalls","getThresholds","getSpots","getRoomAnchors","getWayPoints","getViewportCenterPoint","getMapCenterPoint","getWallPointsByViewportCenter","getForbiddenSweepZonePointsByViewportCenter","getForbiddenMopZonePointsByViewportCenter","getCleanZonePointsByViewportCenter","getThresholdPointsByViewportCenter","getSpotPointByViewportCenter","getEffectiveDividerPoints","getDividerEndPoints","isNearChargerOrRobot","isPointInAnyRoom","isWallIntersectsAnyRoom","isZoneIntersectsAnyRoom","resetPanZoom","snapshot","snapshotByData","getCustomCarpets","forceEndGesture","getFurniturePointsByViewportCenter","getCustomCarpetPointsByViewportCenter","getRectPointsByCenter","getFurnitures","drawCustomZones","getCustomZones","clearCustomZones","setEditingCustomZones"],o=["onMapFirstDrawed","onMapDrawed","onPathDrawed","onRoomPropertiesDrawed","onRoomsDrawed","onClickRoom","onClickRoomProperties","onRemoveForbiddenSweepZone","onRemoveForbiddenMopZone","onRemoveCleanZone","onRemoveVirtualWall","onRemoveThreshold","onUpdateForbiddenSweepZone","onUpdateForbiddenMopZone","onUpdateCleanZone","onUpdateVirtualWall","onUpdateThreshold","onUpdateSpot","onUpdateRoomAnchor","onUpdateWayPoint","onUpdateDivider","onClickForbiddenSweepZone","onClickForbiddenMopZone","onClickCleanZone","onClickVirtualWall","onClickThreshold","onClickSpot","onClickRoomAnchor","onClickWayPoint","onClickDetectedObject","onClickCustomElement","onClickMap","onClickCarpet","onDeleteCarpet","onUpdateCustomCarpet","onDeleteCustomCarpet","onGestureStart","onGestureEnd","onClickRobot","onClickChargingStation","onRemoveFurniture","onUpdateFurniture","onClickFurniture","onRemoveCustomZone","onUpdateCustomZone","onClickCustomZone"];export{e as MAP_API_METHODS,o as MAP_CALLBACK_METHODS};
|
|
1
|
+
const e=["areRoomsAdjacent","getForbiddenSweepZones","getForbiddenMopZones","getCleanZones","getVirtualWalls","getThresholds","getRamps","getSpots","getRoomAnchors","getWayPoints","getViewportCenterPoint","getMapCenterPoint","getWallPointsByViewportCenter","getForbiddenSweepZonePointsByViewportCenter","getForbiddenMopZonePointsByViewportCenter","getCleanZonePointsByViewportCenter","getThresholdPointsByViewportCenter","getRampPointsByViewportCenter","getSpotPointByViewportCenter","getEffectiveDividerPoints","getDividerEndPoints","isNearChargerOrRobot","isPointInAnyRoom","isWallIntersectsAnyRoom","isZoneIntersectsAnyRoom","resetPanZoom","snapshot","snapshotByData","getCustomCarpets","forceEndGesture","getFurniturePointsByViewportCenter","getCustomCarpetPointsByViewportCenter","getRectPointsByCenter","getFurnitures","drawCustomZones","getCustomZones","clearCustomZones","setEditingCustomZones"],o=["onMapFirstDrawed","onMapDrawed","onPathDrawed","onRoomPropertiesDrawed","onRoomsDrawed","onClickRoom","onClickRoomProperties","onRemoveForbiddenSweepZone","onRemoveForbiddenMopZone","onRemoveCleanZone","onRemoveVirtualWall","onRemoveThreshold","onRemoveRamp","onUpdateForbiddenSweepZone","onUpdateForbiddenMopZone","onUpdateCleanZone","onUpdateVirtualWall","onUpdateThreshold","onUpdateRamp","onUpdateSpot","onUpdateRoomAnchor","onUpdateWayPoint","onUpdateDivider","onClickForbiddenSweepZone","onClickForbiddenMopZone","onClickCleanZone","onClickVirtualWall","onClickThreshold","onClickRamp","onClickSpot","onClickRoomAnchor","onClickWayPoint","onClickDetectedObject","onClickCustomElement","onClickMap","onClickCarpet","onDeleteCarpet","onUpdateCustomCarpet","onDeleteCustomCarpet","onGestureStart","onGestureEnd","onClickRobot","onClickChargingStation","onRemoveFurniture","onUpdateFurniture","onClickFurniture","onRemoveCustomZone","onUpdateCustomZone","onClickCustomZone"];export{e as MAP_API_METHODS,o as MAP_CALLBACK_METHODS};
|
package/dist/index.d.ts
CHANGED
|
@@ -776,19 +776,24 @@ export declare type ComponentPropsApp = {
|
|
|
776
776
|
app: MapApplicationInstance
|
|
777
777
|
}
|
|
778
778
|
|
|
779
|
-
/**
|
|
779
|
+
/**
|
|
780
|
+
* 控制层内可排序元素。
|
|
781
|
+
*
|
|
782
|
+
* 门槛(threshold)不在其中:它是不透明地面元素,画在地面标记层
|
|
783
|
+
* (路径 / 机器人 / 房间名之下),层内顺序固定,不参与控制层排序
|
|
784
|
+
* (见 ADR 0006)。
|
|
785
|
+
*/
|
|
780
786
|
export declare type ControlRenderItem =
|
|
781
787
|
| 'forbiddenSweepZone'
|
|
782
788
|
| 'forbiddenMopZone'
|
|
783
789
|
| 'cleanZone'
|
|
784
790
|
| 'virtualWall'
|
|
785
|
-
| 'threshold'
|
|
786
791
|
| 'spot'
|
|
787
792
|
| 'roomAnchor'
|
|
788
793
|
| 'wayPoint'
|
|
789
794
|
| 'divider'
|
|
790
795
|
// Allow any string for custom zone types while keeping IDE autocomplete
|
|
791
|
-
// for the
|
|
796
|
+
// for the eight built-in items via the `(string & {})` trick.
|
|
792
797
|
| (string & {})
|
|
793
798
|
|
|
794
799
|
/**
|
|
@@ -839,6 +844,8 @@ export declare type ControlsConfig = {
|
|
|
839
844
|
virtualWall: VirtualWallConfig
|
|
840
845
|
/** 门槛配置 */
|
|
841
846
|
threshold: ThresholdConfig
|
|
847
|
+
/** 坡道配置 */
|
|
848
|
+
ramp: RampConfig
|
|
842
849
|
/** 定点清扫配置 */
|
|
843
850
|
spot: SpotConfig
|
|
844
851
|
/**
|
|
@@ -1130,9 +1137,9 @@ export declare type LoggerPayload = {
|
|
|
1130
1137
|
ts: number
|
|
1131
1138
|
}
|
|
1132
1139
|
|
|
1133
|
-
export declare const MAP_API_METHODS: readonly ["areRoomsAdjacent", "getForbiddenSweepZones", "getForbiddenMopZones", "getCleanZones", "getVirtualWalls", "getThresholds", "getSpots", "getRoomAnchors", "getWayPoints", "getViewportCenterPoint", "getMapCenterPoint", "getWallPointsByViewportCenter", "getForbiddenSweepZonePointsByViewportCenter", "getForbiddenMopZonePointsByViewportCenter", "getCleanZonePointsByViewportCenter", "getThresholdPointsByViewportCenter", "getSpotPointByViewportCenter", "getEffectiveDividerPoints", "getDividerEndPoints", "isNearChargerOrRobot", "isPointInAnyRoom", "isWallIntersectsAnyRoom", "isZoneIntersectsAnyRoom", "resetPanZoom", "snapshot", "snapshotByData", "getCustomCarpets", "forceEndGesture", "getFurniturePointsByViewportCenter", "getCustomCarpetPointsByViewportCenter", "getRectPointsByCenter", "getFurnitures", "drawCustomZones", "getCustomZones", "clearCustomZones", "setEditingCustomZones"];
|
|
1140
|
+
export declare const MAP_API_METHODS: readonly ["areRoomsAdjacent", "getForbiddenSweepZones", "getForbiddenMopZones", "getCleanZones", "getVirtualWalls", "getThresholds", "getRamps", "getSpots", "getRoomAnchors", "getWayPoints", "getViewportCenterPoint", "getMapCenterPoint", "getWallPointsByViewportCenter", "getForbiddenSweepZonePointsByViewportCenter", "getForbiddenMopZonePointsByViewportCenter", "getCleanZonePointsByViewportCenter", "getThresholdPointsByViewportCenter", "getRampPointsByViewportCenter", "getSpotPointByViewportCenter", "getEffectiveDividerPoints", "getDividerEndPoints", "isNearChargerOrRobot", "isPointInAnyRoom", "isWallIntersectsAnyRoom", "isZoneIntersectsAnyRoom", "resetPanZoom", "snapshot", "snapshotByData", "getCustomCarpets", "forceEndGesture", "getFurniturePointsByViewportCenter", "getCustomCarpetPointsByViewportCenter", "getRectPointsByCenter", "getFurnitures", "drawCustomZones", "getCustomZones", "clearCustomZones", "setEditingCustomZones"];
|
|
1134
1141
|
|
|
1135
|
-
export declare const MAP_CALLBACK_METHODS: readonly ["onMapFirstDrawed", "onMapDrawed", "onPathDrawed", "onRoomPropertiesDrawed", "onRoomsDrawed", "onClickRoom", "onClickRoomProperties", "onRemoveForbiddenSweepZone", "onRemoveForbiddenMopZone", "onRemoveCleanZone", "onRemoveVirtualWall", "onRemoveThreshold", "onUpdateForbiddenSweepZone", "onUpdateForbiddenMopZone", "onUpdateCleanZone", "onUpdateVirtualWall", "onUpdateThreshold", "onUpdateSpot", "onUpdateRoomAnchor", "onUpdateWayPoint", "onUpdateDivider", "onClickForbiddenSweepZone", "onClickForbiddenMopZone", "onClickCleanZone", "onClickVirtualWall", "onClickThreshold", "onClickSpot", "onClickRoomAnchor", "onClickWayPoint", "onClickDetectedObject", "onClickCustomElement", "onClickMap", "onClickCarpet", "onDeleteCarpet", "onUpdateCustomCarpet", "onDeleteCustomCarpet", "onGestureStart", "onGestureEnd", "onClickRobot", "onClickChargingStation", "onRemoveFurniture", "onUpdateFurniture", "onClickFurniture", "onRemoveCustomZone", "onUpdateCustomZone", "onClickCustomZone"];
|
|
1142
|
+
export declare const MAP_CALLBACK_METHODS: readonly ["onMapFirstDrawed", "onMapDrawed", "onPathDrawed", "onRoomPropertiesDrawed", "onRoomsDrawed", "onClickRoom", "onClickRoomProperties", "onRemoveForbiddenSweepZone", "onRemoveForbiddenMopZone", "onRemoveCleanZone", "onRemoveVirtualWall", "onRemoveThreshold", "onRemoveRamp", "onUpdateForbiddenSweepZone", "onUpdateForbiddenMopZone", "onUpdateCleanZone", "onUpdateVirtualWall", "onUpdateThreshold", "onUpdateRamp", "onUpdateSpot", "onUpdateRoomAnchor", "onUpdateWayPoint", "onUpdateDivider", "onClickForbiddenSweepZone", "onClickForbiddenMopZone", "onClickCleanZone", "onClickVirtualWall", "onClickThreshold", "onClickRamp", "onClickSpot", "onClickRoomAnchor", "onClickWayPoint", "onClickDetectedObject", "onClickCustomElement", "onClickMap", "onClickCarpet", "onDeleteCarpet", "onUpdateCustomCarpet", "onDeleteCustomCarpet", "onGestureStart", "onGestureEnd", "onClickRobot", "onClickChargingStation", "onRemoveFurniture", "onUpdateFurniture", "onClickFurniture", "onRemoveCustomZone", "onUpdateCustomZone", "onClickCustomZone"];
|
|
1136
1143
|
|
|
1137
1144
|
/**
|
|
1138
1145
|
* 地图 API 接口定义
|
|
@@ -1277,6 +1284,12 @@ export declare interface MapApi {
|
|
|
1277
1284
|
* @returns 门槛数据数组(长度已修正,`height` 已补默认值并钳制)
|
|
1278
1285
|
*/
|
|
1279
1286
|
getThresholds(): ThresholdParam[];
|
|
1287
|
+
/**
|
|
1288
|
+
* 获取当前地图上所有坡道数据
|
|
1289
|
+
*
|
|
1290
|
+
* @returns 坡道数据数组(角点为归一化后的结果)
|
|
1291
|
+
*/
|
|
1292
|
+
getRamps(): RampParam[];
|
|
1280
1293
|
/**
|
|
1281
1294
|
* 获取当前地图上所有定点清扫数据
|
|
1282
1295
|
*
|
|
@@ -1463,6 +1476,28 @@ export declare interface MapApi {
|
|
|
1463
1476
|
offsetX?: number;
|
|
1464
1477
|
offsetY?: number;
|
|
1465
1478
|
}): Point[];
|
|
1479
|
+
/**
|
|
1480
|
+
* 基于视口中心生成坡道的四个角点坐标
|
|
1481
|
+
*
|
|
1482
|
+
* 缺省尺寸 0.8m × 0.4m(宽 × 高,高方向即坡向)—— 「新建坡道」的初始尺寸,不是配置项;
|
|
1483
|
+
* 需要别的初始尺寸就传 `width` / `height`。传入值会被钳制到
|
|
1484
|
+
* `controls.ramp` 的 `minWidth`/`maxWidth` 与 `minHeight`/`maxHeight`
|
|
1485
|
+
* (米)区间内。
|
|
1486
|
+
*
|
|
1487
|
+
* @param options - 配置选项
|
|
1488
|
+
* @param options.width - 坡道宽度,单位米,默认 0.8
|
|
1489
|
+
* @param options.height - 坡道高度,单位米,默认 0.4(正好等于 minHeight)
|
|
1490
|
+
* @param options.offsetX - X方向像素偏移,支持负数,默认为 0
|
|
1491
|
+
* @param options.offsetY - Y方向像素偏移,支持负数,默认为 0
|
|
1492
|
+
* @returns 四个角点坐标,顺时针顺序:[左上, 右上, 右下, 左下](0→1 为宽
|
|
1493
|
+
* 方向,0→3 为高方向),可直接作为 `RampParam.points`;坡向为屏幕上方
|
|
1494
|
+
*/
|
|
1495
|
+
getRampPointsByViewportCenter(options?: {
|
|
1496
|
+
width?: number;
|
|
1497
|
+
height?: number;
|
|
1498
|
+
offsetX?: number;
|
|
1499
|
+
offsetY?: number;
|
|
1500
|
+
}): Point[];
|
|
1466
1501
|
/**
|
|
1467
1502
|
* 基于任意中心点生成矩形的四个顶点坐标
|
|
1468
1503
|
*
|
|
@@ -1746,6 +1781,15 @@ export declare interface MapCallbacks {
|
|
|
1746
1781
|
* @param.en id - ID of the deleted threshold
|
|
1747
1782
|
*/
|
|
1748
1783
|
onRemoveThreshold?: (id: string) => void;
|
|
1784
|
+
/**
|
|
1785
|
+
* @description.zh 点击坡道删除按钮的回调
|
|
1786
|
+
* @description.en Callback when clicking the delete button of ramp
|
|
1787
|
+
* @description.zh 当用户点击编辑态坡道的删除按钮时触发。SDK 不会移除该坡道,宿主更新自己的坡道列表后重绘。
|
|
1788
|
+
* @description.en Triggered when the user clicks the delete button of an editing ramp. The SDK does not remove it; the host updates its own list and redraws.
|
|
1789
|
+
* @param.zh id - 被删除的坡道ID
|
|
1790
|
+
* @param.en id - ID of the deleted ramp
|
|
1791
|
+
*/
|
|
1792
|
+
onRemoveRamp?: (id: string) => void;
|
|
1749
1793
|
/**
|
|
1750
1794
|
* @description.zh 更新禁扫区域的回调
|
|
1751
1795
|
* @description.en Callback when updating forbidden sweep zone
|
|
@@ -1791,6 +1835,15 @@ export declare interface MapCallbacks {
|
|
|
1791
1835
|
* @param.en threshold - Updated threshold data
|
|
1792
1836
|
*/
|
|
1793
1837
|
onUpdateThreshold?: (threshold: ThresholdParam) => void;
|
|
1838
|
+
/**
|
|
1839
|
+
* @description.zh 更新坡道的回调
|
|
1840
|
+
* @description.en Callback when updating ramp
|
|
1841
|
+
* @description.zh 当用户完成一次坡道编辑操作(旋转 / 缩放 / 移动,或拖拽整体平移)后触发,携带最终几何。
|
|
1842
|
+
* @description.en Triggered after the user finishes a ramp edit (rotate/scale/move, or body drag), carrying the final geometry.
|
|
1843
|
+
* @param.zh ramp - 更新后的坡道数据
|
|
1844
|
+
* @param.en ramp - Updated ramp data
|
|
1845
|
+
*/
|
|
1846
|
+
onUpdateRamp?: (ramp: RampParam) => void;
|
|
1794
1847
|
/**
|
|
1795
1848
|
* @description.zh 更新定点清扫的回调
|
|
1796
1849
|
* @description.en Callback when updating spot clean
|
|
@@ -1872,6 +1925,15 @@ export declare interface MapCallbacks {
|
|
|
1872
1925
|
* @param.en threshold - Clicked threshold data
|
|
1873
1926
|
*/
|
|
1874
1927
|
onClickThreshold?: (threshold: ThresholdParam) => void;
|
|
1928
|
+
/**
|
|
1929
|
+
* @description.zh 点击坡道回调
|
|
1930
|
+
* @description.en Callback when clicking ramp
|
|
1931
|
+
* @description.zh 点击坡道时触发。常用于「点击进入编辑」(把该 id 加入 editingRampIds)。
|
|
1932
|
+
* @description.en Triggered when the user taps a ramp. Commonly used to enter edit mode (add the id to editingRampIds).
|
|
1933
|
+
* @param.zh ramp - 被点击的坡道数据
|
|
1934
|
+
* @param.en ramp - Clicked ramp data
|
|
1935
|
+
*/
|
|
1936
|
+
onClickRamp?: (ramp: RampParam) => void;
|
|
1875
1937
|
/**
|
|
1876
1938
|
* @description.zh 点击定点清扫回调
|
|
1877
1939
|
* @description.en Callback when clicking spot clean
|
|
@@ -2225,6 +2287,114 @@ export declare type ProcessedRasterData = {
|
|
|
2225
2287
|
totalPixels: number
|
|
2226
2288
|
}
|
|
2227
2289
|
|
|
2290
|
+
/** 坡道配置 */
|
|
2291
|
+
export declare type RampConfig = {
|
|
2292
|
+
/** 底色(不透明 —— 坡道是地面元素,画在路径 / 机器人之下,见 ADR 0006) */
|
|
2293
|
+
fillColor: ColorSource
|
|
2294
|
+
/** 描边颜色 */
|
|
2295
|
+
strokeColor: ColorSource
|
|
2296
|
+
/** 描边线宽(屏幕像素,不随地图缩放) */
|
|
2297
|
+
strokeWidth: number
|
|
2298
|
+
/**
|
|
2299
|
+
* 箭头颜色。默认白色 40% 透明叠在底色上(与 UED 稿一致)——
|
|
2300
|
+
* 这样改 `fillColor` 时箭头会自动跟随,不用两处对着调。
|
|
2301
|
+
*/
|
|
2302
|
+
arrowColor: ColorSource
|
|
2303
|
+
/**
|
|
2304
|
+
* 箭头**最小**线宽(屏幕像素,不随地图缩放)。
|
|
2305
|
+
*
|
|
2306
|
+
* 实际线宽取 `实际行距 × arrowThicknessRatio` 与本值中的较大者:正常缩放
|
|
2307
|
+
* 下由比例决定(线与缝的粗细比恒定,观感等于 UED 稿),坡道小到 / 地图
|
|
2308
|
+
* 缩到线要细过本值时由本值兜底,保证箭头不会细成看不见。
|
|
2309
|
+
*/
|
|
2310
|
+
arrowThickness: number
|
|
2311
|
+
/**
|
|
2312
|
+
* 箭头线宽相对**实际行距**的比例,UED 稿量得 `3 / 7 ≈ 0.43`。
|
|
2313
|
+
*
|
|
2314
|
+
* 线宽跟着行距走而不是锁在固定像素:行距随坡道尺寸变化,若线宽不跟着长,
|
|
2315
|
+
* 放大地图就会看到又粗又疏的缝里夹着细发丝一样的箭头。按比例算才能任何
|
|
2316
|
+
* 缩放下都是同一张贴纸。
|
|
2317
|
+
*/
|
|
2318
|
+
arrowThicknessRatio: number
|
|
2319
|
+
/**
|
|
2320
|
+
* 相邻箭头的**最小**间隙(屏幕像素),沿坡向度量。
|
|
2321
|
+
*
|
|
2322
|
+
* 最小步距 = `arrowThickness + arrowGap`,它是密度上限:箭头永远不会比这
|
|
2323
|
+
* 更挤。地图缩得很小时它会顶掉 {@link RampConfig.arrowDensity} 算出的砖
|
|
2324
|
+
* 尺寸,让砖变大、行数变少,保证箭头不会糊成一片。
|
|
2325
|
+
*/
|
|
2326
|
+
arrowGap: number
|
|
2327
|
+
/**
|
|
2328
|
+
* 纹样密度:**短边**上铺几个箭头。UED 稿是方形坡道上 6 个,故默认 6。
|
|
2329
|
+
*
|
|
2330
|
+
* 箭头是一块比例固定的「砖」,而不是拉满坡道宽度的单根折线:砖的尺寸
|
|
2331
|
+
* 取 `短边 / arrowDensity`,再沿坡向铺若干**行**、沿宽方向铺若干**列**。
|
|
2332
|
+
* 因此任何宽高比的坡道看到的都是同一块砖,只是数量不同。
|
|
2333
|
+
*
|
|
2334
|
+
* 若改成「整宽一个箭头 + 固定行数」,折角深浅由宽决定、线宽由高决定,
|
|
2335
|
+
* 两个特征分别挂在两条边上:窄高坡道会退化成胖带子(折角只有线宽的
|
|
2336
|
+
* 1/7),宽矮坡道会退化成细丝配大折角。见 plan record
|
|
2337
|
+
* `docs/records/plans/2026-08-06-ramp-map-element-plan.md`。
|
|
2338
|
+
*
|
|
2339
|
+
* 调小更稀、调大更密;密度还受最小步距 `arrowThickness + arrowGap` 约束。
|
|
2340
|
+
*/
|
|
2341
|
+
arrowDensity: number
|
|
2342
|
+
/**
|
|
2343
|
+
* 箭头两臂相对横轴的抬升角度(度),钳制在 `[1, 60]`。
|
|
2344
|
+
*
|
|
2345
|
+
* **不是固定的外凸像素**:外凸量由 `半个砖宽 × tan(角度)` 反推,所以任何
|
|
2346
|
+
* 坡道尺寸、任何地图缩放下箭头形状恒定。若改成固定像素,宽砖上的箭头会
|
|
2347
|
+
* 被摊平成直线。UED 稿量得约 8.7°,默认取 9。
|
|
2348
|
+
*/
|
|
2349
|
+
arrowAngle: number
|
|
2350
|
+
/** 箭头区域相对坡道边缘的内缩(屏幕像素),箭头不贴边 */
|
|
2351
|
+
arrowInset: number
|
|
2352
|
+
/** 最小宽度 (米),绘制与缩放时宽边(顶点 0→1)被钳制到不小于该值 */
|
|
2353
|
+
minWidth: number
|
|
2354
|
+
/** 最大宽度 (米),可选。缺省或 ≤ minWidth 时不限制。 */
|
|
2355
|
+
maxWidth?: number
|
|
2356
|
+
/** 最小高度 (米),绘制与缩放时高边(顶点 0→3)被钳制到不小于该值 */
|
|
2357
|
+
minHeight: number
|
|
2358
|
+
/** 最大高度 (米),可选。缺省或 ≤ minHeight 时不限制。 */
|
|
2359
|
+
maxHeight?: number
|
|
2360
|
+
/** 四角控制按钮图标容器填充颜色(编辑态显示) */
|
|
2361
|
+
iconWrapperFillColor: ColorSource
|
|
2362
|
+
/** 编辑态轮廓相对坡道边缘的偏移(屏幕像素) */
|
|
2363
|
+
outlineOffset: number
|
|
2364
|
+
/** 编辑态轮廓描边颜色 */
|
|
2365
|
+
outlineStrokeColor: ColorSource
|
|
2366
|
+
/** 编辑态轮廓描边宽度 */
|
|
2367
|
+
outlineStrokeWidth: number
|
|
2368
|
+
/** 编辑态轮廓是否虚线 */
|
|
2369
|
+
outlineDashed: boolean
|
|
2370
|
+
/** 编辑态轮廓虚线数组 */
|
|
2371
|
+
outlineDashArray: [number, number]
|
|
2372
|
+
/** 编辑态轮廓填充颜色 */
|
|
2373
|
+
outlineFillColor: ColorSource
|
|
2374
|
+
/** 尺寸标签(宽×高)文本颜色(编辑态显示) */
|
|
2375
|
+
textColor: ColorSource
|
|
2376
|
+
/** 尺寸标签相对轮廓边缘向外的偏移(屏幕像素) */
|
|
2377
|
+
textOffset: number
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
/** 坡道参数 */
|
|
2381
|
+
export declare type RampParam = {
|
|
2382
|
+
/** 坡道ID */
|
|
2383
|
+
id: string
|
|
2384
|
+
/**
|
|
2385
|
+
* 四角坐标(地图像素坐标系),顺时针 左上→右上→右下→左下,与家具 /
|
|
2386
|
+
* 禁区等四边形元素同序:顶点 0→1 为宽(w)方向,0→3 为高(h)方向。
|
|
2387
|
+
*
|
|
2388
|
+
* 坡道的上坡方向由点序自带:垂直于 0→1 边、从 3→2 边指向 0→1 边
|
|
2389
|
+
* (未旋转时即"朝上")。旋转时点集整体旋转,坡向随之旋转 —— 没有独立的
|
|
2390
|
+
* direction 字段。因此点序**不做**长边规范(那会翻转坡向),入口只纠正
|
|
2391
|
+
* 绕向为顺时针、把宽与高分别钳制到 `minWidth`/`maxWidth` 与
|
|
2392
|
+
* `minHeight`/`maxHeight`(米)区间并拉直成标准矩形。`getRamps()` 回吐的
|
|
2393
|
+
* 点集是归一化后的结果,不一定与传入的原始点逐字相同。
|
|
2394
|
+
*/
|
|
2395
|
+
points: Point[]
|
|
2396
|
+
}
|
|
2397
|
+
|
|
2228
2398
|
/**
|
|
2229
2399
|
* 栅格房间的美化几何(仅 `runtime.enableBeautify` 开启时由 MapManager 计算,
|
|
2230
2400
|
* 随 `ProcessedRasterData` 一并交给渲染层)。
|
|
@@ -2478,6 +2648,14 @@ export declare type RuntimeConfig = {
|
|
|
2478
2648
|
* 加入本列表即可。
|
|
2479
2649
|
*/
|
|
2480
2650
|
editingThresholdIds: string[]
|
|
2651
|
+
/**
|
|
2652
|
+
* 正在编辑的坡道ID列表。
|
|
2653
|
+
*
|
|
2654
|
+
* 列入的坡道显示编辑控件(虚线轮廓、尺寸标签与删除 / 旋转 / 缩放 / 移动
|
|
2655
|
+
* 按钮)并可整体拖拽;未列入的坡道不显示编辑控件,但坡道本身仍可点击
|
|
2656
|
+
* (上抛 `onClickRamp`,宿主可借此实现「点击进入编辑」)。
|
|
2657
|
+
*/
|
|
2658
|
+
editingRampIds: string[]
|
|
2481
2659
|
/** 正在编辑的定点清扫ID列表 */
|
|
2482
2660
|
editingSpotIds: string[]
|
|
2483
2661
|
/** 正在编辑的房间锚点ID列表(独立于 editingSpotIds,互不影响) */
|
|
@@ -2928,3 +3106,19 @@ export declare type ZoneParam = {
|
|
|
2928
3106
|
export declare type ZoneTypeDefinition = ZoneConfig
|
|
2929
3107
|
|
|
2930
3108
|
export { }
|
|
3109
|
+
|
|
3110
|
+
/**
|
|
3111
|
+
* Minimal `node:fs` surface for the few tests that read source files off disk
|
|
3112
|
+
* (structural invariants like `throttle-cancel-invariant.test.ts`).
|
|
3113
|
+
*
|
|
3114
|
+
* `@types/node` is installed but unreachable: `tsconfig.json` pins `typeRoots`
|
|
3115
|
+
* to `./src/core/@types`, deliberately keeping Node globals out of a browser
|
|
3116
|
+
* SDK's type surface. Shimming the three functions actually used is contained;
|
|
3117
|
+
* widening `typeRoots` would put `process`, `Buffer` and friends in scope for
|
|
3118
|
+
* every `src/` file, where they must never be used.
|
|
3119
|
+
*/
|
|
3120
|
+
declare module 'node:fs' {
|
|
3121
|
+
export function readFileSync(path: string, encoding: 'utf8'): string
|
|
3122
|
+
export function readdirSync(path: string): string[]
|
|
3123
|
+
export function statSync(path: string): { isDirectory(): boolean }
|
|
3124
|
+
}
|