mqtt5-wasm 0.7.2 → 0.8.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.d.ts +61 -7
- package/mqtt5_wasm.js +224 -20
- package/mqtt5_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/mqtt5_wasm.d.ts
CHANGED
|
@@ -70,10 +70,14 @@ export class WasmBroker {
|
|
|
70
70
|
*/
|
|
71
71
|
remove_bridge(name: string): Promise<void>;
|
|
72
72
|
unassign_role(username: string, role_name: string): Promise<boolean>;
|
|
73
|
+
update_config(new_config: WasmBrokerConfig): void;
|
|
73
74
|
acl_rule_count(): Promise<number>;
|
|
74
75
|
get_user_roles(username: string): Promise<string[]>;
|
|
75
76
|
clear_acl_rules(): Promise<void>;
|
|
77
|
+
get_config_hash(): number;
|
|
78
|
+
get_max_clients(): number;
|
|
76
79
|
stop_sys_topics(): void;
|
|
80
|
+
on_config_change(callback: Function): void;
|
|
77
81
|
start_sys_topics(): void;
|
|
78
82
|
stop_all_bridges(): Promise<void>;
|
|
79
83
|
add_user_with_hash(username: string, password_hash: string): Promise<void>;
|
|
@@ -82,6 +86,8 @@ export class WasmBroker {
|
|
|
82
86
|
* Returns an error if the `MessageChannel` cannot be created.
|
|
83
87
|
*/
|
|
84
88
|
create_client_port(): MessagePort;
|
|
89
|
+
get_max_packet_size(): number;
|
|
90
|
+
get_session_expiry_interval_secs(): number;
|
|
85
91
|
start_sys_topics_with_interval_secs(interval_secs: number): void;
|
|
86
92
|
/**
|
|
87
93
|
* # Errors
|
|
@@ -118,7 +124,10 @@ export class WasmConnectOptions {
|
|
|
118
124
|
free(): void;
|
|
119
125
|
[Symbol.dispose](): void;
|
|
120
126
|
clear_will(): void;
|
|
127
|
+
addBackupUrl(url: string): void;
|
|
128
|
+
getBackupUrls(): string[];
|
|
121
129
|
addUserProperty(key: string, value: string): void;
|
|
130
|
+
clearBackupUrls(): void;
|
|
122
131
|
clearUserProperties(): void;
|
|
123
132
|
constructor();
|
|
124
133
|
set_will(will: WasmWillMessage): void;
|
|
@@ -189,7 +198,10 @@ export class WasmMqttClient {
|
|
|
189
198
|
*/
|
|
190
199
|
respond_auth(auth_data: Uint8Array): void;
|
|
191
200
|
on_disconnect(callback: Function): void;
|
|
201
|
+
is_reconnecting(): boolean;
|
|
202
|
+
on_reconnecting(callback: Function): void;
|
|
192
203
|
on_auth_challenge(callback: Function): void;
|
|
204
|
+
on_reconnect_failed(callback: Function): void;
|
|
193
205
|
/**
|
|
194
206
|
* # Errors
|
|
195
207
|
* Returns an error if connection fails.
|
|
@@ -205,6 +217,8 @@ export class WasmMqttClient {
|
|
|
205
217
|
* Returns an error if not connected or publish fails.
|
|
206
218
|
*/
|
|
207
219
|
publish_with_options(topic: string, payload: Uint8Array, options: WasmPublishOptions): Promise<void>;
|
|
220
|
+
enable_auto_reconnect(enabled: boolean): void;
|
|
221
|
+
set_reconnect_options(options: WasmReconnectOptions): void;
|
|
208
222
|
/**
|
|
209
223
|
* # Errors
|
|
210
224
|
* Returns an error if not connected or subscribe fails.
|
|
@@ -265,6 +279,19 @@ export class WasmPublishOptions {
|
|
|
265
279
|
qos: number;
|
|
266
280
|
}
|
|
267
281
|
|
|
282
|
+
export class WasmReconnectOptions {
|
|
283
|
+
free(): void;
|
|
284
|
+
[Symbol.dispose](): void;
|
|
285
|
+
constructor();
|
|
286
|
+
static disabled(): WasmReconnectOptions;
|
|
287
|
+
maxDelayMs: number;
|
|
288
|
+
get maxAttempts(): number | undefined;
|
|
289
|
+
set maxAttempts(value: number | null | undefined);
|
|
290
|
+
enabled: boolean;
|
|
291
|
+
backoffFactor: number;
|
|
292
|
+
initialDelayMs: number;
|
|
293
|
+
}
|
|
294
|
+
|
|
268
295
|
export class WasmSubscribeOptions {
|
|
269
296
|
free(): void;
|
|
270
297
|
[Symbol.dispose](): void;
|
|
@@ -314,6 +341,7 @@ export interface InitOutput {
|
|
|
314
341
|
readonly __wbg_wasmmessageproperties_free: (a: number, b: number) => void;
|
|
315
342
|
readonly __wbg_wasmmqttclient_free: (a: number, b: number) => void;
|
|
316
343
|
readonly __wbg_wasmpublishoptions_free: (a: number, b: number) => void;
|
|
344
|
+
readonly __wbg_wasmreconnectoptions_free: (a: number, b: number) => void;
|
|
317
345
|
readonly __wbg_wasmsubscribeoptions_free: (a: number, b: number) => void;
|
|
318
346
|
readonly __wbg_wasmtopicmapping_free: (a: number, b: number) => void;
|
|
319
347
|
readonly __wbg_wasmwillmessage_free: (a: number, b: number) => void;
|
|
@@ -336,12 +364,17 @@ export interface InitOutput {
|
|
|
336
364
|
readonly wasmbroker_clear_acl_rules: (a: number) => any;
|
|
337
365
|
readonly wasmbroker_clear_roles: (a: number) => any;
|
|
338
366
|
readonly wasmbroker_create_client_port: (a: number) => [number, number, number];
|
|
367
|
+
readonly wasmbroker_get_config_hash: (a: number) => number;
|
|
368
|
+
readonly wasmbroker_get_max_clients: (a: number) => number;
|
|
369
|
+
readonly wasmbroker_get_max_packet_size: (a: number) => number;
|
|
370
|
+
readonly wasmbroker_get_session_expiry_interval_secs: (a: number) => number;
|
|
339
371
|
readonly wasmbroker_get_user_roles: (a: number, b: number, c: number) => any;
|
|
340
372
|
readonly wasmbroker_has_user: (a: number, b: number, c: number) => any;
|
|
341
373
|
readonly wasmbroker_hash_password: (a: number, b: number) => [number, number, number, number];
|
|
342
374
|
readonly wasmbroker_list_bridges: (a: number) => [number, number];
|
|
343
375
|
readonly wasmbroker_list_roles: (a: number) => any;
|
|
344
376
|
readonly wasmbroker_new: () => [number, number, number];
|
|
377
|
+
readonly wasmbroker_on_config_change: (a: number, b: any) => void;
|
|
345
378
|
readonly wasmbroker_remove_bridge: (a: number, b: number, c: number) => any;
|
|
346
379
|
readonly wasmbroker_remove_role: (a: number, b: number, c: number) => any;
|
|
347
380
|
readonly wasmbroker_remove_user: (a: number, b: number, c: number) => any;
|
|
@@ -351,6 +384,7 @@ export interface InitOutput {
|
|
|
351
384
|
readonly wasmbroker_stop_all_bridges: (a: number) => any;
|
|
352
385
|
readonly wasmbroker_stop_sys_topics: (a: number) => void;
|
|
353
386
|
readonly wasmbroker_unassign_role: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
387
|
+
readonly wasmbroker_update_config: (a: number, b: number) => [number, number];
|
|
354
388
|
readonly wasmbroker_user_count: (a: number) => any;
|
|
355
389
|
readonly wasmbroker_with_config: (a: number) => [number, number, number];
|
|
356
390
|
readonly wasmbrokerconfig_new: () => number;
|
|
@@ -365,11 +399,14 @@ export interface InitOutput {
|
|
|
365
399
|
readonly wasmbrokerconfig_set_subscription_identifier_available: (a: number, b: number) => void;
|
|
366
400
|
readonly wasmbrokerconfig_set_topic_alias_maximum: (a: number, b: number) => void;
|
|
367
401
|
readonly wasmbrokerconfig_set_wildcard_subscription_available: (a: number, b: number) => void;
|
|
402
|
+
readonly wasmconnectoptions_addBackupUrl: (a: number, b: number, c: number) => void;
|
|
368
403
|
readonly wasmconnectoptions_addUserProperty: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
369
404
|
readonly wasmconnectoptions_authenticationMethod: (a: number) => [number, number];
|
|
370
405
|
readonly wasmconnectoptions_cleanStart: (a: number) => number;
|
|
406
|
+
readonly wasmconnectoptions_clearBackupUrls: (a: number) => void;
|
|
371
407
|
readonly wasmconnectoptions_clearUserProperties: (a: number) => void;
|
|
372
408
|
readonly wasmconnectoptions_clear_will: (a: number) => void;
|
|
409
|
+
readonly wasmconnectoptions_getBackupUrls: (a: number) => [number, number];
|
|
373
410
|
readonly wasmconnectoptions_keepAlive: (a: number) => number;
|
|
374
411
|
readonly wasmconnectoptions_maximumPacketSize: (a: number) => number;
|
|
375
412
|
readonly wasmconnectoptions_new: () => number;
|
|
@@ -407,17 +444,22 @@ export interface InitOutput {
|
|
|
407
444
|
readonly wasmmqttclient_connect_message_port_with_options: (a: number, b: any, c: number) => any;
|
|
408
445
|
readonly wasmmqttclient_connect_with_options: (a: number, b: number, c: number, d: number) => any;
|
|
409
446
|
readonly wasmmqttclient_disconnect: (a: number) => any;
|
|
447
|
+
readonly wasmmqttclient_enable_auto_reconnect: (a: number, b: number) => void;
|
|
410
448
|
readonly wasmmqttclient_is_connected: (a: number) => number;
|
|
449
|
+
readonly wasmmqttclient_is_reconnecting: (a: number) => number;
|
|
411
450
|
readonly wasmmqttclient_new: (a: number, b: number) => number;
|
|
412
451
|
readonly wasmmqttclient_on_auth_challenge: (a: number, b: any) => void;
|
|
413
452
|
readonly wasmmqttclient_on_connect: (a: number, b: any) => void;
|
|
414
453
|
readonly wasmmqttclient_on_disconnect: (a: number, b: any) => void;
|
|
415
454
|
readonly wasmmqttclient_on_error: (a: number, b: any) => void;
|
|
455
|
+
readonly wasmmqttclient_on_reconnect_failed: (a: number, b: any) => void;
|
|
456
|
+
readonly wasmmqttclient_on_reconnecting: (a: number, b: any) => void;
|
|
416
457
|
readonly wasmmqttclient_publish: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
417
458
|
readonly wasmmqttclient_publish_qos1: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
|
|
418
459
|
readonly wasmmqttclient_publish_qos2: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
|
|
419
460
|
readonly wasmmqttclient_publish_with_options: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
420
461
|
readonly wasmmqttclient_respond_auth: (a: number, b: number, c: number) => [number, number];
|
|
462
|
+
readonly wasmmqttclient_set_reconnect_options: (a: number, b: number) => void;
|
|
421
463
|
readonly wasmmqttclient_subscribe: (a: number, b: number, c: number) => any;
|
|
422
464
|
readonly wasmmqttclient_subscribe_with_callback: (a: number, b: number, c: number, d: any) => any;
|
|
423
465
|
readonly wasmmqttclient_subscribe_with_options: (a: number, b: number, c: number, d: any, e: number) => any;
|
|
@@ -440,6 +482,18 @@ export interface InitOutput {
|
|
|
440
482
|
readonly wasmpublishoptions_set_retain: (a: number, b: number) => void;
|
|
441
483
|
readonly wasmpublishoptions_set_topicAlias: (a: number, b: number) => void;
|
|
442
484
|
readonly wasmpublishoptions_topicAlias: (a: number) => number;
|
|
485
|
+
readonly wasmreconnectoptions_backoffFactor: (a: number) => number;
|
|
486
|
+
readonly wasmreconnectoptions_disabled: () => number;
|
|
487
|
+
readonly wasmreconnectoptions_enabled: (a: number) => number;
|
|
488
|
+
readonly wasmreconnectoptions_initialDelayMs: (a: number) => number;
|
|
489
|
+
readonly wasmreconnectoptions_maxAttempts: (a: number) => number;
|
|
490
|
+
readonly wasmreconnectoptions_maxDelayMs: (a: number) => number;
|
|
491
|
+
readonly wasmreconnectoptions_new: () => number;
|
|
492
|
+
readonly wasmreconnectoptions_set_backoffFactor: (a: number, b: number) => void;
|
|
493
|
+
readonly wasmreconnectoptions_set_enabled: (a: number, b: number) => void;
|
|
494
|
+
readonly wasmreconnectoptions_set_initialDelayMs: (a: number, b: number) => void;
|
|
495
|
+
readonly wasmreconnectoptions_set_maxAttempts: (a: number, b: number) => void;
|
|
496
|
+
readonly wasmreconnectoptions_set_maxDelayMs: (a: number, b: number) => void;
|
|
443
497
|
readonly wasmsubscribeoptions_new: () => number;
|
|
444
498
|
readonly wasmsubscribeoptions_noLocal: (a: number) => number;
|
|
445
499
|
readonly wasmsubscribeoptions_qos: (a: number) => number;
|
|
@@ -470,13 +524,13 @@ export interface InitOutput {
|
|
|
470
524
|
readonly wasmwillmessage_set_willDelayInterval: (a: number, b: number) => void;
|
|
471
525
|
readonly wasmwillmessage_topic: (a: number) => [number, number];
|
|
472
526
|
readonly wasmwillmessage_willDelayInterval: (a: number) => number;
|
|
473
|
-
readonly
|
|
474
|
-
readonly
|
|
475
|
-
readonly
|
|
476
|
-
readonly
|
|
477
|
-
readonly
|
|
478
|
-
readonly
|
|
479
|
-
readonly
|
|
527
|
+
readonly wasm_bindgen__convert__closures_____invoke__h03550a3e6639a016: (a: number, b: number, c: any) => void;
|
|
528
|
+
readonly wasm_bindgen__closure__destroy__h2693416e24019557: (a: number, b: number) => void;
|
|
529
|
+
readonly wasm_bindgen__convert__closures_____invoke__hd15651196cb2505d: (a: number, b: number, c: any) => void;
|
|
530
|
+
readonly wasm_bindgen__closure__destroy__ha2949eb6d63c4297: (a: number, b: number) => void;
|
|
531
|
+
readonly wasm_bindgen__convert__closures_____invoke__hd696d8bd99da4c41: (a: number, b: number) => void;
|
|
532
|
+
readonly wasm_bindgen__closure__destroy__h30ea16cd0ac6175f: (a: number, b: number) => void;
|
|
533
|
+
readonly wasm_bindgen__convert__closures_____invoke__h73e303788c372d47: (a: number, b: number, c: any, d: any) => void;
|
|
480
534
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
481
535
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
482
536
|
readonly __wbindgen_exn_store: (a: number) => void;
|
package/mqtt5_wasm.js
CHANGED
|
@@ -251,20 +251,20 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
251
251
|
|
|
252
252
|
let WASM_VECTOR_LEN = 0;
|
|
253
253
|
|
|
254
|
-
function
|
|
255
|
-
wasm.
|
|
254
|
+
function wasm_bindgen__convert__closures_____invoke__h03550a3e6639a016(arg0, arg1, arg2) {
|
|
255
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h03550a3e6639a016(arg0, arg1, arg2);
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
function
|
|
259
|
-
wasm.
|
|
258
|
+
function wasm_bindgen__convert__closures_____invoke__hd15651196cb2505d(arg0, arg1, arg2) {
|
|
259
|
+
wasm.wasm_bindgen__convert__closures_____invoke__hd15651196cb2505d(arg0, arg1, arg2);
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
-
function
|
|
263
|
-
wasm.
|
|
262
|
+
function wasm_bindgen__convert__closures_____invoke__hd696d8bd99da4c41(arg0, arg1) {
|
|
263
|
+
wasm.wasm_bindgen__convert__closures_____invoke__hd696d8bd99da4c41(arg0, arg1);
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
-
function
|
|
267
|
-
wasm.
|
|
266
|
+
function wasm_bindgen__convert__closures_____invoke__h73e303788c372d47(arg0, arg1, arg2, arg3) {
|
|
267
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h73e303788c372d47(arg0, arg1, arg2, arg3);
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
|
|
@@ -297,6 +297,10 @@ const WasmPublishOptionsFinalization = (typeof FinalizationRegistry === 'undefin
|
|
|
297
297
|
? { register: () => {}, unregister: () => {} }
|
|
298
298
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmpublishoptions_free(ptr >>> 0, 1));
|
|
299
299
|
|
|
300
|
+
const WasmReconnectOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
301
|
+
? { register: () => {}, unregister: () => {} }
|
|
302
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmreconnectoptions_free(ptr >>> 0, 1));
|
|
303
|
+
|
|
300
304
|
const WasmSubscribeOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
301
305
|
? { register: () => {}, unregister: () => {} }
|
|
302
306
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmsubscribeoptions_free(ptr >>> 0, 1));
|
|
@@ -602,6 +606,17 @@ export class WasmBroker {
|
|
|
602
606
|
const ret = wasm.wasmbroker_unassign_role(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
603
607
|
return ret;
|
|
604
608
|
}
|
|
609
|
+
/**
|
|
610
|
+
* @param {WasmBrokerConfig} new_config
|
|
611
|
+
*/
|
|
612
|
+
update_config(new_config) {
|
|
613
|
+
_assertClass(new_config, WasmBrokerConfig);
|
|
614
|
+
var ptr0 = new_config.__destroy_into_raw();
|
|
615
|
+
const ret = wasm.wasmbroker_update_config(this.__wbg_ptr, ptr0);
|
|
616
|
+
if (ret[1]) {
|
|
617
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
605
620
|
/**
|
|
606
621
|
* @returns {Promise<number>}
|
|
607
622
|
*/
|
|
@@ -626,9 +641,29 @@ export class WasmBroker {
|
|
|
626
641
|
const ret = wasm.wasmbroker_clear_acl_rules(this.__wbg_ptr);
|
|
627
642
|
return ret;
|
|
628
643
|
}
|
|
644
|
+
/**
|
|
645
|
+
* @returns {number}
|
|
646
|
+
*/
|
|
647
|
+
get_config_hash() {
|
|
648
|
+
const ret = wasm.wasmbroker_get_config_hash(this.__wbg_ptr);
|
|
649
|
+
return ret;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* @returns {number}
|
|
653
|
+
*/
|
|
654
|
+
get_max_clients() {
|
|
655
|
+
const ret = wasm.wasmbroker_get_max_clients(this.__wbg_ptr);
|
|
656
|
+
return ret >>> 0;
|
|
657
|
+
}
|
|
629
658
|
stop_sys_topics() {
|
|
630
659
|
wasm.wasmbroker_stop_sys_topics(this.__wbg_ptr);
|
|
631
660
|
}
|
|
661
|
+
/**
|
|
662
|
+
* @param {Function} callback
|
|
663
|
+
*/
|
|
664
|
+
on_config_change(callback) {
|
|
665
|
+
wasm.wasmbroker_on_config_change(this.__wbg_ptr, callback);
|
|
666
|
+
}
|
|
632
667
|
start_sys_topics() {
|
|
633
668
|
wasm.wasmbroker_start_sys_topics(this.__wbg_ptr);
|
|
634
669
|
}
|
|
@@ -664,6 +699,20 @@ export class WasmBroker {
|
|
|
664
699
|
}
|
|
665
700
|
return takeFromExternrefTable0(ret[0]);
|
|
666
701
|
}
|
|
702
|
+
/**
|
|
703
|
+
* @returns {number}
|
|
704
|
+
*/
|
|
705
|
+
get_max_packet_size() {
|
|
706
|
+
const ret = wasm.wasmbroker_get_max_packet_size(this.__wbg_ptr);
|
|
707
|
+
return ret >>> 0;
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* @returns {number}
|
|
711
|
+
*/
|
|
712
|
+
get_session_expiry_interval_secs() {
|
|
713
|
+
const ret = wasm.wasmbroker_get_session_expiry_interval_secs(this.__wbg_ptr);
|
|
714
|
+
return ret >>> 0;
|
|
715
|
+
}
|
|
667
716
|
/**
|
|
668
717
|
* @param {number} interval_secs
|
|
669
718
|
*/
|
|
@@ -828,6 +877,14 @@ export class WasmConnectOptions {
|
|
|
828
877
|
clear_will() {
|
|
829
878
|
wasm.wasmconnectoptions_clear_will(this.__wbg_ptr);
|
|
830
879
|
}
|
|
880
|
+
/**
|
|
881
|
+
* @param {string} url
|
|
882
|
+
*/
|
|
883
|
+
addBackupUrl(url) {
|
|
884
|
+
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
885
|
+
const len0 = WASM_VECTOR_LEN;
|
|
886
|
+
wasm.wasmconnectoptions_addBackupUrl(this.__wbg_ptr, ptr0, len0);
|
|
887
|
+
}
|
|
831
888
|
/**
|
|
832
889
|
* @param {Uint8Array} value
|
|
833
890
|
*/
|
|
@@ -844,6 +901,15 @@ export class WasmConnectOptions {
|
|
|
844
901
|
var len0 = WASM_VECTOR_LEN;
|
|
845
902
|
wasm.wasmconnectoptions_set_username(this.__wbg_ptr, ptr0, len0);
|
|
846
903
|
}
|
|
904
|
+
/**
|
|
905
|
+
* @returns {string[]}
|
|
906
|
+
*/
|
|
907
|
+
getBackupUrls() {
|
|
908
|
+
const ret = wasm.wasmconnectoptions_getBackupUrls(this.__wbg_ptr);
|
|
909
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
910
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
911
|
+
return v1;
|
|
912
|
+
}
|
|
847
913
|
/**
|
|
848
914
|
* @param {number} value
|
|
849
915
|
*/
|
|
@@ -874,6 +940,9 @@ export class WasmConnectOptions {
|
|
|
874
940
|
const len1 = WASM_VECTOR_LEN;
|
|
875
941
|
wasm.wasmconnectoptions_addUserProperty(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
876
942
|
}
|
|
943
|
+
clearBackupUrls() {
|
|
944
|
+
wasm.wasmconnectoptions_clearBackupUrls(this.__wbg_ptr);
|
|
945
|
+
}
|
|
877
946
|
/**
|
|
878
947
|
* @returns {number}
|
|
879
948
|
*/
|
|
@@ -1208,12 +1277,31 @@ export class WasmMqttClient {
|
|
|
1208
1277
|
on_disconnect(callback) {
|
|
1209
1278
|
wasm.wasmmqttclient_on_disconnect(this.__wbg_ptr, callback);
|
|
1210
1279
|
}
|
|
1280
|
+
/**
|
|
1281
|
+
* @returns {boolean}
|
|
1282
|
+
*/
|
|
1283
|
+
is_reconnecting() {
|
|
1284
|
+
const ret = wasm.wasmmqttclient_is_reconnecting(this.__wbg_ptr);
|
|
1285
|
+
return ret !== 0;
|
|
1286
|
+
}
|
|
1287
|
+
/**
|
|
1288
|
+
* @param {Function} callback
|
|
1289
|
+
*/
|
|
1290
|
+
on_reconnecting(callback) {
|
|
1291
|
+
wasm.wasmmqttclient_on_reconnecting(this.__wbg_ptr, callback);
|
|
1292
|
+
}
|
|
1211
1293
|
/**
|
|
1212
1294
|
* @param {Function} callback
|
|
1213
1295
|
*/
|
|
1214
1296
|
on_auth_challenge(callback) {
|
|
1215
1297
|
wasm.wasmmqttclient_on_auth_challenge(this.__wbg_ptr, callback);
|
|
1216
1298
|
}
|
|
1299
|
+
/**
|
|
1300
|
+
* @param {Function} callback
|
|
1301
|
+
*/
|
|
1302
|
+
on_reconnect_failed(callback) {
|
|
1303
|
+
wasm.wasmmqttclient_on_reconnect_failed(this.__wbg_ptr, callback);
|
|
1304
|
+
}
|
|
1217
1305
|
/**
|
|
1218
1306
|
* # Errors
|
|
1219
1307
|
* Returns an error if connection fails.
|
|
@@ -1255,6 +1343,19 @@ export class WasmMqttClient {
|
|
|
1255
1343
|
const ret = wasm.wasmmqttclient_publish_with_options(this.__wbg_ptr, ptr0, len0, ptr1, len1, options.__wbg_ptr);
|
|
1256
1344
|
return ret;
|
|
1257
1345
|
}
|
|
1346
|
+
/**
|
|
1347
|
+
* @param {boolean} enabled
|
|
1348
|
+
*/
|
|
1349
|
+
enable_auto_reconnect(enabled) {
|
|
1350
|
+
wasm.wasmmqttclient_enable_auto_reconnect(this.__wbg_ptr, enabled);
|
|
1351
|
+
}
|
|
1352
|
+
/**
|
|
1353
|
+
* @param {WasmReconnectOptions} options
|
|
1354
|
+
*/
|
|
1355
|
+
set_reconnect_options(options) {
|
|
1356
|
+
_assertClass(options, WasmReconnectOptions);
|
|
1357
|
+
wasm.wasmmqttclient_set_reconnect_options(this.__wbg_ptr, options.__wbg_ptr);
|
|
1358
|
+
}
|
|
1258
1359
|
/**
|
|
1259
1360
|
* # Errors
|
|
1260
1361
|
* Returns an error if not connected or subscribe fails.
|
|
@@ -1513,6 +1614,105 @@ export class WasmPublishOptions {
|
|
|
1513
1614
|
}
|
|
1514
1615
|
if (Symbol.dispose) WasmPublishOptions.prototype[Symbol.dispose] = WasmPublishOptions.prototype.free;
|
|
1515
1616
|
|
|
1617
|
+
export class WasmReconnectOptions {
|
|
1618
|
+
static __wrap(ptr) {
|
|
1619
|
+
ptr = ptr >>> 0;
|
|
1620
|
+
const obj = Object.create(WasmReconnectOptions.prototype);
|
|
1621
|
+
obj.__wbg_ptr = ptr;
|
|
1622
|
+
WasmReconnectOptionsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1623
|
+
return obj;
|
|
1624
|
+
}
|
|
1625
|
+
__destroy_into_raw() {
|
|
1626
|
+
const ptr = this.__wbg_ptr;
|
|
1627
|
+
this.__wbg_ptr = 0;
|
|
1628
|
+
WasmReconnectOptionsFinalization.unregister(this);
|
|
1629
|
+
return ptr;
|
|
1630
|
+
}
|
|
1631
|
+
free() {
|
|
1632
|
+
const ptr = this.__destroy_into_raw();
|
|
1633
|
+
wasm.__wbg_wasmreconnectoptions_free(ptr, 0);
|
|
1634
|
+
}
|
|
1635
|
+
/**
|
|
1636
|
+
* @returns {number}
|
|
1637
|
+
*/
|
|
1638
|
+
get maxDelayMs() {
|
|
1639
|
+
const ret = wasm.wasmreconnectoptions_maxDelayMs(this.__wbg_ptr);
|
|
1640
|
+
return ret >>> 0;
|
|
1641
|
+
}
|
|
1642
|
+
/**
|
|
1643
|
+
* @returns {number | undefined}
|
|
1644
|
+
*/
|
|
1645
|
+
get maxAttempts() {
|
|
1646
|
+
const ret = wasm.wasmreconnectoptions_maxAttempts(this.__wbg_ptr);
|
|
1647
|
+
return ret === 0x100000001 ? undefined : ret;
|
|
1648
|
+
}
|
|
1649
|
+
/**
|
|
1650
|
+
* @param {boolean} value
|
|
1651
|
+
*/
|
|
1652
|
+
set enabled(value) {
|
|
1653
|
+
wasm.wasmreconnectoptions_set_enabled(this.__wbg_ptr, value);
|
|
1654
|
+
}
|
|
1655
|
+
/**
|
|
1656
|
+
* @returns {number}
|
|
1657
|
+
*/
|
|
1658
|
+
get backoffFactor() {
|
|
1659
|
+
const ret = wasm.wasmreconnectoptions_backoffFactor(this.__wbg_ptr);
|
|
1660
|
+
return ret;
|
|
1661
|
+
}
|
|
1662
|
+
/**
|
|
1663
|
+
* @returns {number}
|
|
1664
|
+
*/
|
|
1665
|
+
get initialDelayMs() {
|
|
1666
|
+
const ret = wasm.wasmreconnectoptions_initialDelayMs(this.__wbg_ptr);
|
|
1667
|
+
return ret >>> 0;
|
|
1668
|
+
}
|
|
1669
|
+
/**
|
|
1670
|
+
* @param {number} value
|
|
1671
|
+
*/
|
|
1672
|
+
set maxDelayMs(value) {
|
|
1673
|
+
wasm.wasmreconnectoptions_set_maxDelayMs(this.__wbg_ptr, value);
|
|
1674
|
+
}
|
|
1675
|
+
/**
|
|
1676
|
+
* @param {number | null} [value]
|
|
1677
|
+
*/
|
|
1678
|
+
set maxAttempts(value) {
|
|
1679
|
+
wasm.wasmreconnectoptions_set_maxAttempts(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0);
|
|
1680
|
+
}
|
|
1681
|
+
/**
|
|
1682
|
+
* @param {number} value
|
|
1683
|
+
*/
|
|
1684
|
+
set backoffFactor(value) {
|
|
1685
|
+
wasm.wasmreconnectoptions_set_backoffFactor(this.__wbg_ptr, value);
|
|
1686
|
+
}
|
|
1687
|
+
/**
|
|
1688
|
+
* @param {number} value
|
|
1689
|
+
*/
|
|
1690
|
+
set initialDelayMs(value) {
|
|
1691
|
+
wasm.wasmreconnectoptions_set_initialDelayMs(this.__wbg_ptr, value);
|
|
1692
|
+
}
|
|
1693
|
+
constructor() {
|
|
1694
|
+
const ret = wasm.wasmreconnectoptions_new();
|
|
1695
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1696
|
+
WasmReconnectOptionsFinalization.register(this, this.__wbg_ptr, this);
|
|
1697
|
+
return this;
|
|
1698
|
+
}
|
|
1699
|
+
/**
|
|
1700
|
+
* @returns {boolean}
|
|
1701
|
+
*/
|
|
1702
|
+
get enabled() {
|
|
1703
|
+
const ret = wasm.wasmreconnectoptions_enabled(this.__wbg_ptr);
|
|
1704
|
+
return ret !== 0;
|
|
1705
|
+
}
|
|
1706
|
+
/**
|
|
1707
|
+
* @returns {WasmReconnectOptions}
|
|
1708
|
+
*/
|
|
1709
|
+
static disabled() {
|
|
1710
|
+
const ret = wasm.wasmreconnectoptions_disabled();
|
|
1711
|
+
return WasmReconnectOptions.__wrap(ret);
|
|
1712
|
+
}
|
|
1713
|
+
}
|
|
1714
|
+
if (Symbol.dispose) WasmReconnectOptions.prototype[Symbol.dispose] = WasmReconnectOptions.prototype.free;
|
|
1715
|
+
|
|
1516
1716
|
export class WasmSubscribeOptions {
|
|
1517
1717
|
__destroy_into_raw() {
|
|
1518
1718
|
const ptr = this.__wbg_ptr;
|
|
@@ -1956,7 +2156,7 @@ function __wbg_get_imports() {
|
|
|
1956
2156
|
const a = state0.a;
|
|
1957
2157
|
state0.a = 0;
|
|
1958
2158
|
try {
|
|
1959
|
-
return
|
|
2159
|
+
return wasm_bindgen__convert__closures_____invoke__h73e303788c372d47(a, state0.b, arg0, arg1);
|
|
1960
2160
|
} finally {
|
|
1961
2161
|
state0.a = a;
|
|
1962
2162
|
}
|
|
@@ -2019,6 +2219,10 @@ function __wbg_get_imports() {
|
|
|
2019
2219
|
imports.wbg.__wbg_queueMicrotask_fca69f5bfad613a5 = function(arg0) {
|
|
2020
2220
|
queueMicrotask(arg0);
|
|
2021
2221
|
};
|
|
2222
|
+
imports.wbg.__wbg_random_cc1f9237d866d212 = function() {
|
|
2223
|
+
const ret = Math.random();
|
|
2224
|
+
return ret;
|
|
2225
|
+
};
|
|
2022
2226
|
imports.wbg.__wbg_resolve_fd5bfbaa4ce36e1e = function(arg0) {
|
|
2023
2227
|
const ret = Promise.resolve(arg0);
|
|
2024
2228
|
return ret;
|
|
@@ -2101,6 +2305,11 @@ function __wbg_get_imports() {
|
|
|
2101
2305
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
2102
2306
|
return ret;
|
|
2103
2307
|
};
|
|
2308
|
+
imports.wbg.__wbindgen_cast_22daa9e11cd314ef = function(arg0, arg1) {
|
|
2309
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 368, function: Function { arguments: [Externref], shim_idx: 369, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2310
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__ha2949eb6d63c4297, wasm_bindgen__convert__closures_____invoke__hd15651196cb2505d);
|
|
2311
|
+
return ret;
|
|
2312
|
+
};
|
|
2104
2313
|
imports.wbg.__wbindgen_cast_25a0a844437d0e92 = function(arg0, arg1) {
|
|
2105
2314
|
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
2106
2315
|
wasm.__wbindgen_free(arg0, arg1 * 4, 4);
|
|
@@ -2108,19 +2317,19 @@ function __wbg_get_imports() {
|
|
|
2108
2317
|
const ret = v0;
|
|
2109
2318
|
return ret;
|
|
2110
2319
|
};
|
|
2111
|
-
imports.wbg.
|
|
2112
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2113
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2320
|
+
imports.wbg.__wbindgen_cast_71d90ac9f14f6e03 = function(arg0, arg1) {
|
|
2321
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 357, function: Function { arguments: [], shim_idx: 358, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2322
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h30ea16cd0ac6175f, wasm_bindgen__convert__closures_____invoke__hd696d8bd99da4c41);
|
|
2114
2323
|
return ret;
|
|
2115
2324
|
};
|
|
2116
2325
|
imports.wbg.__wbindgen_cast_a6d58121ace2ceaa = function(arg0, arg1) {
|
|
2117
2326
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 7, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 8, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2118
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2327
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h2693416e24019557, wasm_bindgen__convert__closures_____invoke__h03550a3e6639a016);
|
|
2119
2328
|
return ret;
|
|
2120
2329
|
};
|
|
2121
2330
|
imports.wbg.__wbindgen_cast_d3f7166d7f91ad34 = function(arg0, arg1) {
|
|
2122
2331
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 7, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 8, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2123
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2332
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h2693416e24019557, wasm_bindgen__convert__closures_____invoke__h03550a3e6639a016);
|
|
2124
2333
|
return ret;
|
|
2125
2334
|
};
|
|
2126
2335
|
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
@@ -2128,14 +2337,9 @@ function __wbg_get_imports() {
|
|
|
2128
2337
|
const ret = arg0;
|
|
2129
2338
|
return ret;
|
|
2130
2339
|
};
|
|
2131
|
-
imports.wbg.__wbindgen_cast_e7f97fba0726b4ab = function(arg0, arg1) {
|
|
2132
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 366, function: Function { arguments: [Externref], shim_idx: 367, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2133
|
-
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h849099dfd9acf928, wasm_bindgen__convert__closures_____invoke__ha9d3e198cd0951b0);
|
|
2134
|
-
return ret;
|
|
2135
|
-
};
|
|
2136
2340
|
imports.wbg.__wbindgen_cast_fac85390ef55bfaa = function(arg0, arg1) {
|
|
2137
2341
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 7, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 8, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2138
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2342
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h2693416e24019557, wasm_bindgen__convert__closures_____invoke__h03550a3e6639a016);
|
|
2139
2343
|
return ret;
|
|
2140
2344
|
};
|
|
2141
2345
|
imports.wbg.__wbindgen_init_externref_table = function() {
|
package/mqtt5_wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED