@openipc-rs/web 0.1.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/LICENSE +21 -0
- package/README.md +190 -0
- package/openipc_web.d.ts +168 -0
- package/openipc_web.js +1347 -0
- package/openipc_web_bg.wasm +0 -0
- package/openipc_web_bg.wasm.d.ts +58 -0
- package/package.json +43 -0
package/openipc_web.js
ADDED
|
@@ -0,0 +1,1347 @@
|
|
|
1
|
+
/* @ts-self-types="./openipc_web.d.ts" */
|
|
2
|
+
|
|
3
|
+
export class OpenIpcAdaptiveLink {
|
|
4
|
+
__destroy_into_raw() {
|
|
5
|
+
const ptr = this.__wbg_ptr;
|
|
6
|
+
this.__wbg_ptr = 0;
|
|
7
|
+
OpenIpcAdaptiveLinkFinalization.unregister(this);
|
|
8
|
+
return ptr;
|
|
9
|
+
}
|
|
10
|
+
free() {
|
|
11
|
+
const ptr = this.__destroy_into_raw();
|
|
12
|
+
wasm.__wbg_openipcadaptivelink_free(ptr, 0);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @returns {string}
|
|
16
|
+
*/
|
|
17
|
+
counters() {
|
|
18
|
+
let deferred1_0;
|
|
19
|
+
let deferred1_1;
|
|
20
|
+
try {
|
|
21
|
+
const ret = wasm.openipcadaptivelink_counters(this.__wbg_ptr);
|
|
22
|
+
deferred1_0 = ret[0];
|
|
23
|
+
deferred1_1 = ret[1];
|
|
24
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
25
|
+
} finally {
|
|
26
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @param {number} link_id
|
|
31
|
+
* @param {Uint8Array} keypair
|
|
32
|
+
* @param {bigint} epoch
|
|
33
|
+
* @param {number} fec_k
|
|
34
|
+
* @param {number} fec_n
|
|
35
|
+
*/
|
|
36
|
+
constructor(link_id, keypair, epoch, fec_k, fec_n) {
|
|
37
|
+
const ptr0 = passArray8ToWasm0(keypair, wasm.__wbindgen_malloc);
|
|
38
|
+
const len0 = WASM_VECTOR_LEN;
|
|
39
|
+
const ret = wasm.openipcadaptivelink_new(link_id, ptr0, len0, epoch, fec_k, fec_n);
|
|
40
|
+
if (ret[2]) {
|
|
41
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
42
|
+
}
|
|
43
|
+
this.__wbg_ptr = ret[0];
|
|
44
|
+
OpenIpcAdaptiveLinkFinalization.register(this, this.__wbg_ptr, this);
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* @param {number} now_ms
|
|
49
|
+
* @returns {string}
|
|
50
|
+
*/
|
|
51
|
+
quality(now_ms) {
|
|
52
|
+
let deferred1_0;
|
|
53
|
+
let deferred1_1;
|
|
54
|
+
try {
|
|
55
|
+
const ret = wasm.openipcadaptivelink_quality(this.__wbg_ptr, now_ms);
|
|
56
|
+
deferred1_0 = ret[0];
|
|
57
|
+
deferred1_1 = ret[1];
|
|
58
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
59
|
+
} finally {
|
|
60
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* @param {number} now_ms
|
|
65
|
+
* @param {number} total
|
|
66
|
+
* @param {number} recovered
|
|
67
|
+
* @param {number} lost
|
|
68
|
+
*/
|
|
69
|
+
recordFec(now_ms, total, recovered, lost) {
|
|
70
|
+
wasm.openipcadaptivelink_recordFec(this.__wbg_ptr, now_ms, total, recovered, lost);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* @param {OpenIpcReceiver} receiver
|
|
74
|
+
* @param {number} now_ms
|
|
75
|
+
*/
|
|
76
|
+
recordReceiverCounters(receiver, now_ms) {
|
|
77
|
+
_assertClass(receiver, OpenIpcReceiver);
|
|
78
|
+
wasm.openipcadaptivelink_recordReceiverCounters(this.__wbg_ptr, receiver.__wbg_ptr, now_ms);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* @param {number} now_ms
|
|
82
|
+
* @param {number} rssi0
|
|
83
|
+
* @param {number} rssi1
|
|
84
|
+
* @param {number} snr0
|
|
85
|
+
* @param {number} snr1
|
|
86
|
+
*/
|
|
87
|
+
recordRx(now_ms, rssi0, rssi1, snr0, snr1) {
|
|
88
|
+
wasm.openipcadaptivelink_recordRx(this.__wbg_ptr, now_ms, rssi0, rssi1, snr0, snr1);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* @param {Uint8Array} transfer
|
|
92
|
+
* @param {number} now_ms
|
|
93
|
+
*/
|
|
94
|
+
recordRxTransfer(transfer, now_ms) {
|
|
95
|
+
const ptr0 = passArray8ToWasm0(transfer, wasm.__wbindgen_malloc);
|
|
96
|
+
const len0 = WASM_VECTOR_LEN;
|
|
97
|
+
const ret = wasm.openipcadaptivelink_recordRxTransfer(this.__wbg_ptr, ptr0, len0, now_ms);
|
|
98
|
+
if (ret[1]) {
|
|
99
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
requestKeyframe() {
|
|
103
|
+
wasm.openipcadaptivelink_requestKeyframe(this.__wbg_ptr);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* @param {number} messages
|
|
107
|
+
*/
|
|
108
|
+
setKeyframeRequestMessages(messages) {
|
|
109
|
+
wasm.openipcadaptivelink_setKeyframeRequestMessages(this.__wbg_ptr, messages);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* @param {number} idle_ms
|
|
113
|
+
*/
|
|
114
|
+
setVideoStartIdleMs(idle_ms) {
|
|
115
|
+
wasm.openipcadaptivelink_setVideoStartIdleMs(this.__wbg_ptr, idle_ms);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* @param {number} now_ms
|
|
119
|
+
* @returns {Array<any>}
|
|
120
|
+
*/
|
|
121
|
+
tick(now_ms) {
|
|
122
|
+
const ret = wasm.openipcadaptivelink_tick(this.__wbg_ptr, now_ms);
|
|
123
|
+
if (ret[2]) {
|
|
124
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
125
|
+
}
|
|
126
|
+
return takeFromExternrefTable0(ret[0]);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* @param {WebUsbRealtekDevice} device
|
|
130
|
+
* @param {number} now_ms
|
|
131
|
+
* @param {number} current_channel
|
|
132
|
+
* @returns {Promise<number>}
|
|
133
|
+
*/
|
|
134
|
+
tickAndSend(device, now_ms, current_channel) {
|
|
135
|
+
_assertClass(device, WebUsbRealtekDevice);
|
|
136
|
+
const ret = wasm.openipcadaptivelink_tickAndSend(this.__wbg_ptr, device.__wbg_ptr, now_ms, current_channel);
|
|
137
|
+
return ret;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (Symbol.dispose) OpenIpcAdaptiveLink.prototype[Symbol.dispose] = OpenIpcAdaptiveLink.prototype.free;
|
|
141
|
+
|
|
142
|
+
export class OpenIpcReceiver {
|
|
143
|
+
static __wrap(ptr) {
|
|
144
|
+
const obj = Object.create(OpenIpcReceiver.prototype);
|
|
145
|
+
obj.__wbg_ptr = ptr;
|
|
146
|
+
OpenIpcReceiverFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
147
|
+
return obj;
|
|
148
|
+
}
|
|
149
|
+
__destroy_into_raw() {
|
|
150
|
+
const ptr = this.__wbg_ptr;
|
|
151
|
+
this.__wbg_ptr = 0;
|
|
152
|
+
OpenIpcReceiverFinalization.unregister(this);
|
|
153
|
+
return ptr;
|
|
154
|
+
}
|
|
155
|
+
free() {
|
|
156
|
+
const ptr = this.__destroy_into_raw();
|
|
157
|
+
wasm.__wbg_openipcreceiver_free(ptr, 0);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* @returns {string}
|
|
161
|
+
*/
|
|
162
|
+
fecCounters() {
|
|
163
|
+
let deferred1_0;
|
|
164
|
+
let deferred1_1;
|
|
165
|
+
try {
|
|
166
|
+
const ret = wasm.openipcreceiver_fecCounters(this.__wbg_ptr);
|
|
167
|
+
deferred1_0 = ret[0];
|
|
168
|
+
deferred1_1 = ret[1];
|
|
169
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
170
|
+
} finally {
|
|
171
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
constructor() {
|
|
175
|
+
const ret = wasm.openipcreceiver_new();
|
|
176
|
+
if (ret[2]) {
|
|
177
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
178
|
+
}
|
|
179
|
+
this.__wbg_ptr = ret[0];
|
|
180
|
+
OpenIpcReceiverFinalization.register(this, this.__wbg_ptr, this);
|
|
181
|
+
return this;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* @param {Uint8Array} frame
|
|
185
|
+
* @param {Uint8Array} fragment
|
|
186
|
+
* @returns {Array<any>}
|
|
187
|
+
*/
|
|
188
|
+
pushDecrypted80211Frame(frame, fragment) {
|
|
189
|
+
const ptr0 = passArray8ToWasm0(frame, wasm.__wbindgen_malloc);
|
|
190
|
+
const len0 = WASM_VECTOR_LEN;
|
|
191
|
+
const ptr1 = passArray8ToWasm0(fragment, wasm.__wbindgen_malloc);
|
|
192
|
+
const len1 = WASM_VECTOR_LEN;
|
|
193
|
+
const ret = wasm.openipcreceiver_pushDecrypted80211Frame(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
194
|
+
if (ret[2]) {
|
|
195
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
196
|
+
}
|
|
197
|
+
return takeFromExternrefTable0(ret[0]);
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* @param {string} data_nonce_hex
|
|
201
|
+
* @param {Uint8Array} fragment
|
|
202
|
+
* @returns {Array<any>}
|
|
203
|
+
*/
|
|
204
|
+
pushDecryptedFragment(data_nonce_hex, fragment) {
|
|
205
|
+
const ptr0 = passStringToWasm0(data_nonce_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
206
|
+
const len0 = WASM_VECTOR_LEN;
|
|
207
|
+
const ptr1 = passArray8ToWasm0(fragment, wasm.__wbindgen_malloc);
|
|
208
|
+
const len1 = WASM_VECTOR_LEN;
|
|
209
|
+
const ret = wasm.openipcreceiver_pushDecryptedFragment(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
210
|
+
if (ret[2]) {
|
|
211
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
212
|
+
}
|
|
213
|
+
return takeFromExternrefTable0(ret[0]);
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* @param {Uint8Array} frame
|
|
217
|
+
* @returns {Array<any>}
|
|
218
|
+
*/
|
|
219
|
+
pushEncrypted80211Frame(frame) {
|
|
220
|
+
const ptr0 = passArray8ToWasm0(frame, wasm.__wbindgen_malloc);
|
|
221
|
+
const len0 = WASM_VECTOR_LEN;
|
|
222
|
+
const ret = wasm.openipcreceiver_pushEncrypted80211Frame(this.__wbg_ptr, ptr0, len0);
|
|
223
|
+
if (ret[2]) {
|
|
224
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
225
|
+
}
|
|
226
|
+
return takeFromExternrefTable0(ret[0]);
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* @param {Uint8Array} data
|
|
230
|
+
* @returns {Uint8Array | undefined}
|
|
231
|
+
*/
|
|
232
|
+
pushRtpPacket(data) {
|
|
233
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
234
|
+
const len0 = WASM_VECTOR_LEN;
|
|
235
|
+
const ret = wasm.openipcreceiver_pushRtpPacket(this.__wbg_ptr, ptr0, len0);
|
|
236
|
+
return ret;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* @param {Uint8Array} data
|
|
240
|
+
* @returns {OpenIpcVideoFrame | null}
|
|
241
|
+
*/
|
|
242
|
+
pushRtpPacketDetailed(data) {
|
|
243
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
244
|
+
const len0 = WASM_VECTOR_LEN;
|
|
245
|
+
const ret = wasm.openipcreceiver_pushRtpPacketDetailed(this.__wbg_ptr, ptr0, len0);
|
|
246
|
+
if (ret[2]) {
|
|
247
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
248
|
+
}
|
|
249
|
+
return takeFromExternrefTable0(ret[0]);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* @param {Uint8Array} transfer
|
|
253
|
+
* @returns {Array<any>}
|
|
254
|
+
*/
|
|
255
|
+
pushRxTransfer(transfer) {
|
|
256
|
+
const ptr0 = passArray8ToWasm0(transfer, wasm.__wbindgen_malloc);
|
|
257
|
+
const len0 = WASM_VECTOR_LEN;
|
|
258
|
+
const ret = wasm.openipcreceiver_pushRxTransfer(this.__wbg_ptr, ptr0, len0);
|
|
259
|
+
if (ret[2]) {
|
|
260
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
261
|
+
}
|
|
262
|
+
return takeFromExternrefTable0(ret[0]);
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* @param {Uint8Array} transfer
|
|
266
|
+
* @returns {OpenIpcVideoFrame[]}
|
|
267
|
+
*/
|
|
268
|
+
pushRxTransferDetailed(transfer) {
|
|
269
|
+
const ptr0 = passArray8ToWasm0(transfer, wasm.__wbindgen_malloc);
|
|
270
|
+
const len0 = WASM_VECTOR_LEN;
|
|
271
|
+
const ret = wasm.openipcreceiver_pushRxTransferDetailed(this.__wbg_ptr, ptr0, len0);
|
|
272
|
+
if (ret[2]) {
|
|
273
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
274
|
+
}
|
|
275
|
+
return takeFromExternrefTable0(ret[0]);
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* @param {Uint8Array} transfer
|
|
279
|
+
* @returns {OpenIpcRxTransferProfile}
|
|
280
|
+
*/
|
|
281
|
+
pushRxTransferProfiled(transfer) {
|
|
282
|
+
const ptr0 = passArray8ToWasm0(transfer, wasm.__wbindgen_malloc);
|
|
283
|
+
const len0 = WASM_VECTOR_LEN;
|
|
284
|
+
const ret = wasm.openipcreceiver_pushRxTransferProfiled(this.__wbg_ptr, ptr0, len0);
|
|
285
|
+
if (ret[2]) {
|
|
286
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
287
|
+
}
|
|
288
|
+
return takeFromExternrefTable0(ret[0]);
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* @param {number} channel_id
|
|
292
|
+
* @param {number} fec_k
|
|
293
|
+
* @param {number} fec_n
|
|
294
|
+
* @returns {OpenIpcReceiver}
|
|
295
|
+
*/
|
|
296
|
+
static withChannelId(channel_id, fec_k, fec_n) {
|
|
297
|
+
const ret = wasm.openipcreceiver_withChannelId(channel_id, fec_k, fec_n);
|
|
298
|
+
if (ret[2]) {
|
|
299
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
300
|
+
}
|
|
301
|
+
return OpenIpcReceiver.__wrap(ret[0]);
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* @param {number} channel_id
|
|
305
|
+
* @param {Uint8Array} keypair
|
|
306
|
+
* @param {bigint} minimum_epoch
|
|
307
|
+
* @returns {OpenIpcReceiver}
|
|
308
|
+
*/
|
|
309
|
+
static withKeypair(channel_id, keypair, minimum_epoch) {
|
|
310
|
+
const ptr0 = passArray8ToWasm0(keypair, wasm.__wbindgen_malloc);
|
|
311
|
+
const len0 = WASM_VECTOR_LEN;
|
|
312
|
+
const ret = wasm.openipcreceiver_withKeypair(channel_id, ptr0, len0, minimum_epoch);
|
|
313
|
+
if (ret[2]) {
|
|
314
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
315
|
+
}
|
|
316
|
+
return OpenIpcReceiver.__wrap(ret[0]);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
if (Symbol.dispose) OpenIpcReceiver.prototype[Symbol.dispose] = OpenIpcReceiver.prototype.free;
|
|
320
|
+
|
|
321
|
+
export class WebUsbRealtekDevice {
|
|
322
|
+
static __wrap(ptr) {
|
|
323
|
+
const obj = Object.create(WebUsbRealtekDevice.prototype);
|
|
324
|
+
obj.__wbg_ptr = ptr;
|
|
325
|
+
WebUsbRealtekDeviceFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
326
|
+
return obj;
|
|
327
|
+
}
|
|
328
|
+
__destroy_into_raw() {
|
|
329
|
+
const ptr = this.__wbg_ptr;
|
|
330
|
+
this.__wbg_ptr = 0;
|
|
331
|
+
WebUsbRealtekDeviceFinalization.unregister(this);
|
|
332
|
+
return ptr;
|
|
333
|
+
}
|
|
334
|
+
free() {
|
|
335
|
+
const ptr = this.__destroy_into_raw();
|
|
336
|
+
wasm.__wbg_webusbrealtekdevice_free(ptr, 0);
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* @returns {number}
|
|
340
|
+
*/
|
|
341
|
+
bulkInEndpoint() {
|
|
342
|
+
const ret = wasm.webusbrealtekdevice_bulkInEndpoint(this.__wbg_ptr);
|
|
343
|
+
return ret;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* @returns {number}
|
|
347
|
+
*/
|
|
348
|
+
bulkOutEndpoint() {
|
|
349
|
+
const ret = wasm.webusbrealtekdevice_bulkOutEndpoint(this.__wbg_ptr);
|
|
350
|
+
return ret;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* @param {USBDevice} device
|
|
354
|
+
* @returns {Promise<WebUsbRealtekDevice>}
|
|
355
|
+
*/
|
|
356
|
+
static fromWebUsbDevice(device) {
|
|
357
|
+
const ret = wasm.webusbrealtekdevice_fromWebUsbDevice(device);
|
|
358
|
+
return ret;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* @param {number} channel
|
|
362
|
+
* @param {number} channel_width_mhz
|
|
363
|
+
* @param {number} channel_offset
|
|
364
|
+
* @returns {Promise<string>}
|
|
365
|
+
*/
|
|
366
|
+
initializeMonitor(channel, channel_width_mhz, channel_offset) {
|
|
367
|
+
const ret = wasm.webusbrealtekdevice_initializeMonitor(this.__wbg_ptr, channel, channel_width_mhz, channel_offset);
|
|
368
|
+
return ret;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* @param {number} register
|
|
372
|
+
* @returns {Promise<number>}
|
|
373
|
+
*/
|
|
374
|
+
readRegisterU32(register) {
|
|
375
|
+
const ret = wasm.webusbrealtekdevice_readRegisterU32(this.__wbg_ptr, register);
|
|
376
|
+
return ret;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* @param {number} register
|
|
380
|
+
* @returns {Promise<number>}
|
|
381
|
+
*/
|
|
382
|
+
readRegisterU8(register) {
|
|
383
|
+
const ret = wasm.webusbrealtekdevice_readRegisterU8(this.__wbg_ptr, register);
|
|
384
|
+
return ret;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* @param {number} length
|
|
388
|
+
* @returns {Promise<Uint8Array>}
|
|
389
|
+
*/
|
|
390
|
+
readRxTransfer(length) {
|
|
391
|
+
const ret = wasm.webusbrealtekdevice_readRxTransfer(this.__wbg_ptr, length);
|
|
392
|
+
return ret;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* @param {Uint8Array} radiotap_packet
|
|
396
|
+
* @param {number} current_channel
|
|
397
|
+
* @returns {Promise<number>}
|
|
398
|
+
*/
|
|
399
|
+
sendPacket(radiotap_packet, current_channel) {
|
|
400
|
+
const ptr0 = passArray8ToWasm0(radiotap_packet, wasm.__wbindgen_malloc);
|
|
401
|
+
const len0 = WASM_VECTOR_LEN;
|
|
402
|
+
const ret = wasm.webusbrealtekdevice_sendPacket(this.__wbg_ptr, ptr0, len0, current_channel);
|
|
403
|
+
return ret;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* @param {number} current_channel
|
|
407
|
+
* @param {number} power
|
|
408
|
+
* @returns {Promise<void>}
|
|
409
|
+
*/
|
|
410
|
+
setTxPowerOverride(current_channel, power) {
|
|
411
|
+
const ret = wasm.webusbrealtekdevice_setTxPowerOverride(this.__wbg_ptr, current_channel, power);
|
|
412
|
+
return ret;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* @param {Uint8Array} transfer
|
|
416
|
+
* @returns {Promise<number>}
|
|
417
|
+
*/
|
|
418
|
+
writeTxTransfer(transfer) {
|
|
419
|
+
const ptr0 = passArray8ToWasm0(transfer, wasm.__wbindgen_malloc);
|
|
420
|
+
const len0 = WASM_VECTOR_LEN;
|
|
421
|
+
const ret = wasm.webusbrealtekdevice_writeTxTransfer(this.__wbg_ptr, ptr0, len0);
|
|
422
|
+
return ret;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
if (Symbol.dispose) WebUsbRealtekDevice.prototype[Symbol.dispose] = WebUsbRealtekDevice.prototype.free;
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* @returns {Promise<Array<any>>}
|
|
429
|
+
*/
|
|
430
|
+
export function listAuthorizedUsbDevices() {
|
|
431
|
+
const ret = wasm.listAuthorizedUsbDevices();
|
|
432
|
+
return ret;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* @returns {string}
|
|
437
|
+
*/
|
|
438
|
+
export function supportedUsbFilters() {
|
|
439
|
+
let deferred1_0;
|
|
440
|
+
let deferred1_1;
|
|
441
|
+
try {
|
|
442
|
+
const ret = wasm.supportedUsbFilters();
|
|
443
|
+
deferred1_0 = ret[0];
|
|
444
|
+
deferred1_1 = ret[1];
|
|
445
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
446
|
+
} finally {
|
|
447
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
function __wbg_get_imports() {
|
|
451
|
+
const import0 = {
|
|
452
|
+
__proto__: null,
|
|
453
|
+
__wbg___wbindgen_debug_string_c25d447a39f5578f: function(arg0, arg1) {
|
|
454
|
+
const ret = debugString(arg1);
|
|
455
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
456
|
+
const len1 = WASM_VECTOR_LEN;
|
|
457
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
458
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
459
|
+
},
|
|
460
|
+
__wbg___wbindgen_is_function_1ff95bcc5517c252: function(arg0) {
|
|
461
|
+
const ret = typeof(arg0) === 'function';
|
|
462
|
+
return ret;
|
|
463
|
+
},
|
|
464
|
+
__wbg___wbindgen_is_object_a27215656b807791: function(arg0) {
|
|
465
|
+
const val = arg0;
|
|
466
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
467
|
+
return ret;
|
|
468
|
+
},
|
|
469
|
+
__wbg___wbindgen_is_string_ea5e6cc2e4141dfe: function(arg0) {
|
|
470
|
+
const ret = typeof(arg0) === 'string';
|
|
471
|
+
return ret;
|
|
472
|
+
},
|
|
473
|
+
__wbg___wbindgen_is_undefined_c05833b95a3cf397: function(arg0) {
|
|
474
|
+
const ret = arg0 === undefined;
|
|
475
|
+
return ret;
|
|
476
|
+
},
|
|
477
|
+
__wbg___wbindgen_string_get_b0ca35b86a603356: function(arg0, arg1) {
|
|
478
|
+
const obj = arg1;
|
|
479
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
480
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
481
|
+
var len1 = WASM_VECTOR_LEN;
|
|
482
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
483
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
484
|
+
},
|
|
485
|
+
__wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
|
|
486
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
487
|
+
},
|
|
488
|
+
__wbg__wbg_cb_unref_fffb441def202758: function(arg0) {
|
|
489
|
+
arg0._wbg_cb_unref();
|
|
490
|
+
},
|
|
491
|
+
__wbg_alternates_a7b8475e8840999f: function(arg0) {
|
|
492
|
+
const ret = arg0.alternates;
|
|
493
|
+
return ret;
|
|
494
|
+
},
|
|
495
|
+
__wbg_buffer_dd4a6db812895671: function(arg0) {
|
|
496
|
+
const ret = arg0.buffer;
|
|
497
|
+
return ret;
|
|
498
|
+
},
|
|
499
|
+
__wbg_bytesWritten_231cdd79b2c2ba53: function(arg0) {
|
|
500
|
+
const ret = arg0.bytesWritten;
|
|
501
|
+
return ret;
|
|
502
|
+
},
|
|
503
|
+
__wbg_call_8a2dd23819f8a60a: function() { return handleError(function (arg0, arg1) {
|
|
504
|
+
const ret = arg0.call(arg1);
|
|
505
|
+
return ret;
|
|
506
|
+
}, arguments); },
|
|
507
|
+
__wbg_call_a6e5c5dce5018821: function() { return handleError(function (arg0, arg1, arg2) {
|
|
508
|
+
const ret = arg0.call(arg1, arg2);
|
|
509
|
+
return ret;
|
|
510
|
+
}, arguments); },
|
|
511
|
+
__wbg_claimInterface_6811335856e2e73a: function(arg0, arg1) {
|
|
512
|
+
const ret = arg0.claimInterface(arg1);
|
|
513
|
+
return ret;
|
|
514
|
+
},
|
|
515
|
+
__wbg_clearHalt_a7ef8bb1d6ea5b94: function(arg0, arg1, arg2) {
|
|
516
|
+
const ret = arg0.clearHalt(__wbindgen_enum_UsbDirection[arg1], arg2);
|
|
517
|
+
return ret;
|
|
518
|
+
},
|
|
519
|
+
__wbg_configurationValue_2b70d4402fe7d1f1: function(arg0) {
|
|
520
|
+
const ret = arg0.configurationValue;
|
|
521
|
+
return ret;
|
|
522
|
+
},
|
|
523
|
+
__wbg_configuration_a8b2cbb2c5c1cfaf: function(arg0) {
|
|
524
|
+
const ret = arg0.configuration;
|
|
525
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
526
|
+
},
|
|
527
|
+
__wbg_configurations_5b3545606368535c: function(arg0) {
|
|
528
|
+
const ret = arg0.configurations;
|
|
529
|
+
return ret;
|
|
530
|
+
},
|
|
531
|
+
__wbg_controlTransferIn_2ecf845a19bb81c3: function(arg0, arg1, arg2) {
|
|
532
|
+
const ret = arg0.controlTransferIn(arg1, arg2);
|
|
533
|
+
return ret;
|
|
534
|
+
},
|
|
535
|
+
__wbg_controlTransferOut_884118387fd394ac: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
536
|
+
const ret = arg0.controlTransferOut(arg1, getArrayU8FromWasm0(arg2, arg3));
|
|
537
|
+
return ret;
|
|
538
|
+
}, arguments); },
|
|
539
|
+
__wbg_crypto_38df2bab126b63dc: function(arg0) {
|
|
540
|
+
const ret = arg0.crypto;
|
|
541
|
+
return ret;
|
|
542
|
+
},
|
|
543
|
+
__wbg_data_f3c2ee257c33a55f: function(arg0) {
|
|
544
|
+
const ret = arg0.data;
|
|
545
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
546
|
+
},
|
|
547
|
+
__wbg_deviceClass_32ac4aa90a034647: function(arg0) {
|
|
548
|
+
const ret = arg0.deviceClass;
|
|
549
|
+
return ret;
|
|
550
|
+
},
|
|
551
|
+
__wbg_deviceProtocol_024a4b105eaff0b1: function(arg0) {
|
|
552
|
+
const ret = arg0.deviceProtocol;
|
|
553
|
+
return ret;
|
|
554
|
+
},
|
|
555
|
+
__wbg_deviceSubclass_8e6c3719ee4b8984: function(arg0) {
|
|
556
|
+
const ret = arg0.deviceSubclass;
|
|
557
|
+
return ret;
|
|
558
|
+
},
|
|
559
|
+
__wbg_deviceVersionMajor_79230f0bd1167948: function(arg0) {
|
|
560
|
+
const ret = arg0.deviceVersionMajor;
|
|
561
|
+
return ret;
|
|
562
|
+
},
|
|
563
|
+
__wbg_deviceVersionMinor_2d7b927a841871d4: function(arg0) {
|
|
564
|
+
const ret = arg0.deviceVersionMinor;
|
|
565
|
+
return ret;
|
|
566
|
+
},
|
|
567
|
+
__wbg_deviceVersionSubminor_b307ff2bb1218235: function(arg0) {
|
|
568
|
+
const ret = arg0.deviceVersionSubminor;
|
|
569
|
+
return ret;
|
|
570
|
+
},
|
|
571
|
+
__wbg_getDevices_1135dbcd73900f8c: function(arg0) {
|
|
572
|
+
const ret = arg0.getDevices();
|
|
573
|
+
return ret;
|
|
574
|
+
},
|
|
575
|
+
__wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
|
|
576
|
+
arg0.getRandomValues(arg1);
|
|
577
|
+
}, arguments); },
|
|
578
|
+
__wbg_get_507a50627bffa49b: function(arg0, arg1) {
|
|
579
|
+
const ret = arg0[arg1 >>> 0];
|
|
580
|
+
return ret;
|
|
581
|
+
},
|
|
582
|
+
__wbg_get_unchecked_6e0ad6d2a41b06f6: function(arg0, arg1) {
|
|
583
|
+
const ret = arg0[arg1 >>> 0];
|
|
584
|
+
return ret;
|
|
585
|
+
},
|
|
586
|
+
__wbg_instanceof_Error_1fdac9f13a8181ba: function(arg0) {
|
|
587
|
+
let result;
|
|
588
|
+
try {
|
|
589
|
+
result = arg0 instanceof Error;
|
|
590
|
+
} catch (_) {
|
|
591
|
+
result = false;
|
|
592
|
+
}
|
|
593
|
+
const ret = result;
|
|
594
|
+
return ret;
|
|
595
|
+
},
|
|
596
|
+
__wbg_instanceof_Window_05ba1ee4f6781663: function(arg0) {
|
|
597
|
+
let result;
|
|
598
|
+
try {
|
|
599
|
+
result = arg0 instanceof Window;
|
|
600
|
+
} catch (_) {
|
|
601
|
+
result = false;
|
|
602
|
+
}
|
|
603
|
+
const ret = result;
|
|
604
|
+
return ret;
|
|
605
|
+
},
|
|
606
|
+
__wbg_instanceof_WorkerGlobalScope_8ec07b5e040a41c3: function(arg0) {
|
|
607
|
+
let result;
|
|
608
|
+
try {
|
|
609
|
+
result = arg0 instanceof WorkerGlobalScope;
|
|
610
|
+
} catch (_) {
|
|
611
|
+
result = false;
|
|
612
|
+
}
|
|
613
|
+
const ret = result;
|
|
614
|
+
return ret;
|
|
615
|
+
},
|
|
616
|
+
__wbg_interfaceClass_3613e3f761f23a15: function(arg0) {
|
|
617
|
+
const ret = arg0.interfaceClass;
|
|
618
|
+
return ret;
|
|
619
|
+
},
|
|
620
|
+
__wbg_interfaceName_6b41e43e1c16dfe4: function(arg0, arg1) {
|
|
621
|
+
const ret = arg1.interfaceName;
|
|
622
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
623
|
+
var len1 = WASM_VECTOR_LEN;
|
|
624
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
625
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
626
|
+
},
|
|
627
|
+
__wbg_interfaceNumber_74df5503a8316323: function(arg0) {
|
|
628
|
+
const ret = arg0.interfaceNumber;
|
|
629
|
+
return ret;
|
|
630
|
+
},
|
|
631
|
+
__wbg_interfaceProtocol_cbe8d6d10e8389ae: function(arg0) {
|
|
632
|
+
const ret = arg0.interfaceProtocol;
|
|
633
|
+
return ret;
|
|
634
|
+
},
|
|
635
|
+
__wbg_interfaceSubclass_4e37024627b05368: function(arg0) {
|
|
636
|
+
const ret = arg0.interfaceSubclass;
|
|
637
|
+
return ret;
|
|
638
|
+
},
|
|
639
|
+
__wbg_interfaces_0bb70b1af95f6924: function(arg0) {
|
|
640
|
+
const ret = arg0.interfaces;
|
|
641
|
+
return ret;
|
|
642
|
+
},
|
|
643
|
+
__wbg_length_1f0964f4a5e2c6d8: function(arg0) {
|
|
644
|
+
const ret = arg0.length;
|
|
645
|
+
return ret;
|
|
646
|
+
},
|
|
647
|
+
__wbg_length_370319915dc99107: function(arg0) {
|
|
648
|
+
const ret = arg0.length;
|
|
649
|
+
return ret;
|
|
650
|
+
},
|
|
651
|
+
__wbg_manufacturerName_1a946ff31c24d132: function(arg0, arg1) {
|
|
652
|
+
const ret = arg1.manufacturerName;
|
|
653
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
654
|
+
var len1 = WASM_VECTOR_LEN;
|
|
655
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
656
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
657
|
+
},
|
|
658
|
+
__wbg_message_8326fb1d549bebc5: function(arg0) {
|
|
659
|
+
const ret = arg0.message;
|
|
660
|
+
return ret;
|
|
661
|
+
},
|
|
662
|
+
__wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
|
|
663
|
+
const ret = arg0.msCrypto;
|
|
664
|
+
return ret;
|
|
665
|
+
},
|
|
666
|
+
__wbg_name_b0b4809690944614: function(arg0) {
|
|
667
|
+
const ret = arg0.name;
|
|
668
|
+
return ret;
|
|
669
|
+
},
|
|
670
|
+
__wbg_navigator_51379c10a84aeec9: function(arg0) {
|
|
671
|
+
const ret = arg0.navigator;
|
|
672
|
+
return ret;
|
|
673
|
+
},
|
|
674
|
+
__wbg_navigator_99621db14b3f1099: function(arg0) {
|
|
675
|
+
const ret = arg0.navigator;
|
|
676
|
+
return ret;
|
|
677
|
+
},
|
|
678
|
+
__wbg_new_32b398fb48b6d94a: function() {
|
|
679
|
+
const ret = new Array();
|
|
680
|
+
return ret;
|
|
681
|
+
},
|
|
682
|
+
__wbg_new_aec3e25493d729fe: function(arg0, arg1) {
|
|
683
|
+
try {
|
|
684
|
+
var state0 = {a: arg0, b: arg1};
|
|
685
|
+
var cb0 = (arg0, arg1) => {
|
|
686
|
+
const a = state0.a;
|
|
687
|
+
state0.a = 0;
|
|
688
|
+
try {
|
|
689
|
+
return wasm_bindgen__convert__closures_____invoke__h32085c8bafd70877(a, state0.b, arg0, arg1);
|
|
690
|
+
} finally {
|
|
691
|
+
state0.a = a;
|
|
692
|
+
}
|
|
693
|
+
};
|
|
694
|
+
const ret = new Promise(cb0);
|
|
695
|
+
return ret;
|
|
696
|
+
} finally {
|
|
697
|
+
state0.a = 0;
|
|
698
|
+
}
|
|
699
|
+
},
|
|
700
|
+
__wbg_new_b667d279fd5aa943: function(arg0, arg1) {
|
|
701
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
702
|
+
return ret;
|
|
703
|
+
},
|
|
704
|
+
__wbg_new_cd45aabdf6073e84: function(arg0) {
|
|
705
|
+
const ret = new Uint8Array(arg0);
|
|
706
|
+
return ret;
|
|
707
|
+
},
|
|
708
|
+
__wbg_new_da52cf8fe3429cb2: function() {
|
|
709
|
+
const ret = new Object();
|
|
710
|
+
return ret;
|
|
711
|
+
},
|
|
712
|
+
__wbg_new_from_slice_77cdfb7977362f3c: function(arg0, arg1) {
|
|
713
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
714
|
+
return ret;
|
|
715
|
+
},
|
|
716
|
+
__wbg_new_typed_1824d93f294193e5: function(arg0, arg1) {
|
|
717
|
+
try {
|
|
718
|
+
var state0 = {a: arg0, b: arg1};
|
|
719
|
+
var cb0 = (arg0, arg1) => {
|
|
720
|
+
const a = state0.a;
|
|
721
|
+
state0.a = 0;
|
|
722
|
+
try {
|
|
723
|
+
return wasm_bindgen__convert__closures_____invoke__h32085c8bafd70877(a, state0.b, arg0, arg1);
|
|
724
|
+
} finally {
|
|
725
|
+
state0.a = a;
|
|
726
|
+
}
|
|
727
|
+
};
|
|
728
|
+
const ret = new Promise(cb0);
|
|
729
|
+
return ret;
|
|
730
|
+
} finally {
|
|
731
|
+
state0.a = 0;
|
|
732
|
+
}
|
|
733
|
+
},
|
|
734
|
+
__wbg_new_with_length_e6785c33c8e4cce8: function(arg0) {
|
|
735
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
736
|
+
return ret;
|
|
737
|
+
},
|
|
738
|
+
__wbg_node_84ea875411254db1: function(arg0) {
|
|
739
|
+
const ret = arg0.node;
|
|
740
|
+
return ret;
|
|
741
|
+
},
|
|
742
|
+
__wbg_now_390768da5ee9e776: function(arg0) {
|
|
743
|
+
const ret = arg0.now();
|
|
744
|
+
return ret;
|
|
745
|
+
},
|
|
746
|
+
__wbg_now_86c0d4ba3fa605b8: function() {
|
|
747
|
+
const ret = Date.now();
|
|
748
|
+
return ret;
|
|
749
|
+
},
|
|
750
|
+
__wbg_open_62d364ac8ffdbde8: function(arg0) {
|
|
751
|
+
const ret = arg0.open();
|
|
752
|
+
return ret;
|
|
753
|
+
},
|
|
754
|
+
__wbg_performance_3ef602e13d6c3b56: function(arg0) {
|
|
755
|
+
const ret = arg0.performance;
|
|
756
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
757
|
+
},
|
|
758
|
+
__wbg_process_44c7a14e11e9f69e: function(arg0) {
|
|
759
|
+
const ret = arg0.process;
|
|
760
|
+
return ret;
|
|
761
|
+
},
|
|
762
|
+
__wbg_productId_cfbb4d00f62a9411: function(arg0) {
|
|
763
|
+
const ret = arg0.productId;
|
|
764
|
+
return ret;
|
|
765
|
+
},
|
|
766
|
+
__wbg_productName_6844e32b7d337e24: function(arg0, arg1) {
|
|
767
|
+
const ret = arg1.productName;
|
|
768
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
769
|
+
var len1 = WASM_VECTOR_LEN;
|
|
770
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
771
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
772
|
+
},
|
|
773
|
+
__wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
|
|
774
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
775
|
+
},
|
|
776
|
+
__wbg_push_d2ae3af0c1217ae6: function(arg0, arg1) {
|
|
777
|
+
const ret = arg0.push(arg1);
|
|
778
|
+
return ret;
|
|
779
|
+
},
|
|
780
|
+
__wbg_queueMicrotask_0ab5b2d2393e99b9: function(arg0) {
|
|
781
|
+
const ret = arg0.queueMicrotask;
|
|
782
|
+
return ret;
|
|
783
|
+
},
|
|
784
|
+
__wbg_queueMicrotask_6a09b7bc46549209: function(arg0) {
|
|
785
|
+
queueMicrotask(arg0);
|
|
786
|
+
},
|
|
787
|
+
__wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
|
|
788
|
+
arg0.randomFillSync(arg1);
|
|
789
|
+
}, arguments); },
|
|
790
|
+
__wbg_require_b4edbdcf3e2a1ef0: function() { return handleError(function () {
|
|
791
|
+
const ret = module.require;
|
|
792
|
+
return ret;
|
|
793
|
+
}, arguments); },
|
|
794
|
+
__wbg_resolve_2191a4dfe481c25b: function(arg0) {
|
|
795
|
+
const ret = Promise.resolve(arg0);
|
|
796
|
+
return ret;
|
|
797
|
+
},
|
|
798
|
+
__wbg_serialNumber_a527f93706e3877c: function(arg0, arg1) {
|
|
799
|
+
const ret = arg1.serialNumber;
|
|
800
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
801
|
+
var len1 = WASM_VECTOR_LEN;
|
|
802
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
803
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
804
|
+
},
|
|
805
|
+
__wbg_setTimeout_cfa2cf195c3738db: function() { return handleError(function (arg0, arg1, arg2) {
|
|
806
|
+
const ret = arg0.setTimeout(arg1, arg2);
|
|
807
|
+
return ret;
|
|
808
|
+
}, arguments); },
|
|
809
|
+
__wbg_set_8535240470bf2500: function() { return handleError(function (arg0, arg1, arg2) {
|
|
810
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
811
|
+
return ret;
|
|
812
|
+
}, arguments); },
|
|
813
|
+
__wbg_set_index_026f87b8de446722: function(arg0, arg1) {
|
|
814
|
+
arg0.index = arg1;
|
|
815
|
+
},
|
|
816
|
+
__wbg_set_recipient_2f09c154a85c5297: function(arg0, arg1) {
|
|
817
|
+
arg0.recipient = __wbindgen_enum_UsbRecipient[arg1];
|
|
818
|
+
},
|
|
819
|
+
__wbg_set_request_140129d1d3519a2a: function(arg0, arg1) {
|
|
820
|
+
arg0.request = arg1;
|
|
821
|
+
},
|
|
822
|
+
__wbg_set_request_type_ddca0500c52b7763: function(arg0, arg1) {
|
|
823
|
+
arg0.requestType = __wbindgen_enum_UsbRequestType[arg1];
|
|
824
|
+
},
|
|
825
|
+
__wbg_set_value_c8fb96f03456221f: function(arg0, arg1) {
|
|
826
|
+
arg0.value = arg1;
|
|
827
|
+
},
|
|
828
|
+
__wbg_static_accessor_GLOBAL_4ef717fb391d88b7: function() {
|
|
829
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
830
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
831
|
+
},
|
|
832
|
+
__wbg_static_accessor_GLOBAL_THIS_8d1badc68b5a74f4: function() {
|
|
833
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
834
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
835
|
+
},
|
|
836
|
+
__wbg_static_accessor_SELF_146583524fe1469b: function() {
|
|
837
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
838
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
839
|
+
},
|
|
840
|
+
__wbg_static_accessor_WINDOW_f2829a2234d7819e: function() {
|
|
841
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
842
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
843
|
+
},
|
|
844
|
+
__wbg_status_b9296932cb5870cc: function(arg0) {
|
|
845
|
+
const ret = arg0.status;
|
|
846
|
+
return (__wbindgen_enum_UsbTransferStatus.indexOf(ret) + 1 || 4) - 1;
|
|
847
|
+
},
|
|
848
|
+
__wbg_status_bd1cfa034ce61c28: function(arg0) {
|
|
849
|
+
const ret = arg0.status;
|
|
850
|
+
return (__wbindgen_enum_UsbTransferStatus.indexOf(ret) + 1 || 4) - 1;
|
|
851
|
+
},
|
|
852
|
+
__wbg_subarray_3ed232c8a6baee09: function(arg0, arg1, arg2) {
|
|
853
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
854
|
+
return ret;
|
|
855
|
+
},
|
|
856
|
+
__wbg_then_16d107c451e9905d: function(arg0, arg1, arg2) {
|
|
857
|
+
const ret = arg0.then(arg1, arg2);
|
|
858
|
+
return ret;
|
|
859
|
+
},
|
|
860
|
+
__wbg_then_6ec10ae38b3e92f7: function(arg0, arg1) {
|
|
861
|
+
const ret = arg0.then(arg1);
|
|
862
|
+
return ret;
|
|
863
|
+
},
|
|
864
|
+
__wbg_transferIn_1863f66f2444eb0f: function(arg0, arg1, arg2) {
|
|
865
|
+
const ret = arg0.transferIn(arg1, arg2 >>> 0);
|
|
866
|
+
return ret;
|
|
867
|
+
},
|
|
868
|
+
__wbg_transferOut_9ae0996386b70c8a: function() { return handleError(function (arg0, arg1, arg2) {
|
|
869
|
+
const ret = arg0.transferOut(arg1, arg2);
|
|
870
|
+
return ret;
|
|
871
|
+
}, arguments); },
|
|
872
|
+
__wbg_usbVersionMajor_ce57bb6a82f398c3: function(arg0) {
|
|
873
|
+
const ret = arg0.usbVersionMajor;
|
|
874
|
+
return ret;
|
|
875
|
+
},
|
|
876
|
+
__wbg_usbVersionMinor_dffc3baf67e410ac: function(arg0) {
|
|
877
|
+
const ret = arg0.usbVersionMinor;
|
|
878
|
+
return ret;
|
|
879
|
+
},
|
|
880
|
+
__wbg_usbVersionSubminor_45b8a76af6555b2f: function(arg0) {
|
|
881
|
+
const ret = arg0.usbVersionSubminor;
|
|
882
|
+
return ret;
|
|
883
|
+
},
|
|
884
|
+
__wbg_usb_1bb0cdb28c50bd2c: function(arg0) {
|
|
885
|
+
const ret = arg0.usb;
|
|
886
|
+
return ret;
|
|
887
|
+
},
|
|
888
|
+
__wbg_usb_f1108bd9582a233e: function(arg0) {
|
|
889
|
+
const ret = arg0.usb;
|
|
890
|
+
return ret;
|
|
891
|
+
},
|
|
892
|
+
__wbg_vendorId_466abf1a079b740c: function(arg0) {
|
|
893
|
+
const ret = arg0.vendorId;
|
|
894
|
+
return ret;
|
|
895
|
+
},
|
|
896
|
+
__wbg_versions_276b2795b1c6a219: function(arg0) {
|
|
897
|
+
const ret = arg0.versions;
|
|
898
|
+
return ret;
|
|
899
|
+
},
|
|
900
|
+
__wbg_webusbrealtekdevice_new: function(arg0) {
|
|
901
|
+
const ret = WebUsbRealtekDevice.__wrap(arg0);
|
|
902
|
+
return ret;
|
|
903
|
+
},
|
|
904
|
+
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
905
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 172, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
906
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h39fee390da28f45f);
|
|
907
|
+
return ret;
|
|
908
|
+
},
|
|
909
|
+
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
910
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 101, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
911
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h35992852bc42cc91);
|
|
912
|
+
return ret;
|
|
913
|
+
},
|
|
914
|
+
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
915
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("USBInTransferResult")], shim_idx: 128, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
916
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h22e0fe300bd7dd70);
|
|
917
|
+
return ret;
|
|
918
|
+
},
|
|
919
|
+
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
920
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("USBOutTransferResult")], shim_idx: 101, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
921
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h35992852bc42cc91_3);
|
|
922
|
+
return ret;
|
|
923
|
+
},
|
|
924
|
+
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
925
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 101, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
926
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h35992852bc42cc91_4);
|
|
927
|
+
return ret;
|
|
928
|
+
},
|
|
929
|
+
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
|
930
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 104, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
931
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h4d860cdb1981635b);
|
|
932
|
+
return ret;
|
|
933
|
+
},
|
|
934
|
+
__wbindgen_cast_0000000000000007: function(arg0) {
|
|
935
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
936
|
+
const ret = arg0;
|
|
937
|
+
return ret;
|
|
938
|
+
},
|
|
939
|
+
__wbindgen_cast_0000000000000008: function(arg0, arg1) {
|
|
940
|
+
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
941
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
942
|
+
return ret;
|
|
943
|
+
},
|
|
944
|
+
__wbindgen_cast_0000000000000009: function(arg0, arg1) {
|
|
945
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
946
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
947
|
+
return ret;
|
|
948
|
+
},
|
|
949
|
+
__wbindgen_init_externref_table: function() {
|
|
950
|
+
const table = wasm.__wbindgen_externrefs;
|
|
951
|
+
const offset = table.grow(4);
|
|
952
|
+
table.set(0, undefined);
|
|
953
|
+
table.set(offset + 0, undefined);
|
|
954
|
+
table.set(offset + 1, null);
|
|
955
|
+
table.set(offset + 2, true);
|
|
956
|
+
table.set(offset + 3, false);
|
|
957
|
+
},
|
|
958
|
+
};
|
|
959
|
+
return {
|
|
960
|
+
__proto__: null,
|
|
961
|
+
"./openipc_web_bg.js": import0,
|
|
962
|
+
};
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
function wasm_bindgen__convert__closures_____invoke__h4d860cdb1981635b(arg0, arg1) {
|
|
966
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h4d860cdb1981635b(arg0, arg1);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
function wasm_bindgen__convert__closures_____invoke__h39fee390da28f45f(arg0, arg1, arg2) {
|
|
970
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h39fee390da28f45f(arg0, arg1, arg2);
|
|
971
|
+
if (ret[1]) {
|
|
972
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
function wasm_bindgen__convert__closures_____invoke__h35992852bc42cc91(arg0, arg1, arg2) {
|
|
977
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h35992852bc42cc91(arg0, arg1, arg2);
|
|
978
|
+
if (ret[1]) {
|
|
979
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
function wasm_bindgen__convert__closures_____invoke__h22e0fe300bd7dd70(arg0, arg1, arg2) {
|
|
984
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h22e0fe300bd7dd70(arg0, arg1, arg2);
|
|
985
|
+
if (ret[1]) {
|
|
986
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
function wasm_bindgen__convert__closures_____invoke__h35992852bc42cc91_3(arg0, arg1, arg2) {
|
|
991
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h35992852bc42cc91_3(arg0, arg1, arg2);
|
|
992
|
+
if (ret[1]) {
|
|
993
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
function wasm_bindgen__convert__closures_____invoke__h35992852bc42cc91_4(arg0, arg1, arg2) {
|
|
998
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h35992852bc42cc91_4(arg0, arg1, arg2);
|
|
999
|
+
if (ret[1]) {
|
|
1000
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
function wasm_bindgen__convert__closures_____invoke__h32085c8bafd70877(arg0, arg1, arg2, arg3) {
|
|
1005
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h32085c8bafd70877(arg0, arg1, arg2, arg3);
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
|
|
1009
|
+
const __wbindgen_enum_UsbDirection = ["in", "out"];
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
const __wbindgen_enum_UsbRecipient = ["device", "interface", "endpoint", "other"];
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
const __wbindgen_enum_UsbRequestType = ["standard", "class", "vendor"];
|
|
1016
|
+
|
|
1017
|
+
|
|
1018
|
+
const __wbindgen_enum_UsbTransferStatus = ["ok", "stall", "babble"];
|
|
1019
|
+
const OpenIpcAdaptiveLinkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1020
|
+
? { register: () => {}, unregister: () => {} }
|
|
1021
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_openipcadaptivelink_free(ptr, 1));
|
|
1022
|
+
const OpenIpcReceiverFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1023
|
+
? { register: () => {}, unregister: () => {} }
|
|
1024
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_openipcreceiver_free(ptr, 1));
|
|
1025
|
+
const WebUsbRealtekDeviceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1026
|
+
? { register: () => {}, unregister: () => {} }
|
|
1027
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_webusbrealtekdevice_free(ptr, 1));
|
|
1028
|
+
|
|
1029
|
+
function addToExternrefTable0(obj) {
|
|
1030
|
+
const idx = wasm.__externref_table_alloc();
|
|
1031
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
1032
|
+
return idx;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
function _assertClass(instance, klass) {
|
|
1036
|
+
if (!(instance instanceof klass)) {
|
|
1037
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
1042
|
+
? { register: () => {}, unregister: () => {} }
|
|
1043
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
|
|
1044
|
+
|
|
1045
|
+
function debugString(val) {
|
|
1046
|
+
// primitive types
|
|
1047
|
+
const type = typeof val;
|
|
1048
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
1049
|
+
return `${val}`;
|
|
1050
|
+
}
|
|
1051
|
+
if (type == 'string') {
|
|
1052
|
+
return `"${val}"`;
|
|
1053
|
+
}
|
|
1054
|
+
if (type == 'symbol') {
|
|
1055
|
+
const description = val.description;
|
|
1056
|
+
if (description == null) {
|
|
1057
|
+
return 'Symbol';
|
|
1058
|
+
} else {
|
|
1059
|
+
return `Symbol(${description})`;
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
if (type == 'function') {
|
|
1063
|
+
const name = val.name;
|
|
1064
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
1065
|
+
return `Function(${name})`;
|
|
1066
|
+
} else {
|
|
1067
|
+
return 'Function';
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
// objects
|
|
1071
|
+
if (Array.isArray(val)) {
|
|
1072
|
+
const length = val.length;
|
|
1073
|
+
let debug = '[';
|
|
1074
|
+
if (length > 0) {
|
|
1075
|
+
debug += debugString(val[0]);
|
|
1076
|
+
}
|
|
1077
|
+
for(let i = 1; i < length; i++) {
|
|
1078
|
+
debug += ', ' + debugString(val[i]);
|
|
1079
|
+
}
|
|
1080
|
+
debug += ']';
|
|
1081
|
+
return debug;
|
|
1082
|
+
}
|
|
1083
|
+
// Test for built-in
|
|
1084
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
1085
|
+
let className;
|
|
1086
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
1087
|
+
className = builtInMatches[1];
|
|
1088
|
+
} else {
|
|
1089
|
+
// Failed to match the standard '[object ClassName]'
|
|
1090
|
+
return toString.call(val);
|
|
1091
|
+
}
|
|
1092
|
+
if (className == 'Object') {
|
|
1093
|
+
// we're a user defined class or Object
|
|
1094
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
1095
|
+
// easier than looping through ownProperties of `val`.
|
|
1096
|
+
try {
|
|
1097
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
1098
|
+
} catch (_) {
|
|
1099
|
+
return 'Object';
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
// errors
|
|
1103
|
+
if (val instanceof Error) {
|
|
1104
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
1105
|
+
}
|
|
1106
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
1107
|
+
return className;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
1111
|
+
ptr = ptr >>> 0;
|
|
1112
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
let cachedDataViewMemory0 = null;
|
|
1116
|
+
function getDataViewMemory0() {
|
|
1117
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
1118
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
1119
|
+
}
|
|
1120
|
+
return cachedDataViewMemory0;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
function getStringFromWasm0(ptr, len) {
|
|
1124
|
+
return decodeText(ptr >>> 0, len);
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
let cachedUint8ArrayMemory0 = null;
|
|
1128
|
+
function getUint8ArrayMemory0() {
|
|
1129
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
1130
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
1131
|
+
}
|
|
1132
|
+
return cachedUint8ArrayMemory0;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
function handleError(f, args) {
|
|
1136
|
+
try {
|
|
1137
|
+
return f.apply(this, args);
|
|
1138
|
+
} catch (e) {
|
|
1139
|
+
const idx = addToExternrefTable0(e);
|
|
1140
|
+
wasm.__wbindgen_exn_store(idx);
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
function isLikeNone(x) {
|
|
1145
|
+
return x === undefined || x === null;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
function makeMutClosure(arg0, arg1, f) {
|
|
1149
|
+
const state = { a: arg0, b: arg1, cnt: 1 };
|
|
1150
|
+
const real = (...args) => {
|
|
1151
|
+
|
|
1152
|
+
// First up with a closure we increment the internal reference
|
|
1153
|
+
// count. This ensures that the Rust closure environment won't
|
|
1154
|
+
// be deallocated while we're invoking it.
|
|
1155
|
+
state.cnt++;
|
|
1156
|
+
const a = state.a;
|
|
1157
|
+
state.a = 0;
|
|
1158
|
+
try {
|
|
1159
|
+
return f(a, state.b, ...args);
|
|
1160
|
+
} finally {
|
|
1161
|
+
state.a = a;
|
|
1162
|
+
real._wbg_cb_unref();
|
|
1163
|
+
}
|
|
1164
|
+
};
|
|
1165
|
+
real._wbg_cb_unref = () => {
|
|
1166
|
+
if (--state.cnt === 0) {
|
|
1167
|
+
wasm.__wbindgen_destroy_closure(state.a, state.b);
|
|
1168
|
+
state.a = 0;
|
|
1169
|
+
CLOSURE_DTORS.unregister(state);
|
|
1170
|
+
}
|
|
1171
|
+
};
|
|
1172
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
1173
|
+
return real;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
1177
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
1178
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
1179
|
+
WASM_VECTOR_LEN = arg.length;
|
|
1180
|
+
return ptr;
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
1184
|
+
if (realloc === undefined) {
|
|
1185
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1186
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
1187
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
1188
|
+
WASM_VECTOR_LEN = buf.length;
|
|
1189
|
+
return ptr;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
let len = arg.length;
|
|
1193
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
1194
|
+
|
|
1195
|
+
const mem = getUint8ArrayMemory0();
|
|
1196
|
+
|
|
1197
|
+
let offset = 0;
|
|
1198
|
+
|
|
1199
|
+
for (; offset < len; offset++) {
|
|
1200
|
+
const code = arg.charCodeAt(offset);
|
|
1201
|
+
if (code > 0x7F) break;
|
|
1202
|
+
mem[ptr + offset] = code;
|
|
1203
|
+
}
|
|
1204
|
+
if (offset !== len) {
|
|
1205
|
+
if (offset !== 0) {
|
|
1206
|
+
arg = arg.slice(offset);
|
|
1207
|
+
}
|
|
1208
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
1209
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
1210
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
1211
|
+
|
|
1212
|
+
offset += ret.written;
|
|
1213
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
WASM_VECTOR_LEN = offset;
|
|
1217
|
+
return ptr;
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
function takeFromExternrefTable0(idx) {
|
|
1221
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
1222
|
+
wasm.__externref_table_dealloc(idx);
|
|
1223
|
+
return value;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1227
|
+
cachedTextDecoder.decode();
|
|
1228
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
1229
|
+
let numBytesDecoded = 0;
|
|
1230
|
+
function decodeText(ptr, len) {
|
|
1231
|
+
numBytesDecoded += len;
|
|
1232
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
1233
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1234
|
+
cachedTextDecoder.decode();
|
|
1235
|
+
numBytesDecoded = len;
|
|
1236
|
+
}
|
|
1237
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
const cachedTextEncoder = new TextEncoder();
|
|
1241
|
+
|
|
1242
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
1243
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
1244
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1245
|
+
view.set(buf);
|
|
1246
|
+
return {
|
|
1247
|
+
read: arg.length,
|
|
1248
|
+
written: buf.length
|
|
1249
|
+
};
|
|
1250
|
+
};
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
let WASM_VECTOR_LEN = 0;
|
|
1254
|
+
|
|
1255
|
+
let wasmModule, wasmInstance, wasm;
|
|
1256
|
+
function __wbg_finalize_init(instance, module) {
|
|
1257
|
+
wasmInstance = instance;
|
|
1258
|
+
wasm = instance.exports;
|
|
1259
|
+
wasmModule = module;
|
|
1260
|
+
cachedDataViewMemory0 = null;
|
|
1261
|
+
cachedUint8ArrayMemory0 = null;
|
|
1262
|
+
wasm.__wbindgen_start();
|
|
1263
|
+
return wasm;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
async function __wbg_load(module, imports) {
|
|
1267
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
1268
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1269
|
+
try {
|
|
1270
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1271
|
+
} catch (e) {
|
|
1272
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
1273
|
+
|
|
1274
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
1275
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
1276
|
+
|
|
1277
|
+
} else { throw e; }
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
const bytes = await module.arrayBuffer();
|
|
1282
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
1283
|
+
} else {
|
|
1284
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
1285
|
+
|
|
1286
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1287
|
+
return { instance, module };
|
|
1288
|
+
} else {
|
|
1289
|
+
return instance;
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
function expectedResponseType(type) {
|
|
1294
|
+
switch (type) {
|
|
1295
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
1296
|
+
}
|
|
1297
|
+
return false;
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
function initSync(module) {
|
|
1302
|
+
if (wasm !== undefined) return wasm;
|
|
1303
|
+
|
|
1304
|
+
|
|
1305
|
+
if (module !== undefined) {
|
|
1306
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
1307
|
+
({module} = module)
|
|
1308
|
+
} else {
|
|
1309
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
const imports = __wbg_get_imports();
|
|
1314
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
1315
|
+
module = new WebAssembly.Module(module);
|
|
1316
|
+
}
|
|
1317
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
1318
|
+
return __wbg_finalize_init(instance, module);
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
async function __wbg_init(module_or_path) {
|
|
1322
|
+
if (wasm !== undefined) return wasm;
|
|
1323
|
+
|
|
1324
|
+
|
|
1325
|
+
if (module_or_path !== undefined) {
|
|
1326
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1327
|
+
({module_or_path} = module_or_path)
|
|
1328
|
+
} else {
|
|
1329
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
if (module_or_path === undefined) {
|
|
1334
|
+
module_or_path = new URL('openipc_web_bg.wasm', import.meta.url);
|
|
1335
|
+
}
|
|
1336
|
+
const imports = __wbg_get_imports();
|
|
1337
|
+
|
|
1338
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
1339
|
+
module_or_path = fetch(module_or_path);
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
1343
|
+
|
|
1344
|
+
return __wbg_finalize_init(instance, module);
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
export { initSync, __wbg_init as default };
|