lebai_sdk 0.1.13 → 0.1.15

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
@@ -271,6 +271,14 @@ export class Robot {
271
271
  */
272
272
  start_task(scene: string, params?: any, dir?: string, is_parallel?: boolean, loop_to?: number): Promise<number>;
273
273
  /**
274
+ * @returns {Promise<any>}
275
+ */
276
+ get_task_list(): Promise<any>;
277
+ /**
278
+ * @returns {Promise<number | undefined>}
279
+ */
280
+ get_main_task_id(): Promise<number | undefined>;
281
+ /**
274
282
  * @param {number | undefined} id
275
283
  * @returns {Promise<string>}
276
284
  */
@@ -281,6 +289,21 @@ export class Robot {
281
289
  */
282
290
  get_task_state(id?: number): Promise<string>;
283
291
  /**
292
+ * @param {number | undefined} id
293
+ * @returns {Promise<void>}
294
+ */
295
+ cancel_task(id?: number): Promise<void>;
296
+ /**
297
+ * @param {number | undefined} id
298
+ * @returns {Promise<void>}
299
+ */
300
+ pause_task(id?: number): Promise<void>;
301
+ /**
302
+ * @param {number | undefined} id
303
+ * @returns {Promise<void>}
304
+ */
305
+ resume_task(id?: number): Promise<void>;
306
+ /**
284
307
  * @param {string} device
285
308
  * @param {number} timeout
286
309
  * @returns {Promise<void>}
package/lebai_sdk_bg.js CHANGED
@@ -8,10 +8,19 @@ const heap = new Array(128).fill(undefined);
8
8
 
9
9
  heap.push(undefined, null, true, false);
10
10
 
11
- function getObject(idx) { return heap[idx]; }
12
-
13
11
  let heap_next = heap.length;
14
12
 
13
+ function addHeapObject(obj) {
14
+ if (heap_next === heap.length) heap.push(heap.length + 1);
15
+ const idx = heap_next;
16
+ heap_next = heap[idx];
17
+
18
+ heap[idx] = obj;
19
+ return idx;
20
+ }
21
+
22
+ function getObject(idx) { return heap[idx]; }
23
+
15
24
  function dropObject(idx) {
16
25
  if (idx < 132) return;
17
26
  heap[idx] = heap_next;
@@ -24,20 +33,7 @@ function takeObject(idx) {
24
33
  return ret;
25
34
  }
26
35
 
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
-
36
- const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
37
-
38
- let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
39
-
40
- cachedTextDecoder.decode();
36
+ let WASM_VECTOR_LEN = 0;
41
37
 
42
38
  let cachedUint8Memory0 = null;
43
39
 
@@ -48,13 +44,6 @@ function getUint8Memory0() {
48
44
  return cachedUint8Memory0;
49
45
  }
50
46
 
51
- function getStringFromWasm0(ptr, len) {
52
- ptr = ptr >>> 0;
53
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
54
- }
55
-
56
- let WASM_VECTOR_LEN = 0;
57
-
58
47
  const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
59
48
 
60
49
  let cachedTextEncoder = new lTextEncoder('utf-8');
@@ -123,6 +112,17 @@ function getInt32Memory0() {
123
112
  return cachedInt32Memory0;
124
113
  }
125
114
 
115
+ const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
116
+
117
+ let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
118
+
119
+ cachedTextDecoder.decode();
120
+
121
+ function getStringFromWasm0(ptr, len) {
122
+ ptr = ptr >>> 0;
123
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
124
+ }
125
+
126
126
  let cachedFloat64Memory0 = null;
127
127
 
128
128
  function getFloat64Memory0() {
@@ -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__h2839438a712b504b(arg0, arg1, addHeapObject(arg2));
234
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h13f7d1ed76369391(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__h680b6b8f369a3c31(arg0, arg1);
237
+ function __wbg_adapter_53(arg0, arg1) {
238
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h449ab864e507fca8(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__h51a85773cf9886da(arg0, arg1, addHeapObject(arg2));
242
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h61dcfe8467004f4a(arg0, arg1, addHeapObject(arg2));
243
243
  }
244
244
 
245
245
  function __wbg_adapter_61(arg0, arg1) {
246
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hd646f7b17c8e85b7(arg0, arg1);
246
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hf4a29d40d1827e55(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_229(arg0, arg1, arg2, arg3) {
326
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h39177fd04e0af7c0(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
325
+ function __wbg_adapter_234(arg0, arg1, arg2, arg3) {
326
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h174c72652431fca0(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
327
327
  }
328
328
 
329
329
  /**
@@ -738,6 +738,20 @@ export class Robot {
738
738
  return takeObject(ret);
739
739
  }
740
740
  /**
741
+ * @returns {Promise<any>}
742
+ */
743
+ get_task_list() {
744
+ const ret = wasm.robot_get_task_list(this.__wbg_ptr);
745
+ return takeObject(ret);
746
+ }
747
+ /**
748
+ * @returns {Promise<number | undefined>}
749
+ */
750
+ get_main_task_id() {
751
+ const ret = wasm.robot_get_main_task_id(this.__wbg_ptr);
752
+ return takeObject(ret);
753
+ }
754
+ /**
741
755
  * @param {number | undefined} id
742
756
  * @returns {Promise<string>}
743
757
  */
@@ -754,6 +768,30 @@ export class Robot {
754
768
  return takeObject(ret);
755
769
  }
756
770
  /**
771
+ * @param {number | undefined} id
772
+ * @returns {Promise<void>}
773
+ */
774
+ cancel_task(id) {
775
+ const ret = wasm.robot_cancel_task(this.__wbg_ptr, !isLikeNone(id), isLikeNone(id) ? 0 : id);
776
+ return takeObject(ret);
777
+ }
778
+ /**
779
+ * @param {number | undefined} id
780
+ * @returns {Promise<void>}
781
+ */
782
+ pause_task(id) {
783
+ const ret = wasm.robot_pause_task(this.__wbg_ptr, !isLikeNone(id), isLikeNone(id) ? 0 : id);
784
+ return takeObject(ret);
785
+ }
786
+ /**
787
+ * @param {number | undefined} id
788
+ * @returns {Promise<void>}
789
+ */
790
+ resume_task(id) {
791
+ const ret = wasm.robot_resume_task(this.__wbg_ptr, !isLikeNone(id), isLikeNone(id) ? 0 : id);
792
+ return takeObject(ret);
793
+ }
794
+ /**
757
795
  * @param {string} device
758
796
  * @param {number} timeout
759
797
  * @returns {Promise<void>}
@@ -1181,38 +1219,13 @@ export class RobotSubscription {
1181
1219
  }
1182
1220
  }
1183
1221
 
1184
- export function __wbindgen_object_drop_ref(arg0) {
1185
- takeObject(arg0);
1186
- };
1187
-
1188
- export function __wbindgen_cb_drop(arg0) {
1189
- const obj = takeObject(arg0).original;
1190
- if (obj.cnt-- == 1) {
1191
- obj.a = 0;
1192
- return true;
1193
- }
1194
- const ret = false;
1195
- return ret;
1196
- };
1197
-
1198
1222
  export function __wbindgen_number_new(arg0) {
1199
1223
  const ret = arg0;
1200
1224
  return addHeapObject(ret);
1201
1225
  };
1202
1226
 
1203
- export function __wbindgen_string_new(arg0, arg1) {
1204
- const ret = getStringFromWasm0(arg0, arg1);
1205
- return addHeapObject(ret);
1206
- };
1207
-
1208
- export function __wbg_robot_new(arg0) {
1209
- const ret = Robot.__wrap(arg0);
1210
- return addHeapObject(ret);
1211
- };
1212
-
1213
- export function __wbg_robotsubscription_new(arg0) {
1214
- const ret = RobotSubscription.__wrap(arg0);
1215
- return addHeapObject(ret);
1227
+ export function __wbindgen_object_drop_ref(arg0) {
1228
+ takeObject(arg0);
1216
1229
  };
1217
1230
 
1218
1231
  export function __wbindgen_string_get(arg0, arg1) {
@@ -1224,17 +1237,19 @@ export function __wbindgen_string_get(arg0, arg1) {
1224
1237
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
1225
1238
  };
1226
1239
 
1227
- export function __wbindgen_number_get(arg0, arg1) {
1228
- const obj = getObject(arg1);
1229
- const ret = typeof(obj) === 'number' ? obj : undefined;
1230
- getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
1231
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
1240
+ export function __wbg_robot_new(arg0) {
1241
+ const ret = Robot.__wrap(arg0);
1242
+ return addHeapObject(ret);
1232
1243
  };
1233
1244
 
1234
- export function __wbindgen_boolean_get(arg0) {
1235
- const v = getObject(arg0);
1236
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1237
- return ret;
1245
+ export function __wbindgen_string_new(arg0, arg1) {
1246
+ const ret = getStringFromWasm0(arg0, arg1);
1247
+ return addHeapObject(ret);
1248
+ };
1249
+
1250
+ export function __wbg_robotsubscription_new(arg0) {
1251
+ const ret = RobotSubscription.__wrap(arg0);
1252
+ return addHeapObject(ret);
1238
1253
  };
1239
1254
 
1240
1255
  export function __wbindgen_is_object(arg0) {
@@ -1243,11 +1258,34 @@ export function __wbindgen_is_object(arg0) {
1243
1258
  return ret;
1244
1259
  };
1245
1260
 
1261
+ export function __wbindgen_cb_drop(arg0) {
1262
+ const obj = takeObject(arg0).original;
1263
+ if (obj.cnt-- == 1) {
1264
+ obj.a = 0;
1265
+ return true;
1266
+ }
1267
+ const ret = false;
1268
+ return ret;
1269
+ };
1270
+
1246
1271
  export function __wbindgen_error_new(arg0, arg1) {
1247
1272
  const ret = new Error(getStringFromWasm0(arg0, arg1));
1248
1273
  return addHeapObject(ret);
1249
1274
  };
1250
1275
 
1276
+ export function __wbindgen_boolean_get(arg0) {
1277
+ const v = getObject(arg0);
1278
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1279
+ return ret;
1280
+ };
1281
+
1282
+ export function __wbindgen_number_get(arg0, arg1) {
1283
+ const obj = getObject(arg1);
1284
+ const ret = typeof(obj) === 'number' ? obj : undefined;
1285
+ getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
1286
+ getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
1287
+ };
1288
+
1251
1289
  export function __wbindgen_is_bigint(arg0) {
1252
1290
  const ret = typeof(getObject(arg0)) === 'bigint';
1253
1291
  return ret;
@@ -1263,16 +1301,16 @@ export function __wbindgen_jsval_eq(arg0, arg1) {
1263
1301
  return ret;
1264
1302
  };
1265
1303
 
1266
- export function __wbindgen_in(arg0, arg1) {
1267
- const ret = getObject(arg0) in getObject(arg1);
1268
- return ret;
1269
- };
1270
-
1271
1304
  export function __wbindgen_bigint_from_u64(arg0) {
1272
1305
  const ret = BigInt.asUintN(64, arg0);
1273
1306
  return addHeapObject(ret);
1274
1307
  };
1275
1308
 
1309
+ export function __wbindgen_in(arg0, arg1) {
1310
+ const ret = getObject(arg0) in getObject(arg1);
1311
+ return ret;
1312
+ };
1313
+
1276
1314
  export function __wbindgen_is_undefined(arg0) {
1277
1315
  const ret = getObject(arg0) === undefined;
1278
1316
  return ret;
@@ -1288,23 +1326,6 @@ export function __wbindgen_object_clone_ref(arg0) {
1288
1326
  return addHeapObject(ret);
1289
1327
  };
1290
1328
 
1291
- export function __wbg_addEventListener_5651108fc3ffeb6e() { return handleError(function (arg0, arg1, arg2, arg3) {
1292
- getObject(arg0).addEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3));
1293
- }, arguments) };
1294
-
1295
- export function __wbg_addEventListener_a5963e26cd7b176b() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1296
- getObject(arg0).addEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3), getObject(arg4));
1297
- }, arguments) };
1298
-
1299
- export function __wbg_dispatchEvent_a622a6455be582eb() { return handleError(function (arg0, arg1) {
1300
- const ret = getObject(arg0).dispatchEvent(getObject(arg1));
1301
- return ret;
1302
- }, arguments) };
1303
-
1304
- export function __wbg_removeEventListener_5de660c02ed784e4() { return handleError(function (arg0, arg1, arg2, arg3) {
1305
- getObject(arg0).removeEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3));
1306
- }, arguments) };
1307
-
1308
1329
  export function __wbg_wasClean_74cf0c4d617e8bf5(arg0) {
1309
1330
  const ret = getObject(arg0).wasClean;
1310
1331
  return ret;
@@ -1359,6 +1380,23 @@ export function __wbg_data_ab99ae4a2e1e8bc9(arg0) {
1359
1380
  return addHeapObject(ret);
1360
1381
  };
1361
1382
 
1383
+ export function __wbg_addEventListener_5651108fc3ffeb6e() { return handleError(function (arg0, arg1, arg2, arg3) {
1384
+ getObject(arg0).addEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3));
1385
+ }, arguments) };
1386
+
1387
+ export function __wbg_addEventListener_a5963e26cd7b176b() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1388
+ getObject(arg0).addEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3), getObject(arg4));
1389
+ }, arguments) };
1390
+
1391
+ export function __wbg_dispatchEvent_a622a6455be582eb() { return handleError(function (arg0, arg1) {
1392
+ const ret = getObject(arg0).dispatchEvent(getObject(arg1));
1393
+ return ret;
1394
+ }, arguments) };
1395
+
1396
+ export function __wbg_removeEventListener_5de660c02ed784e4() { return handleError(function (arg0, arg1, arg2, arg3) {
1397
+ getObject(arg0).removeEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3));
1398
+ }, arguments) };
1399
+
1362
1400
  export function __wbg_clearTimeout_76877dbc010e786d(arg0) {
1363
1401
  const ret = clearTimeout(takeObject(arg0));
1364
1402
  return addHeapObject(ret);
@@ -1511,7 +1549,7 @@ export function __wbg_new_43f1b47c28813cbd(arg0, arg1) {
1511
1549
  const a = state0.a;
1512
1550
  state0.a = 0;
1513
1551
  try {
1514
- return __wbg_adapter_229(a, state0.b, arg0, arg1);
1552
+ return __wbg_adapter_234(a, state0.b, arg0, arg1);
1515
1553
  } finally {
1516
1554
  state0.a = a;
1517
1555
  }
@@ -1592,33 +1630,33 @@ export function __wbindgen_memory() {
1592
1630
  return addHeapObject(ret);
1593
1631
  };
1594
1632
 
1595
- export function __wbindgen_closure_wrapper1714(arg0, arg1, arg2) {
1596
- const ret = makeMutClosure(arg0, arg1, 653, __wbg_adapter_48);
1633
+ export function __wbindgen_closure_wrapper1602(arg0, arg1, arg2) {
1634
+ const ret = makeMutClosure(arg0, arg1, 640, __wbg_adapter_48);
1597
1635
  return addHeapObject(ret);
1598
1636
  };
1599
1637
 
1600
- export function __wbindgen_closure_wrapper1716(arg0, arg1, arg2) {
1601
- const ret = makeMutClosure(arg0, arg1, 653, __wbg_adapter_48);
1638
+ export function __wbindgen_closure_wrapper1604(arg0, arg1, arg2) {
1639
+ const ret = makeMutClosure(arg0, arg1, 640, __wbg_adapter_48);
1602
1640
  return addHeapObject(ret);
1603
1641
  };
1604
1642
 
1605
- export function __wbindgen_closure_wrapper1718(arg0, arg1, arg2) {
1606
- const ret = makeMutClosure(arg0, arg1, 653, __wbg_adapter_48);
1643
+ export function __wbindgen_closure_wrapper1606(arg0, arg1, arg2) {
1644
+ const ret = makeMutClosure(arg0, arg1, 640, __wbg_adapter_53);
1607
1645
  return addHeapObject(ret);
1608
1646
  };
1609
1647
 
1610
- export function __wbindgen_closure_wrapper1720(arg0, arg1, arg2) {
1611
- const ret = makeMutClosure(arg0, arg1, 653, __wbg_adapter_55);
1648
+ export function __wbindgen_closure_wrapper1608(arg0, arg1, arg2) {
1649
+ const ret = makeMutClosure(arg0, arg1, 640, __wbg_adapter_48);
1612
1650
  return addHeapObject(ret);
1613
1651
  };
1614
1652
 
1615
- export function __wbindgen_closure_wrapper2185(arg0, arg1, arg2) {
1616
- const ret = makeMutClosure(arg0, arg1, 723, __wbg_adapter_58);
1653
+ export function __wbindgen_closure_wrapper2354(arg0, arg1, arg2) {
1654
+ const ret = makeMutClosure(arg0, arg1, 756, __wbg_adapter_58);
1617
1655
  return addHeapObject(ret);
1618
1656
  };
1619
1657
 
1620
- export function __wbindgen_closure_wrapper2225(arg0, arg1, arg2) {
1621
- const ret = makeMutClosure(arg0, arg1, 740, __wbg_adapter_61);
1658
+ export function __wbindgen_closure_wrapper2406(arg0, arg1, arg2) {
1659
+ const ret = makeMutClosure(arg0, arg1, 780, __wbg_adapter_61);
1622
1660
  return addHeapObject(ret);
1623
1661
  };
1624
1662
 
package/lebai_sdk_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lebai_sdk",
3
3
  "description": "lebai_sdk",
4
- "version": "0.1.13",
4
+ "version": "0.1.15",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
7
7
  "type": "git",