@ray-js/robot-map 0.0.8 → 0.0.9-beta.2
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/lib/RobotMap.js +2 -1
- package/lib/index.d.ts +1 -0
- package/lib/props.d.ts +15 -0
- package/package.json +2 -2
package/lib/RobotMap.js
CHANGED
|
@@ -18,7 +18,8 @@ import { EXCLUDED_API_METHODS } from './types';
|
|
|
18
18
|
|
|
19
19
|
// 回调名到事件名的映射
|
|
20
20
|
const CALLBACK_TO_EVENT_MAP = _objectSpread({
|
|
21
|
-
onInitialized: 'onInitialized'
|
|
21
|
+
onInitialized: 'onInitialized',
|
|
22
|
+
onLogger: 'onLogger'
|
|
22
23
|
}, MAP_CALLBACK_METHODS.reduce((acc, methodName) => {
|
|
23
24
|
acc[methodName] = methodName;
|
|
24
25
|
return acc;
|
package/lib/index.d.ts
CHANGED
package/lib/props.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { DeepPartialAppConfig, DeepPartialRuntimeConfig, RoomProperty, ZoneParam, VirtualWallParam, SpotParam, WayPointParam, DetectedObjectParam, CustomElementParam, CustomCarpetParam, FurnitureParam, MapCallbacks } from '@ray-js/robot-map-sdk';
|
|
2
2
|
import { MapApi } from './types';
|
|
3
|
+
export type LoggerLevel = 'info' | 'warn' | 'error' | 'debug';
|
|
4
|
+
export type LoggerPayload = {
|
|
5
|
+
level: LoggerLevel;
|
|
6
|
+
message: string;
|
|
7
|
+
data: unknown[];
|
|
8
|
+
tag: string;
|
|
9
|
+
ts: number;
|
|
10
|
+
};
|
|
3
11
|
/**
|
|
4
12
|
* 机器人地图组件属性接口
|
|
5
13
|
*
|
|
@@ -134,5 +142,12 @@ export interface RobotMapProps extends MapCallbacks {
|
|
|
134
142
|
* @param mapApi - 可供使用的地图 API 函数对象,所有方法返回 Promise / Available map API functions object, all methods return Promise
|
|
135
143
|
*/
|
|
136
144
|
onMapReady?: (mapApi: MapApi) => void;
|
|
145
|
+
/**
|
|
146
|
+
* @description.zh SDK 日志回调
|
|
147
|
+
* @description.en Callback for SDK log payloads
|
|
148
|
+
* @description.zh 当 webview 内部 SDK 转发结构化日志时触发。默认仅转发 warn 和 error,可通过 `config.logger.hostLevels` 扩展到 info 和 debug。
|
|
149
|
+
* @description.en Triggered when the webview SDK forwards structured logs. By default only warn and error are forwarded, and you can extend this to info and debug through `config.logger.hostLevels`.
|
|
150
|
+
*/
|
|
151
|
+
onLogger?: (payload: LoggerPayload) => void;
|
|
137
152
|
}
|
|
138
153
|
export declare const robotMapDefaultProps: RobotMapProps;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/robot-map",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9-beta.2",
|
|
4
4
|
"description": "机器人地图组件",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"files": [
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@ray-js/ray": "^1.7.39"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@ray-js/robot-map-sdk": "0.0.15-beta.
|
|
36
|
+
"@ray-js/robot-map-sdk": "0.0.15-beta.4",
|
|
37
37
|
"clsx": "^1.2.1",
|
|
38
38
|
"nanoid": "^5.1.6"
|
|
39
39
|
},
|