lebai_sdk 0.1.19 → 0.1.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/lebai_sdk.d.ts CHANGED
@@ -262,6 +262,28 @@ export class Robot {
262
262
  */
263
263
  add_signal(index: number, value: number): Promise<void>;
264
264
  /**
265
+ * @param {string} key
266
+ * @param {string} value
267
+ * @returns {Promise<void>}
268
+ */
269
+ set_item(key: string, value: string): Promise<void>;
270
+ /**
271
+ * @param {string} key
272
+ * @returns {Promise<any>}
273
+ */
274
+ get_item(key: string): Promise<any>;
275
+ /**
276
+ * @param {string} prefix
277
+ * @returns {Promise<any>}
278
+ */
279
+ get_items(prefix: string): Promise<any>;
280
+ /**
281
+ * @param {string} name
282
+ * @param {any | undefined} params
283
+ * @returns {Promise<any>}
284
+ */
285
+ run_plugin_cmd(name: string, params?: any): Promise<any>;
286
+ /**
265
287
  * @param {string} scene
266
288
  * @param {any | undefined} params
267
289
  * @param {string | undefined} dir
package/lebai_sdk_bg.js CHANGED
@@ -10,20 +10,6 @@ heap.push(undefined, null, true, false);
10
10
 
11
11
  function getObject(idx) { return heap[idx]; }
12
12
 
13
- let heap_next = heap.length;
14
-
15
- function dropObject(idx) {
16
- if (idx < 132) return;
17
- heap[idx] = heap_next;
18
- heap_next = idx;
19
- }
20
-
21
- function takeObject(idx) {
22
- const ret = getObject(idx);
23
- dropObject(idx);
24
- return ret;
25
- }
26
-
27
13
  let WASM_VECTOR_LEN = 0;
28
14
 
29
15
  let cachedUint8Memory0 = null;
@@ -103,6 +89,20 @@ function getInt32Memory0() {
103
89
  return cachedInt32Memory0;
104
90
  }
105
91
 
92
+ let heap_next = heap.length;
93
+
94
+ function dropObject(idx) {
95
+ if (idx < 132) return;
96
+ heap[idx] = heap_next;
97
+ heap_next = idx;
98
+ }
99
+
100
+ function takeObject(idx) {
101
+ const ret = getObject(idx);
102
+ dropObject(idx);
103
+ return ret;
104
+ }
105
+
106
106
  function addHeapObject(obj) {
107
107
  if (heap_next === heap.length) heap.push(heap.length + 1);
108
108
  const idx = heap_next;
@@ -231,19 +231,19 @@ function makeMutClosure(arg0, arg1, dtor, f) {
231
231
  return real;
232
232
  }
233
233
  function __wbg_adapter_48(arg0, arg1, arg2) {
234
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h14a0a7cc34d6cb7b(arg0, arg1, addHeapObject(arg2));
234
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h231cdc31d5e648b0(arg0, arg1, addHeapObject(arg2));
235
235
  }
236
236
 
237
- function __wbg_adapter_55(arg0, arg1) {
238
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__heeda6a83a91cd6af(arg0, arg1);
237
+ function __wbg_adapter_51(arg0, arg1) {
238
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h5bad810fbe7d5326(arg0, arg1);
239
239
  }
240
240
 
241
241
  function __wbg_adapter_58(arg0, arg1, arg2) {
242
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h418bcfa3d9cfb1d7(arg0, arg1, addHeapObject(arg2));
242
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1aa97e2e62025508(arg0, arg1, addHeapObject(arg2));
243
243
  }
244
244
 
245
245
  function __wbg_adapter_61(arg0, arg1) {
246
- wasm.wasm_bindgen__convert__closures__invoke0_mut__h3202873ee772e7ea(arg0, arg1);
246
+ wasm.wasm_bindgen__convert__closures__invoke0_mut__h84db21ea0680b43a(arg0, arg1);
247
247
  }
248
248
 
249
249
  let cachedUint32Memory0 = null;
@@ -322,8 +322,8 @@ function getArrayU8FromWasm0(ptr, len) {
322
322
  ptr = ptr >>> 0;
323
323
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
324
324
  }
325
- function __wbg_adapter_234(arg0, arg1, arg2, arg3) {
326
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h2a9104be04933eb2(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
325
+ function __wbg_adapter_238(arg0, arg1, arg2, arg3) {
326
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h113bdd07219d3bc1(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
327
327
  }
328
328
 
329
329
  /**
@@ -722,6 +722,50 @@ export class Robot {
722
722
  return takeObject(ret);
723
723
  }
724
724
  /**
725
+ * @param {string} key
726
+ * @param {string} value
727
+ * @returns {Promise<void>}
728
+ */
729
+ set_item(key, value) {
730
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
731
+ const len0 = WASM_VECTOR_LEN;
732
+ const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
733
+ const len1 = WASM_VECTOR_LEN;
734
+ const ret = wasm.robot_set_item(this.__wbg_ptr, ptr0, len0, ptr1, len1);
735
+ return takeObject(ret);
736
+ }
737
+ /**
738
+ * @param {string} key
739
+ * @returns {Promise<any>}
740
+ */
741
+ get_item(key) {
742
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
743
+ const len0 = WASM_VECTOR_LEN;
744
+ const ret = wasm.robot_get_item(this.__wbg_ptr, ptr0, len0);
745
+ return takeObject(ret);
746
+ }
747
+ /**
748
+ * @param {string} prefix
749
+ * @returns {Promise<any>}
750
+ */
751
+ get_items(prefix) {
752
+ const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
753
+ const len0 = WASM_VECTOR_LEN;
754
+ const ret = wasm.robot_get_items(this.__wbg_ptr, ptr0, len0);
755
+ return takeObject(ret);
756
+ }
757
+ /**
758
+ * @param {string} name
759
+ * @param {any | undefined} params
760
+ * @returns {Promise<any>}
761
+ */
762
+ run_plugin_cmd(name, params) {
763
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
764
+ const len0 = WASM_VECTOR_LEN;
765
+ const ret = wasm.robot_run_plugin_cmd(this.__wbg_ptr, ptr0, len0, isLikeNone(params) ? 0 : addHeapObject(params));
766
+ return takeObject(ret);
767
+ }
768
+ /**
725
769
  * @param {string} scene
726
770
  * @param {any | undefined} params
727
771
  * @param {string | undefined} dir
@@ -1219,10 +1263,6 @@ export class RobotSubscription {
1219
1263
  }
1220
1264
  }
1221
1265
 
1222
- export function __wbindgen_object_drop_ref(arg0) {
1223
- takeObject(arg0);
1224
- };
1225
-
1226
1266
  export function __wbindgen_string_get(arg0, arg1) {
1227
1267
  const obj = getObject(arg1);
1228
1268
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -1232,13 +1272,17 @@ export function __wbindgen_string_get(arg0, arg1) {
1232
1272
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
1233
1273
  };
1234
1274
 
1275
+ export function __wbindgen_object_drop_ref(arg0) {
1276
+ takeObject(arg0);
1277
+ };
1278
+
1235
1279
  export function __wbindgen_number_new(arg0) {
1236
1280
  const ret = arg0;
1237
1281
  return addHeapObject(ret);
1238
1282
  };
1239
1283
 
1240
- export function __wbg_robotsubscription_new(arg0) {
1241
- const ret = RobotSubscription.__wrap(arg0);
1284
+ export function __wbg_robot_new(arg0) {
1285
+ const ret = Robot.__wrap(arg0);
1242
1286
  return addHeapObject(ret);
1243
1287
  };
1244
1288
 
@@ -1247,17 +1291,11 @@ export function __wbindgen_string_new(arg0, arg1) {
1247
1291
  return addHeapObject(ret);
1248
1292
  };
1249
1293
 
1250
- export function __wbg_robot_new(arg0) {
1251
- const ret = Robot.__wrap(arg0);
1294
+ export function __wbg_robotsubscription_new(arg0) {
1295
+ const ret = RobotSubscription.__wrap(arg0);
1252
1296
  return addHeapObject(ret);
1253
1297
  };
1254
1298
 
1255
- export function __wbindgen_is_object(arg0) {
1256
- const val = getObject(arg0);
1257
- const ret = typeof(val) === 'object' && val !== null;
1258
- return ret;
1259
- };
1260
-
1261
1299
  export function __wbindgen_cb_drop(arg0) {
1262
1300
  const obj = takeObject(arg0).original;
1263
1301
  if (obj.cnt-- == 1) {
@@ -1301,6 +1339,12 @@ export function __wbindgen_number_get(arg0, arg1) {
1301
1339
  getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
1302
1340
  };
1303
1341
 
1342
+ export function __wbindgen_is_object(arg0) {
1343
+ const val = getObject(arg0);
1344
+ const ret = typeof(val) === 'object' && val !== null;
1345
+ return ret;
1346
+ };
1347
+
1304
1348
  export function __wbindgen_in(arg0, arg1) {
1305
1349
  const ret = getObject(arg0) in getObject(arg1);
1306
1350
  return ret;
@@ -1549,7 +1593,7 @@ export function __wbg_new_43f1b47c28813cbd(arg0, arg1) {
1549
1593
  const a = state0.a;
1550
1594
  state0.a = 0;
1551
1595
  try {
1552
- return __wbg_adapter_234(a, state0.b, arg0, arg1);
1596
+ return __wbg_adapter_238(a, state0.b, arg0, arg1);
1553
1597
  } finally {
1554
1598
  state0.a = a;
1555
1599
  }
@@ -1630,33 +1674,33 @@ export function __wbindgen_memory() {
1630
1674
  return addHeapObject(ret);
1631
1675
  };
1632
1676
 
1633
- export function __wbindgen_closure_wrapper1587(arg0, arg1, arg2) {
1634
- const ret = makeMutClosure(arg0, arg1, 656, __wbg_adapter_48);
1677
+ export function __wbindgen_closure_wrapper1667(arg0, arg1, arg2) {
1678
+ const ret = makeMutClosure(arg0, arg1, 681, __wbg_adapter_48);
1635
1679
  return addHeapObject(ret);
1636
1680
  };
1637
1681
 
1638
- export function __wbindgen_closure_wrapper1589(arg0, arg1, arg2) {
1639
- const ret = makeMutClosure(arg0, arg1, 656, __wbg_adapter_48);
1682
+ export function __wbindgen_closure_wrapper1669(arg0, arg1, arg2) {
1683
+ const ret = makeMutClosure(arg0, arg1, 681, __wbg_adapter_51);
1640
1684
  return addHeapObject(ret);
1641
1685
  };
1642
1686
 
1643
- export function __wbindgen_closure_wrapper1591(arg0, arg1, arg2) {
1644
- const ret = makeMutClosure(arg0, arg1, 656, __wbg_adapter_48);
1687
+ export function __wbindgen_closure_wrapper1671(arg0, arg1, arg2) {
1688
+ const ret = makeMutClosure(arg0, arg1, 681, __wbg_adapter_48);
1645
1689
  return addHeapObject(ret);
1646
1690
  };
1647
1691
 
1648
- export function __wbindgen_closure_wrapper1593(arg0, arg1, arg2) {
1649
- const ret = makeMutClosure(arg0, arg1, 656, __wbg_adapter_55);
1692
+ export function __wbindgen_closure_wrapper1673(arg0, arg1, arg2) {
1693
+ const ret = makeMutClosure(arg0, arg1, 681, __wbg_adapter_48);
1650
1694
  return addHeapObject(ret);
1651
1695
  };
1652
1696
 
1653
- export function __wbindgen_closure_wrapper2335(arg0, arg1, arg2) {
1654
- const ret = makeMutClosure(arg0, arg1, 772, __wbg_adapter_58);
1697
+ export function __wbindgen_closure_wrapper2410(arg0, arg1, arg2) {
1698
+ const ret = makeMutClosure(arg0, arg1, 793, __wbg_adapter_58);
1655
1699
  return addHeapObject(ret);
1656
1700
  };
1657
1701
 
1658
- export function __wbindgen_closure_wrapper2382(arg0, arg1, arg2) {
1659
- const ret = makeMutClosure(arg0, arg1, 795, __wbg_adapter_61);
1702
+ export function __wbindgen_closure_wrapper2455(arg0, arg1, arg2) {
1703
+ const ret = makeMutClosure(arg0, arg1, 815, __wbg_adapter_61);
1660
1704
  return addHeapObject(ret);
1661
1705
  };
1662
1706
 
package/lebai_sdk_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "rise0chen<rise0chen@163.com>"
5
5
  ],
6
6
  "description": "lebai_sdk",
7
- "version": "0.1.19",
7
+ "version": "0.1.21",
8
8
  "license": "SEE LICENSE IN LICENSE",
9
9
  "repository": {
10
10
  "type": "git",