mqtt5-wasm 0.1.2 → 0.2.1

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/README.md CHANGED
@@ -7,6 +7,7 @@ MQTT v5.0 WebAssembly client and broker for browser environments.
7
7
  - **WebSocket transport** - Connect to remote MQTT brokers
8
8
  - **In-tab broker** - Run a complete MQTT broker in the browser
9
9
  - **MessagePort/BroadcastChannel** - Inter-tab communication
10
+ - **Broker bridging** - Connect multiple in-browser brokers via MessagePort
10
11
  - **Full QoS support** - QoS 0, 1, and 2
11
12
  - **Automatic keepalive** - Connection health monitoring
12
13
 
@@ -22,7 +23,7 @@ npm install mqtt5-wasm
22
23
 
23
24
  ```toml
24
25
  [dependencies]
25
- mqtt5-wasm = "0.1.2"
26
+ mqtt5-wasm = "0.2"
26
27
  ```
27
28
 
28
29
  Build with wasm-pack:
package/mqtt5_wasm.d.ts CHANGED
@@ -1,5 +1,25 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+
4
+ export class WasmBridgeConfig {
5
+ free(): void;
6
+ [Symbol.dispose](): void;
7
+ constructor(name: string);
8
+ add_topic(mapping: WasmTopicMapping): void;
9
+ validate(): void;
10
+ set client_id(value: string);
11
+ set clean_start(value: boolean);
12
+ set keep_alive_secs(value: number);
13
+ set username(value: string | null | undefined);
14
+ set password(value: string | null | undefined);
15
+ }
16
+
17
+ export enum WasmBridgeDirection {
18
+ In = 0,
19
+ Out = 1,
20
+ Both = 2,
21
+ }
22
+
3
23
  export class WasmBroker {
4
24
  free(): void;
5
25
  [Symbol.dispose](): void;
@@ -13,7 +33,12 @@ export class WasmBroker {
13
33
  set_allow_anonymous(allow: boolean): void;
14
34
  static hash_password(password: string): string;
15
35
  create_client_port(): MessagePort;
36
+ add_bridge(config: WasmBridgeConfig, remote_port: MessagePort): Promise<void>;
37
+ remove_bridge(name: string): Promise<void>;
38
+ list_bridges(): string[];
39
+ stop_all_bridges(): Promise<void>;
16
40
  }
41
+
17
42
  export class WasmBrokerConfig {
18
43
  free(): void;
19
44
  [Symbol.dispose](): void;
@@ -29,6 +54,7 @@ export class WasmBrokerConfig {
29
54
  set shared_subscription_available(value: boolean);
30
55
  set server_keep_alive_secs(value: number | null | undefined);
31
56
  }
57
+
32
58
  export class WasmConnectOptions {
33
59
  free(): void;
34
60
  [Symbol.dispose](): void;
@@ -58,6 +84,7 @@ export class WasmConnectOptions {
58
84
  set authenticationMethod(value: string | null | undefined);
59
85
  set authenticationData(value: Uint8Array);
60
86
  }
87
+
61
88
  export class WasmMqttClient {
62
89
  free(): void;
63
90
  [Symbol.dispose](): void;
@@ -82,6 +109,7 @@ export class WasmMqttClient {
82
109
  on_auth_challenge(callback: Function): void;
83
110
  respond_auth(auth_data: Uint8Array): Promise<void>;
84
111
  }
112
+
85
113
  export class WasmPublishOptions {
86
114
  free(): void;
87
115
  [Symbol.dispose](): void;
@@ -102,6 +130,7 @@ export class WasmPublishOptions {
102
130
  get contentType(): string | undefined;
103
131
  set contentType(value: string | null | undefined);
104
132
  }
133
+
105
134
  export class WasmSubscribeOptions {
106
135
  free(): void;
107
136
  [Symbol.dispose](): void;
@@ -113,6 +142,16 @@ export class WasmSubscribeOptions {
113
142
  get subscriptionIdentifier(): number | undefined;
114
143
  set subscriptionIdentifier(value: number | null | undefined);
115
144
  }
145
+
146
+ export class WasmTopicMapping {
147
+ free(): void;
148
+ [Symbol.dispose](): void;
149
+ constructor(pattern: string, direction: WasmBridgeDirection);
150
+ set qos(value: number);
151
+ set local_prefix(value: string | null | undefined);
152
+ set remote_prefix(value: string | null | undefined);
153
+ }
154
+
116
155
  export class WasmWillMessage {
117
156
  free(): void;
118
157
  [Symbol.dispose](): void;
@@ -134,6 +173,20 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
134
173
 
135
174
  export interface InitOutput {
136
175
  readonly memory: WebAssembly.Memory;
176
+ readonly __wbg_wasmtopicmapping_free: (a: number, b: number) => void;
177
+ readonly wasmtopicmapping_new: (a: number, b: number, c: number) => number;
178
+ readonly wasmtopicmapping_set_qos: (a: number, b: number) => void;
179
+ readonly wasmtopicmapping_set_local_prefix: (a: number, b: number, c: number) => void;
180
+ readonly wasmtopicmapping_set_remote_prefix: (a: number, b: number, c: number) => void;
181
+ readonly __wbg_wasmbridgeconfig_free: (a: number, b: number) => void;
182
+ readonly wasmbridgeconfig_new: (a: number, b: number) => number;
183
+ readonly wasmbridgeconfig_set_client_id: (a: number, b: number, c: number) => void;
184
+ readonly wasmbridgeconfig_set_clean_start: (a: number, b: number) => void;
185
+ readonly wasmbridgeconfig_set_keep_alive_secs: (a: number, b: number) => void;
186
+ readonly wasmbridgeconfig_set_username: (a: number, b: number, c: number) => void;
187
+ readonly wasmbridgeconfig_set_password: (a: number, b: number, c: number) => void;
188
+ readonly wasmbridgeconfig_add_topic: (a: number, b: number) => void;
189
+ readonly wasmbridgeconfig_validate: (a: number) => [number, number];
137
190
  readonly __wbg_wasmbrokerconfig_free: (a: number, b: number) => void;
138
191
  readonly wasmbrokerconfig_new: () => number;
139
192
  readonly wasmbrokerconfig_set_max_clients: (a: number, b: number) => void;
@@ -157,6 +210,10 @@ export interface InitOutput {
157
210
  readonly wasmbroker_set_allow_anonymous: (a: number, b: number) => void;
158
211
  readonly wasmbroker_hash_password: (a: number, b: number) => [number, number, number, number];
159
212
  readonly wasmbroker_create_client_port: (a: number) => [number, number, number];
213
+ readonly wasmbroker_add_bridge: (a: number, b: number, c: any) => any;
214
+ readonly wasmbroker_remove_bridge: (a: number, b: number, c: number) => any;
215
+ readonly wasmbroker_list_bridges: (a: number) => [number, number];
216
+ readonly wasmbroker_stop_all_bridges: (a: number) => any;
160
217
  readonly __wbg_wasmmqttclient_free: (a: number, b: number) => void;
161
218
  readonly wasmmqttclient_new: (a: number, b: number) => number;
162
219
  readonly wasmmqttclient_connect: (a: number, b: number, c: number) => any;
@@ -253,13 +310,13 @@ export interface InitOutput {
253
310
  readonly wasmwillmessage_willDelayInterval: (a: number) => number;
254
311
  readonly wasmwillmessage_messageExpiryInterval: (a: number) => number;
255
312
  readonly wasmwillmessage_set_messageExpiryInterval: (a: number, b: number) => void;
256
- readonly wasm_bindgen__convert__closures_____invoke__h83490f8cd1f822be: (a: number, b: number, c: any) => void;
257
- readonly wasm_bindgen__closure__destroy__h3e5175841145af54: (a: number, b: number) => void;
258
- readonly wasm_bindgen__convert__closures_____invoke__h4c33ce4d986075ed: (a: number, b: number) => void;
259
- readonly wasm_bindgen__closure__destroy__he3a6d52737a61d69: (a: number, b: number) => void;
260
- readonly wasm_bindgen__convert__closures_____invoke__hacd56641ea4358f0: (a: number, b: number, c: any) => void;
261
- readonly wasm_bindgen__closure__destroy__h2a5cb8478cd1adb0: (a: number, b: number) => void;
262
- readonly wasm_bindgen__convert__closures_____invoke__hbbb6f9316512cb4e: (a: number, b: number, c: any, d: any) => void;
313
+ readonly wasm_bindgen__convert__closures_____invoke__ha8b0b9fe7fac12a4: (a: number, b: number, c: any) => void;
314
+ readonly wasm_bindgen__closure__destroy__h60ca8c1f3f61ef16: (a: number, b: number) => void;
315
+ readonly wasm_bindgen__convert__closures_____invoke__h07efcda49d573328: (a: number, b: number, c: any) => void;
316
+ readonly wasm_bindgen__closure__destroy__h2f92eaaa514835eb: (a: number, b: number) => void;
317
+ readonly wasm_bindgen__convert__closures_____invoke__hf8b807ed3211f368: (a: number, b: number) => void;
318
+ readonly wasm_bindgen__closure__destroy__h41d50b86eff9c0fb: (a: number, b: number) => void;
319
+ readonly wasm_bindgen__convert__closures_____invoke__h22971f3c49e1e8f1: (a: number, b: number, c: any, d: any) => void;
263
320
  readonly __wbindgen_malloc: (a: number, b: number) => number;
264
321
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
265
322
  readonly __wbindgen_exn_store: (a: number) => void;
@@ -267,10 +324,12 @@ export interface InitOutput {
267
324
  readonly __wbindgen_externrefs: WebAssembly.Table;
268
325
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
269
326
  readonly __externref_table_dealloc: (a: number) => void;
327
+ readonly __externref_drop_slice: (a: number, b: number) => void;
270
328
  readonly __wbindgen_start: () => void;
271
329
  }
272
330
 
273
331
  export type SyncInitInput = BufferSource | WebAssembly.Module;
332
+
274
333
  /**
275
334
  * Instantiates the given `module`, which can either be bytes or
276
335
  * a precompiled `WebAssembly.Module`.
package/mqtt5_wasm.js CHANGED
@@ -1,5 +1,21 @@
1
1
  let wasm;
2
2
 
3
+ function addToExternrefTable0(obj) {
4
+ const idx = wasm.__externref_table_alloc();
5
+ wasm.__wbindgen_externrefs.set(idx, obj);
6
+ return idx;
7
+ }
8
+
9
+ function _assertClass(instance, klass) {
10
+ if (!(instance instanceof klass)) {
11
+ throw new Error(`expected instance of ${klass.name}`);
12
+ }
13
+ }
14
+
15
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
16
+ ? { register: () => {}, unregister: () => {} }
17
+ : new FinalizationRegistry(state => state.dtor(state.a, state.b));
18
+
3
19
  function debugString(val) {
4
20
  // primitive types
5
21
  const type = typeof val;
@@ -65,10 +81,36 @@ function debugString(val) {
65
81
  return className;
66
82
  }
67
83
 
68
- let WASM_VECTOR_LEN = 0;
84
+ function getArrayJsValueFromWasm0(ptr, len) {
85
+ ptr = ptr >>> 0;
86
+ const mem = getDataViewMemory0();
87
+ const result = [];
88
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
89
+ result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
90
+ }
91
+ wasm.__externref_drop_slice(ptr, len);
92
+ return result;
93
+ }
69
94
 
70
- let cachedUint8ArrayMemory0 = null;
95
+ function getArrayU8FromWasm0(ptr, len) {
96
+ ptr = ptr >>> 0;
97
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
98
+ }
71
99
 
100
+ let cachedDataViewMemory0 = null;
101
+ function getDataViewMemory0() {
102
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
103
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
104
+ }
105
+ return cachedDataViewMemory0;
106
+ }
107
+
108
+ function getStringFromWasm0(ptr, len) {
109
+ ptr = ptr >>> 0;
110
+ return decodeText(ptr, len);
111
+ }
112
+
113
+ let cachedUint8ArrayMemory0 = null;
72
114
  function getUint8ArrayMemory0() {
73
115
  if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
74
116
  cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
@@ -76,21 +118,55 @@ function getUint8ArrayMemory0() {
76
118
  return cachedUint8ArrayMemory0;
77
119
  }
78
120
 
79
- const cachedTextEncoder = new TextEncoder();
80
-
81
- if (!('encodeInto' in cachedTextEncoder)) {
82
- cachedTextEncoder.encodeInto = function (arg, view) {
83
- const buf = cachedTextEncoder.encode(arg);
84
- view.set(buf);
85
- return {
86
- read: arg.length,
87
- written: buf.length
88
- };
121
+ function handleError(f, args) {
122
+ try {
123
+ return f.apply(this, args);
124
+ } catch (e) {
125
+ const idx = addToExternrefTable0(e);
126
+ wasm.__wbindgen_exn_store(idx);
89
127
  }
90
128
  }
91
129
 
92
- function passStringToWasm0(arg, malloc, realloc) {
130
+ function isLikeNone(x) {
131
+ return x === undefined || x === null;
132
+ }
133
+
134
+ function makeMutClosure(arg0, arg1, dtor, f) {
135
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
136
+ const real = (...args) => {
137
+
138
+ // First up with a closure we increment the internal reference
139
+ // count. This ensures that the Rust closure environment won't
140
+ // be deallocated while we're invoking it.
141
+ state.cnt++;
142
+ const a = state.a;
143
+ state.a = 0;
144
+ try {
145
+ return f(a, state.b, ...args);
146
+ } finally {
147
+ state.a = a;
148
+ real._wbg_cb_unref();
149
+ }
150
+ };
151
+ real._wbg_cb_unref = () => {
152
+ if (--state.cnt === 0) {
153
+ state.dtor(state.a, state.b);
154
+ state.a = 0;
155
+ CLOSURE_DTORS.unregister(state);
156
+ }
157
+ };
158
+ CLOSURE_DTORS.register(real, state, state);
159
+ return real;
160
+ }
93
161
 
162
+ function passArray8ToWasm0(arg, malloc) {
163
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
164
+ getUint8ArrayMemory0().set(arg, ptr / 1);
165
+ WASM_VECTOR_LEN = arg.length;
166
+ return ptr;
167
+ }
168
+
169
+ function passStringToWasm0(arg, malloc, realloc) {
94
170
  if (realloc === undefined) {
95
171
  const buf = cachedTextEncoder.encode(arg);
96
172
  const ptr = malloc(buf.length, 1) >>> 0;
@@ -111,7 +187,6 @@ function passStringToWasm0(arg, malloc, realloc) {
111
187
  if (code > 0x7F) break;
112
188
  mem[ptr + offset] = code;
113
189
  }
114
-
115
190
  if (offset !== len) {
116
191
  if (offset !== 0) {
117
192
  arg = arg.slice(offset);
@@ -128,19 +203,14 @@ function passStringToWasm0(arg, malloc, realloc) {
128
203
  return ptr;
129
204
  }
130
205
 
131
- let cachedDataViewMemory0 = null;
132
-
133
- function getDataViewMemory0() {
134
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
135
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
136
- }
137
- return cachedDataViewMemory0;
206
+ function takeFromExternrefTable0(idx) {
207
+ const value = wasm.__wbindgen_externrefs.get(idx);
208
+ wasm.__externref_table_dealloc(idx);
209
+ return value;
138
210
  }
139
211
 
140
212
  let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
141
-
142
213
  cachedTextDecoder.decode();
143
-
144
214
  const MAX_SAFARI_DECODE_BYTES = 2146435072;
145
215
  let numBytesDecoded = 0;
146
216
  function decodeText(ptr, len) {
@@ -153,109 +223,160 @@ function decodeText(ptr, len) {
153
223
  return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
154
224
  }
155
225
 
156
- function getStringFromWasm0(ptr, len) {
157
- ptr = ptr >>> 0;
158
- return decodeText(ptr, len);
226
+ const cachedTextEncoder = new TextEncoder();
227
+
228
+ if (!('encodeInto' in cachedTextEncoder)) {
229
+ cachedTextEncoder.encodeInto = function (arg, view) {
230
+ const buf = cachedTextEncoder.encode(arg);
231
+ view.set(buf);
232
+ return {
233
+ read: arg.length,
234
+ written: buf.length
235
+ };
236
+ }
159
237
  }
160
238
 
161
- function addToExternrefTable0(obj) {
162
- const idx = wasm.__externref_table_alloc();
163
- wasm.__wbindgen_externrefs.set(idx, obj);
164
- return idx;
239
+ let WASM_VECTOR_LEN = 0;
240
+
241
+ function wasm_bindgen__convert__closures_____invoke__ha8b0b9fe7fac12a4(arg0, arg1, arg2) {
242
+ wasm.wasm_bindgen__convert__closures_____invoke__ha8b0b9fe7fac12a4(arg0, arg1, arg2);
165
243
  }
166
244
 
167
- function handleError(f, args) {
168
- try {
169
- return f.apply(this, args);
170
- } catch (e) {
171
- const idx = addToExternrefTable0(e);
172
- wasm.__wbindgen_exn_store(idx);
173
- }
245
+ function wasm_bindgen__convert__closures_____invoke__h07efcda49d573328(arg0, arg1, arg2) {
246
+ wasm.wasm_bindgen__convert__closures_____invoke__h07efcda49d573328(arg0, arg1, arg2);
174
247
  }
175
248
 
176
- function getArrayU8FromWasm0(ptr, len) {
177
- ptr = ptr >>> 0;
178
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
249
+ function wasm_bindgen__convert__closures_____invoke__hf8b807ed3211f368(arg0, arg1) {
250
+ wasm.wasm_bindgen__convert__closures_____invoke__hf8b807ed3211f368(arg0, arg1);
179
251
  }
180
252
 
181
- function isLikeNone(x) {
182
- return x === undefined || x === null;
253
+ function wasm_bindgen__convert__closures_____invoke__h22971f3c49e1e8f1(arg0, arg1, arg2, arg3) {
254
+ wasm.wasm_bindgen__convert__closures_____invoke__h22971f3c49e1e8f1(arg0, arg1, arg2, arg3);
183
255
  }
184
256
 
185
- const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
257
+ const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
258
+
259
+ const WasmBridgeConfigFinalization = (typeof FinalizationRegistry === 'undefined')
186
260
  ? { register: () => {}, unregister: () => {} }
187
- : new FinalizationRegistry(state => state.dtor(state.a, state.b));
261
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmbridgeconfig_free(ptr >>> 0, 1));
188
262
 
189
- function makeMutClosure(arg0, arg1, dtor, f) {
190
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
191
- const real = (...args) => {
263
+ const WasmBrokerFinalization = (typeof FinalizationRegistry === 'undefined')
264
+ ? { register: () => {}, unregister: () => {} }
265
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmbroker_free(ptr >>> 0, 1));
192
266
 
193
- // First up with a closure we increment the internal reference
194
- // count. This ensures that the Rust closure environment won't
195
- // be deallocated while we're invoking it.
196
- state.cnt++;
197
- const a = state.a;
198
- state.a = 0;
199
- try {
200
- return f(a, state.b, ...args);
201
- } finally {
202
- state.a = a;
203
- real._wbg_cb_unref();
204
- }
205
- };
206
- real._wbg_cb_unref = () => {
207
- if (--state.cnt === 0) {
208
- state.dtor(state.a, state.b);
209
- state.a = 0;
210
- CLOSURE_DTORS.unregister(state);
211
- }
212
- };
213
- CLOSURE_DTORS.register(real, state, state);
214
- return real;
215
- }
267
+ const WasmBrokerConfigFinalization = (typeof FinalizationRegistry === 'undefined')
268
+ ? { register: () => {}, unregister: () => {} }
269
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmbrokerconfig_free(ptr >>> 0, 1));
216
270
 
217
- function takeFromExternrefTable0(idx) {
218
- const value = wasm.__wbindgen_externrefs.get(idx);
219
- wasm.__externref_table_dealloc(idx);
220
- return value;
221
- }
271
+ const WasmConnectOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
272
+ ? { register: () => {}, unregister: () => {} }
273
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmconnectoptions_free(ptr >>> 0, 1));
222
274
 
223
- function _assertClass(instance, klass) {
224
- if (!(instance instanceof klass)) {
225
- throw new Error(`expected instance of ${klass.name}`);
226
- }
227
- }
275
+ const WasmMqttClientFinalization = (typeof FinalizationRegistry === 'undefined')
276
+ ? { register: () => {}, unregister: () => {} }
277
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmmqttclient_free(ptr >>> 0, 1));
228
278
 
229
- function passArray8ToWasm0(arg, malloc) {
230
- const ptr = malloc(arg.length * 1, 1) >>> 0;
231
- getUint8ArrayMemory0().set(arg, ptr / 1);
232
- WASM_VECTOR_LEN = arg.length;
233
- return ptr;
234
- }
235
- function wasm_bindgen__convert__closures_____invoke__h83490f8cd1f822be(arg0, arg1, arg2) {
236
- wasm.wasm_bindgen__convert__closures_____invoke__h83490f8cd1f822be(arg0, arg1, arg2);
237
- }
279
+ const WasmPublishOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
280
+ ? { register: () => {}, unregister: () => {} }
281
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmpublishoptions_free(ptr >>> 0, 1));
238
282
 
239
- function wasm_bindgen__convert__closures_____invoke__h4c33ce4d986075ed(arg0, arg1) {
240
- wasm.wasm_bindgen__convert__closures_____invoke__h4c33ce4d986075ed(arg0, arg1);
241
- }
283
+ const WasmSubscribeOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
284
+ ? { register: () => {}, unregister: () => {} }
285
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmsubscribeoptions_free(ptr >>> 0, 1));
242
286
 
243
- function wasm_bindgen__convert__closures_____invoke__hacd56641ea4358f0(arg0, arg1, arg2) {
244
- wasm.wasm_bindgen__convert__closures_____invoke__hacd56641ea4358f0(arg0, arg1, arg2);
245
- }
287
+ const WasmTopicMappingFinalization = (typeof FinalizationRegistry === 'undefined')
288
+ ? { register: () => {}, unregister: () => {} }
289
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmtopicmapping_free(ptr >>> 0, 1));
246
290
 
247
- function wasm_bindgen__convert__closures_____invoke__hbbb6f9316512cb4e(arg0, arg1, arg2, arg3) {
248
- wasm.wasm_bindgen__convert__closures_____invoke__hbbb6f9316512cb4e(arg0, arg1, arg2, arg3);
249
- }
291
+ const WasmWillMessageFinalization = (typeof FinalizationRegistry === 'undefined')
292
+ ? { register: () => {}, unregister: () => {} }
293
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmwillmessage_free(ptr >>> 0, 1));
250
294
 
251
- const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
295
+ export class WasmBridgeConfig {
296
+ __destroy_into_raw() {
297
+ const ptr = this.__wbg_ptr;
298
+ this.__wbg_ptr = 0;
299
+ WasmBridgeConfigFinalization.unregister(this);
300
+ return ptr;
301
+ }
302
+ free() {
303
+ const ptr = this.__destroy_into_raw();
304
+ wasm.__wbg_wasmbridgeconfig_free(ptr, 0);
305
+ }
306
+ /**
307
+ * @param {string} name
308
+ */
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;
316
+ }
317
+ /**
318
+ * @param {string} client_id
319
+ */
320
+ set client_id(client_id) {
321
+ const ptr0 = passStringToWasm0(client_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
322
+ const len0 = WASM_VECTOR_LEN;
323
+ wasm.wasmbridgeconfig_set_client_id(this.__wbg_ptr, ptr0, len0);
324
+ }
325
+ /**
326
+ * @param {boolean} clean_start
327
+ */
328
+ set clean_start(clean_start) {
329
+ wasm.wasmbridgeconfig_set_clean_start(this.__wbg_ptr, clean_start);
330
+ }
331
+ /**
332
+ * @param {number} secs
333
+ */
334
+ set keep_alive_secs(secs) {
335
+ wasm.wasmbridgeconfig_set_keep_alive_secs(this.__wbg_ptr, secs);
336
+ }
337
+ /**
338
+ * @param {string | null} [username]
339
+ */
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);
344
+ }
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);
352
+ }
353
+ /**
354
+ * @param {WasmTopicMapping} mapping
355
+ */
356
+ add_topic(mapping) {
357
+ _assertClass(mapping, WasmTopicMapping);
358
+ var ptr0 = mapping.__destroy_into_raw();
359
+ wasm.wasmbridgeconfig_add_topic(this.__wbg_ptr, ptr0);
360
+ }
361
+ validate() {
362
+ const ret = wasm.wasmbridgeconfig_validate(this.__wbg_ptr);
363
+ if (ret[1]) {
364
+ throw takeFromExternrefTable0(ret[0]);
365
+ }
366
+ }
367
+ }
368
+ if (Symbol.dispose) WasmBridgeConfig.prototype[Symbol.dispose] = WasmBridgeConfig.prototype.free;
252
369
 
253
- const WasmBrokerFinalization = (typeof FinalizationRegistry === 'undefined')
254
- ? { register: () => {}, unregister: () => {} }
255
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmbroker_free(ptr >>> 0, 1));
370
+ /**
371
+ * @enum {0 | 1 | 2}
372
+ */
373
+ export const WasmBridgeDirection = Object.freeze({
374
+ In: 0, "0": "In",
375
+ Out: 1, "1": "Out",
376
+ Both: 2, "2": "Both",
377
+ });
256
378
 
257
379
  export class WasmBroker {
258
-
259
380
  static __wrap(ptr) {
260
381
  ptr = ptr >>> 0;
261
382
  const obj = Object.create(WasmBroker.prototype);
@@ -263,14 +384,12 @@ export class WasmBroker {
263
384
  WasmBrokerFinalization.register(obj, obj.__wbg_ptr, obj);
264
385
  return obj;
265
386
  }
266
-
267
387
  __destroy_into_raw() {
268
388
  const ptr = this.__wbg_ptr;
269
389
  this.__wbg_ptr = 0;
270
390
  WasmBrokerFinalization.unregister(this);
271
391
  return ptr;
272
392
  }
273
-
274
393
  free() {
275
394
  const ptr = this.__destroy_into_raw();
276
395
  wasm.__wbg_wasmbroker_free(ptr, 0);
@@ -390,22 +509,53 @@ export class WasmBroker {
390
509
  }
391
510
  return takeFromExternrefTable0(ret[0]);
392
511
  }
512
+ /**
513
+ * @param {WasmBridgeConfig} config
514
+ * @param {MessagePort} remote_port
515
+ * @returns {Promise<void>}
516
+ */
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;
522
+ }
523
+ /**
524
+ * @param {string} name
525
+ * @returns {Promise<void>}
526
+ */
527
+ remove_bridge(name) {
528
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
529
+ const len0 = WASM_VECTOR_LEN;
530
+ const ret = wasm.wasmbroker_remove_bridge(this.__wbg_ptr, ptr0, len0);
531
+ return ret;
532
+ }
533
+ /**
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>}
544
+ */
545
+ stop_all_bridges() {
546
+ const ret = wasm.wasmbroker_stop_all_bridges(this.__wbg_ptr);
547
+ return ret;
548
+ }
393
549
  }
394
550
  if (Symbol.dispose) WasmBroker.prototype[Symbol.dispose] = WasmBroker.prototype.free;
395
551
 
396
- const WasmBrokerConfigFinalization = (typeof FinalizationRegistry === 'undefined')
397
- ? { register: () => {}, unregister: () => {} }
398
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmbrokerconfig_free(ptr >>> 0, 1));
399
-
400
552
  export class WasmBrokerConfig {
401
-
402
553
  __destroy_into_raw() {
403
554
  const ptr = this.__wbg_ptr;
404
555
  this.__wbg_ptr = 0;
405
556
  WasmBrokerConfigFinalization.unregister(this);
406
557
  return ptr;
407
558
  }
408
-
409
559
  free() {
410
560
  const ptr = this.__destroy_into_raw();
411
561
  wasm.__wbg_wasmbrokerconfig_free(ptr, 0);
@@ -479,19 +629,13 @@ export class WasmBrokerConfig {
479
629
  }
480
630
  if (Symbol.dispose) WasmBrokerConfig.prototype[Symbol.dispose] = WasmBrokerConfig.prototype.free;
481
631
 
482
- const WasmConnectOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
483
- ? { register: () => {}, unregister: () => {} }
484
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmconnectoptions_free(ptr >>> 0, 1));
485
-
486
632
  export class WasmConnectOptions {
487
-
488
633
  __destroy_into_raw() {
489
634
  const ptr = this.__wbg_ptr;
490
635
  this.__wbg_ptr = 0;
491
636
  WasmConnectOptionsFinalization.unregister(this);
492
637
  return ptr;
493
638
  }
494
-
495
639
  free() {
496
640
  const ptr = this.__destroy_into_raw();
497
641
  wasm.__wbg_wasmconnectoptions_free(ptr, 0);
@@ -690,19 +834,13 @@ export class WasmConnectOptions {
690
834
  }
691
835
  if (Symbol.dispose) WasmConnectOptions.prototype[Symbol.dispose] = WasmConnectOptions.prototype.free;
692
836
 
693
- const WasmMqttClientFinalization = (typeof FinalizationRegistry === 'undefined')
694
- ? { register: () => {}, unregister: () => {} }
695
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmmqttclient_free(ptr >>> 0, 1));
696
-
697
837
  export class WasmMqttClient {
698
-
699
838
  __destroy_into_raw() {
700
839
  const ptr = this.__wbg_ptr;
701
840
  this.__wbg_ptr = 0;
702
841
  WasmMqttClientFinalization.unregister(this);
703
842
  return ptr;
704
843
  }
705
-
706
844
  free() {
707
845
  const ptr = this.__destroy_into_raw();
708
846
  wasm.__wbg_wasmmqttclient_free(ptr, 0);
@@ -909,19 +1047,13 @@ export class WasmMqttClient {
909
1047
  }
910
1048
  if (Symbol.dispose) WasmMqttClient.prototype[Symbol.dispose] = WasmMqttClient.prototype.free;
911
1049
 
912
- const WasmPublishOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
913
- ? { register: () => {}, unregister: () => {} }
914
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmpublishoptions_free(ptr >>> 0, 1));
915
-
916
1050
  export class WasmPublishOptions {
917
-
918
1051
  __destroy_into_raw() {
919
1052
  const ptr = this.__wbg_ptr;
920
1053
  this.__wbg_ptr = 0;
921
1054
  WasmPublishOptionsFinalization.unregister(this);
922
1055
  return ptr;
923
1056
  }
924
-
925
1057
  free() {
926
1058
  const ptr = this.__destroy_into_raw();
927
1059
  wasm.__wbg_wasmpublishoptions_free(ptr, 0);
@@ -1062,19 +1194,13 @@ export class WasmPublishOptions {
1062
1194
  }
1063
1195
  if (Symbol.dispose) WasmPublishOptions.prototype[Symbol.dispose] = WasmPublishOptions.prototype.free;
1064
1196
 
1065
- const WasmSubscribeOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
1066
- ? { register: () => {}, unregister: () => {} }
1067
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmsubscribeoptions_free(ptr >>> 0, 1));
1068
-
1069
1197
  export class WasmSubscribeOptions {
1070
-
1071
1198
  __destroy_into_raw() {
1072
1199
  const ptr = this.__wbg_ptr;
1073
1200
  this.__wbg_ptr = 0;
1074
1201
  WasmSubscribeOptionsFinalization.unregister(this);
1075
1202
  return ptr;
1076
1203
  }
1077
-
1078
1204
  free() {
1079
1205
  const ptr = this.__destroy_into_raw();
1080
1206
  wasm.__wbg_wasmsubscribeoptions_free(ptr, 0);
@@ -1153,19 +1279,61 @@ export class WasmSubscribeOptions {
1153
1279
  }
1154
1280
  if (Symbol.dispose) WasmSubscribeOptions.prototype[Symbol.dispose] = WasmSubscribeOptions.prototype.free;
1155
1281
 
1156
- const WasmWillMessageFinalization = (typeof FinalizationRegistry === 'undefined')
1157
- ? { register: () => {}, unregister: () => {} }
1158
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmwillmessage_free(ptr >>> 0, 1));
1282
+ export class WasmTopicMapping {
1283
+ __destroy_into_raw() {
1284
+ const ptr = this.__wbg_ptr;
1285
+ this.__wbg_ptr = 0;
1286
+ WasmTopicMappingFinalization.unregister(this);
1287
+ return ptr;
1288
+ }
1289
+ free() {
1290
+ const ptr = this.__destroy_into_raw();
1291
+ wasm.__wbg_wasmtopicmapping_free(ptr, 0);
1292
+ }
1293
+ /**
1294
+ * @param {string} pattern
1295
+ * @param {WasmBridgeDirection} direction
1296
+ */
1297
+ constructor(pattern, direction) {
1298
+ const ptr0 = passStringToWasm0(pattern, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1299
+ const len0 = WASM_VECTOR_LEN;
1300
+ const ret = wasm.wasmtopicmapping_new(ptr0, len0, direction);
1301
+ this.__wbg_ptr = ret >>> 0;
1302
+ WasmTopicMappingFinalization.register(this, this.__wbg_ptr, this);
1303
+ return this;
1304
+ }
1305
+ /**
1306
+ * @param {number} qos
1307
+ */
1308
+ set qos(qos) {
1309
+ wasm.wasmtopicmapping_set_qos(this.__wbg_ptr, qos);
1310
+ }
1311
+ /**
1312
+ * @param {string | null} [prefix]
1313
+ */
1314
+ set local_prefix(prefix) {
1315
+ var ptr0 = isLikeNone(prefix) ? 0 : passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1316
+ var len0 = WASM_VECTOR_LEN;
1317
+ wasm.wasmtopicmapping_set_local_prefix(this.__wbg_ptr, ptr0, len0);
1318
+ }
1319
+ /**
1320
+ * @param {string | null} [prefix]
1321
+ */
1322
+ set remote_prefix(prefix) {
1323
+ var ptr0 = isLikeNone(prefix) ? 0 : passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1324
+ var len0 = WASM_VECTOR_LEN;
1325
+ wasm.wasmtopicmapping_set_remote_prefix(this.__wbg_ptr, ptr0, len0);
1326
+ }
1327
+ }
1328
+ if (Symbol.dispose) WasmTopicMapping.prototype[Symbol.dispose] = WasmTopicMapping.prototype.free;
1159
1329
 
1160
1330
  export class WasmWillMessage {
1161
-
1162
1331
  __destroy_into_raw() {
1163
1332
  const ptr = this.__wbg_ptr;
1164
1333
  this.__wbg_ptr = 0;
1165
1334
  WasmWillMessageFinalization.unregister(this);
1166
1335
  return ptr;
1167
1336
  }
1168
-
1169
1337
  free() {
1170
1338
  const ptr = this.__destroy_into_raw();
1171
1339
  wasm.__wbg_wasmwillmessage_free(ptr, 0);
@@ -1309,7 +1477,6 @@ async function __wbg_load(module, imports) {
1309
1477
  if (typeof WebAssembly.instantiateStreaming === 'function') {
1310
1478
  try {
1311
1479
  return await WebAssembly.instantiateStreaming(module, imports);
1312
-
1313
1480
  } catch (e) {
1314
1481
  const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
1315
1482
 
@@ -1324,13 +1491,11 @@ async function __wbg_load(module, imports) {
1324
1491
 
1325
1492
  const bytes = await module.arrayBuffer();
1326
1493
  return await WebAssembly.instantiate(bytes, imports);
1327
-
1328
1494
  } else {
1329
1495
  const instance = await WebAssembly.instantiate(module, imports);
1330
1496
 
1331
1497
  if (instance instanceof WebAssembly.Instance) {
1332
1498
  return { instance, module };
1333
-
1334
1499
  } else {
1335
1500
  return instance;
1336
1501
  }
@@ -1340,57 +1505,57 @@ async function __wbg_load(module, imports) {
1340
1505
  function __wbg_get_imports() {
1341
1506
  const imports = {};
1342
1507
  imports.wbg = {};
1343
- imports.wbg.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
1508
+ imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
1344
1509
  const ret = debugString(arg1);
1345
1510
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1346
1511
  const len1 = WASM_VECTOR_LEN;
1347
1512
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1348
1513
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1349
1514
  };
1350
- imports.wbg.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
1515
+ imports.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) {
1351
1516
  const ret = typeof(arg0) === 'function';
1352
1517
  return ret;
1353
1518
  };
1354
- imports.wbg.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {
1519
+ imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
1355
1520
  const ret = arg0 === undefined;
1356
1521
  return ret;
1357
1522
  };
1358
- imports.wbg.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
1523
+ imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
1359
1524
  throw new Error(getStringFromWasm0(arg0, arg1));
1360
1525
  };
1361
- imports.wbg.__wbg__wbg_cb_unref_2454a539ea5790d9 = function(arg0) {
1526
+ imports.wbg.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7 = function(arg0) {
1362
1527
  arg0._wbg_cb_unref();
1363
1528
  };
1364
- imports.wbg.__wbg_buffer_ccc4520b36d3ccf4 = function(arg0) {
1529
+ imports.wbg.__wbg_buffer_6cb2fecb1f253d71 = function(arg0) {
1365
1530
  const ret = arg0.buffer;
1366
1531
  return ret;
1367
1532
  };
1368
- imports.wbg.__wbg_call_525440f72fbfc0ea = function() { return handleError(function (arg0, arg1, arg2) {
1533
+ imports.wbg.__wbg_call_3020136f7a2d6e44 = function() { return handleError(function (arg0, arg1, arg2) {
1369
1534
  const ret = arg0.call(arg1, arg2);
1370
1535
  return ret;
1371
1536
  }, arguments) };
1372
- imports.wbg.__wbg_call_e45d2cf9fc925fcf = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1373
- const ret = arg0.call(arg1, arg2, arg3);
1537
+ imports.wbg.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) {
1538
+ const ret = arg0.call(arg1);
1374
1539
  return ret;
1375
1540
  }, arguments) };
1376
- imports.wbg.__wbg_call_e762c39fa8ea36bf = function() { return handleError(function (arg0, arg1) {
1377
- const ret = arg0.call(arg1);
1541
+ imports.wbg.__wbg_call_c8baa5c5e72d274e = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1542
+ const ret = arg0.call(arg1, arg2, arg3);
1378
1543
  return ret;
1379
1544
  }, arguments) };
1380
1545
  imports.wbg.__wbg_clearTimeout_5a54f8841c30079a = function(arg0) {
1381
1546
  const ret = clearTimeout(arg0);
1382
1547
  return ret;
1383
1548
  };
1384
- imports.wbg.__wbg_close_209083eb02f34c98 = function(arg0) {
1549
+ imports.wbg.__wbg_close_1db3952de1b5b1cf = function() { return handleError(function (arg0) {
1385
1550
  arg0.close();
1386
- };
1387
- imports.wbg.__wbg_close_462d6d95a9f53a1d = function(arg0) {
1551
+ }, arguments) };
1552
+ imports.wbg.__wbg_close_8158530fc398ee2f = function(arg0) {
1388
1553
  arg0.close();
1389
1554
  };
1390
- imports.wbg.__wbg_close_885e277edf06b3fa = function() { return handleError(function (arg0) {
1555
+ imports.wbg.__wbg_close_c956ddbf0426a990 = function(arg0) {
1391
1556
  arg0.close();
1392
- }, arguments) };
1393
- imports.wbg.__wbg_data_ee4306d069f24f2d = function(arg0) {
1557
+ };
1558
+ imports.wbg.__wbg_data_8bf4ae669a78a688 = function(arg0) {
1394
1559
  const ret = arg0.data;
1395
1560
  return ret;
1396
1561
  };
@@ -1405,13 +1570,13 @@ function __wbg_get_imports() {
1405
1570
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1406
1571
  }
1407
1572
  };
1408
- imports.wbg.__wbg_error_a7f8fbb0523dae15 = function(arg0) {
1573
+ imports.wbg.__wbg_error_7bc7d576a6aaf855 = function(arg0) {
1409
1574
  console.error(arg0);
1410
1575
  };
1411
1576
  imports.wbg.__wbg_getRandomValues_1c61fac11405ffdc = function() { return handleError(function (arg0, arg1) {
1412
1577
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1413
1578
  }, arguments) };
1414
- imports.wbg.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
1579
+ imports.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
1415
1580
  let result;
1416
1581
  try {
1417
1582
  result = arg0 instanceof ArrayBuffer;
@@ -1421,7 +1586,7 @@ function __wbg_get_imports() {
1421
1586
  const ret = result;
1422
1587
  return ret;
1423
1588
  };
1424
- imports.wbg.__wbg_instanceof_Window_4846dbb3de56c84c = function(arg0) {
1589
+ imports.wbg.__wbg_instanceof_Window_b5cf7783caa68180 = function(arg0) {
1425
1590
  let result;
1426
1591
  try {
1427
1592
  result = arg0 instanceof Window;
@@ -1431,21 +1596,45 @@ function __wbg_get_imports() {
1431
1596
  const ret = result;
1432
1597
  return ret;
1433
1598
  };
1434
- imports.wbg.__wbg_length_69bca3cb64fc8748 = function(arg0) {
1599
+ imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {
1435
1600
  const ret = arg0.length;
1436
1601
  return ret;
1437
1602
  };
1438
- imports.wbg.__wbg_log_8cec76766b8c0e33 = function(arg0) {
1603
+ imports.wbg.__wbg_log_1d990106d99dacb7 = function(arg0) {
1439
1604
  console.log(arg0);
1440
1605
  };
1441
- imports.wbg.__wbg_new_3c3d849046688a66 = function(arg0, arg1) {
1606
+ imports.wbg.__wbg_new_137453588c393c59 = function() { return handleError(function () {
1607
+ const ret = new MessageChannel();
1608
+ return ret;
1609
+ }, arguments) };
1610
+ imports.wbg.__wbg_new_25f239778d6112b9 = function() {
1611
+ const ret = new Array();
1612
+ return ret;
1613
+ };
1614
+ imports.wbg.__wbg_new_6421f6084cc5bc5a = function(arg0) {
1615
+ const ret = new Uint8Array(arg0);
1616
+ return ret;
1617
+ };
1618
+ imports.wbg.__wbg_new_7c30d1f874652e62 = function() { return handleError(function (arg0, arg1) {
1619
+ const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
1620
+ return ret;
1621
+ }, arguments) };
1622
+ imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
1623
+ const ret = new Error();
1624
+ return ret;
1625
+ };
1626
+ imports.wbg.__wbg_new_b3dd747604c3c93e = function() { return handleError(function (arg0, arg1) {
1627
+ const ret = new BroadcastChannel(getStringFromWasm0(arg0, arg1));
1628
+ return ret;
1629
+ }, arguments) };
1630
+ imports.wbg.__wbg_new_ff12d2b041fb48f1 = function(arg0, arg1) {
1442
1631
  try {
1443
1632
  var state0 = {a: arg0, b: arg1};
1444
1633
  var cb0 = (arg0, arg1) => {
1445
1634
  const a = state0.a;
1446
1635
  state0.a = 0;
1447
1636
  try {
1448
- return wasm_bindgen__convert__closures_____invoke__hbbb6f9316512cb4e(a, state0.b, arg0, arg1);
1637
+ return wasm_bindgen__convert__closures_____invoke__h22971f3c49e1e8f1(a, state0.b, arg0, arg1);
1449
1638
  } finally {
1450
1639
  state0.a = a;
1451
1640
  }
@@ -1456,35 +1645,11 @@ function __wbg_get_imports() {
1456
1645
  state0.a = state0.b = 0;
1457
1646
  }
1458
1647
  };
1459
- imports.wbg.__wbg_new_5a79be3ab53b8aa5 = function(arg0) {
1460
- const ret = new Uint8Array(arg0);
1461
- return ret;
1462
- };
1463
- imports.wbg.__wbg_new_67069b49258d9f2a = function() { return handleError(function (arg0, arg1) {
1464
- const ret = new BroadcastChannel(getStringFromWasm0(arg0, arg1));
1465
- return ret;
1466
- }, arguments) };
1467
- imports.wbg.__wbg_new_881c4fe631eee9ad = function() { return handleError(function (arg0, arg1) {
1468
- const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
1469
- return ret;
1470
- }, arguments) };
1471
- imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
1472
- const ret = new Error();
1473
- return ret;
1474
- };
1475
- imports.wbg.__wbg_new_c31bb2023cab7b59 = function() { return handleError(function () {
1476
- const ret = new MessageChannel();
1477
- return ret;
1478
- }, arguments) };
1479
- imports.wbg.__wbg_new_e17d9f43105b08be = function() {
1480
- const ret = new Array();
1481
- return ret;
1482
- };
1483
- imports.wbg.__wbg_new_from_slice_92f4d78ca282a2d2 = function(arg0, arg1) {
1648
+ imports.wbg.__wbg_new_from_slice_f9c22b9153b26992 = function(arg0, arg1) {
1484
1649
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1485
1650
  return ret;
1486
1651
  };
1487
- imports.wbg.__wbg_new_no_args_ee98eee5275000a4 = function(arg0, arg1) {
1652
+ imports.wbg.__wbg_new_no_args_cb138f77cf6151ee = function(arg0, arg1) {
1488
1653
  const ret = new Function(getStringFromWasm0(arg0, arg1));
1489
1654
  return ret;
1490
1655
  };
@@ -1492,7 +1657,7 @@ function __wbg_get_imports() {
1492
1657
  const ret = arg0.now();
1493
1658
  return ret;
1494
1659
  };
1495
- imports.wbg.__wbg_now_793306c526e2e3b6 = function() {
1660
+ imports.wbg.__wbg_now_69d776cd24f5215b = function() {
1496
1661
  const ret = Date.now();
1497
1662
  return ret;
1498
1663
  };
@@ -1500,42 +1665,42 @@ function __wbg_get_imports() {
1500
1665
  const ret = arg0.performance;
1501
1666
  return ret;
1502
1667
  };
1503
- imports.wbg.__wbg_port1_d9822fb6881d8cfe = function(arg0) {
1668
+ imports.wbg.__wbg_port1_75dce9d0d8087125 = function(arg0) {
1504
1669
  const ret = arg0.port1;
1505
1670
  return ret;
1506
1671
  };
1507
- imports.wbg.__wbg_port2_bd4cbea5c475915f = function(arg0) {
1672
+ imports.wbg.__wbg_port2_3cffa4119380f41d = function(arg0) {
1508
1673
  const ret = arg0.port2;
1509
1674
  return ret;
1510
1675
  };
1511
- imports.wbg.__wbg_postMessage_2e1248c7fe808340 = function() { return handleError(function (arg0, arg1) {
1676
+ imports.wbg.__wbg_postMessage_79f844174f56304f = function() { return handleError(function (arg0, arg1) {
1512
1677
  arg0.postMessage(arg1);
1513
1678
  }, arguments) };
1514
- imports.wbg.__wbg_postMessage_cea6d6f3b452f8bc = function() { return handleError(function (arg0, arg1) {
1679
+ imports.wbg.__wbg_postMessage_ee7b4e76cd1ed685 = function() { return handleError(function (arg0, arg1) {
1515
1680
  arg0.postMessage(arg1);
1516
1681
  }, arguments) };
1517
- imports.wbg.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
1682
+ imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
1518
1683
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1519
1684
  };
1520
- imports.wbg.__wbg_push_df81a39d04db858c = function(arg0, arg1) {
1685
+ imports.wbg.__wbg_push_7d9be8f38fc13975 = function(arg0, arg1) {
1521
1686
  const ret = arg0.push(arg1);
1522
1687
  return ret;
1523
1688
  };
1524
- imports.wbg.__wbg_queueMicrotask_34d692c25c47d05b = function(arg0) {
1689
+ imports.wbg.__wbg_queueMicrotask_9b549dfce8865860 = function(arg0) {
1525
1690
  const ret = arg0.queueMicrotask;
1526
1691
  return ret;
1527
1692
  };
1528
- imports.wbg.__wbg_queueMicrotask_9d76cacb20c84d58 = function(arg0) {
1693
+ imports.wbg.__wbg_queueMicrotask_fca69f5bfad613a5 = function(arg0) {
1529
1694
  queueMicrotask(arg0);
1530
1695
  };
1531
- imports.wbg.__wbg_resolve_caf97c30b83f7053 = function(arg0) {
1696
+ imports.wbg.__wbg_resolve_fd5bfbaa4ce36e1e = function(arg0) {
1532
1697
  const ret = Promise.resolve(arg0);
1533
1698
  return ret;
1534
1699
  };
1535
- imports.wbg.__wbg_send_3d2cf376613294f0 = function() { return handleError(function (arg0, arg1, arg2) {
1700
+ imports.wbg.__wbg_send_ea59e150ab5ebe08 = function() { return handleError(function (arg0, arg1, arg2) {
1536
1701
  arg0.send(getArrayU8FromWasm0(arg1, arg2));
1537
1702
  }, arguments) };
1538
- imports.wbg.__wbg_setTimeout_780ac15e3df4c663 = function() { return handleError(function (arg0, arg1, arg2) {
1703
+ imports.wbg.__wbg_setTimeout_06477c23d31efef1 = function() { return handleError(function (arg0, arg1, arg2) {
1539
1704
  const ret = arg0.setTimeout(arg1, arg2);
1540
1705
  return ret;
1541
1706
  }, arguments) };
@@ -1543,25 +1708,25 @@ function __wbg_get_imports() {
1543
1708
  const ret = setTimeout(arg0, arg1);
1544
1709
  return ret;
1545
1710
  }, arguments) };
1546
- imports.wbg.__wbg_set_binaryType_9d839cea8fcdc5c3 = function(arg0, arg1) {
1711
+ imports.wbg.__wbg_set_binaryType_73e8c75df97825f8 = function(arg0, arg1) {
1547
1712
  arg0.binaryType = __wbindgen_enum_BinaryType[arg1];
1548
1713
  };
1549
- imports.wbg.__wbg_set_onclose_c09e4f7422de8dae = function(arg0, arg1) {
1714
+ imports.wbg.__wbg_set_onclose_032729b3d7ed7a9e = function(arg0, arg1) {
1550
1715
  arg0.onclose = arg1;
1551
1716
  };
1552
- imports.wbg.__wbg_set_onerror_337a3a2db9517378 = function(arg0, arg1) {
1717
+ imports.wbg.__wbg_set_onerror_7819daa6af176ddb = function(arg0, arg1) {
1553
1718
  arg0.onerror = arg1;
1554
1719
  };
1555
- imports.wbg.__wbg_set_onmessage_8661558551a89792 = function(arg0, arg1) {
1720
+ imports.wbg.__wbg_set_onmessage_6fa00f5d8f1c055a = function(arg0, arg1) {
1556
1721
  arg0.onmessage = arg1;
1557
1722
  };
1558
- imports.wbg.__wbg_set_onmessage_86d8d65dbed3a751 = function(arg0, arg1) {
1723
+ imports.wbg.__wbg_set_onmessage_71321d0bed69856c = function(arg0, arg1) {
1559
1724
  arg0.onmessage = arg1;
1560
1725
  };
1561
- imports.wbg.__wbg_set_onmessage_ac099d3d55b27116 = function(arg0, arg1) {
1726
+ imports.wbg.__wbg_set_onmessage_f0d5bf805190d1d8 = function(arg0, arg1) {
1562
1727
  arg0.onmessage = arg1;
1563
1728
  };
1564
- imports.wbg.__wbg_set_onopen_efccb9305427b907 = function(arg0, arg1) {
1729
+ imports.wbg.__wbg_set_onopen_6d4abedb27ba5656 = function(arg0, arg1) {
1565
1730
  arg0.onopen = arg1;
1566
1731
  };
1567
1732
  imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
@@ -1571,59 +1736,59 @@ function __wbg_get_imports() {
1571
1736
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1572
1737
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1573
1738
  };
1574
- imports.wbg.__wbg_start_90678d64025085fc = function(arg0) {
1739
+ imports.wbg.__wbg_start_dd05b3be5674e9f3 = function(arg0) {
1575
1740
  arg0.start();
1576
1741
  };
1577
- imports.wbg.__wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e = function() {
1742
+ imports.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335 = function() {
1578
1743
  const ret = typeof global === 'undefined' ? null : global;
1579
1744
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1580
1745
  };
1581
- imports.wbg.__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac = function() {
1746
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1 = function() {
1582
1747
  const ret = typeof globalThis === 'undefined' ? null : globalThis;
1583
1748
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1584
1749
  };
1585
- imports.wbg.__wbg_static_accessor_SELF_6fdf4b64710cc91b = function() {
1750
+ imports.wbg.__wbg_static_accessor_SELF_08f5a74c69739274 = function() {
1586
1751
  const ret = typeof self === 'undefined' ? null : self;
1587
1752
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1588
1753
  };
1589
- imports.wbg.__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2 = function() {
1754
+ imports.wbg.__wbg_static_accessor_WINDOW_a8924b26aa92d024 = function() {
1590
1755
  const ret = typeof window === 'undefined' ? null : window;
1591
1756
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1592
1757
  };
1593
- imports.wbg.__wbg_then_4f46f6544e6b4a28 = function(arg0, arg1) {
1594
- const ret = arg0.then(arg1);
1758
+ imports.wbg.__wbg_then_429f7caf1026411d = function(arg0, arg1, arg2) {
1759
+ const ret = arg0.then(arg1, arg2);
1595
1760
  return ret;
1596
1761
  };
1597
- imports.wbg.__wbg_then_70d05cf780a18d77 = function(arg0, arg1, arg2) {
1598
- const ret = arg0.then(arg1, arg2);
1762
+ imports.wbg.__wbg_then_4f95312d68691235 = function(arg0, arg1) {
1763
+ const ret = arg0.then(arg1);
1599
1764
  return ret;
1600
1765
  };
1601
- imports.wbg.__wbg_warn_1d74dddbe2fd1dbb = function(arg0) {
1766
+ imports.wbg.__wbg_warn_6e567d0d926ff881 = function(arg0) {
1602
1767
  console.warn(arg0);
1603
1768
  };
1604
- imports.wbg.__wbindgen_cast_185aa6d69e66b753 = function(arg0, arg1) {
1605
- // Cast intrinsic for `Closure(Closure { dtor_idx: 223, function: Function { arguments: [], shim_idx: 224, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1606
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__he3a6d52737a61d69, wasm_bindgen__convert__closures_____invoke__h4c33ce4d986075ed);
1607
- return ret;
1608
- };
1609
1769
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1610
1770
  // Cast intrinsic for `Ref(String) -> Externref`.
1611
1771
  const ret = getStringFromWasm0(arg0, arg1);
1612
1772
  return ret;
1613
1773
  };
1774
+ imports.wbg.__wbindgen_cast_50587bdb51ef1517 = function(arg0, arg1) {
1775
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 264, function: Function { arguments: [Externref], shim_idx: 265, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1776
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h60ca8c1f3f61ef16, wasm_bindgen__convert__closures_____invoke__ha8b0b9fe7fac12a4);
1777
+ return ret;
1778
+ };
1614
1779
  imports.wbg.__wbindgen_cast_841ad4dc62ebec90 = function(arg0, arg1) {
1615
1780
  // 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`.
1616
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h3e5175841145af54, wasm_bindgen__convert__closures_____invoke__h83490f8cd1f822be);
1781
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h2f92eaaa514835eb, wasm_bindgen__convert__closures_____invoke__h07efcda49d573328);
1617
1782
  return ret;
1618
1783
  };
1619
1784
  imports.wbg.__wbindgen_cast_9a4d11962b71bb1d = function(arg0, arg1) {
1620
1785
  // 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`.
1621
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h3e5175841145af54, wasm_bindgen__convert__closures_____invoke__h83490f8cd1f822be);
1786
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h2f92eaaa514835eb, wasm_bindgen__convert__closures_____invoke__h07efcda49d573328);
1622
1787
  return ret;
1623
1788
  };
1624
- imports.wbg.__wbindgen_cast_9f5e1abc47e97f45 = function(arg0, arg1) {
1625
- // Cast intrinsic for `Closure(Closure { dtor_idx: 234, function: Function { arguments: [Externref], shim_idx: 235, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1626
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h2a5cb8478cd1adb0, wasm_bindgen__convert__closures_____invoke__hacd56641ea4358f0);
1789
+ imports.wbg.__wbindgen_cast_cb324e6edc0859b7 = function(arg0, arg1) {
1790
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 253, function: Function { arguments: [], shim_idx: 254, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1791
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h41d50b86eff9c0fb, wasm_bindgen__convert__closures_____invoke__hf8b807ed3211f368);
1627
1792
  return ret;
1628
1793
  };
1629
1794
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
@@ -1633,7 +1798,7 @@ function __wbg_get_imports() {
1633
1798
  };
1634
1799
  imports.wbg.__wbindgen_cast_eee2c0f90882ae61 = function(arg0, arg1) {
1635
1800
  // 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`.
1636
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h3e5175841145af54, wasm_bindgen__convert__closures_____invoke__h83490f8cd1f822be);
1801
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h2f92eaaa514835eb, wasm_bindgen__convert__closures_____invoke__h07efcda49d573328);
1637
1802
  return ret;
1638
1803
  };
1639
1804
  imports.wbg.__wbindgen_init_externref_table = function() {
@@ -1644,7 +1809,6 @@ function __wbg_get_imports() {
1644
1809
  table.set(offset + 1, null);
1645
1810
  table.set(offset + 2, true);
1646
1811
  table.set(offset + 3, false);
1647
- ;
1648
1812
  };
1649
1813
 
1650
1814
  return imports;
@@ -1674,13 +1838,10 @@ function initSync(module) {
1674
1838
  }
1675
1839
 
1676
1840
  const imports = __wbg_get_imports();
1677
-
1678
1841
  if (!(module instanceof WebAssembly.Module)) {
1679
1842
  module = new WebAssembly.Module(module);
1680
1843
  }
1681
-
1682
1844
  const instance = new WebAssembly.Instance(module, imports);
1683
-
1684
1845
  return __wbg_finalize_init(instance, module);
1685
1846
  }
1686
1847
 
Binary file
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "fabriciobracht <fabricio@bracht.dev>"
6
6
  ],
7
7
  "description": "MQTT v5.0 WebAssembly client and broker for browser environments",
8
- "version": "0.1.2",
8
+ "version": "0.2.1",
9
9
  "license": "MIT OR Apache-2.0",
10
10
  "repository": {
11
11
  "type": "git",