mqtt5-wasm 0.2.4 → 0.3.0

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/mqtt5_wasm.js CHANGED
@@ -92,6 +92,11 @@ function getArrayJsValueFromWasm0(ptr, len) {
92
92
  return result;
93
93
  }
94
94
 
95
+ function getArrayU32FromWasm0(ptr, len) {
96
+ ptr = ptr >>> 0;
97
+ return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
98
+ }
99
+
95
100
  function getArrayU8FromWasm0(ptr, len) {
96
101
  ptr = ptr >>> 0;
97
102
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
@@ -110,6 +115,14 @@ function getStringFromWasm0(ptr, len) {
110
115
  return decodeText(ptr, len);
111
116
  }
112
117
 
118
+ let cachedUint32ArrayMemory0 = null;
119
+ function getUint32ArrayMemory0() {
120
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
121
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
122
+ }
123
+ return cachedUint32ArrayMemory0;
124
+ }
125
+
113
126
  let cachedUint8ArrayMemory0 = null;
114
127
  function getUint8ArrayMemory0() {
115
128
  if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
@@ -238,20 +251,20 @@ if (!('encodeInto' in cachedTextEncoder)) {
238
251
 
239
252
  let WASM_VECTOR_LEN = 0;
240
253
 
241
- function wasm_bindgen__convert__closures_____invoke__h28af81100ba72912(arg0, arg1, arg2) {
242
- wasm.wasm_bindgen__convert__closures_____invoke__h28af81100ba72912(arg0, arg1, arg2);
254
+ function wasm_bindgen__convert__closures_____invoke__h0669e1264d41ddde(arg0, arg1, arg2) {
255
+ wasm.wasm_bindgen__convert__closures_____invoke__h0669e1264d41ddde(arg0, arg1, arg2);
243
256
  }
244
257
 
245
- function wasm_bindgen__convert__closures_____invoke__hf8b807ed3211f368(arg0, arg1) {
246
- wasm.wasm_bindgen__convert__closures_____invoke__hf8b807ed3211f368(arg0, arg1);
258
+ function wasm_bindgen__convert__closures_____invoke__he72b1024119f349e(arg0, arg1) {
259
+ wasm.wasm_bindgen__convert__closures_____invoke__he72b1024119f349e(arg0, arg1);
247
260
  }
248
261
 
249
- function wasm_bindgen__convert__closures_____invoke__ha8b0b9fe7fac12a4(arg0, arg1, arg2) {
250
- wasm.wasm_bindgen__convert__closures_____invoke__ha8b0b9fe7fac12a4(arg0, arg1, arg2);
262
+ function wasm_bindgen__convert__closures_____invoke__h12ffa24d99e28e58(arg0, arg1, arg2) {
263
+ wasm.wasm_bindgen__convert__closures_____invoke__h12ffa24d99e28e58(arg0, arg1, arg2);
251
264
  }
252
265
 
253
- function wasm_bindgen__convert__closures_____invoke__h22971f3c49e1e8f1(arg0, arg1, arg2, arg3) {
254
- wasm.wasm_bindgen__convert__closures_____invoke__h22971f3c49e1e8f1(arg0, arg1, arg2, arg3);
266
+ function wasm_bindgen__convert__closures_____invoke__h2d9e646cfc355363(arg0, arg1, arg2, arg3) {
267
+ wasm.wasm_bindgen__convert__closures_____invoke__h2d9e646cfc355363(arg0, arg1, arg2, arg3);
255
268
  }
256
269
 
257
270
  const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
@@ -272,6 +285,10 @@ const WasmConnectOptionsFinalization = (typeof FinalizationRegistry === 'undefin
272
285
  ? { register: () => {}, unregister: () => {} }
273
286
  : new FinalizationRegistry(ptr => wasm.__wbg_wasmconnectoptions_free(ptr >>> 0, 1));
274
287
 
288
+ const WasmMessagePropertiesFinalization = (typeof FinalizationRegistry === 'undefined')
289
+ ? { register: () => {}, unregister: () => {} }
290
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmmessageproperties_free(ptr >>> 0, 1));
291
+
275
292
  const WasmMqttClientFinalization = (typeof FinalizationRegistry === 'undefined')
276
293
  ? { register: () => {}, unregister: () => {} }
277
294
  : new FinalizationRegistry(ptr => wasm.__wbg_wasmmqttclient_free(ptr >>> 0, 1));
@@ -304,15 +321,20 @@ export class WasmBridgeConfig {
304
321
  wasm.__wbg_wasmbridgeconfig_free(ptr, 0);
305
322
  }
306
323
  /**
307
- * @param {string} name
324
+ * @param {string | null} [password]
308
325
  */
309
- constructor(name) {
310
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
311
- const len0 = WASM_VECTOR_LEN;
312
- const ret = wasm.wasmbridgeconfig_new(ptr0, len0);
313
- this.__wbg_ptr = ret >>> 0;
314
- WasmBridgeConfigFinalization.register(this, this.__wbg_ptr, this);
315
- return this;
326
+ set password(password) {
327
+ var ptr0 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
328
+ var len0 = WASM_VECTOR_LEN;
329
+ wasm.wasmbridgeconfig_set_password(this.__wbg_ptr, ptr0, len0);
330
+ }
331
+ /**
332
+ * @param {string | null} [username]
333
+ */
334
+ set username(username) {
335
+ var ptr0 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
336
+ var len0 = WASM_VECTOR_LEN;
337
+ wasm.wasmbridgeconfig_set_username(this.__wbg_ptr, ptr0, len0);
316
338
  }
317
339
  /**
318
340
  * @param {string} client_id
@@ -335,20 +357,21 @@ export class WasmBridgeConfig {
335
357
  wasm.wasmbridgeconfig_set_keep_alive_secs(this.__wbg_ptr, secs);
336
358
  }
337
359
  /**
338
- * @param {string | null} [username]
360
+ * @param {string} name
339
361
  */
340
- set username(username) {
341
- var ptr0 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
342
- var len0 = WASM_VECTOR_LEN;
343
- wasm.wasmbridgeconfig_set_username(this.__wbg_ptr, ptr0, len0);
362
+ constructor(name) {
363
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
364
+ const len0 = WASM_VECTOR_LEN;
365
+ const ret = wasm.wasmbridgeconfig_new(ptr0, len0);
366
+ this.__wbg_ptr = ret >>> 0;
367
+ WasmBridgeConfigFinalization.register(this, this.__wbg_ptr, this);
368
+ return this;
344
369
  }
345
- /**
346
- * @param {string | null} [password]
347
- */
348
- set password(password) {
349
- var ptr0 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
350
- var len0 = WASM_VECTOR_LEN;
351
- wasm.wasmbridgeconfig_set_password(this.__wbg_ptr, ptr0, len0);
370
+ validate() {
371
+ const ret = wasm.wasmbridgeconfig_validate(this.__wbg_ptr);
372
+ if (ret[1]) {
373
+ throw takeFromExternrefTable0(ret[0]);
374
+ }
352
375
  }
353
376
  /**
354
377
  * @param {WasmTopicMapping} mapping
@@ -358,12 +381,6 @@ export class WasmBridgeConfig {
358
381
  var ptr0 = mapping.__destroy_into_raw();
359
382
  wasm.wasmbridgeconfig_add_topic(this.__wbg_ptr, ptr0);
360
383
  }
361
- validate() {
362
- const ret = wasm.wasmbridgeconfig_validate(this.__wbg_ptr);
363
- if (ret[1]) {
364
- throw takeFromExternrefTable0(ret[0]);
365
- }
366
- }
367
384
  }
368
385
  if (Symbol.dispose) WasmBridgeConfig.prototype[Symbol.dispose] = WasmBridgeConfig.prototype.free;
369
386
 
@@ -394,52 +411,22 @@ export class WasmBroker {
394
411
  const ptr = this.__destroy_into_raw();
395
412
  wasm.__wbg_wasmbroker_free(ptr, 0);
396
413
  }
397
- constructor() {
398
- const ret = wasm.wasmbroker_new();
399
- if (ret[2]) {
400
- throw takeFromExternrefTable0(ret[1]);
401
- }
402
- this.__wbg_ptr = ret[0] >>> 0;
403
- WasmBrokerFinalization.register(this, this.__wbg_ptr, this);
404
- return this;
405
- }
406
- /**
407
- * @param {WasmBrokerConfig} wasm_config
408
- * @returns {WasmBroker}
409
- */
410
- static with_config(wasm_config) {
411
- _assertClass(wasm_config, WasmBrokerConfig);
412
- var ptr0 = wasm_config.__destroy_into_raw();
413
- const ret = wasm.wasmbroker_with_config(ptr0);
414
- if (ret[2]) {
415
- throw takeFromExternrefTable0(ret[1]);
416
- }
417
- return WasmBroker.__wrap(ret[0]);
418
- }
419
414
  /**
420
- * @param {string} username
421
- * @param {string} password
415
+ * @param {WasmBridgeConfig} config
416
+ * @param {MessagePort} remote_port
422
417
  * @returns {Promise<void>}
423
418
  */
424
- add_user(username, password) {
425
- const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
426
- const len0 = WASM_VECTOR_LEN;
427
- const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
428
- const len1 = WASM_VECTOR_LEN;
429
- const ret = wasm.wasmbroker_add_user(this.__wbg_ptr, ptr0, len0, ptr1, len1);
419
+ add_bridge(config, remote_port) {
420
+ _assertClass(config, WasmBridgeConfig);
421
+ var ptr0 = config.__destroy_into_raw();
422
+ const ret = wasm.wasmbroker_add_bridge(this.__wbg_ptr, ptr0, remote_port);
430
423
  return ret;
431
424
  }
432
425
  /**
433
- * @param {string} username
434
- * @param {string} password_hash
435
- * @returns {Promise<void>}
426
+ * @returns {Promise<number>}
436
427
  */
437
- add_user_with_hash(username, password_hash) {
438
- const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
439
- const len0 = WASM_VECTOR_LEN;
440
- const ptr1 = passStringToWasm0(password_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
441
- const len1 = WASM_VECTOR_LEN;
442
- const ret = wasm.wasmbroker_add_user_with_hash(this.__wbg_ptr, ptr0, len0, ptr1, len1);
428
+ user_count() {
429
+ const ret = wasm.wasmbroker_user_count(this.__wbg_ptr);
443
430
  return ret;
444
431
  }
445
432
  /**
@@ -453,27 +440,26 @@ export class WasmBroker {
453
440
  return ret;
454
441
  }
455
442
  /**
456
- * @param {string} username
457
- * @returns {Promise<boolean>}
458
- */
459
- has_user(username) {
460
- const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
461
- const len0 = WASM_VECTOR_LEN;
462
- const ret = wasm.wasmbroker_has_user(this.__wbg_ptr, ptr0, len0);
463
- return ret;
464
- }
465
- /**
466
- * @returns {Promise<number>}
443
+ * @param {WasmBrokerConfig} wasm_config
444
+ * @returns {WasmBroker}
467
445
  */
468
- user_count() {
469
- const ret = wasm.wasmbroker_user_count(this.__wbg_ptr);
470
- return ret;
446
+ static with_config(wasm_config) {
447
+ _assertClass(wasm_config, WasmBrokerConfig);
448
+ var ptr0 = wasm_config.__destroy_into_raw();
449
+ const ret = wasm.wasmbroker_with_config(ptr0);
450
+ if (ret[2]) {
451
+ throw takeFromExternrefTable0(ret[1]);
452
+ }
453
+ return WasmBroker.__wrap(ret[0]);
471
454
  }
472
455
  /**
473
- * @param {boolean} allow
456
+ * @returns {string[]}
474
457
  */
475
- set_allow_anonymous(allow) {
476
- wasm.wasmbroker_set_allow_anonymous(this.__wbg_ptr, allow);
458
+ list_bridges() {
459
+ const ret = wasm.wasmbroker_list_bridges(this.__wbg_ptr);
460
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
461
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
462
+ return v1;
477
463
  }
478
464
  /**
479
465
  * @param {string} password
@@ -499,6 +485,36 @@ export class WasmBroker {
499
485
  wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
500
486
  }
501
487
  }
488
+ /**
489
+ * @param {string} name
490
+ * @returns {Promise<void>}
491
+ */
492
+ remove_bridge(name) {
493
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
494
+ const len0 = WASM_VECTOR_LEN;
495
+ const ret = wasm.wasmbroker_remove_bridge(this.__wbg_ptr, ptr0, len0);
496
+ return ret;
497
+ }
498
+ /**
499
+ * @returns {Promise<void>}
500
+ */
501
+ stop_all_bridges() {
502
+ const ret = wasm.wasmbroker_stop_all_bridges(this.__wbg_ptr);
503
+ return ret;
504
+ }
505
+ /**
506
+ * @param {string} username
507
+ * @param {string} password_hash
508
+ * @returns {Promise<void>}
509
+ */
510
+ add_user_with_hash(username, password_hash) {
511
+ const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
512
+ const len0 = WASM_VECTOR_LEN;
513
+ const ptr1 = passStringToWasm0(password_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
514
+ const len1 = WASM_VECTOR_LEN;
515
+ const ret = wasm.wasmbroker_add_user_with_hash(this.__wbg_ptr, ptr0, len0, ptr1, len1);
516
+ return ret;
517
+ }
502
518
  /**
503
519
  * @returns {MessagePort}
504
520
  */
@@ -510,40 +526,41 @@ export class WasmBroker {
510
526
  return takeFromExternrefTable0(ret[0]);
511
527
  }
512
528
  /**
513
- * @param {WasmBridgeConfig} config
514
- * @param {MessagePort} remote_port
515
- * @returns {Promise<void>}
529
+ * @param {boolean} allow
516
530
  */
517
- add_bridge(config, remote_port) {
518
- _assertClass(config, WasmBridgeConfig);
519
- var ptr0 = config.__destroy_into_raw();
520
- const ret = wasm.wasmbroker_add_bridge(this.__wbg_ptr, ptr0, remote_port);
521
- return ret;
531
+ set_allow_anonymous(allow) {
532
+ wasm.wasmbroker_set_allow_anonymous(this.__wbg_ptr, allow);
533
+ }
534
+ constructor() {
535
+ const ret = wasm.wasmbroker_new();
536
+ if (ret[2]) {
537
+ throw takeFromExternrefTable0(ret[1]);
538
+ }
539
+ this.__wbg_ptr = ret[0] >>> 0;
540
+ WasmBrokerFinalization.register(this, this.__wbg_ptr, this);
541
+ return this;
522
542
  }
523
543
  /**
524
- * @param {string} name
544
+ * @param {string} username
545
+ * @param {string} password
525
546
  * @returns {Promise<void>}
526
547
  */
527
- remove_bridge(name) {
528
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
548
+ add_user(username, password) {
549
+ const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
529
550
  const len0 = WASM_VECTOR_LEN;
530
- const ret = wasm.wasmbroker_remove_bridge(this.__wbg_ptr, ptr0, len0);
551
+ const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
552
+ const len1 = WASM_VECTOR_LEN;
553
+ const ret = wasm.wasmbroker_add_user(this.__wbg_ptr, ptr0, len0, ptr1, len1);
531
554
  return ret;
532
555
  }
533
556
  /**
534
- * @returns {string[]}
535
- */
536
- list_bridges() {
537
- const ret = wasm.wasmbroker_list_bridges(this.__wbg_ptr);
538
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
539
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
540
- return v1;
541
- }
542
- /**
543
- * @returns {Promise<void>}
557
+ * @param {string} username
558
+ * @returns {Promise<boolean>}
544
559
  */
545
- stop_all_bridges() {
546
- const ret = wasm.wasmbroker_stop_all_bridges(this.__wbg_ptr);
560
+ has_user(username) {
561
+ const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
562
+ const len0 = WASM_VECTOR_LEN;
563
+ const ret = wasm.wasmbroker_has_user(this.__wbg_ptr, ptr0, len0);
547
564
  return ret;
548
565
  }
549
566
  }
@@ -560,12 +577,6 @@ export class WasmBrokerConfig {
560
577
  const ptr = this.__destroy_into_raw();
561
578
  wasm.__wbg_wasmbrokerconfig_free(ptr, 0);
562
579
  }
563
- constructor() {
564
- const ret = wasm.wasmbrokerconfig_new();
565
- this.__wbg_ptr = ret >>> 0;
566
- WasmBrokerConfigFinalization.register(this, this.__wbg_ptr, this);
567
- return this;
568
- }
569
580
  /**
570
581
  * @param {number} value
571
582
  */
@@ -575,8 +586,8 @@ export class WasmBrokerConfig {
575
586
  /**
576
587
  * @param {number} value
577
588
  */
578
- set session_expiry_interval_secs(value) {
579
- wasm.wasmbrokerconfig_set_session_expiry_interval_secs(this.__wbg_ptr, value);
589
+ set maximum_qos(value) {
590
+ wasm.wasmbrokerconfig_set_maximum_qos(this.__wbg_ptr, value);
580
591
  }
581
592
  /**
582
593
  * @param {number} value
@@ -584,6 +595,12 @@ export class WasmBrokerConfig {
584
595
  set max_packet_size(value) {
585
596
  wasm.wasmbrokerconfig_set_max_packet_size(this.__wbg_ptr, value);
586
597
  }
598
+ /**
599
+ * @param {boolean} value
600
+ */
601
+ set retain_available(value) {
602
+ wasm.wasmbrokerconfig_set_retain_available(this.__wbg_ptr, value);
603
+ }
587
604
  /**
588
605
  * @param {number} value
589
606
  */
@@ -591,16 +608,22 @@ export class WasmBrokerConfig {
591
608
  wasm.wasmbrokerconfig_set_topic_alias_maximum(this.__wbg_ptr, value);
592
609
  }
593
610
  /**
594
- * @param {boolean} value
611
+ * @param {number | null} [value]
595
612
  */
596
- set retain_available(value) {
597
- wasm.wasmbrokerconfig_set_retain_available(this.__wbg_ptr, value);
613
+ set server_keep_alive_secs(value) {
614
+ wasm.wasmbrokerconfig_set_server_keep_alive_secs(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0);
598
615
  }
599
616
  /**
600
617
  * @param {number} value
601
618
  */
602
- set maximum_qos(value) {
603
- wasm.wasmbrokerconfig_set_maximum_qos(this.__wbg_ptr, value);
619
+ set session_expiry_interval_secs(value) {
620
+ wasm.wasmbrokerconfig_set_session_expiry_interval_secs(this.__wbg_ptr, value);
621
+ }
622
+ /**
623
+ * @param {boolean} value
624
+ */
625
+ set shared_subscription_available(value) {
626
+ wasm.wasmbrokerconfig_set_shared_subscription_available(this.__wbg_ptr, value);
604
627
  }
605
628
  /**
606
629
  * @param {boolean} value
@@ -614,17 +637,11 @@ export class WasmBrokerConfig {
614
637
  set subscription_identifier_available(value) {
615
638
  wasm.wasmbrokerconfig_set_subscription_identifier_available(this.__wbg_ptr, value);
616
639
  }
617
- /**
618
- * @param {boolean} value
619
- */
620
- set shared_subscription_available(value) {
621
- wasm.wasmbrokerconfig_set_shared_subscription_available(this.__wbg_ptr, value);
622
- }
623
- /**
624
- * @param {number | null} [value]
625
- */
626
- set server_keep_alive_secs(value) {
627
- wasm.wasmbrokerconfig_set_server_keep_alive_secs(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0);
640
+ constructor() {
641
+ const ret = wasm.wasmbrokerconfig_new();
642
+ this.__wbg_ptr = ret >>> 0;
643
+ WasmBrokerConfigFinalization.register(this, this.__wbg_ptr, this);
644
+ return this;
628
645
  }
629
646
  }
630
647
  if (Symbol.dispose) WasmBrokerConfig.prototype[Symbol.dispose] = WasmBrokerConfig.prototype.free;
@@ -640,25 +657,6 @@ export class WasmConnectOptions {
640
657
  const ptr = this.__destroy_into_raw();
641
658
  wasm.__wbg_wasmconnectoptions_free(ptr, 0);
642
659
  }
643
- constructor() {
644
- const ret = wasm.wasmconnectoptions_new();
645
- this.__wbg_ptr = ret >>> 0;
646
- WasmConnectOptionsFinalization.register(this, this.__wbg_ptr, this);
647
- return this;
648
- }
649
- /**
650
- * @returns {number}
651
- */
652
- get keepAlive() {
653
- const ret = wasm.wasmconnectoptions_keepAlive(this.__wbg_ptr);
654
- return ret;
655
- }
656
- /**
657
- * @param {number} value
658
- */
659
- set keepAlive(value) {
660
- wasm.wasmconnectoptions_set_keepAlive(this.__wbg_ptr, value);
661
- }
662
660
  /**
663
661
  * @returns {boolean}
664
662
  */
@@ -666,23 +664,16 @@ export class WasmConnectOptions {
666
664
  const ret = wasm.wasmconnectoptions_cleanStart(this.__wbg_ptr);
667
665
  return ret !== 0;
668
666
  }
669
- /**
670
- * @param {boolean} value
671
- */
672
- set cleanStart(value) {
673
- wasm.wasmconnectoptions_set_cleanStart(this.__wbg_ptr, value);
667
+ clear_will() {
668
+ wasm.wasmconnectoptions_clear_will(this.__wbg_ptr);
674
669
  }
675
670
  /**
676
- * @returns {string | undefined}
671
+ * @param {Uint8Array} value
677
672
  */
678
- get username() {
679
- const ret = wasm.wasmconnectoptions_username(this.__wbg_ptr);
680
- let v1;
681
- if (ret[0] !== 0) {
682
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
683
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
684
- }
685
- return v1;
673
+ set password(value) {
674
+ const ptr0 = passArray8ToWasm0(value, wasm.__wbindgen_malloc);
675
+ const len0 = WASM_VECTOR_LEN;
676
+ wasm.wasmconnectoptions_set_password(this.__wbg_ptr, ptr0, len0);
686
677
  }
687
678
  /**
688
679
  * @param {string | null} [value]
@@ -693,42 +684,54 @@ export class WasmConnectOptions {
693
684
  wasm.wasmconnectoptions_set_username(this.__wbg_ptr, ptr0, len0);
694
685
  }
695
686
  /**
696
- * @param {Uint8Array} value
687
+ * @param {number} value
697
688
  */
698
- set password(value) {
699
- const ptr0 = passArray8ToWasm0(value, wasm.__wbindgen_malloc);
700
- const len0 = WASM_VECTOR_LEN;
701
- wasm.wasmconnectoptions_set_password(this.__wbg_ptr, ptr0, len0);
689
+ set keepAlive(value) {
690
+ wasm.wasmconnectoptions_set_keepAlive(this.__wbg_ptr, value);
702
691
  }
703
692
  /**
704
- * @param {WasmWillMessage} will
693
+ * @returns {number | undefined}
705
694
  */
706
- set_will(will) {
707
- _assertClass(will, WasmWillMessage);
708
- var ptr0 = will.__destroy_into_raw();
709
- wasm.wasmconnectoptions_set_will(this.__wbg_ptr, ptr0);
695
+ get receiveMaximum() {
696
+ const ret = wasm.wasmconnectoptions_receiveMaximum(this.__wbg_ptr);
697
+ return ret === 0xFFFFFF ? undefined : ret;
710
698
  }
711
- clear_will() {
712
- wasm.wasmconnectoptions_clear_will(this.__wbg_ptr);
699
+ /**
700
+ * @param {boolean} value
701
+ */
702
+ set cleanStart(value) {
703
+ wasm.wasmconnectoptions_set_cleanStart(this.__wbg_ptr, value);
713
704
  }
714
705
  /**
715
- * @returns {number | undefined}
706
+ * @param {string} key
707
+ * @param {string} value
716
708
  */
717
- get sessionExpiryInterval() {
718
- const ret = wasm.wasmconnectoptions_sessionExpiryInterval(this.__wbg_ptr);
719
- return ret === 0x100000001 ? undefined : ret;
709
+ addUserProperty(key, value) {
710
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
711
+ const len0 = WASM_VECTOR_LEN;
712
+ const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
713
+ const len1 = WASM_VECTOR_LEN;
714
+ wasm.wasmconnectoptions_addUserProperty(this.__wbg_ptr, ptr0, len0, ptr1, len1);
720
715
  }
721
716
  /**
722
- * @param {number | null} [value]
717
+ * @returns {number}
723
718
  */
724
- set sessionExpiryInterval(value) {
725
- wasm.wasmbrokerconfig_set_server_keep_alive_secs(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0);
719
+ get protocolVersion() {
720
+ const ret = wasm.wasmconnectoptions_protocolVersion(this.__wbg_ptr);
721
+ return ret;
726
722
  }
727
723
  /**
728
724
  * @returns {number | undefined}
729
725
  */
730
- get receiveMaximum() {
731
- const ret = wasm.wasmconnectoptions_receiveMaximum(this.__wbg_ptr);
726
+ get maximumPacketSize() {
727
+ const ret = wasm.wasmconnectoptions_maximumPacketSize(this.__wbg_ptr);
728
+ return ret === 0x100000001 ? undefined : ret;
729
+ }
730
+ /**
731
+ * @returns {number | undefined}
732
+ */
733
+ get topicAliasMaximum() {
734
+ const ret = wasm.wasmconnectoptions_topicAliasMaximum(this.__wbg_ptr);
732
735
  return ret === 0xFFFFFF ? undefined : ret;
733
736
  }
734
737
  /**
@@ -737,11 +740,32 @@ export class WasmConnectOptions {
737
740
  set receiveMaximum(value) {
738
741
  wasm.wasmconnectoptions_set_receiveMaximum(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value);
739
742
  }
743
+ clearUserProperties() {
744
+ wasm.wasmconnectoptions_clearUserProperties(this.__wbg_ptr);
745
+ }
746
+ /**
747
+ * @param {number} value
748
+ */
749
+ set protocolVersion(value) {
750
+ wasm.wasmconnectoptions_set_protocolVersion(this.__wbg_ptr, value);
751
+ }
752
+ /**
753
+ * @returns {string | undefined}
754
+ */
755
+ get authenticationMethod() {
756
+ const ret = wasm.wasmconnectoptions_authenticationMethod(this.__wbg_ptr);
757
+ let v1;
758
+ if (ret[0] !== 0) {
759
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
760
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
761
+ }
762
+ return v1;
763
+ }
740
764
  /**
741
765
  * @returns {number | undefined}
742
766
  */
743
- get maximumPacketSize() {
744
- const ret = wasm.wasmconnectoptions_maximumPacketSize(this.__wbg_ptr);
767
+ get sessionExpiryInterval() {
768
+ const ret = wasm.wasmconnectoptions_sessionExpiryInterval(this.__wbg_ptr);
745
769
  return ret === 0x100000001 ? undefined : ret;
746
770
  }
747
771
  /**
@@ -750,13 +774,6 @@ export class WasmConnectOptions {
750
774
  set maximumPacketSize(value) {
751
775
  wasm.wasmconnectoptions_set_maximumPacketSize(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0);
752
776
  }
753
- /**
754
- * @returns {number | undefined}
755
- */
756
- get topicAliasMaximum() {
757
- const ret = wasm.wasmconnectoptions_topicAliasMaximum(this.__wbg_ptr);
758
- return ret === 0xFFFFFF ? undefined : ret;
759
- }
760
777
  /**
761
778
  * @param {number | null} [value]
762
779
  */
@@ -764,17 +781,20 @@ export class WasmConnectOptions {
764
781
  wasm.wasmconnectoptions_set_topicAliasMaximum(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value);
765
782
  }
766
783
  /**
767
- * @returns {boolean | undefined}
784
+ * @param {Uint8Array} value
768
785
  */
769
- get requestResponseInformation() {
770
- const ret = wasm.wasmconnectoptions_requestResponseInformation(this.__wbg_ptr);
771
- return ret === 0xFFFFFF ? undefined : ret !== 0;
786
+ set authenticationData(value) {
787
+ const ptr0 = passArray8ToWasm0(value, wasm.__wbindgen_malloc);
788
+ const len0 = WASM_VECTOR_LEN;
789
+ wasm.wasmconnectoptions_set_authenticationData(this.__wbg_ptr, ptr0, len0);
772
790
  }
773
791
  /**
774
- * @param {boolean | null} [value]
792
+ * @param {string | null} [value]
775
793
  */
776
- set requestResponseInformation(value) {
777
- wasm.wasmconnectoptions_set_requestResponseInformation(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
794
+ set authenticationMethod(value) {
795
+ var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
796
+ var len0 = WASM_VECTOR_LEN;
797
+ wasm.wasmconnectoptions_set_authenticationMethod(this.__wbg_ptr, ptr0, len0);
778
798
  }
779
799
  /**
780
800
  * @returns {boolean | undefined}
@@ -783,17 +803,50 @@ export class WasmConnectOptions {
783
803
  const ret = wasm.wasmconnectoptions_requestProblemInformation(this.__wbg_ptr);
784
804
  return ret === 0xFFFFFF ? undefined : ret !== 0;
785
805
  }
806
+ /**
807
+ * @param {number | null} [value]
808
+ */
809
+ set sessionExpiryInterval(value) {
810
+ wasm.wasmbrokerconfig_set_server_keep_alive_secs(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0);
811
+ }
812
+ /**
813
+ * @returns {boolean | undefined}
814
+ */
815
+ get requestResponseInformation() {
816
+ const ret = wasm.wasmconnectoptions_requestResponseInformation(this.__wbg_ptr);
817
+ return ret === 0xFFFFFF ? undefined : ret !== 0;
818
+ }
786
819
  /**
787
820
  * @param {boolean | null} [value]
788
821
  */
789
822
  set requestProblemInformation(value) {
790
823
  wasm.wasmconnectoptions_set_requestProblemInformation(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
791
824
  }
825
+ /**
826
+ * @param {boolean | null} [value]
827
+ */
828
+ set requestResponseInformation(value) {
829
+ wasm.wasmconnectoptions_set_requestResponseInformation(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
830
+ }
831
+ constructor() {
832
+ const ret = wasm.wasmconnectoptions_new();
833
+ this.__wbg_ptr = ret >>> 0;
834
+ WasmConnectOptionsFinalization.register(this, this.__wbg_ptr, this);
835
+ return this;
836
+ }
837
+ /**
838
+ * @param {WasmWillMessage} will
839
+ */
840
+ set_will(will) {
841
+ _assertClass(will, WasmWillMessage);
842
+ var ptr0 = will.__destroy_into_raw();
843
+ wasm.wasmconnectoptions_set_will(this.__wbg_ptr, ptr0);
844
+ }
792
845
  /**
793
846
  * @returns {string | undefined}
794
847
  */
795
- get authenticationMethod() {
796
- const ret = wasm.wasmconnectoptions_authenticationMethod(this.__wbg_ptr);
848
+ get username() {
849
+ const ret = wasm.wasmconnectoptions_username(this.__wbg_ptr);
797
850
  let v1;
798
851
  if (ret[0] !== 0) {
799
852
  v1 = getStringFromWasm0(ret[0], ret[1]).slice();
@@ -802,138 +855,143 @@ export class WasmConnectOptions {
802
855
  return v1;
803
856
  }
804
857
  /**
805
- * @param {string | null} [value]
806
- */
807
- set authenticationMethod(value) {
808
- var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
809
- var len0 = WASM_VECTOR_LEN;
810
- wasm.wasmconnectoptions_set_authenticationMethod(this.__wbg_ptr, ptr0, len0);
811
- }
812
- /**
813
- * @param {Uint8Array} value
814
- */
815
- set authenticationData(value) {
816
- const ptr0 = passArray8ToWasm0(value, wasm.__wbindgen_malloc);
817
- const len0 = WASM_VECTOR_LEN;
818
- wasm.wasmconnectoptions_set_authenticationData(this.__wbg_ptr, ptr0, len0);
819
- }
820
- /**
821
- * @param {string} key
822
- * @param {string} value
858
+ * @returns {number}
823
859
  */
824
- addUserProperty(key, value) {
825
- const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
826
- const len0 = WASM_VECTOR_LEN;
827
- const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
828
- const len1 = WASM_VECTOR_LEN;
829
- wasm.wasmconnectoptions_addUserProperty(this.__wbg_ptr, ptr0, len0, ptr1, len1);
830
- }
831
- clearUserProperties() {
832
- wasm.wasmconnectoptions_clearUserProperties(this.__wbg_ptr);
860
+ get keepAlive() {
861
+ const ret = wasm.wasmconnectoptions_keepAlive(this.__wbg_ptr);
862
+ return ret;
833
863
  }
834
864
  }
835
865
  if (Symbol.dispose) WasmConnectOptions.prototype[Symbol.dispose] = WasmConnectOptions.prototype.free;
836
866
 
837
- export class WasmMqttClient {
867
+ export class WasmMessageProperties {
868
+ static __wrap(ptr) {
869
+ ptr = ptr >>> 0;
870
+ const obj = Object.create(WasmMessageProperties.prototype);
871
+ obj.__wbg_ptr = ptr;
872
+ WasmMessagePropertiesFinalization.register(obj, obj.__wbg_ptr, obj);
873
+ return obj;
874
+ }
838
875
  __destroy_into_raw() {
839
876
  const ptr = this.__wbg_ptr;
840
877
  this.__wbg_ptr = 0;
841
- WasmMqttClientFinalization.unregister(this);
878
+ WasmMessagePropertiesFinalization.unregister(this);
842
879
  return ptr;
843
880
  }
844
881
  free() {
845
882
  const ptr = this.__destroy_into_raw();
846
- wasm.__wbg_wasmmqttclient_free(ptr, 0);
883
+ wasm.__wbg_wasmmessageproperties_free(ptr, 0);
847
884
  }
848
885
  /**
849
- * @param {string} client_id
886
+ * @returns {string | undefined}
850
887
  */
851
- constructor(client_id) {
852
- const ptr0 = passStringToWasm0(client_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
853
- const len0 = WASM_VECTOR_LEN;
854
- const ret = wasm.wasmmqttclient_new(ptr0, len0);
855
- this.__wbg_ptr = ret >>> 0;
856
- WasmMqttClientFinalization.register(this, this.__wbg_ptr, this);
857
- return this;
888
+ get contentType() {
889
+ const ret = wasm.wasmmessageproperties_contentType(this.__wbg_ptr);
890
+ let v1;
891
+ if (ret[0] !== 0) {
892
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
893
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
894
+ }
895
+ return v1;
858
896
  }
859
897
  /**
860
- * @param {string} url
861
- * @returns {Promise<void>}
898
+ * @returns {string | undefined}
862
899
  */
863
- connect(url) {
864
- const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
865
- const len0 = WASM_VECTOR_LEN;
866
- const ret = wasm.wasmmqttclient_connect(this.__wbg_ptr, ptr0, len0);
867
- return ret;
900
+ get responseTopic() {
901
+ const ret = wasm.wasmmessageproperties_responseTopic(this.__wbg_ptr);
902
+ let v1;
903
+ if (ret[0] !== 0) {
904
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
905
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
906
+ }
907
+ return v1;
868
908
  }
869
909
  /**
870
- * @param {string} url
871
- * @param {WasmConnectOptions} config
872
- * @returns {Promise<void>}
910
+ * @returns {Uint8Array | undefined}
873
911
  */
874
- connect_with_options(url, config) {
875
- const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
876
- const len0 = WASM_VECTOR_LEN;
877
- _assertClass(config, WasmConnectOptions);
878
- const ret = wasm.wasmmqttclient_connect_with_options(this.__wbg_ptr, ptr0, len0, config.__wbg_ptr);
879
- return ret;
912
+ get correlationData() {
913
+ const ret = wasm.wasmmessageproperties_correlationData(this.__wbg_ptr);
914
+ let v1;
915
+ if (ret[0] !== 0) {
916
+ v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
917
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
918
+ }
919
+ return v1;
880
920
  }
881
921
  /**
882
- * @param {MessagePort} port
883
- * @returns {Promise<void>}
922
+ * @returns {Array<any>}
884
923
  */
885
- connect_message_port(port) {
886
- const ret = wasm.wasmmqttclient_connect_message_port(this.__wbg_ptr, port);
924
+ getUserProperties() {
925
+ const ret = wasm.wasmmessageproperties_getUserProperties(this.__wbg_ptr);
887
926
  return ret;
888
927
  }
889
928
  /**
890
- * @param {MessagePort} port
891
- * @param {WasmConnectOptions} config
892
- * @returns {Promise<void>}
929
+ * @returns {number | undefined}
893
930
  */
894
- connect_message_port_with_options(port, config) {
895
- _assertClass(config, WasmConnectOptions);
896
- const ret = wasm.wasmmqttclient_connect_message_port_with_options(this.__wbg_ptr, port, config.__wbg_ptr);
897
- return ret;
931
+ get messageExpiryInterval() {
932
+ const ret = wasm.wasmconnectoptions_sessionExpiryInterval(this.__wbg_ptr);
933
+ return ret === 0x100000001 ? undefined : ret;
898
934
  }
899
935
  /**
900
- * @param {string} channel_name
901
- * @returns {Promise<void>}
936
+ * @returns {boolean | undefined}
902
937
  */
903
- connect_broadcast_channel(channel_name) {
904
- const ptr0 = passStringToWasm0(channel_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
905
- const len0 = WASM_VECTOR_LEN;
906
- const ret = wasm.wasmmqttclient_connect_broadcast_channel(this.__wbg_ptr, ptr0, len0);
907
- return ret;
938
+ get payloadFormatIndicator() {
939
+ const ret = wasm.wasmmessageproperties_payloadFormatIndicator(this.__wbg_ptr);
940
+ return ret === 0xFFFFFF ? undefined : ret !== 0;
941
+ }
942
+ /**
943
+ * @returns {Uint32Array}
944
+ */
945
+ get subscriptionIdentifiers() {
946
+ const ret = wasm.wasmmessageproperties_subscriptionIdentifiers(this.__wbg_ptr);
947
+ var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
948
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
949
+ return v1;
950
+ }
951
+ }
952
+ if (Symbol.dispose) WasmMessageProperties.prototype[Symbol.dispose] = WasmMessageProperties.prototype.free;
953
+
954
+ export class WasmMqttClient {
955
+ __destroy_into_raw() {
956
+ const ptr = this.__wbg_ptr;
957
+ this.__wbg_ptr = 0;
958
+ WasmMqttClientFinalization.unregister(this);
959
+ return ptr;
960
+ }
961
+ free() {
962
+ const ptr = this.__destroy_into_raw();
963
+ wasm.__wbg_wasmmqttclient_free(ptr, 0);
908
964
  }
909
965
  /**
910
- * @param {string} topic
911
- * @param {Uint8Array} payload
912
966
  * @returns {Promise<void>}
913
967
  */
914
- publish(topic, payload) {
915
- const ptr0 = passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
916
- const len0 = WASM_VECTOR_LEN;
917
- const ptr1 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
918
- const len1 = WASM_VECTOR_LEN;
919
- const ret = wasm.wasmmqttclient_publish(this.__wbg_ptr, ptr0, len0, ptr1, len1);
968
+ disconnect() {
969
+ const ret = wasm.wasmmqttclient_disconnect(this.__wbg_ptr);
920
970
  return ret;
921
971
  }
972
+ /**
973
+ * @param {Function} callback
974
+ */
975
+ on_connect(callback) {
976
+ wasm.wasmmqttclient_on_connect(this.__wbg_ptr, callback);
977
+ }
922
978
  /**
923
979
  * @param {string} topic
924
- * @param {Uint8Array} payload
925
- * @param {WasmPublishOptions} options
926
- * @returns {Promise<void>}
980
+ * @returns {Promise<number>}
927
981
  */
928
- publish_with_options(topic, payload, options) {
982
+ unsubscribe(topic) {
929
983
  const ptr0 = passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
930
984
  const len0 = WASM_VECTOR_LEN;
931
- const ptr1 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
932
- const len1 = WASM_VECTOR_LEN;
933
- _assertClass(options, WasmPublishOptions);
934
- const ret = wasm.wasmmqttclient_publish_with_options(this.__wbg_ptr, ptr0, len0, ptr1, len1, options.__wbg_ptr);
985
+ const ret = wasm.wasmmqttclient_unsubscribe(this.__wbg_ptr, ptr0, len0);
935
986
  return ret;
936
987
  }
988
+ /**
989
+ * @returns {boolean}
990
+ */
991
+ is_connected() {
992
+ const ret = wasm.wasmmqttclient_is_connected(this.__wbg_ptr);
993
+ return ret !== 0;
994
+ }
937
995
  /**
938
996
  * @param {string} topic
939
997
  * @param {Uint8Array} payload
@@ -962,14 +1020,61 @@ export class WasmMqttClient {
962
1020
  const ret = wasm.wasmmqttclient_publish_qos2(this.__wbg_ptr, ptr0, len0, ptr1, len1, callback);
963
1021
  return ret;
964
1022
  }
1023
+ /**
1024
+ * @param {Uint8Array} auth_data
1025
+ * @returns {Promise<void>}
1026
+ */
1027
+ respond_auth(auth_data) {
1028
+ const ptr0 = passArray8ToWasm0(auth_data, wasm.__wbindgen_malloc);
1029
+ const len0 = WASM_VECTOR_LEN;
1030
+ const ret = wasm.wasmmqttclient_respond_auth(this.__wbg_ptr, ptr0, len0);
1031
+ return ret;
1032
+ }
1033
+ /**
1034
+ * @param {Function} callback
1035
+ */
1036
+ on_disconnect(callback) {
1037
+ wasm.wasmmqttclient_on_disconnect(this.__wbg_ptr, callback);
1038
+ }
1039
+ /**
1040
+ * @param {Function} callback
1041
+ */
1042
+ on_auth_challenge(callback) {
1043
+ wasm.wasmmqttclient_on_auth_challenge(this.__wbg_ptr, callback);
1044
+ }
1045
+ /**
1046
+ * @param {MessagePort} port
1047
+ * @returns {Promise<void>}
1048
+ */
1049
+ connect_message_port(port) {
1050
+ const ret = wasm.wasmmqttclient_connect_message_port(this.__wbg_ptr, port);
1051
+ return ret;
1052
+ }
1053
+ /**
1054
+ * @param {string} url
1055
+ * @param {WasmConnectOptions} config
1056
+ * @returns {Promise<void>}
1057
+ */
1058
+ connect_with_options(url, config) {
1059
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1060
+ const len0 = WASM_VECTOR_LEN;
1061
+ _assertClass(config, WasmConnectOptions);
1062
+ const ret = wasm.wasmmqttclient_connect_with_options(this.__wbg_ptr, ptr0, len0, config.__wbg_ptr);
1063
+ return ret;
1064
+ }
965
1065
  /**
966
1066
  * @param {string} topic
967
- * @returns {Promise<number>}
1067
+ * @param {Uint8Array} payload
1068
+ * @param {WasmPublishOptions} options
1069
+ * @returns {Promise<void>}
968
1070
  */
969
- subscribe(topic) {
1071
+ publish_with_options(topic, payload, options) {
970
1072
  const ptr0 = passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
971
1073
  const len0 = WASM_VECTOR_LEN;
972
- const ret = wasm.wasmmqttclient_subscribe(this.__wbg_ptr, ptr0, len0);
1074
+ const ptr1 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
1075
+ const len1 = WASM_VECTOR_LEN;
1076
+ _assertClass(options, WasmPublishOptions);
1077
+ const ret = wasm.wasmmqttclient_publish_with_options(this.__wbg_ptr, ptr0, len0, ptr1, len1, options.__wbg_ptr);
973
1078
  return ret;
974
1079
  }
975
1080
  /**
@@ -997,40 +1102,58 @@ export class WasmMqttClient {
997
1102
  return ret;
998
1103
  }
999
1104
  /**
1000
- * @param {string} topic
1001
- * @returns {Promise<number>}
1105
+ * @param {string} channel_name
1106
+ * @returns {Promise<void>}
1002
1107
  */
1003
- unsubscribe(topic) {
1004
- const ptr0 = passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1108
+ connect_broadcast_channel(channel_name) {
1109
+ const ptr0 = passStringToWasm0(channel_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1005
1110
  const len0 = WASM_VECTOR_LEN;
1006
- const ret = wasm.wasmmqttclient_unsubscribe(this.__wbg_ptr, ptr0, len0);
1111
+ const ret = wasm.wasmmqttclient_connect_broadcast_channel(this.__wbg_ptr, ptr0, len0);
1007
1112
  return ret;
1008
1113
  }
1009
1114
  /**
1115
+ * @param {MessagePort} port
1116
+ * @param {WasmConnectOptions} config
1010
1117
  * @returns {Promise<void>}
1011
1118
  */
1012
- disconnect() {
1013
- const ret = wasm.wasmmqttclient_disconnect(this.__wbg_ptr);
1119
+ connect_message_port_with_options(port, config) {
1120
+ _assertClass(config, WasmConnectOptions);
1121
+ const ret = wasm.wasmmqttclient_connect_message_port_with_options(this.__wbg_ptr, port, config.__wbg_ptr);
1014
1122
  return ret;
1015
1123
  }
1016
1124
  /**
1017
- * @returns {boolean}
1125
+ * @param {string} client_id
1018
1126
  */
1019
- is_connected() {
1020
- const ret = wasm.wasmmqttclient_is_connected(this.__wbg_ptr);
1021
- return ret !== 0;
1127
+ constructor(client_id) {
1128
+ const ptr0 = passStringToWasm0(client_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1129
+ const len0 = WASM_VECTOR_LEN;
1130
+ const ret = wasm.wasmmqttclient_new(ptr0, len0);
1131
+ this.__wbg_ptr = ret >>> 0;
1132
+ WasmMqttClientFinalization.register(this, this.__wbg_ptr, this);
1133
+ return this;
1022
1134
  }
1023
1135
  /**
1024
- * @param {Function} callback
1136
+ * @param {string} url
1137
+ * @returns {Promise<void>}
1025
1138
  */
1026
- on_connect(callback) {
1027
- wasm.wasmmqttclient_on_connect(this.__wbg_ptr, callback);
1139
+ connect(url) {
1140
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1141
+ const len0 = WASM_VECTOR_LEN;
1142
+ const ret = wasm.wasmmqttclient_connect(this.__wbg_ptr, ptr0, len0);
1143
+ return ret;
1028
1144
  }
1029
1145
  /**
1030
- * @param {Function} callback
1146
+ * @param {string} topic
1147
+ * @param {Uint8Array} payload
1148
+ * @returns {Promise<void>}
1031
1149
  */
1032
- on_disconnect(callback) {
1033
- wasm.wasmmqttclient_on_disconnect(this.__wbg_ptr, callback);
1150
+ publish(topic, payload) {
1151
+ const ptr0 = passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1152
+ const len0 = WASM_VECTOR_LEN;
1153
+ const ptr1 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
1154
+ const len1 = WASM_VECTOR_LEN;
1155
+ const ret = wasm.wasmmqttclient_publish(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1156
+ return ret;
1034
1157
  }
1035
1158
  /**
1036
1159
  * @param {Function} callback
@@ -1039,19 +1162,13 @@ export class WasmMqttClient {
1039
1162
  wasm.wasmmqttclient_on_error(this.__wbg_ptr, callback);
1040
1163
  }
1041
1164
  /**
1042
- * @param {Function} callback
1043
- */
1044
- on_auth_challenge(callback) {
1045
- wasm.wasmmqttclient_on_auth_challenge(this.__wbg_ptr, callback);
1046
- }
1047
- /**
1048
- * @param {Uint8Array} auth_data
1049
- * @returns {Promise<void>}
1165
+ * @param {string} topic
1166
+ * @returns {Promise<number>}
1050
1167
  */
1051
- respond_auth(auth_data) {
1052
- const ptr0 = passArray8ToWasm0(auth_data, wasm.__wbindgen_malloc);
1168
+ subscribe(topic) {
1169
+ const ptr0 = passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1053
1170
  const len0 = WASM_VECTOR_LEN;
1054
- const ret = wasm.wasmmqttclient_respond_auth(this.__wbg_ptr, ptr0, len0);
1171
+ const ret = wasm.wasmmqttclient_subscribe(this.__wbg_ptr, ptr0, len0);
1055
1172
  return ret;
1056
1173
  }
1057
1174
  }
@@ -1068,64 +1185,12 @@ export class WasmPublishOptions {
1068
1185
  const ptr = this.__destroy_into_raw();
1069
1186
  wasm.__wbg_wasmpublishoptions_free(ptr, 0);
1070
1187
  }
1071
- constructor() {
1072
- const ret = wasm.wasmpublishoptions_new();
1073
- this.__wbg_ptr = ret >>> 0;
1074
- WasmPublishOptionsFinalization.register(this, this.__wbg_ptr, this);
1075
- return this;
1076
- }
1077
- /**
1078
- * @returns {number}
1079
- */
1080
- get qos() {
1081
- const ret = wasm.wasmpublishoptions_qos(this.__wbg_ptr);
1082
- return ret;
1083
- }
1084
- /**
1085
- * @param {number} value
1086
- */
1087
- set qos(value) {
1088
- wasm.wasmpublishoptions_set_qos(this.__wbg_ptr, value);
1089
- }
1090
- /**
1091
- * @returns {boolean}
1092
- */
1093
- get retain() {
1094
- const ret = wasm.wasmpublishoptions_retain(this.__wbg_ptr);
1095
- return ret !== 0;
1096
- }
1097
1188
  /**
1098
1189
  * @param {boolean} value
1099
1190
  */
1100
1191
  set retain(value) {
1101
1192
  wasm.wasmpublishoptions_set_retain(this.__wbg_ptr, value);
1102
1193
  }
1103
- /**
1104
- * @returns {boolean | undefined}
1105
- */
1106
- get payloadFormatIndicator() {
1107
- const ret = wasm.wasmpublishoptions_payloadFormatIndicator(this.__wbg_ptr);
1108
- return ret === 0xFFFFFF ? undefined : ret !== 0;
1109
- }
1110
- /**
1111
- * @param {boolean | null} [value]
1112
- */
1113
- set payloadFormatIndicator(value) {
1114
- wasm.wasmpublishoptions_set_payloadFormatIndicator(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
1115
- }
1116
- /**
1117
- * @returns {number | undefined}
1118
- */
1119
- get messageExpiryInterval() {
1120
- const ret = wasm.wasmconnectoptions_sessionExpiryInterval(this.__wbg_ptr);
1121
- return ret === 0x100000001 ? undefined : ret;
1122
- }
1123
- /**
1124
- * @param {number | null} [value]
1125
- */
1126
- set messageExpiryInterval(value) {
1127
- wasm.wasmbrokerconfig_set_server_keep_alive_secs(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0);
1128
- }
1129
1194
  /**
1130
1195
  * @returns {number | undefined}
1131
1196
  */
@@ -1134,10 +1199,16 @@ export class WasmPublishOptions {
1134
1199
  return ret === 0xFFFFFF ? undefined : ret;
1135
1200
  }
1136
1201
  /**
1137
- * @param {number | null} [value]
1202
+ * @returns {string | undefined}
1138
1203
  */
1139
- set topicAlias(value) {
1140
- wasm.wasmpublishoptions_set_topicAlias(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value);
1204
+ get contentType() {
1205
+ const ret = wasm.wasmpublishoptions_contentType(this.__wbg_ptr);
1206
+ let v1;
1207
+ if (ret[0] !== 0) {
1208
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1209
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1210
+ }
1211
+ return v1;
1141
1212
  }
1142
1213
  /**
1143
1214
  * @returns {string | undefined}
@@ -1151,6 +1222,31 @@ export class WasmPublishOptions {
1151
1222
  }
1152
1223
  return v1;
1153
1224
  }
1225
+ /**
1226
+ * @param {number | null} [value]
1227
+ */
1228
+ set topicAlias(value) {
1229
+ wasm.wasmpublishoptions_set_topicAlias(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value);
1230
+ }
1231
+ /**
1232
+ * @param {string} key
1233
+ * @param {string} value
1234
+ */
1235
+ addUserProperty(key, value) {
1236
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1237
+ const len0 = WASM_VECTOR_LEN;
1238
+ const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1239
+ const len1 = WASM_VECTOR_LEN;
1240
+ wasm.wasmpublishoptions_addUserProperty(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1241
+ }
1242
+ /**
1243
+ * @param {string | null} [value]
1244
+ */
1245
+ set contentType(value) {
1246
+ var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1247
+ var len0 = WASM_VECTOR_LEN;
1248
+ wasm.wasmpublishoptions_set_contentType(this.__wbg_ptr, ptr0, len0);
1249
+ }
1154
1250
  /**
1155
1251
  * @param {string | null} [value]
1156
1252
  */
@@ -1159,6 +1255,9 @@ export class WasmPublishOptions {
1159
1255
  var len0 = WASM_VECTOR_LEN;
1160
1256
  wasm.wasmpublishoptions_set_responseTopic(this.__wbg_ptr, ptr0, len0);
1161
1257
  }
1258
+ clearUserProperties() {
1259
+ wasm.wasmpublishoptions_clearUserProperties(this.__wbg_ptr);
1260
+ }
1162
1261
  /**
1163
1262
  * @param {Uint8Array} value
1164
1263
  */
@@ -1168,78 +1267,70 @@ export class WasmPublishOptions {
1168
1267
  wasm.wasmpublishoptions_set_correlationData(this.__wbg_ptr, ptr0, len0);
1169
1268
  }
1170
1269
  /**
1171
- * @returns {string | undefined}
1270
+ * @returns {number | undefined}
1172
1271
  */
1173
- get contentType() {
1174
- const ret = wasm.wasmpublishoptions_contentType(this.__wbg_ptr);
1175
- let v1;
1176
- if (ret[0] !== 0) {
1177
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1178
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1179
- }
1180
- return v1;
1272
+ get messageExpiryInterval() {
1273
+ const ret = wasm.wasmconnectoptions_sessionExpiryInterval(this.__wbg_ptr);
1274
+ return ret === 0x100000001 ? undefined : ret;
1181
1275
  }
1182
1276
  /**
1183
- * @param {string | null} [value]
1277
+ * @returns {boolean | undefined}
1184
1278
  */
1185
- set contentType(value) {
1186
- var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1187
- var len0 = WASM_VECTOR_LEN;
1188
- wasm.wasmpublishoptions_set_contentType(this.__wbg_ptr, ptr0, len0);
1279
+ get payloadFormatIndicator() {
1280
+ const ret = wasm.wasmpublishoptions_payloadFormatIndicator(this.__wbg_ptr);
1281
+ return ret === 0xFFFFFF ? undefined : ret !== 0;
1189
1282
  }
1190
1283
  /**
1191
- * @param {string} key
1192
- * @param {string} value
1284
+ * @param {number | null} [value]
1193
1285
  */
1194
- addUserProperty(key, value) {
1195
- const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1196
- const len0 = WASM_VECTOR_LEN;
1197
- const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1198
- const len1 = WASM_VECTOR_LEN;
1199
- wasm.wasmpublishoptions_addUserProperty(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1200
- }
1201
- clearUserProperties() {
1202
- wasm.wasmpublishoptions_clearUserProperties(this.__wbg_ptr);
1203
- }
1204
- }
1205
- if (Symbol.dispose) WasmPublishOptions.prototype[Symbol.dispose] = WasmPublishOptions.prototype.free;
1206
-
1207
- export class WasmSubscribeOptions {
1208
- __destroy_into_raw() {
1209
- const ptr = this.__wbg_ptr;
1210
- this.__wbg_ptr = 0;
1211
- WasmSubscribeOptionsFinalization.unregister(this);
1212
- return ptr;
1286
+ set messageExpiryInterval(value) {
1287
+ wasm.wasmbrokerconfig_set_server_keep_alive_secs(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0);
1213
1288
  }
1214
- free() {
1215
- const ptr = this.__destroy_into_raw();
1216
- wasm.__wbg_wasmsubscribeoptions_free(ptr, 0);
1289
+ /**
1290
+ * @param {boolean | null} [value]
1291
+ */
1292
+ set payloadFormatIndicator(value) {
1293
+ wasm.wasmpublishoptions_set_payloadFormatIndicator(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
1217
1294
  }
1218
1295
  constructor() {
1219
- const ret = wasm.wasmsubscribeoptions_new();
1296
+ const ret = wasm.wasmpublishoptions_new();
1220
1297
  this.__wbg_ptr = ret >>> 0;
1221
- WasmSubscribeOptionsFinalization.register(this, this.__wbg_ptr, this);
1298
+ WasmPublishOptionsFinalization.register(this, this.__wbg_ptr, this);
1222
1299
  return this;
1223
1300
  }
1224
1301
  /**
1225
1302
  * @returns {number}
1226
1303
  */
1227
1304
  get qos() {
1228
- const ret = wasm.wasmsubscribeoptions_qos(this.__wbg_ptr);
1305
+ const ret = wasm.wasmpublishoptions_qos(this.__wbg_ptr);
1229
1306
  return ret;
1230
1307
  }
1231
1308
  /**
1232
- * @param {number} value
1309
+ * @returns {boolean}
1233
1310
  */
1234
- set qos(value) {
1235
- wasm.wasmsubscribeoptions_set_qos(this.__wbg_ptr, value);
1311
+ get retain() {
1312
+ const ret = wasm.wasmpublishoptions_retain(this.__wbg_ptr);
1313
+ return ret !== 0;
1236
1314
  }
1237
1315
  /**
1238
- * @returns {boolean}
1316
+ * @param {number} value
1239
1317
  */
1240
- get noLocal() {
1241
- const ret = wasm.wasmsubscribeoptions_noLocal(this.__wbg_ptr);
1242
- return ret !== 0;
1318
+ set qos(value) {
1319
+ wasm.wasmpublishoptions_set_qos(this.__wbg_ptr, value);
1320
+ }
1321
+ }
1322
+ if (Symbol.dispose) WasmPublishOptions.prototype[Symbol.dispose] = WasmPublishOptions.prototype.free;
1323
+
1324
+ export class WasmSubscribeOptions {
1325
+ __destroy_into_raw() {
1326
+ const ptr = this.__wbg_ptr;
1327
+ this.__wbg_ptr = 0;
1328
+ WasmSubscribeOptionsFinalization.unregister(this);
1329
+ return ptr;
1330
+ }
1331
+ free() {
1332
+ const ptr = this.__destroy_into_raw();
1333
+ wasm.__wbg_wasmsubscribeoptions_free(ptr, 0);
1243
1334
  }
1244
1335
  /**
1245
1336
  * @param {boolean} value
@@ -1247,19 +1338,6 @@ export class WasmSubscribeOptions {
1247
1338
  set noLocal(value) {
1248
1339
  wasm.wasmsubscribeoptions_set_noLocal(this.__wbg_ptr, value);
1249
1340
  }
1250
- /**
1251
- * @returns {boolean}
1252
- */
1253
- get retainAsPublished() {
1254
- const ret = wasm.wasmsubscribeoptions_retainAsPublished(this.__wbg_ptr);
1255
- return ret !== 0;
1256
- }
1257
- /**
1258
- * @param {boolean} value
1259
- */
1260
- set retainAsPublished(value) {
1261
- wasm.wasmsubscribeoptions_set_retainAsPublished(this.__wbg_ptr, value);
1262
- }
1263
1341
  /**
1264
1342
  * @returns {number}
1265
1343
  */
@@ -1267,12 +1345,25 @@ export class WasmSubscribeOptions {
1267
1345
  const ret = wasm.wasmsubscribeoptions_retainHandling(this.__wbg_ptr);
1268
1346
  return ret;
1269
1347
  }
1348
+ /**
1349
+ * @returns {boolean}
1350
+ */
1351
+ get retainAsPublished() {
1352
+ const ret = wasm.wasmsubscribeoptions_retainAsPublished(this.__wbg_ptr);
1353
+ return ret !== 0;
1354
+ }
1270
1355
  /**
1271
1356
  * @param {number} value
1272
1357
  */
1273
1358
  set retainHandling(value) {
1274
1359
  wasm.wasmsubscribeoptions_set_retainHandling(this.__wbg_ptr, value);
1275
1360
  }
1361
+ /**
1362
+ * @param {boolean} value
1363
+ */
1364
+ set retainAsPublished(value) {
1365
+ wasm.wasmsubscribeoptions_set_retainAsPublished(this.__wbg_ptr, value);
1366
+ }
1276
1367
  /**
1277
1368
  * @returns {number | undefined}
1278
1369
  */
@@ -1286,6 +1377,32 @@ export class WasmSubscribeOptions {
1286
1377
  set subscriptionIdentifier(value) {
1287
1378
  wasm.wasmbrokerconfig_set_server_keep_alive_secs(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0);
1288
1379
  }
1380
+ constructor() {
1381
+ const ret = wasm.wasmsubscribeoptions_new();
1382
+ this.__wbg_ptr = ret >>> 0;
1383
+ WasmSubscribeOptionsFinalization.register(this, this.__wbg_ptr, this);
1384
+ return this;
1385
+ }
1386
+ /**
1387
+ * @returns {number}
1388
+ */
1389
+ get qos() {
1390
+ const ret = wasm.wasmsubscribeoptions_qos(this.__wbg_ptr);
1391
+ return ret;
1392
+ }
1393
+ /**
1394
+ * @returns {boolean}
1395
+ */
1396
+ get noLocal() {
1397
+ const ret = wasm.wasmsubscribeoptions_noLocal(this.__wbg_ptr);
1398
+ return ret !== 0;
1399
+ }
1400
+ /**
1401
+ * @param {number} value
1402
+ */
1403
+ set qos(value) {
1404
+ wasm.wasmsubscribeoptions_set_qos(this.__wbg_ptr, value);
1405
+ }
1289
1406
  }
1290
1407
  if (Symbol.dispose) WasmSubscribeOptions.prototype[Symbol.dispose] = WasmSubscribeOptions.prototype.free;
1291
1408
 
@@ -1300,6 +1417,22 @@ export class WasmTopicMapping {
1300
1417
  const ptr = this.__destroy_into_raw();
1301
1418
  wasm.__wbg_wasmtopicmapping_free(ptr, 0);
1302
1419
  }
1420
+ /**
1421
+ * @param {string | null} [prefix]
1422
+ */
1423
+ set local_prefix(prefix) {
1424
+ var ptr0 = isLikeNone(prefix) ? 0 : passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1425
+ var len0 = WASM_VECTOR_LEN;
1426
+ wasm.wasmtopicmapping_set_local_prefix(this.__wbg_ptr, ptr0, len0);
1427
+ }
1428
+ /**
1429
+ * @param {string | null} [prefix]
1430
+ */
1431
+ set remote_prefix(prefix) {
1432
+ var ptr0 = isLikeNone(prefix) ? 0 : passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1433
+ var len0 = WASM_VECTOR_LEN;
1434
+ wasm.wasmtopicmapping_set_remote_prefix(this.__wbg_ptr, ptr0, len0);
1435
+ }
1303
1436
  /**
1304
1437
  * @param {string} pattern
1305
1438
  * @param {WasmBridgeDirection} direction
@@ -1318,22 +1451,6 @@ export class WasmTopicMapping {
1318
1451
  set qos(qos) {
1319
1452
  wasm.wasmtopicmapping_set_qos(this.__wbg_ptr, qos);
1320
1453
  }
1321
- /**
1322
- * @param {string | null} [prefix]
1323
- */
1324
- set local_prefix(prefix) {
1325
- var ptr0 = isLikeNone(prefix) ? 0 : passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1326
- var len0 = WASM_VECTOR_LEN;
1327
- wasm.wasmtopicmapping_set_local_prefix(this.__wbg_ptr, ptr0, len0);
1328
- }
1329
- /**
1330
- * @param {string | null} [prefix]
1331
- */
1332
- set remote_prefix(prefix) {
1333
- var ptr0 = isLikeNone(prefix) ? 0 : passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1334
- var len0 = WASM_VECTOR_LEN;
1335
- wasm.wasmtopicmapping_set_remote_prefix(this.__wbg_ptr, ptr0, len0);
1336
- }
1337
1454
  }
1338
1455
  if (Symbol.dispose) WasmTopicMapping.prototype[Symbol.dispose] = WasmTopicMapping.prototype.free;
1339
1456
 
@@ -1349,67 +1466,50 @@ export class WasmWillMessage {
1349
1466
  wasm.__wbg_wasmwillmessage_free(ptr, 0);
1350
1467
  }
1351
1468
  /**
1352
- * @param {string} topic
1353
- * @param {Uint8Array} payload
1469
+ * @param {boolean} value
1354
1470
  */
1355
- constructor(topic, payload) {
1356
- const ptr0 = passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1357
- const len0 = WASM_VECTOR_LEN;
1358
- const ptr1 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
1359
- const len1 = WASM_VECTOR_LEN;
1360
- const ret = wasm.wasmwillmessage_new(ptr0, len0, ptr1, len1);
1361
- this.__wbg_ptr = ret >>> 0;
1362
- WasmWillMessageFinalization.register(this, this.__wbg_ptr, this);
1363
- return this;
1471
+ set retain(value) {
1472
+ wasm.wasmwillmessage_set_retain(this.__wbg_ptr, value);
1364
1473
  }
1365
1474
  /**
1366
- * @returns {string}
1475
+ * @returns {string | undefined}
1367
1476
  */
1368
- get topic() {
1369
- let deferred1_0;
1370
- let deferred1_1;
1371
- try {
1372
- const ret = wasm.wasmwillmessage_topic(this.__wbg_ptr);
1373
- deferred1_0 = ret[0];
1374
- deferred1_1 = ret[1];
1375
- return getStringFromWasm0(ret[0], ret[1]);
1376
- } finally {
1377
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1477
+ get contentType() {
1478
+ const ret = wasm.wasmwillmessage_contentType(this.__wbg_ptr);
1479
+ let v1;
1480
+ if (ret[0] !== 0) {
1481
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1482
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1378
1483
  }
1484
+ return v1;
1379
1485
  }
1380
1486
  /**
1381
- * @param {string} value
1382
- */
1383
- set topic(value) {
1384
- const ptr0 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1385
- const len0 = WASM_VECTOR_LEN;
1386
- wasm.wasmwillmessage_set_topic(this.__wbg_ptr, ptr0, len0);
1387
- }
1388
- /**
1389
- * @returns {number}
1390
- */
1391
- get qos() {
1392
- const ret = wasm.wasmwillmessage_qos(this.__wbg_ptr);
1393
- return ret;
1394
- }
1395
- /**
1396
- * @param {number} value
1487
+ * @returns {string | undefined}
1397
1488
  */
1398
- set qos(value) {
1399
- wasm.wasmwillmessage_set_qos(this.__wbg_ptr, value);
1489
+ get responseTopic() {
1490
+ const ret = wasm.wasmwillmessage_responseTopic(this.__wbg_ptr);
1491
+ let v1;
1492
+ if (ret[0] !== 0) {
1493
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1494
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1495
+ }
1496
+ return v1;
1400
1497
  }
1401
1498
  /**
1402
- * @returns {boolean}
1499
+ * @param {string | null} [value]
1403
1500
  */
1404
- get retain() {
1405
- const ret = wasm.wasmwillmessage_retain(this.__wbg_ptr);
1406
- return ret !== 0;
1501
+ set contentType(value) {
1502
+ var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1503
+ var len0 = WASM_VECTOR_LEN;
1504
+ wasm.wasmwillmessage_set_contentType(this.__wbg_ptr, ptr0, len0);
1407
1505
  }
1408
1506
  /**
1409
- * @param {boolean} value
1507
+ * @param {string | null} [value]
1410
1508
  */
1411
- set retain(value) {
1412
- wasm.wasmwillmessage_set_retain(this.__wbg_ptr, value);
1509
+ set responseTopic(value) {
1510
+ var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1511
+ var len0 = WASM_VECTOR_LEN;
1512
+ wasm.wasmwillmessage_set_responseTopic(this.__wbg_ptr, ptr0, len0);
1413
1513
  }
1414
1514
  /**
1415
1515
  * @returns {number | undefined}
@@ -1418,12 +1518,6 @@ export class WasmWillMessage {
1418
1518
  const ret = wasm.wasmconnectoptions_sessionExpiryInterval(this.__wbg_ptr);
1419
1519
  return ret === 0x100000001 ? undefined : ret;
1420
1520
  }
1421
- /**
1422
- * @param {number | null} [value]
1423
- */
1424
- set willDelayInterval(value) {
1425
- wasm.wasmbrokerconfig_set_server_keep_alive_secs(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0);
1426
- }
1427
1521
  /**
1428
1522
  * @returns {number | undefined}
1429
1523
  */
@@ -1431,6 +1525,12 @@ export class WasmWillMessage {
1431
1525
  const ret = wasm.wasmconnectoptions_maximumPacketSize(this.__wbg_ptr);
1432
1526
  return ret === 0x100000001 ? undefined : ret;
1433
1527
  }
1528
+ /**
1529
+ * @param {number | null} [value]
1530
+ */
1531
+ set willDelayInterval(value) {
1532
+ wasm.wasmbrokerconfig_set_server_keep_alive_secs(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0);
1533
+ }
1434
1534
  /**
1435
1535
  * @param {number | null} [value]
1436
1536
  */
@@ -1438,44 +1538,61 @@ export class WasmWillMessage {
1438
1538
  wasm.wasmconnectoptions_set_maximumPacketSize(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0);
1439
1539
  }
1440
1540
  /**
1441
- * @returns {string | undefined}
1541
+ * @param {string} topic
1542
+ * @param {Uint8Array} payload
1442
1543
  */
1443
- get contentType() {
1444
- const ret = wasm.wasmwillmessage_contentType(this.__wbg_ptr);
1445
- let v1;
1446
- if (ret[0] !== 0) {
1447
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1448
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1449
- }
1450
- return v1;
1544
+ constructor(topic, payload) {
1545
+ const ptr0 = passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1546
+ const len0 = WASM_VECTOR_LEN;
1547
+ const ptr1 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
1548
+ const len1 = WASM_VECTOR_LEN;
1549
+ const ret = wasm.wasmwillmessage_new(ptr0, len0, ptr1, len1);
1550
+ this.__wbg_ptr = ret >>> 0;
1551
+ WasmWillMessageFinalization.register(this, this.__wbg_ptr, this);
1552
+ return this;
1451
1553
  }
1452
1554
  /**
1453
- * @param {string | null} [value]
1555
+ * @returns {number}
1454
1556
  */
1455
- set contentType(value) {
1456
- var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1457
- var len0 = WASM_VECTOR_LEN;
1458
- wasm.wasmwillmessage_set_contentType(this.__wbg_ptr, ptr0, len0);
1557
+ get qos() {
1558
+ const ret = wasm.wasmwillmessage_qos(this.__wbg_ptr);
1559
+ return ret;
1459
1560
  }
1460
1561
  /**
1461
- * @returns {string | undefined}
1562
+ * @returns {string}
1462
1563
  */
1463
- get responseTopic() {
1464
- const ret = wasm.wasmwillmessage_responseTopic(this.__wbg_ptr);
1465
- let v1;
1466
- if (ret[0] !== 0) {
1467
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1468
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1564
+ get topic() {
1565
+ let deferred1_0;
1566
+ let deferred1_1;
1567
+ try {
1568
+ const ret = wasm.wasmwillmessage_topic(this.__wbg_ptr);
1569
+ deferred1_0 = ret[0];
1570
+ deferred1_1 = ret[1];
1571
+ return getStringFromWasm0(ret[0], ret[1]);
1572
+ } finally {
1573
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1469
1574
  }
1470
- return v1;
1471
1575
  }
1472
1576
  /**
1473
- * @param {string | null} [value]
1577
+ * @returns {boolean}
1474
1578
  */
1475
- set responseTopic(value) {
1476
- var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1477
- var len0 = WASM_VECTOR_LEN;
1478
- wasm.wasmwillmessage_set_responseTopic(this.__wbg_ptr, ptr0, len0);
1579
+ get retain() {
1580
+ const ret = wasm.wasmwillmessage_retain(this.__wbg_ptr);
1581
+ return ret !== 0;
1582
+ }
1583
+ /**
1584
+ * @param {number} value
1585
+ */
1586
+ set qos(value) {
1587
+ wasm.wasmwillmessage_set_qos(this.__wbg_ptr, value);
1588
+ }
1589
+ /**
1590
+ * @param {string} value
1591
+ */
1592
+ set topic(value) {
1593
+ const ptr0 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1594
+ const len0 = WASM_VECTOR_LEN;
1595
+ wasm.wasmwillmessage_set_topic(this.__wbg_ptr, ptr0, len0);
1479
1596
  }
1480
1597
  }
1481
1598
  if (Symbol.dispose) WasmWillMessage.prototype[Symbol.dispose] = WasmWillMessage.prototype.free;
@@ -1544,6 +1661,10 @@ function __wbg_get_imports() {
1544
1661
  const ret = arg0.call(arg1, arg2);
1545
1662
  return ret;
1546
1663
  }, arguments) };
1664
+ imports.wbg.__wbg_call_78f94eb02ec7f9b2 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1665
+ const ret = arg0.call(arg1, arg2, arg3, arg4);
1666
+ return ret;
1667
+ }, arguments) };
1547
1668
  imports.wbg.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) {
1548
1669
  const ret = arg0.call(arg1);
1549
1670
  return ret;
@@ -1625,10 +1746,6 @@ function __wbg_get_imports() {
1625
1746
  const ret = new Uint8Array(arg0);
1626
1747
  return ret;
1627
1748
  };
1628
- imports.wbg.__wbg_new_7c30d1f874652e62 = function() { return handleError(function (arg0, arg1) {
1629
- const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
1630
- return ret;
1631
- }, arguments) };
1632
1749
  imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
1633
1750
  const ret = new Error();
1634
1751
  return ret;
@@ -1644,7 +1761,7 @@ function __wbg_get_imports() {
1644
1761
  const a = state0.a;
1645
1762
  state0.a = 0;
1646
1763
  try {
1647
- return wasm_bindgen__convert__closures_____invoke__h22971f3c49e1e8f1(a, state0.b, arg0, arg1);
1764
+ return wasm_bindgen__convert__closures_____invoke__h2d9e646cfc355363(a, state0.b, arg0, arg1);
1648
1765
  } finally {
1649
1766
  state0.a = a;
1650
1767
  }
@@ -1663,6 +1780,10 @@ function __wbg_get_imports() {
1663
1780
  const ret = new Function(getStringFromWasm0(arg0, arg1));
1664
1781
  return ret;
1665
1782
  };
1783
+ imports.wbg.__wbg_new_with_str_78eef2ccb7920c9a = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1784
+ const ret = new WebSocket(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
1785
+ return ret;
1786
+ }, arguments) };
1666
1787
  imports.wbg.__wbg_now_2c95c9de01293173 = function(arg0) {
1667
1788
  const ret = arg0.now();
1668
1789
  return ret;
@@ -1776,29 +1897,28 @@ function __wbg_get_imports() {
1776
1897
  imports.wbg.__wbg_warn_6e567d0d926ff881 = function(arg0) {
1777
1898
  console.warn(arg0);
1778
1899
  };
1900
+ imports.wbg.__wbg_wasmmessageproperties_new = function(arg0) {
1901
+ const ret = WasmMessageProperties.__wrap(arg0);
1902
+ return ret;
1903
+ };
1779
1904
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1780
1905
  // Cast intrinsic for `Ref(String) -> Externref`.
1781
1906
  const ret = getStringFromWasm0(arg0, arg1);
1782
1907
  return ret;
1783
1908
  };
1784
- imports.wbg.__wbindgen_cast_7c91697a8c7f6a55 = function(arg0, arg1) {
1785
- // Cast intrinsic for `Closure(Closure { dtor_idx: 268, function: Function { arguments: [Externref], shim_idx: 269, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1786
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h60ca8c1f3f61ef16, wasm_bindgen__convert__closures_____invoke__ha8b0b9fe7fac12a4);
1909
+ imports.wbg.__wbindgen_cast_3b08804410be858c = function(arg0, arg1) {
1910
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 13, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 14, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1911
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h49e187871d56b618, wasm_bindgen__convert__closures_____invoke__h0669e1264d41ddde);
1787
1912
  return ret;
1788
1913
  };
1789
- imports.wbg.__wbindgen_cast_841ad4dc62ebec90 = function(arg0, arg1) {
1790
- // Cast intrinsic for `Closure(Closure { dtor_idx: 2, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 3, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1791
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h37234bac070c7b88, wasm_bindgen__convert__closures_____invoke__h28af81100ba72912);
1914
+ imports.wbg.__wbindgen_cast_4de2fdf31531b840 = function(arg0, arg1) {
1915
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 13, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 14, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1916
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h49e187871d56b618, wasm_bindgen__convert__closures_____invoke__h0669e1264d41ddde);
1792
1917
  return ret;
1793
1918
  };
1794
- imports.wbg.__wbindgen_cast_9a4d11962b71bb1d = function(arg0, arg1) {
1795
- // Cast intrinsic for `Closure(Closure { dtor_idx: 2, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 3, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1796
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h37234bac070c7b88, wasm_bindgen__convert__closures_____invoke__h28af81100ba72912);
1797
- return ret;
1798
- };
1799
- imports.wbg.__wbindgen_cast_b03fa23b55c812ea = function(arg0, arg1) {
1800
- // Cast intrinsic for `Closure(Closure { dtor_idx: 257, function: Function { arguments: [], shim_idx: 258, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1801
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h41d50b86eff9c0fb, wasm_bindgen__convert__closures_____invoke__hf8b807ed3211f368);
1919
+ imports.wbg.__wbindgen_cast_6c5b6c989d728adc = function(arg0, arg1) {
1920
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 270, function: Function { arguments: [Externref], shim_idx: 271, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1921
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hebcaa2b719f28442, wasm_bindgen__convert__closures_____invoke__h12ffa24d99e28e58);
1802
1922
  return ret;
1803
1923
  };
1804
1924
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
@@ -1806,9 +1926,14 @@ function __wbg_get_imports() {
1806
1926
  const ret = arg0;
1807
1927
  return ret;
1808
1928
  };
1809
- imports.wbg.__wbindgen_cast_eee2c0f90882ae61 = function(arg0, arg1) {
1810
- // Cast intrinsic for `Closure(Closure { dtor_idx: 2, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 3, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1811
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h37234bac070c7b88, wasm_bindgen__convert__closures_____invoke__h28af81100ba72912);
1929
+ imports.wbg.__wbindgen_cast_e7cbf2f9a6ee5b78 = function(arg0, arg1) {
1930
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 259, function: Function { arguments: [], shim_idx: 260, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1931
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h010cf814693e663b, wasm_bindgen__convert__closures_____invoke__he72b1024119f349e);
1932
+ return ret;
1933
+ };
1934
+ imports.wbg.__wbindgen_cast_ff1a1195be1e8b11 = function(arg0, arg1) {
1935
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 13, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 14, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1936
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h49e187871d56b618, wasm_bindgen__convert__closures_____invoke__h0669e1264d41ddde);
1812
1937
  return ret;
1813
1938
  };
1814
1939
  imports.wbg.__wbindgen_init_externref_table = function() {
@@ -1828,6 +1953,7 @@ function __wbg_finalize_init(instance, module) {
1828
1953
  wasm = instance.exports;
1829
1954
  __wbg_init.__wbindgen_wasm_module = module;
1830
1955
  cachedDataViewMemory0 = null;
1956
+ cachedUint32ArrayMemory0 = null;
1831
1957
  cachedUint8ArrayMemory0 = null;
1832
1958
 
1833
1959