@unyt/datex 0.0.4 → 0.0.5

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.
Files changed (97) hide show
  1. package/esm/_dnt.shims.d.ts +1 -2
  2. package/esm/_dnt.shims.d.ts.map +1 -1
  3. package/esm/datex-core/datex_core_js.d.ts.map +1 -0
  4. package/esm/{src/datex-core → datex-core}/datex_core_js.internal.d.ts +82 -128
  5. package/esm/datex-core/datex_core_js.internal.d.ts.map +1 -0
  6. package/esm/{src/datex-core → datex-core}/datex_core_js.internal.js +227 -352
  7. package/esm/{src/datex-core → datex-core}/datex_core_js.js +2 -2
  8. package/esm/datex-core/datex_core_js.wasm +0 -0
  9. package/esm/datex-core.d.ts.map +1 -0
  10. package/esm/deno.json +3 -3
  11. package/esm/{src/mod.d.ts → mod.d.ts} +2 -2
  12. package/esm/mod.d.ts.map +1 -0
  13. package/esm/mod.js +29 -0
  14. package/esm/network/com-hub.d.ts +21 -0
  15. package/esm/network/com-hub.d.ts.map +1 -0
  16. package/esm/network/com-hub.js +74 -0
  17. package/esm/network/com-interface.d.ts +17 -0
  18. package/esm/network/com-interface.d.ts.map +1 -0
  19. package/esm/network/com-interface.js +62 -0
  20. package/esm/runtime/runtime.d.ts +38 -0
  21. package/esm/runtime/runtime.d.ts.map +1 -0
  22. package/esm/{src/runtime → runtime}/runtime.js +21 -6
  23. package/package.json +5 -9
  24. package/esm/_dnt.test_polyfills.d.ts.map +0 -1
  25. package/esm/_dnt.test_shims.d.ts.map +0 -1
  26. package/esm/deps/jsr.io/@std/assert/1.0.13/almost_equals.d.ts.map +0 -1
  27. package/esm/deps/jsr.io/@std/assert/1.0.13/array_includes.d.ts.map +0 -1
  28. package/esm/deps/jsr.io/@std/assert/1.0.13/assert.d.ts.map +0 -1
  29. package/esm/deps/jsr.io/@std/assert/1.0.13/assertion_error.d.ts.map +0 -1
  30. package/esm/deps/jsr.io/@std/assert/1.0.13/equal.d.ts.map +0 -1
  31. package/esm/deps/jsr.io/@std/assert/1.0.13/equals.d.ts.map +0 -1
  32. package/esm/deps/jsr.io/@std/assert/1.0.13/exists.d.ts.map +0 -1
  33. package/esm/deps/jsr.io/@std/assert/1.0.13/fail.d.ts.map +0 -1
  34. package/esm/deps/jsr.io/@std/assert/1.0.13/false.d.ts.map +0 -1
  35. package/esm/deps/jsr.io/@std/assert/1.0.13/greater.d.ts.map +0 -1
  36. package/esm/deps/jsr.io/@std/assert/1.0.13/greater_or_equal.d.ts.map +0 -1
  37. package/esm/deps/jsr.io/@std/assert/1.0.13/instance_of.d.ts.map +0 -1
  38. package/esm/deps/jsr.io/@std/assert/1.0.13/is_error.d.ts.map +0 -1
  39. package/esm/deps/jsr.io/@std/assert/1.0.13/less.d.ts.map +0 -1
  40. package/esm/deps/jsr.io/@std/assert/1.0.13/less_or_equal.d.ts.map +0 -1
  41. package/esm/deps/jsr.io/@std/assert/1.0.13/match.d.ts.map +0 -1
  42. package/esm/deps/jsr.io/@std/assert/1.0.13/mod.d.ts.map +0 -1
  43. package/esm/deps/jsr.io/@std/assert/1.0.13/not_equals.d.ts.map +0 -1
  44. package/esm/deps/jsr.io/@std/assert/1.0.13/not_instance_of.d.ts.map +0 -1
  45. package/esm/deps/jsr.io/@std/assert/1.0.13/not_match.d.ts.map +0 -1
  46. package/esm/deps/jsr.io/@std/assert/1.0.13/not_strict_equals.d.ts.map +0 -1
  47. package/esm/deps/jsr.io/@std/assert/1.0.13/object_match.d.ts.map +0 -1
  48. package/esm/deps/jsr.io/@std/assert/1.0.13/rejects.d.ts.map +0 -1
  49. package/esm/deps/jsr.io/@std/assert/1.0.13/strict_equals.d.ts.map +0 -1
  50. package/esm/deps/jsr.io/@std/assert/1.0.13/string_includes.d.ts.map +0 -1
  51. package/esm/deps/jsr.io/@std/assert/1.0.13/throws.d.ts.map +0 -1
  52. package/esm/deps/jsr.io/@std/assert/1.0.13/unimplemented.d.ts.map +0 -1
  53. package/esm/deps/jsr.io/@std/assert/1.0.13/unreachable.d.ts.map +0 -1
  54. package/esm/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts.map +0 -1
  55. package/esm/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts.map +0 -1
  56. package/esm/deps/jsr.io/@std/crypto/1.0.5/_wasm/lib/deno_std_wasm_crypto.d.ts +0 -2
  57. package/esm/deps/jsr.io/@std/crypto/1.0.5/_wasm/lib/deno_std_wasm_crypto.d.ts.map +0 -1
  58. package/esm/deps/jsr.io/@std/crypto/1.0.5/_wasm/lib/deno_std_wasm_crypto.internal.d.ts +0 -69
  59. package/esm/deps/jsr.io/@std/crypto/1.0.5/_wasm/lib/deno_std_wasm_crypto.internal.d.ts.map +0 -1
  60. package/esm/deps/jsr.io/@std/crypto/1.0.5/_wasm/mod.d.ts.map +0 -1
  61. package/esm/deps/jsr.io/@std/crypto/1.0.5/crypto.d.ts.map +0 -1
  62. package/esm/deps/jsr.io/@std/internal/1.0.9/build_message.d.ts.map +0 -1
  63. package/esm/deps/jsr.io/@std/internal/1.0.9/diff.d.ts.map +0 -1
  64. package/esm/deps/jsr.io/@std/internal/1.0.9/diff_str.d.ts.map +0 -1
  65. package/esm/deps/jsr.io/@std/internal/1.0.9/format.d.ts.map +0 -1
  66. package/esm/deps/jsr.io/@std/internal/1.0.9/styles.d.ts.map +0 -1
  67. package/esm/deps/jsr.io/@std/internal/1.0.9/types.d.ts.map +0 -1
  68. package/esm/deps/jsr.io/@std/uuid/1.0.9/_common.d.ts.map +0 -1
  69. package/esm/deps/jsr.io/@std/uuid/1.0.9/common.d.ts.map +0 -1
  70. package/esm/deps/jsr.io/@std/uuid/1.0.9/constants.d.ts.map +0 -1
  71. package/esm/deps/jsr.io/@std/uuid/1.0.9/mod.d.ts.map +0 -1
  72. package/esm/deps/jsr.io/@std/uuid/1.0.9/v1.d.ts.map +0 -1
  73. package/esm/deps/jsr.io/@std/uuid/1.0.9/v3.d.ts.map +0 -1
  74. package/esm/deps/jsr.io/@std/uuid/1.0.9/v4.d.ts.map +0 -1
  75. package/esm/deps/jsr.io/@std/uuid/1.0.9/v5.d.ts.map +0 -1
  76. package/esm/rs-lib/datex-core/Cargo.toml +0 -169
  77. package/esm/src/datex-core/datex_core_js.d.ts.map +0 -1
  78. package/esm/src/datex-core/datex_core_js.internal.d.ts.map +0 -1
  79. package/esm/src/datex-core/datex_core_js.wasm +0 -0
  80. package/esm/src/datex-core.d.ts.map +0 -1
  81. package/esm/src/mod.d.ts.map +0 -1
  82. package/esm/src/mod.js +0 -11
  83. package/esm/src/runtime/runtime.d.ts +0 -25
  84. package/esm/src/runtime/runtime.d.ts.map +0 -1
  85. package/esm/test/compiler/execute.test.d.ts.map +0 -1
  86. package/esm/test/crypto.test.d.ts.map +0 -1
  87. package/esm/test/init.test.d.ts.map +0 -1
  88. package/esm/test/is-node.d.ts.map +0 -1
  89. package/esm/test/network/BaseInterface.test.d.ts.map +0 -1
  90. package/esm/test/network/ComHub.test.d.ts.map +0 -1
  91. package/esm/test/network/WebsocketClientInterface.test.d.ts.map +0 -1
  92. package/esm/test/network/WebsocketMockupServer.d.ts.map +0 -1
  93. package/esm/test/network/WebsocketServerInterface.test.d.ts.map +0 -1
  94. package/esm/test/utils.d.ts.map +0 -1
  95. /package/esm/{src/datex-core → datex-core}/datex_core_js.d.ts +0 -0
  96. /package/esm/{src/datex-core.d.ts → datex-core.d.ts} +0 -0
  97. /package/esm/{src/datex-core.js → datex-core.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  // @generated file from wasmbuild -- do not edit
2
- import * as dntShim from "../../_dnt.shims.js";
2
+ import * as dntShim from "../_dnt.shims.js";
3
3
  // @ts-nocheck: generated
4
4
  // deno-lint-ignore-file
5
5
  // deno-fmt-ignore-file
@@ -226,6 +226,11 @@ function getArrayJsValueFromWasm0(ptr, len) {
226
226
  wasm.__externref_drop_slice(ptr, len);
227
227
  return result;
228
228
  }
229
+ function _assertClass(instance, klass) {
230
+ if (!(instance instanceof klass)) {
231
+ throw new Error(`expected instance of ${klass.name}`);
232
+ }
233
+ }
229
234
  function passArrayJsValueToWasm0(array, malloc) {
230
235
  const ptr = malloc(array.length * 4, 4) >>> 0;
231
236
  for (let i = 0; i < array.length; i++) {
@@ -236,14 +241,14 @@ function passArrayJsValueToWasm0(array, malloc) {
236
241
  return ptr;
237
242
  }
238
243
  /**
239
- * @param {string} endpoint
244
+ * @param {string} config
240
245
  * @param {any} debug_flags
241
246
  * @returns {JSRuntime}
242
247
  */
243
- export function init_runtime(endpoint, debug_flags) {
244
- const ptr0 = passStringToWasm0(endpoint, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
248
+ export function create_runtime(config, debug_flags) {
249
+ const ptr0 = passStringToWasm0(config, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
245
250
  const len0 = WASM_VECTOR_LEN;
246
- const ret = wasm.init_runtime(ptr0, len0, debug_flags);
251
+ const ret = wasm.create_runtime(ptr0, len0, debug_flags);
247
252
  return JSRuntime.__wrap(ret);
248
253
  }
249
254
  /**
@@ -287,28 +292,17 @@ export function execute_internal(datex_script) {
287
292
  const ret = wasm.execute_internal(ptr0, len0);
288
293
  return ret !== 0;
289
294
  }
290
- function _assertClass(instance, klass) {
291
- if (!(instance instanceof klass)) {
292
- throw new Error(`expected instance of ${klass.name}`);
293
- }
294
- }
295
- function __wbg_adapter_52(arg0, arg1, arg2) {
296
- wasm.closure490_externref_shim(arg0, arg1, arg2);
297
- }
298
- function __wbg_adapter_57(arg0, arg1) {
299
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hab851cbeb73a172f(arg0, arg1);
295
+ function __wbg_adapter_40(arg0, arg1, arg2) {
296
+ wasm.closure403_externref_shim(arg0, arg1, arg2);
300
297
  }
301
- function __wbg_adapter_60(arg0, arg1, arg2) {
302
- wasm.closure887_externref_shim(arg0, arg1, arg2);
298
+ function __wbg_adapter_49(arg0, arg1, arg2) {
299
+ wasm.closure1033_externref_shim(arg0, arg1, arg2);
303
300
  }
304
- function __wbg_adapter_63(arg0, arg1, arg2) {
305
- wasm.closure891_externref_shim(arg0, arg1, arg2);
301
+ function __wbg_adapter_52(arg0, arg1) {
302
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hc8a7d0aeea5060d1(arg0, arg1);
306
303
  }
307
- function __wbg_adapter_66(arg0, arg1, arg2) {
308
- wasm.closure895_externref_shim(arg0, arg1, arg2);
309
- }
310
- function __wbg_adapter_310(arg0, arg1, arg2, arg3) {
311
- wasm.closure1796_externref_shim(arg0, arg1, arg2, arg3);
304
+ function __wbg_adapter_278(arg0, arg1, arg2, arg3) {
305
+ wasm.closure1979_externref_shim(arg0, arg1, arg2, arg3);
312
306
  }
313
307
  const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
314
308
  const __wbindgen_enum_RtcIceConnectionState = [
@@ -343,110 +337,6 @@ export class BaseJSInterface {
343
337
  const ptr = this.__destroy_into_raw();
344
338
  wasm.__wbg_basejsinterface_free(ptr, 0);
345
339
  }
346
- /**
347
- * @param {JSComHub} com_hub
348
- * @param {InterfaceProperties | string} name_or_properties
349
- */
350
- constructor(com_hub, name_or_properties) {
351
- _assertClass(com_hub, JSComHub);
352
- var ptr0 = com_hub.__destroy_into_raw();
353
- const ret = wasm.basejsinterface_new(ptr0, name_or_properties);
354
- this.__wbg_ptr = ret >>> 0;
355
- BaseJSInterfaceFinalization.register(this, this.__wbg_ptr, this);
356
- return this;
357
- }
358
- /**
359
- * @returns {InterfaceProperties}
360
- */
361
- get properties() {
362
- const ret = wasm.basejsinterface_properties(this.__wbg_ptr);
363
- return ret;
364
- }
365
- /**
366
- * @returns {string}
367
- */
368
- get uuid() {
369
- let deferred1_0;
370
- let deferred1_1;
371
- try {
372
- const ret = wasm.basejsinterface_uuid(this.__wbg_ptr);
373
- deferred1_0 = ret[0];
374
- deferred1_1 = ret[1];
375
- return getStringFromWasm0(ret[0], ret[1]);
376
- }
377
- finally {
378
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
379
- }
380
- }
381
- /**
382
- * @param {string} socket_uuid
383
- * @param {Uint8Array} data
384
- * @returns {Promise<boolean>}
385
- */
386
- test_send_block(socket_uuid, data) {
387
- const ptr0 = passStringToWasm0(socket_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
388
- const len0 = WASM_VECTOR_LEN;
389
- const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
390
- const len1 = WASM_VECTOR_LEN;
391
- const ret = wasm.basejsinterface_test_send_block(this.__wbg_ptr, ptr0, len0, ptr1, len1);
392
- return ret;
393
- }
394
- /**
395
- * @param {Function} func
396
- */
397
- on_send(func) {
398
- wasm.basejsinterface_on_send(this.__wbg_ptr, func);
399
- }
400
- /**
401
- * @param {string} direction
402
- * @returns {string}
403
- */
404
- register_socket(direction) {
405
- let deferred3_0;
406
- let deferred3_1;
407
- try {
408
- const ptr0 = passStringToWasm0(direction, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
409
- const len0 = WASM_VECTOR_LEN;
410
- const ret = wasm.basejsinterface_register_socket(this.__wbg_ptr, ptr0, len0);
411
- var ptr2 = ret[0];
412
- var len2 = ret[1];
413
- if (ret[3]) {
414
- ptr2 = 0;
415
- len2 = 0;
416
- throw takeFromExternrefTable0(ret[2]);
417
- }
418
- deferred3_0 = ptr2;
419
- deferred3_1 = len2;
420
- return getStringFromWasm0(ptr2, len2);
421
- }
422
- finally {
423
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
424
- }
425
- }
426
- /**
427
- * @param {string} socket_uuid
428
- */
429
- destroy_socket(socket_uuid) {
430
- const ptr0 = passStringToWasm0(socket_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
431
- const len0 = WASM_VECTOR_LEN;
432
- const ret = wasm.basejsinterface_destroy_socket(this.__wbg_ptr, ptr0, len0);
433
- if (ret[1]) {
434
- throw takeFromExternrefTable0(ret[0]);
435
- }
436
- }
437
- /**
438
- * @param {string} socket_uuid
439
- * @param {Uint8Array} data
440
- * @returns {Promise<void>}
441
- */
442
- receive(socket_uuid, data) {
443
- const ptr0 = passStringToWasm0(socket_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
444
- const len0 = WASM_VECTOR_LEN;
445
- const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
446
- const len1 = WASM_VECTOR_LEN;
447
- const ret = wasm.basejsinterface_receive(this.__wbg_ptr, ptr0, len0, ptr1, len1);
448
- return ret;
449
- }
450
340
  }
451
341
  const JSComHubFinalization = (typeof FinalizationRegistry === "undefined")
452
342
  ? { register: () => { }, unregister: () => { } }
@@ -469,24 +359,30 @@ export class JSComHub {
469
359
  const ptr = this.__destroy_into_raw();
470
360
  wasm.__wbg_jscomhub_free(ptr, 0);
471
361
  }
362
+ register_default_interface_factories() {
363
+ wasm.jscomhub_register_default_interface_factories(this.__wbg_ptr);
364
+ }
472
365
  /**
473
- * @param {string} interface_uuid
366
+ * @param {string} interface_type
367
+ * @param {string} properties
474
368
  * @returns {Promise<any>}
475
369
  */
476
- close_interface(interface_uuid) {
477
- const ptr0 = passStringToWasm0(interface_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
370
+ create_interface(interface_type, properties) {
371
+ const ptr0 = passStringToWasm0(interface_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
478
372
  const len0 = WASM_VECTOR_LEN;
479
- const ret = wasm.jscomhub_close_interface(this.__wbg_ptr, ptr0, len0);
373
+ const ptr1 = passStringToWasm0(properties, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
374
+ const len1 = WASM_VECTOR_LEN;
375
+ const ret = wasm.jscomhub_create_interface(this.__wbg_ptr, ptr0, len0, ptr1, len1);
480
376
  return ret;
481
377
  }
482
- start_update_loop() {
483
- wasm.jscomhub_start_update_loop(this.__wbg_ptr);
484
- }
485
378
  /**
486
- * @returns {Promise<void>}
379
+ * @param {string} interface_uuid
380
+ * @returns {Promise<any>}
487
381
  */
488
- stop_update_loop() {
489
- const ret = wasm.jscomhub_stop_update_loop(this.__wbg_ptr);
382
+ close_interface(interface_uuid) {
383
+ const ptr0 = passStringToWasm0(interface_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
384
+ const len0 = WASM_VECTOR_LEN;
385
+ const ret = wasm.jscomhub_close_interface(this.__wbg_ptr, ptr0, len0);
490
386
  return ret;
491
387
  }
492
388
  /**
@@ -496,34 +392,6 @@ export class JSComHub {
496
392
  const ret = wasm.jscomhub_update(this.__wbg_ptr);
497
393
  return ret;
498
394
  }
499
- /**
500
- * @returns {WebSocketServerRegistry}
501
- */
502
- get websocket_server() {
503
- const ret = wasm.jscomhub_serial(this.__wbg_ptr);
504
- return WebSocketServerRegistry.__wrap(ret);
505
- }
506
- /**
507
- * @returns {WebSocketClientRegistry}
508
- */
509
- get websocket_client() {
510
- const ret = wasm.jscomhub_serial(this.__wbg_ptr);
511
- return WebSocketClientRegistry.__wrap(ret);
512
- }
513
- /**
514
- * @returns {SerialRegistry}
515
- */
516
- get serial() {
517
- const ret = wasm.jscomhub_serial(this.__wbg_ptr);
518
- return SerialRegistry.__wrap(ret);
519
- }
520
- /**
521
- * @returns {WebRTCRegistry}
522
- */
523
- get webrtc() {
524
- const ret = wasm.jscomhub_serial(this.__wbg_ptr);
525
- return WebRTCRegistry.__wrap(ret);
526
- }
527
395
  /**
528
396
  * Send a block to the given interface and socket
529
397
  * This does not involve the routing on the ComHub level.
@@ -553,6 +421,121 @@ export class JSComHub {
553
421
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
554
422
  return v1;
555
423
  }
424
+ /**
425
+ * @param {string} uuid
426
+ * @param {string} direction
427
+ * @returns {string}
428
+ */
429
+ base_interface_register_socket(uuid, direction) {
430
+ let deferred4_0;
431
+ let deferred4_1;
432
+ try {
433
+ const ptr0 = passStringToWasm0(uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
434
+ const len0 = WASM_VECTOR_LEN;
435
+ const ptr1 = passStringToWasm0(direction, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
436
+ const len1 = WASM_VECTOR_LEN;
437
+ const ret = wasm.jscomhub_base_interface_register_socket(this.__wbg_ptr, ptr0, len0, ptr1, len1);
438
+ var ptr3 = ret[0];
439
+ var len3 = ret[1];
440
+ if (ret[3]) {
441
+ ptr3 = 0;
442
+ len3 = 0;
443
+ throw takeFromExternrefTable0(ret[2]);
444
+ }
445
+ deferred4_0 = ptr3;
446
+ deferred4_1 = len3;
447
+ return getStringFromWasm0(ptr3, len3);
448
+ }
449
+ finally {
450
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
451
+ }
452
+ }
453
+ /**
454
+ * @param {string} uuid
455
+ * @param {string} socket_uuid
456
+ * @param {Uint8Array} data
457
+ */
458
+ base_interface_receive(uuid, socket_uuid, data) {
459
+ const ptr0 = passStringToWasm0(uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
460
+ const len0 = WASM_VECTOR_LEN;
461
+ const ptr1 = passStringToWasm0(socket_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
462
+ const len1 = WASM_VECTOR_LEN;
463
+ const ptr2 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
464
+ const len2 = WASM_VECTOR_LEN;
465
+ const ret = wasm.jscomhub_base_interface_receive(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
466
+ if (ret[1]) {
467
+ throw takeFromExternrefTable0(ret[0]);
468
+ }
469
+ }
470
+ /**
471
+ * @param {string} uuid
472
+ * @param {string} socket_uuid
473
+ */
474
+ base_interface_destroy_socket(uuid, socket_uuid) {
475
+ const ptr0 = passStringToWasm0(uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
476
+ const len0 = WASM_VECTOR_LEN;
477
+ const ptr1 = passStringToWasm0(socket_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
478
+ const len1 = WASM_VECTOR_LEN;
479
+ const ret = wasm.jscomhub_base_interface_destroy_socket(this.__wbg_ptr, ptr0, len0, ptr1, len1);
480
+ if (ret[1]) {
481
+ throw takeFromExternrefTable0(ret[0]);
482
+ }
483
+ }
484
+ /**
485
+ * @param {string} uuid
486
+ * @param {Function} func
487
+ */
488
+ base_interface_on_send(uuid, func) {
489
+ const ptr0 = passStringToWasm0(uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
490
+ const len0 = WASM_VECTOR_LEN;
491
+ const ret = wasm.jscomhub_base_interface_on_send(this.__wbg_ptr, ptr0, len0, func);
492
+ if (ret[1]) {
493
+ throw takeFromExternrefTable0(ret[0]);
494
+ }
495
+ }
496
+ /**
497
+ * @param {string} uuid
498
+ * @param {string} socket_uuid
499
+ * @param {Uint8Array} data
500
+ * @returns {Promise<boolean>}
501
+ */
502
+ base_interface_test_send_block(uuid, socket_uuid, data) {
503
+ const ptr0 = passStringToWasm0(uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
504
+ const len0 = WASM_VECTOR_LEN;
505
+ const ptr1 = passStringToWasm0(socket_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
506
+ const len1 = WASM_VECTOR_LEN;
507
+ const ptr2 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
508
+ const len2 = WASM_VECTOR_LEN;
509
+ const ret = wasm.jscomhub_base_interface_test_send_block(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
510
+ return ret;
511
+ }
512
+ /**
513
+ * @param {string} interface_uuid
514
+ * @param {WebSocket} websocket
515
+ * @returns {string}
516
+ */
517
+ websocket_server_interface_add_socket(interface_uuid, websocket) {
518
+ let deferred3_0;
519
+ let deferred3_1;
520
+ try {
521
+ const ptr0 = passStringToWasm0(interface_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
522
+ const len0 = WASM_VECTOR_LEN;
523
+ const ret = wasm.jscomhub_websocket_server_interface_add_socket(this.__wbg_ptr, ptr0, len0, websocket);
524
+ var ptr2 = ret[0];
525
+ var len2 = ret[1];
526
+ if (ret[3]) {
527
+ ptr2 = 0;
528
+ len2 = 0;
529
+ throw takeFromExternrefTable0(ret[2]);
530
+ }
531
+ deferred3_0 = ptr2;
532
+ deferred3_1 = len2;
533
+ return getStringFromWasm0(ptr2, len2);
534
+ }
535
+ finally {
536
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
537
+ }
538
+ }
556
539
  }
557
540
  const JSMemoryFinalization = (typeof FinalizationRegistry === "undefined")
558
541
  ? { register: () => { }, unregister: () => { } }
@@ -636,6 +619,36 @@ export class JSRuntime {
636
619
  const ptr = this.__destroy_into_raw();
637
620
  wasm.__wbg_jsruntime_free(ptr, 0);
638
621
  }
622
+ /**
623
+ * @returns {JSComHub}
624
+ */
625
+ get com_hub() {
626
+ const ret = wasm.__wbg_get_jsruntime_com_hub(this.__wbg_ptr);
627
+ return JSComHub.__wrap(ret);
628
+ }
629
+ /**
630
+ * @param {JSComHub} arg0
631
+ */
632
+ set com_hub(arg0) {
633
+ _assertClass(arg0, JSComHub);
634
+ var ptr0 = arg0.__destroy_into_raw();
635
+ wasm.__wbg_set_jsruntime_com_hub(this.__wbg_ptr, ptr0);
636
+ }
637
+ /**
638
+ * @returns {JSMemory}
639
+ */
640
+ get memory() {
641
+ const ret = wasm.__wbg_get_jsruntime_memory(this.__wbg_ptr);
642
+ return JSMemory.__wrap(ret);
643
+ }
644
+ /**
645
+ * @param {JSMemory} arg0
646
+ */
647
+ set memory(arg0) {
648
+ _assertClass(arg0, JSMemory);
649
+ var ptr0 = arg0.__destroy_into_raw();
650
+ wasm.__wbg_set_jsruntime_memory(this.__wbg_ptr, ptr0);
651
+ }
639
652
  /**
640
653
  * @returns {Promise<Promise<any>>}
641
654
  */
@@ -659,13 +672,6 @@ export class JSRuntime {
659
672
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
660
673
  }
661
674
  }
662
- /**
663
- * @returns {JSMemory}
664
- */
665
- get memory() {
666
- const ret = wasm.jsruntime_memory(this.__wbg_ptr);
667
- return JSMemory.__wrap(ret);
668
- }
669
675
  /**
670
676
  * @returns {string}
671
677
  */
@@ -682,13 +688,6 @@ export class JSRuntime {
682
688
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
683
689
  }
684
690
  }
685
- /**
686
- * @returns {JSComHub}
687
- */
688
- get com_hub() {
689
- const ret = wasm.jsruntime_com_hub(this.__wbg_ptr);
690
- return JSComHub.__wrap(ret);
691
- }
692
691
  /**
693
692
  * @param {Uint8Array | null | undefined} body
694
693
  * @param {string[]} receivers
@@ -706,58 +705,56 @@ export class JSRuntime {
706
705
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
707
706
  return v3;
708
707
  }
709
- }
710
- const SerialRegistryFinalization = (typeof FinalizationRegistry === "undefined")
711
- ? { register: () => { }, unregister: () => { } }
712
- : new FinalizationRegistry((ptr) => wasm.__wbg_serialregistry_free(ptr >>> 0, 1));
713
- export class SerialRegistry {
714
- static __wrap(ptr) {
715
- ptr = ptr >>> 0;
716
- const obj = Object.create(SerialRegistry.prototype);
717
- obj.__wbg_ptr = ptr;
718
- SerialRegistryFinalization.register(obj, obj.__wbg_ptr, obj);
719
- return obj;
720
- }
721
- __destroy_into_raw() {
722
- const ptr = this.__wbg_ptr;
723
- this.__wbg_ptr = 0;
724
- SerialRegistryFinalization.unregister(this);
725
- return ptr;
726
- }
727
- free() {
728
- const ptr = this.__destroy_into_raw();
729
- wasm.__wbg_serialregistry_free(ptr, 0);
708
+ /**
709
+ * @returns {Promise<void>}
710
+ */
711
+ start() {
712
+ const ret = wasm.jsruntime_start(this.__wbg_ptr);
713
+ return ret;
730
714
  }
731
715
  /**
732
- * @param {string} interface_uuid
733
- * @returns {Promise<any>}
716
+ * @returns {Promise<void>}
734
717
  */
735
- close(interface_uuid) {
736
- const ptr0 = passStringToWasm0(interface_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
737
- const len0 = WASM_VECTOR_LEN;
738
- const ret = wasm.serialregistry_close(this.__wbg_ptr, ptr0, len0);
718
+ _stop() {
719
+ const ret = wasm.jsruntime__stop(this.__wbg_ptr);
739
720
  return ret;
740
721
  }
741
722
  /**
742
- * @param {number} baud_rate
723
+ * @param {string} script
724
+ * @param {boolean} formatted
743
725
  * @returns {Promise<string>}
744
726
  */
745
- register(baud_rate) {
746
- const ret = wasm.serialregistry_register(this.__wbg_ptr, baud_rate);
727
+ execute(script, formatted) {
728
+ const ptr0 = passStringToWasm0(script, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
729
+ const len0 = WASM_VECTOR_LEN;
730
+ const ret = wasm.jsruntime_execute(this.__wbg_ptr, ptr0, len0, formatted);
747
731
  return ret;
748
732
  }
733
+ /**
734
+ * @param {string} script
735
+ * @param {boolean} formatted
736
+ * @returns {string}
737
+ */
738
+ execute_sync(script, formatted) {
739
+ let deferred2_0;
740
+ let deferred2_1;
741
+ try {
742
+ const ptr0 = passStringToWasm0(script, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
743
+ const len0 = WASM_VECTOR_LEN;
744
+ const ret = wasm.jsruntime_execute_sync(this.__wbg_ptr, ptr0, len0, formatted);
745
+ deferred2_0 = ret[0];
746
+ deferred2_1 = ret[1];
747
+ return getStringFromWasm0(ret[0], ret[1]);
748
+ }
749
+ finally {
750
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
751
+ }
752
+ }
749
753
  }
750
754
  const WebRTCRegistryFinalization = (typeof FinalizationRegistry === "undefined")
751
755
  ? { register: () => { }, unregister: () => { } }
752
756
  : new FinalizationRegistry((ptr) => wasm.__wbg_webrtcregistry_free(ptr >>> 0, 1));
753
757
  export class WebRTCRegistry {
754
- static __wrap(ptr) {
755
- ptr = ptr >>> 0;
756
- const obj = Object.create(WebRTCRegistry.prototype);
757
- obj.__wbg_ptr = ptr;
758
- WebRTCRegistryFinalization.register(obj, obj.__wbg_ptr, obj);
759
- return obj;
760
- }
761
758
  __destroy_into_raw() {
762
759
  const ptr = this.__wbg_ptr;
763
760
  this.__wbg_ptr = 0;
@@ -860,59 +857,10 @@ export class WebRTCRegistry {
860
857
  return ret;
861
858
  }
862
859
  }
863
- const WebSocketClientRegistryFinalization = (typeof FinalizationRegistry === "undefined")
864
- ? { register: () => { }, unregister: () => { } }
865
- : new FinalizationRegistry((ptr) => wasm.__wbg_websocketclientregistry_free(ptr >>> 0, 1));
866
- export class WebSocketClientRegistry {
867
- static __wrap(ptr) {
868
- ptr = ptr >>> 0;
869
- const obj = Object.create(WebSocketClientRegistry.prototype);
870
- obj.__wbg_ptr = ptr;
871
- WebSocketClientRegistryFinalization.register(obj, obj.__wbg_ptr, obj);
872
- return obj;
873
- }
874
- __destroy_into_raw() {
875
- const ptr = this.__wbg_ptr;
876
- this.__wbg_ptr = 0;
877
- WebSocketClientRegistryFinalization.unregister(this);
878
- return ptr;
879
- }
880
- free() {
881
- const ptr = this.__destroy_into_raw();
882
- wasm.__wbg_websocketclientregistry_free(ptr, 0);
883
- }
884
- /**
885
- * @param {string} interface_uuid
886
- * @returns {Promise<any>}
887
- */
888
- close(interface_uuid) {
889
- const ptr0 = passStringToWasm0(interface_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
890
- const len0 = WASM_VECTOR_LEN;
891
- const ret = wasm.websocketclientregistry_close(this.__wbg_ptr, ptr0, len0);
892
- return ret;
893
- }
894
- /**
895
- * @param {string} address
896
- * @returns {Promise<string>}
897
- */
898
- register(address) {
899
- const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
900
- const len0 = WASM_VECTOR_LEN;
901
- const ret = wasm.websocketclientregistry_register(this.__wbg_ptr, ptr0, len0);
902
- return ret;
903
- }
904
- }
905
860
  const WebSocketServerRegistryFinalization = (typeof FinalizationRegistry === "undefined")
906
861
  ? { register: () => { }, unregister: () => { } }
907
862
  : new FinalizationRegistry((ptr) => wasm.__wbg_websocketserverregistry_free(ptr >>> 0, 1));
908
863
  export class WebSocketServerRegistry {
909
- static __wrap(ptr) {
910
- ptr = ptr >>> 0;
911
- const obj = Object.create(WebSocketServerRegistry.prototype);
912
- obj.__wbg_ptr = ptr;
913
- WebSocketServerRegistryFinalization.register(obj, obj.__wbg_ptr, obj);
914
- return obj;
915
- }
916
864
  __destroy_into_raw() {
917
865
  const ptr = this.__wbg_ptr;
918
866
  this.__wbg_ptr = 0;
@@ -933,24 +881,6 @@ export class WebSocketServerRegistry {
933
881
  const ret = wasm.websocketserverregistry_close(this.__wbg_ptr, ptr0, len0);
934
882
  return ret;
935
883
  }
936
- /**
937
- * @returns {Promise<string>}
938
- */
939
- register() {
940
- const ret = wasm.websocketserverregistry_register(this.__wbg_ptr);
941
- return ret;
942
- }
943
- /**
944
- * @param {string} interface_uuid
945
- * @param {WebSocket} websocket
946
- * @returns {any}
947
- */
948
- add_socket(interface_uuid, websocket) {
949
- const ptr0 = passStringToWasm0(interface_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
950
- const len0 = WASM_VECTOR_LEN;
951
- const ret = wasm.websocketserverregistry_add_socket(this.__wbg_ptr, ptr0, len0, websocket);
952
- return ret;
953
- }
954
884
  }
955
885
  export function __wbg_addIceCandidate_345f614980db6707(arg0, arg1) {
956
886
  const ret = arg0.addIceCandidate(arg1);
@@ -1040,22 +970,12 @@ export function __wbg_decrypt_f913c8ffec178afe() {
1040
970
  return ret;
1041
971
  }, arguments);
1042
972
  }
1043
- export function __wbg_deleteProperty_96363d4a1d977c97() {
1044
- return handleError(function (arg0, arg1) {
1045
- const ret = Reflect.deleteProperty(arg0, arg1);
1046
- return ret;
1047
- }, arguments);
1048
- }
1049
973
  export function __wbg_encrypt_4d890132dfd8a0a7() {
1050
974
  return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
1051
975
  const ret = arg0.encrypt(getStringFromWasm0(arg1, arg2), arg3, getArrayU8FromWasm0(arg4, arg5));
1052
976
  return ret;
1053
977
  }, arguments);
1054
978
  }
1055
- export function __wbg_entries_3265d4158b33e5dc(arg0) {
1056
- const ret = Object.entries(arg0);
1057
- return ret;
1058
- }
1059
979
  export function __wbg_error_524f506f44df1645(arg0) {
1060
980
  console.error(arg0);
1061
981
  }
@@ -1105,10 +1025,6 @@ export function __wbg_get_67b2ba62fc30de12() {
1105
1025
  return ret;
1106
1026
  }, arguments);
1107
1027
  }
1108
- export function __wbg_get_b9b93047fe3cf45b(arg0, arg1) {
1109
- const ret = arg0[arg1 >>> 0];
1110
- return ret;
1111
- }
1112
1028
  export function __wbg_getprivatekey_c03ce2e8935f16db(arg0) {
1113
1029
  const ret = arg0.privateKey;
1114
1030
  return ret;
@@ -1200,10 +1116,6 @@ export function __wbg_instanceof_Window_def73ea0955fc569(arg0) {
1200
1116
  const ret = result;
1201
1117
  return ret;
1202
1118
  }
1203
- export function __wbg_isSafeInteger_343e2beeeece1bb0(arg0) {
1204
- const ret = Number.isSafeInteger(arg0);
1205
- return ret;
1206
- }
1207
1119
  export function __wbg_label_674e88e28b0f69db(arg0, arg1) {
1208
1120
  const ret = arg1.label;
1209
1121
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -1215,10 +1127,6 @@ export function __wbg_length_a446193dc22c12f8(arg0) {
1215
1127
  const ret = arg0.length;
1216
1128
  return ret;
1217
1129
  }
1218
- export function __wbg_length_e2d2a49132c1b256(arg0) {
1219
- const ret = arg0.length;
1220
- return ret;
1221
- }
1222
1130
  export function __wbg_log_c222819a41e063d3(arg0) {
1223
1131
  console.log(arg0);
1224
1132
  }
@@ -1240,7 +1148,7 @@ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
1240
1148
  const a = state0.a;
1241
1149
  state0.a = 0;
1242
1150
  try {
1243
- return __wbg_adapter_310(a, state0.b, arg0, arg1);
1151
+ return __wbg_adapter_278(a, state0.b, arg0, arg1);
1244
1152
  }
1245
1153
  finally {
1246
1154
  state0.a = a;
@@ -1275,10 +1183,6 @@ export function __wbg_new_a12002a7f91c75be(arg0) {
1275
1183
  const ret = new Uint8Array(arg0);
1276
1184
  return ret;
1277
1185
  }
1278
- export function __wbg_new_c68d7209be747379(arg0, arg1) {
1279
- const ret = new Error(getStringFromWasm0(arg0, arg1));
1280
- return ret;
1281
- }
1282
1186
  export function __wbg_newnoargs_105ed471475aaf50(arg0, arg1) {
1283
1187
  const ret = new Function(getStringFromWasm0(arg0, arg1));
1284
1188
  return ret;
@@ -1383,9 +1287,6 @@ export function __wbg_setTimeout_db2dbaeefb6f39c7() {
1383
1287
  return ret;
1384
1288
  }, arguments);
1385
1289
  }
1386
- export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
1387
- arg0[arg1] = arg2;
1388
- }
1389
1290
  export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
1390
1291
  arg0.set(arg1, arg2 >>> 0);
1391
1292
  }
@@ -1517,20 +1418,6 @@ export function __wbg_write_311434e30ee214e5(arg0, arg1) {
1517
1418
  const ret = arg0.write(arg1);
1518
1419
  return ret;
1519
1420
  }
1520
- export function __wbindgen_as_number(arg0) {
1521
- const ret = +arg0;
1522
- return ret;
1523
- }
1524
- export function __wbindgen_bigint_from_u64(arg0) {
1525
- const ret = BigInt.asUintN(64, arg0);
1526
- return ret;
1527
- }
1528
- export function __wbindgen_bigint_get_as_i64(arg0, arg1) {
1529
- const v = arg1;
1530
- const ret = typeof v === "bigint" ? v : undefined;
1531
- getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
1532
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1533
- }
1534
1421
  export function __wbindgen_boolean_get(arg0) {
1535
1422
  const v = arg0;
1536
1423
  const ret = typeof v === "boolean" ? (v ? 1 : 0) : 2;
@@ -1545,28 +1432,28 @@ export function __wbindgen_cb_drop(arg0) {
1545
1432
  const ret = false;
1546
1433
  return ret;
1547
1434
  }
1548
- export function __wbindgen_closure_wrapper3082(arg0, arg1, arg2) {
1549
- const ret = makeMutClosure(arg0, arg1, 845, __wbg_adapter_57);
1435
+ export function __wbindgen_closure_wrapper3633(arg0, arg1, arg2) {
1436
+ const ret = makeMutClosure(arg0, arg1, 1034, __wbg_adapter_49);
1550
1437
  return ret;
1551
1438
  }
1552
- export function __wbindgen_closure_wrapper3321(arg0, arg1, arg2) {
1553
- const ret = makeMutClosure(arg0, arg1, 888, __wbg_adapter_60);
1439
+ export function __wbindgen_closure_wrapper3666(arg0, arg1, arg2) {
1440
+ const ret = makeMutClosure(arg0, arg1, 1051, __wbg_adapter_52);
1554
1441
  return ret;
1555
1442
  }
1556
- export function __wbindgen_closure_wrapper3326(arg0, arg1, arg2) {
1557
- const ret = makeMutClosure(arg0, arg1, 892, __wbg_adapter_63);
1443
+ export function __wbindgen_closure_wrapper745(arg0, arg1, arg2) {
1444
+ const ret = makeMutClosure(arg0, arg1, 404, __wbg_adapter_40);
1558
1445
  return ret;
1559
1446
  }
1560
- export function __wbindgen_closure_wrapper3826(arg0, arg1, arg2) {
1561
- const ret = makeMutClosure(arg0, arg1, 896, __wbg_adapter_66);
1447
+ export function __wbindgen_closure_wrapper746(arg0, arg1, arg2) {
1448
+ const ret = makeMutClosure(arg0, arg1, 404, __wbg_adapter_40);
1562
1449
  return ret;
1563
1450
  }
1564
- export function __wbindgen_closure_wrapper887(arg0, arg1, arg2) {
1565
- const ret = makeMutClosure(arg0, arg1, 491, __wbg_adapter_52);
1451
+ export function __wbindgen_closure_wrapper747(arg0, arg1, arg2) {
1452
+ const ret = makeMutClosure(arg0, arg1, 404, __wbg_adapter_40);
1566
1453
  return ret;
1567
1454
  }
1568
- export function __wbindgen_closure_wrapper888(arg0, arg1, arg2) {
1569
- const ret = makeMutClosure(arg0, arg1, 491, __wbg_adapter_52);
1455
+ export function __wbindgen_closure_wrapper748(arg0, arg1, arg2) {
1456
+ const ret = makeMutClosure(arg0, arg1, 404, __wbg_adapter_40);
1570
1457
  return ret;
1571
1458
  }
1572
1459
  export function __wbindgen_debug_string(arg0, arg1) {
@@ -1593,10 +1480,6 @@ export function __wbindgen_init_externref_table() {
1593
1480
  table.set(offset + 2, true);
1594
1481
  table.set(offset + 3, false);
1595
1482
  }
1596
- export function __wbindgen_is_bigint(arg0) {
1597
- const ret = typeof arg0 === "bigint";
1598
- return ret;
1599
- }
1600
1483
  export function __wbindgen_is_function(arg0) {
1601
1484
  const ret = typeof arg0 === "function";
1602
1485
  return ret;
@@ -1606,18 +1489,10 @@ export function __wbindgen_is_object(arg0) {
1606
1489
  const ret = typeof val === "object" && val !== null;
1607
1490
  return ret;
1608
1491
  }
1609
- export function __wbindgen_is_string(arg0) {
1610
- const ret = typeof arg0 === "string";
1611
- return ret;
1612
- }
1613
1492
  export function __wbindgen_is_undefined(arg0) {
1614
1493
  const ret = arg0 === undefined;
1615
1494
  return ret;
1616
1495
  }
1617
- export function __wbindgen_jsval_eq(arg0, arg1) {
1618
- const ret = arg0 === arg1;
1619
- return ret;
1620
- }
1621
1496
  export function __wbindgen_jsval_loose_eq(arg0, arg1) {
1622
1497
  const ret = arg0 == arg1;
1623
1498
  return ret;