lebai_sdk 0.2.19 → 0.2.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
@@ -210,6 +210,19 @@ export class Robot {
210
210
  * @returns {Promise<void>}
211
211
  */
212
212
  end_teach_mode(): Promise<void>;
213
+ /**
214
+ * @param {any} device
215
+ * @param {number} pin
216
+ * @param {any} mode
217
+ * @returns {Promise<void>}
218
+ */
219
+ set_dio_mode(device: any, pin: number, mode: any): Promise<void>;
220
+ /**
221
+ * @param {any} device
222
+ * @param {number} pin
223
+ * @returns {Promise<any>}
224
+ */
225
+ get_dio_mode(device: any, pin: number): Promise<any>;
213
226
  /**
214
227
  * @param {any} device
215
228
  * @param {number} pin
package/lebai_sdk_bg.js CHANGED
@@ -4,7 +4,11 @@ export function __wbg_set_wasm(val) {
4
4
  }
5
5
 
6
6
 
7
- let WASM_VECTOR_LEN = 0;
7
+ const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
8
+
9
+ let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
10
+
11
+ cachedTextDecoder.decode();
8
12
 
9
13
  let cachedUint8ArrayMemory0 = null;
10
14
 
@@ -15,6 +19,13 @@ function getUint8ArrayMemory0() {
15
19
  return cachedUint8ArrayMemory0;
16
20
  }
17
21
 
22
+ function getStringFromWasm0(ptr, len) {
23
+ ptr = ptr >>> 0;
24
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
25
+ }
26
+
27
+ let WASM_VECTOR_LEN = 0;
28
+
18
29
  const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
19
30
 
20
31
  let cachedTextEncoder = new lTextEncoder('utf-8');
@@ -84,17 +95,6 @@ function getDataViewMemory0() {
84
95
  return cachedDataViewMemory0;
85
96
  }
86
97
 
87
- const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
88
-
89
- let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
90
-
91
- cachedTextDecoder.decode();
92
-
93
- function getStringFromWasm0(ptr, len) {
94
- ptr = ptr >>> 0;
95
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
96
- }
97
-
98
98
  function debugString(val) {
99
99
  // primitive types
100
100
  const type = typeof val;
@@ -191,7 +191,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
191
191
  return real;
192
192
  }
193
193
  function __wbg_adapter_52(arg0, arg1, arg2) {
194
- wasm.closure715_externref_shim(arg0, arg1, arg2);
194
+ wasm.closure732_externref_shim(arg0, arg1, arg2);
195
195
  }
196
196
 
197
197
  function __wbg_adapter_59(arg0, arg1) {
@@ -199,7 +199,7 @@ function __wbg_adapter_59(arg0, arg1) {
199
199
  }
200
200
 
201
201
  function __wbg_adapter_62(arg0, arg1, arg2) {
202
- wasm.closure797_externref_shim(arg0, arg1, arg2);
202
+ wasm.closure814_externref_shim(arg0, arg1, arg2);
203
203
  }
204
204
 
205
205
  function __wbg_adapter_65(arg0, arg1) {
@@ -310,8 +310,8 @@ function getArrayU8FromWasm0(ptr, len) {
310
310
  }
311
311
 
312
312
  function notDefined(what) { return () => { throw new Error(`${what} is not defined`); }; }
313
- function __wbg_adapter_268(arg0, arg1, arg2, arg3) {
314
- wasm.closure886_externref_shim(arg0, arg1, arg2, arg3);
313
+ function __wbg_adapter_270(arg0, arg1, arg2, arg3) {
314
+ wasm.closure903_externref_shim(arg0, arg1, arg2, arg3);
315
315
  }
316
316
 
317
317
  const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
@@ -639,6 +639,25 @@ export class Robot {
639
639
  const ret = wasm.robot_end_teach_mode(this.__wbg_ptr);
640
640
  return ret;
641
641
  }
642
+ /**
643
+ * @param {any} device
644
+ * @param {number} pin
645
+ * @param {any} mode
646
+ * @returns {Promise<void>}
647
+ */
648
+ set_dio_mode(device, pin, mode) {
649
+ const ret = wasm.robot_set_dio_mode(this.__wbg_ptr, device, pin, mode);
650
+ return ret;
651
+ }
652
+ /**
653
+ * @param {any} device
654
+ * @param {number} pin
655
+ * @returns {Promise<any>}
656
+ */
657
+ get_dio_mode(device, pin) {
658
+ const ret = wasm.robot_get_dio_mode(this.__wbg_ptr, device, pin);
659
+ return ret;
660
+ }
642
661
  /**
643
662
  * @param {any} device
644
663
  * @param {number} pin
@@ -1345,6 +1364,11 @@ export class RobotSubscription {
1345
1364
  }
1346
1365
  }
1347
1366
 
1367
+ export function __wbindgen_string_new(arg0, arg1) {
1368
+ const ret = getStringFromWasm0(arg0, arg1);
1369
+ return ret;
1370
+ };
1371
+
1348
1372
  export function __wbindgen_string_get(arg0, arg1) {
1349
1373
  const obj = arg1;
1350
1374
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -1364,13 +1388,13 @@ export function __wbg_robotsubscription_new(arg0) {
1364
1388
  return ret;
1365
1389
  };
1366
1390
 
1367
- export function __wbindgen_string_new(arg0, arg1) {
1368
- const ret = getStringFromWasm0(arg0, arg1);
1391
+ export function __wbg_robot_new(arg0) {
1392
+ const ret = Robot.__wrap(arg0);
1369
1393
  return ret;
1370
1394
  };
1371
1395
 
1372
- export function __wbg_robot_new(arg0) {
1373
- const ret = Robot.__wrap(arg0);
1396
+ export function __wbindgen_as_number(arg0) {
1397
+ const ret = +arg0;
1374
1398
  return ret;
1375
1399
  };
1376
1400
 
@@ -1379,6 +1403,12 @@ export function __wbindgen_error_new(arg0, arg1) {
1379
1403
  return ret;
1380
1404
  };
1381
1405
 
1406
+ export function __wbindgen_boolean_get(arg0) {
1407
+ const v = arg0;
1408
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1409
+ return ret;
1410
+ };
1411
+
1382
1412
  export function __wbindgen_number_get(arg0, arg1) {
1383
1413
  const obj = arg1;
1384
1414
  const ret = typeof(obj) === 'number' ? obj : undefined;
@@ -1386,12 +1416,6 @@ export function __wbindgen_number_get(arg0, arg1) {
1386
1416
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1387
1417
  };
1388
1418
 
1389
- export function __wbindgen_boolean_get(arg0) {
1390
- const v = arg0;
1391
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1392
- return ret;
1393
- };
1394
-
1395
1419
  export function __wbindgen_cb_drop(arg0) {
1396
1420
  const obj = arg0.original;
1397
1421
  if (obj.cnt-- == 1) {
@@ -1402,17 +1426,17 @@ export function __wbindgen_cb_drop(arg0) {
1402
1426
  return ret;
1403
1427
  };
1404
1428
 
1405
- export function __wbindgen_is_bigint(arg0) {
1406
- const ret = typeof(arg0) === 'bigint';
1407
- return ret;
1408
- };
1409
-
1410
1429
  export function __wbindgen_is_object(arg0) {
1411
1430
  const val = arg0;
1412
1431
  const ret = typeof(val) === 'object' && val !== null;
1413
1432
  return ret;
1414
1433
  };
1415
1434
 
1435
+ export function __wbindgen_is_bigint(arg0) {
1436
+ const ret = typeof(arg0) === 'bigint';
1437
+ return ret;
1438
+ };
1439
+
1416
1440
  export function __wbindgen_in(arg0, arg1) {
1417
1441
  const ret = arg0 in arg1;
1418
1442
  return ret;
@@ -1438,11 +1462,6 @@ export function __wbindgen_is_undefined(arg0) {
1438
1462
  return ret;
1439
1463
  };
1440
1464
 
1441
- export function __wbindgen_as_number(arg0) {
1442
- const ret = +arg0;
1443
- return ret;
1444
- };
1445
-
1446
1465
  export function __wbindgen_is_string(arg0) {
1447
1466
  const ret = typeof(arg0) === 'string';
1448
1467
  return ret;
@@ -1723,7 +1742,7 @@ export function __wbg_new_1073970097e5a420(arg0, arg1) {
1723
1742
  const a = state0.a;
1724
1743
  state0.a = 0;
1725
1744
  try {
1726
- return __wbg_adapter_268(a, state0.b, arg0, arg1);
1745
+ return __wbg_adapter_270(a, state0.b, arg0, arg1);
1727
1746
  } finally {
1728
1747
  state0.a = a;
1729
1748
  }
@@ -1799,33 +1818,33 @@ export function __wbindgen_memory() {
1799
1818
  return ret;
1800
1819
  };
1801
1820
 
1802
- export function __wbindgen_closure_wrapper1831(arg0, arg1, arg2) {
1803
- const ret = makeMutClosure(arg0, arg1, 716, __wbg_adapter_52);
1821
+ export function __wbindgen_closure_wrapper1877(arg0, arg1, arg2) {
1822
+ const ret = makeMutClosure(arg0, arg1, 733, __wbg_adapter_52);
1804
1823
  return ret;
1805
1824
  };
1806
1825
 
1807
- export function __wbindgen_closure_wrapper1833(arg0, arg1, arg2) {
1808
- const ret = makeMutClosure(arg0, arg1, 716, __wbg_adapter_52);
1826
+ export function __wbindgen_closure_wrapper1879(arg0, arg1, arg2) {
1827
+ const ret = makeMutClosure(arg0, arg1, 733, __wbg_adapter_52);
1809
1828
  return ret;
1810
1829
  };
1811
1830
 
1812
- export function __wbindgen_closure_wrapper1835(arg0, arg1, arg2) {
1813
- const ret = makeMutClosure(arg0, arg1, 716, __wbg_adapter_52);
1831
+ export function __wbindgen_closure_wrapper1881(arg0, arg1, arg2) {
1832
+ const ret = makeMutClosure(arg0, arg1, 733, __wbg_adapter_52);
1814
1833
  return ret;
1815
1834
  };
1816
1835
 
1817
- export function __wbindgen_closure_wrapper1837(arg0, arg1, arg2) {
1818
- const ret = makeMutClosure(arg0, arg1, 716, __wbg_adapter_59);
1836
+ export function __wbindgen_closure_wrapper1883(arg0, arg1, arg2) {
1837
+ const ret = makeMutClosure(arg0, arg1, 733, __wbg_adapter_59);
1819
1838
  return ret;
1820
1839
  };
1821
1840
 
1822
- export function __wbindgen_closure_wrapper2497(arg0, arg1, arg2) {
1823
- const ret = makeMutClosure(arg0, arg1, 798, __wbg_adapter_62);
1841
+ export function __wbindgen_closure_wrapper2545(arg0, arg1, arg2) {
1842
+ const ret = makeMutClosure(arg0, arg1, 815, __wbg_adapter_62);
1824
1843
  return ret;
1825
1844
  };
1826
1845
 
1827
- export function __wbindgen_closure_wrapper2528(arg0, arg1, arg2) {
1828
- const ret = makeMutClosure(arg0, arg1, 814, __wbg_adapter_65);
1846
+ export function __wbindgen_closure_wrapper2576(arg0, arg1, arg2) {
1847
+ const ret = makeMutClosure(arg0, arg1, 831, __wbg_adapter_65);
1829
1848
  return ret;
1830
1849
  };
1831
1850
 
package/lebai_sdk_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "rise0chen<rise0chen@163.com>"
6
6
  ],
7
7
  "description": "lebai_sdk",
8
- "version": "0.2.19",
8
+ "version": "0.2.21",
9
9
  "license": "SEE LICENSE IN LICENSE",
10
10
  "repository": {
11
11
  "type": "git",