lebai_sdk 0.2.10 → 0.2.13

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
@@ -29,6 +29,14 @@ export function version(): string;
29
29
  export class Robot {
30
30
  free(): void;
31
31
  /**
32
+ * @returns {Promise<boolean>}
33
+ */
34
+ is_connected(): Promise<boolean>;
35
+ /**
36
+ * @returns {Promise<string>}
37
+ */
38
+ wait_disconnect(): Promise<string>;
39
+ /**
32
40
  * @param {string} method
33
41
  * @param {string | undefined} [param]
34
42
  * @returns {Promise<string>}
@@ -71,11 +79,11 @@ export class Robot {
71
79
  pose_inverse(p: any): Promise<any>;
72
80
  /**
73
81
  * @param {string} name
74
- * @param {any} pose
82
+ * @param {any | undefined} [pose]
75
83
  * @param {string | undefined} [dir]
76
84
  * @returns {Promise<void>}
77
85
  */
78
- save_pose(name: string, pose: any, dir?: string): Promise<void>;
86
+ save_pose(name: string, pose?: any, dir?: string): Promise<void>;
79
87
  /**
80
88
  * @param {string} name
81
89
  * @param {string | undefined} [dir]
package/lebai_sdk_bg.js CHANGED
@@ -10,6 +10,29 @@ 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
+ function addHeapObject(obj) {
28
+ if (heap_next === heap.length) heap.push(heap.length + 1);
29
+ const idx = heap_next;
30
+ heap_next = heap[idx];
31
+
32
+ heap[idx] = obj;
33
+ return idx;
34
+ }
35
+
13
36
  let WASM_VECTOR_LEN = 0;
14
37
 
15
38
  let cachedUint8Memory0 = null;
@@ -90,29 +113,6 @@ function getInt32Memory0() {
90
113
  return cachedInt32Memory0;
91
114
  }
92
115
 
93
- let heap_next = heap.length;
94
-
95
- function dropObject(idx) {
96
- if (idx < 132) return;
97
- heap[idx] = heap_next;
98
- heap_next = idx;
99
- }
100
-
101
- function takeObject(idx) {
102
- const ret = getObject(idx);
103
- dropObject(idx);
104
- return ret;
105
- }
106
-
107
- function addHeapObject(obj) {
108
- if (heap_next === heap.length) heap.push(heap.length + 1);
109
- const idx = heap_next;
110
- heap_next = heap[idx];
111
-
112
- heap[idx] = obj;
113
- return idx;
114
- }
115
-
116
116
  const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
117
117
 
118
118
  let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
@@ -238,19 +238,19 @@ function makeMutClosure(arg0, arg1, dtor, f) {
238
238
  return real;
239
239
  }
240
240
  function __wbg_adapter_50(arg0, arg1, arg2) {
241
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h04369be869cfcda9(arg0, arg1, addHeapObject(arg2));
241
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1cb257f3a84aa38b(arg0, arg1, addHeapObject(arg2));
242
242
  }
243
243
 
244
- function __wbg_adapter_53(arg0, arg1) {
245
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h52c02527e9ea2351(arg0, arg1);
244
+ function __wbg_adapter_55(arg0, arg1) {
245
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h24d6faac42ef5dca(arg0, arg1);
246
246
  }
247
247
 
248
248
  function __wbg_adapter_60(arg0, arg1, arg2) {
249
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb583583dd7b49a0d(arg0, arg1, addHeapObject(arg2));
249
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hf3ae89a6bef83f1c(arg0, arg1, addHeapObject(arg2));
250
250
  }
251
251
 
252
252
  function __wbg_adapter_63(arg0, arg1) {
253
- wasm.wasm_bindgen__convert__closures__invoke0_mut__hfe59f759bdfcabc2(arg0, arg1);
253
+ wasm.wasm_bindgen__convert__closures__invoke0_mut__h032693d939b0fa3a(arg0, arg1);
254
254
  }
255
255
 
256
256
  let cachedUint32Memory0 = null;
@@ -357,8 +357,8 @@ function getArrayU8FromWasm0(ptr, len) {
357
357
  ptr = ptr >>> 0;
358
358
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
359
359
  }
360
- function __wbg_adapter_254(arg0, arg1, arg2, arg3) {
361
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h81b812e18a647852(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
360
+ function __wbg_adapter_258(arg0, arg1, arg2, arg3) {
361
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h743e0e03d07bbd79(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
362
362
  }
363
363
 
364
364
  const RobotFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -388,6 +388,20 @@ export class Robot {
388
388
  wasm.__wbg_robot_free(ptr);
389
389
  }
390
390
  /**
391
+ * @returns {Promise<boolean>}
392
+ */
393
+ is_connected() {
394
+ const ret = wasm.robot_is_connected(this.__wbg_ptr);
395
+ return takeObject(ret);
396
+ }
397
+ /**
398
+ * @returns {Promise<string>}
399
+ */
400
+ wait_disconnect() {
401
+ const ret = wasm.robot_wait_disconnect(this.__wbg_ptr);
402
+ return takeObject(ret);
403
+ }
404
+ /**
391
405
  * @param {string} method
392
406
  * @param {string | undefined} [param]
393
407
  * @returns {Promise<string>}
@@ -459,7 +473,7 @@ export class Robot {
459
473
  }
460
474
  /**
461
475
  * @param {string} name
462
- * @param {any} pose
476
+ * @param {any | undefined} [pose]
463
477
  * @param {string | undefined} [dir]
464
478
  * @returns {Promise<void>}
465
479
  */
@@ -468,7 +482,7 @@ export class Robot {
468
482
  const len0 = WASM_VECTOR_LEN;
469
483
  var ptr1 = isLikeNone(dir) ? 0 : passStringToWasm0(dir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
470
484
  var len1 = WASM_VECTOR_LEN;
471
- const ret = wasm.robot_save_pose(this.__wbg_ptr, ptr0, len0, addHeapObject(pose), ptr1, len1);
485
+ const ret = wasm.robot_save_pose(this.__wbg_ptr, ptr0, len0, isLikeNone(pose) ? 0 : addHeapObject(pose), ptr1, len1);
472
486
  return takeObject(ret);
473
487
  }
474
488
  /**
@@ -1360,6 +1374,15 @@ export class RobotSubscription {
1360
1374
  }
1361
1375
  }
1362
1376
 
1377
+ export function __wbindgen_object_drop_ref(arg0) {
1378
+ takeObject(arg0);
1379
+ };
1380
+
1381
+ export function __wbindgen_number_new(arg0) {
1382
+ const ret = arg0;
1383
+ return addHeapObject(ret);
1384
+ };
1385
+
1363
1386
  export function __wbindgen_string_get(arg0, arg1) {
1364
1387
  const obj = getObject(arg1);
1365
1388
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -1369,12 +1392,13 @@ export function __wbindgen_string_get(arg0, arg1) {
1369
1392
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
1370
1393
  };
1371
1394
 
1372
- export function __wbindgen_object_drop_ref(arg0) {
1373
- takeObject(arg0);
1395
+ export function __wbg_robot_new(arg0) {
1396
+ const ret = Robot.__wrap(arg0);
1397
+ return addHeapObject(ret);
1374
1398
  };
1375
1399
 
1376
- export function __wbindgen_number_new(arg0) {
1377
- const ret = arg0;
1400
+ export function __wbg_robotsubscription_new(arg0) {
1401
+ const ret = RobotSubscription.__wrap(arg0);
1378
1402
  return addHeapObject(ret);
1379
1403
  };
1380
1404
 
@@ -1383,29 +1407,22 @@ export function __wbindgen_string_new(arg0, arg1) {
1383
1407
  return addHeapObject(ret);
1384
1408
  };
1385
1409
 
1386
- export function __wbg_robotsubscription_new(arg0) {
1387
- const ret = RobotSubscription.__wrap(arg0);
1388
- return addHeapObject(ret);
1410
+ export function __wbindgen_as_number(arg0) {
1411
+ const ret = +getObject(arg0);
1412
+ return ret;
1389
1413
  };
1390
1414
 
1391
- export function __wbg_robot_new(arg0) {
1392
- const ret = Robot.__wrap(arg0);
1415
+ export function __wbindgen_object_clone_ref(arg0) {
1416
+ const ret = getObject(arg0);
1393
1417
  return addHeapObject(ret);
1394
1418
  };
1395
1419
 
1396
- export function __wbindgen_boolean_get(arg0) {
1397
- const v = getObject(arg0);
1398
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1420
+ export function __wbindgen_is_object(arg0) {
1421
+ const val = getObject(arg0);
1422
+ const ret = typeof(val) === 'object' && val !== null;
1399
1423
  return ret;
1400
1424
  };
1401
1425
 
1402
- export function __wbindgen_number_get(arg0, arg1) {
1403
- const obj = getObject(arg1);
1404
- const ret = typeof(obj) === 'number' ? obj : undefined;
1405
- getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
1406
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
1407
- };
1408
-
1409
1426
  export function __wbindgen_cb_drop(arg0) {
1410
1427
  const obj = takeObject(arg0).original;
1411
1428
  if (obj.cnt-- == 1) {
@@ -1421,34 +1438,31 @@ export function __wbindgen_error_new(arg0, arg1) {
1421
1438
  return addHeapObject(ret);
1422
1439
  };
1423
1440
 
1424
- export function __wbindgen_is_object(arg0) {
1425
- const val = getObject(arg0);
1426
- const ret = typeof(val) === 'object' && val !== null;
1427
- return ret;
1428
- };
1429
-
1430
- export function __wbindgen_as_number(arg0) {
1431
- const ret = +getObject(arg0);
1441
+ export function __wbindgen_boolean_get(arg0) {
1442
+ const v = getObject(arg0);
1443
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1432
1444
  return ret;
1433
1445
  };
1434
1446
 
1435
- export function __wbindgen_object_clone_ref(arg0) {
1436
- const ret = getObject(arg0);
1437
- return addHeapObject(ret);
1447
+ export function __wbindgen_number_get(arg0, arg1) {
1448
+ const obj = getObject(arg1);
1449
+ const ret = typeof(obj) === 'number' ? obj : undefined;
1450
+ getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
1451
+ getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
1438
1452
  };
1439
1453
 
1440
- export function __wbindgen_is_undefined(arg0) {
1441
- const ret = getObject(arg0) === undefined;
1454
+ export function __wbindgen_is_bigint(arg0) {
1455
+ const ret = typeof(getObject(arg0)) === 'bigint';
1442
1456
  return ret;
1443
1457
  };
1444
1458
 
1445
- export function __wbindgen_in(arg0, arg1) {
1446
- const ret = getObject(arg0) in getObject(arg1);
1447
- return ret;
1459
+ export function __wbindgen_bigint_from_u64(arg0) {
1460
+ const ret = BigInt.asUintN(64, arg0);
1461
+ return addHeapObject(ret);
1448
1462
  };
1449
1463
 
1450
- export function __wbindgen_is_bigint(arg0) {
1451
- const ret = typeof(getObject(arg0)) === 'bigint';
1464
+ export function __wbindgen_jsval_eq(arg0, arg1) {
1465
+ const ret = getObject(arg0) === getObject(arg1);
1452
1466
  return ret;
1453
1467
  };
1454
1468
 
@@ -1457,14 +1471,14 @@ export function __wbindgen_bigint_from_i64(arg0) {
1457
1471
  return addHeapObject(ret);
1458
1472
  };
1459
1473
 
1460
- export function __wbindgen_jsval_eq(arg0, arg1) {
1461
- const ret = getObject(arg0) === getObject(arg1);
1474
+ export function __wbindgen_in(arg0, arg1) {
1475
+ const ret = getObject(arg0) in getObject(arg1);
1462
1476
  return ret;
1463
1477
  };
1464
1478
 
1465
- export function __wbindgen_bigint_from_u64(arg0) {
1466
- const ret = BigInt.asUintN(64, arg0);
1467
- return addHeapObject(ret);
1479
+ export function __wbindgen_is_undefined(arg0) {
1480
+ const ret = getObject(arg0) === undefined;
1481
+ return ret;
1468
1482
  };
1469
1483
 
1470
1484
  export function __wbindgen_is_string(arg0) {
@@ -1572,12 +1586,12 @@ export function __wbindgen_jsval_loose_eq(arg0, arg1) {
1572
1586
  return ret;
1573
1587
  };
1574
1588
 
1575
- export function __wbg_getwithrefkey_4a92a5eca60879b9(arg0, arg1) {
1589
+ export function __wbg_getwithrefkey_edc2c8960f0f1191(arg0, arg1) {
1576
1590
  const ret = getObject(arg0)[getObject(arg1)];
1577
1591
  return addHeapObject(ret);
1578
1592
  };
1579
1593
 
1580
- export function __wbg_set_9182712abebf82ef(arg0, arg1, arg2) {
1594
+ export function __wbg_set_f975102236d3c502(arg0, arg1, arg2) {
1581
1595
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1582
1596
  };
1583
1597
 
@@ -1712,6 +1726,17 @@ export function __wbg_call_67f2111acd2dfdb6() { return handleError(function (arg
1712
1726
  return addHeapObject(ret);
1713
1727
  }, arguments) };
1714
1728
 
1729
+ export function __wbg_instanceof_Map_879295fe38a28640(arg0) {
1730
+ let result;
1731
+ try {
1732
+ result = getObject(arg0) instanceof Map;
1733
+ } catch (_) {
1734
+ result = false;
1735
+ }
1736
+ const ret = result;
1737
+ return ret;
1738
+ };
1739
+
1715
1740
  export function __wbg_isSafeInteger_a23a66ee7c41b273(arg0) {
1716
1741
  const ret = Number.isSafeInteger(getObject(arg0));
1717
1742
  return ret;
@@ -1729,7 +1754,7 @@ export function __wbg_new_70828a4353259d4b(arg0, arg1) {
1729
1754
  const a = state0.a;
1730
1755
  state0.a = 0;
1731
1756
  try {
1732
- return __wbg_adapter_254(a, state0.b, arg0, arg1);
1757
+ return __wbg_adapter_258(a, state0.b, arg0, arg1);
1733
1758
  } finally {
1734
1759
  state0.a = a;
1735
1760
  }
@@ -1810,33 +1835,33 @@ export function __wbindgen_memory() {
1810
1835
  return addHeapObject(ret);
1811
1836
  };
1812
1837
 
1813
- export function __wbindgen_closure_wrapper1800(arg0, arg1, arg2) {
1814
- const ret = makeMutClosure(arg0, arg1, 759, __wbg_adapter_50);
1838
+ export function __wbindgen_closure_wrapper1809(arg0, arg1, arg2) {
1839
+ const ret = makeMutClosure(arg0, arg1, 763, __wbg_adapter_50);
1815
1840
  return addHeapObject(ret);
1816
1841
  };
1817
1842
 
1818
- export function __wbindgen_closure_wrapper1802(arg0, arg1, arg2) {
1819
- const ret = makeMutClosure(arg0, arg1, 759, __wbg_adapter_53);
1843
+ export function __wbindgen_closure_wrapper1811(arg0, arg1, arg2) {
1844
+ const ret = makeMutClosure(arg0, arg1, 763, __wbg_adapter_50);
1820
1845
  return addHeapObject(ret);
1821
1846
  };
1822
1847
 
1823
- export function __wbindgen_closure_wrapper1804(arg0, arg1, arg2) {
1824
- const ret = makeMutClosure(arg0, arg1, 759, __wbg_adapter_50);
1848
+ export function __wbindgen_closure_wrapper1813(arg0, arg1, arg2) {
1849
+ const ret = makeMutClosure(arg0, arg1, 763, __wbg_adapter_55);
1825
1850
  return addHeapObject(ret);
1826
1851
  };
1827
1852
 
1828
- export function __wbindgen_closure_wrapper1806(arg0, arg1, arg2) {
1829
- const ret = makeMutClosure(arg0, arg1, 759, __wbg_adapter_50);
1853
+ export function __wbindgen_closure_wrapper1815(arg0, arg1, arg2) {
1854
+ const ret = makeMutClosure(arg0, arg1, 763, __wbg_adapter_50);
1830
1855
  return addHeapObject(ret);
1831
1856
  };
1832
1857
 
1833
- export function __wbindgen_closure_wrapper2468(arg0, arg1, arg2) {
1834
- const ret = makeMutClosure(arg0, arg1, 868, __wbg_adapter_60);
1858
+ export function __wbindgen_closure_wrapper2478(arg0, arg1, arg2) {
1859
+ const ret = makeMutClosure(arg0, arg1, 873, __wbg_adapter_60);
1835
1860
  return addHeapObject(ret);
1836
1861
  };
1837
1862
 
1838
- export function __wbindgen_closure_wrapper2508(arg0, arg1, arg2) {
1839
- const ret = makeMutClosure(arg0, arg1, 885, __wbg_adapter_63);
1863
+ export function __wbindgen_closure_wrapper2518(arg0, arg1, arg2) {
1864
+ const ret = makeMutClosure(arg0, arg1, 890, __wbg_adapter_63);
1840
1865
  return addHeapObject(ret);
1841
1866
  };
1842
1867
 
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.2.10",
7
+ "version": "0.2.13",
8
8
  "license": "SEE LICENSE IN LICENSE",
9
9
  "repository": {
10
10
  "type": "git",