@xconnio/xconn 0.0.0-stage → 0.6.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/CHANGELOG.md +31 -0
- package/LICENSE +22 -0
- package/README.md +281 -2
- package/dist/auth.d.ts +51 -0
- package/dist/auth.js +57 -0
- package/dist/call.d.ts +38 -0
- package/dist/call.js +146 -0
- package/dist/client.d.ts +21 -0
- package/dist/client.js +62 -0
- package/dist/constants.d.ts +60 -0
- package/dist/constants.js +61 -0
- package/dist/crypto.d.ts +9 -0
- package/dist/crypto.js +25 -0
- package/dist/discovery.d.ts +20 -0
- package/dist/discovery.js +25 -0
- package/dist/exception.d.ts +12 -0
- package/dist/exception.js +28 -0
- package/dist/inbox.d.ts +14 -0
- package/dist/inbox.js +71 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +15 -0
- package/dist/message.d.ts +33 -0
- package/dist/message.js +59 -0
- package/dist/native.d.ts +6 -0
- package/dist/native.js +35 -0
- package/dist/package.json +1 -0
- package/dist/payload.d.ts +48 -0
- package/dist/payload.js +314 -0
- package/dist/peer.d.ts +16 -0
- package/dist/peer.js +124 -0
- package/dist/requests.d.ts +57 -0
- package/dist/requests.js +121 -0
- package/dist/rpc-streams.d.ts +13 -0
- package/dist/rpc-streams.js +31 -0
- package/dist/serializers.d.ts +29 -0
- package/dist/serializers.js +44 -0
- package/dist/session.d.ts +67 -0
- package/dist/session.js +528 -0
- package/dist/toolchain.txt +3 -0
- package/dist/transport.d.ts +47 -0
- package/dist/transport.js +201 -0
- package/dist/types.d.ts +70 -0
- package/dist/types.js +140 -0
- package/dist/util.d.ts +2 -0
- package/dist/util.js +20 -0
- package/dist/wasm/xconn_browser.d.ts +176 -0
- package/dist/wasm/xconn_browser.js +1467 -0
- package/dist/wasm/xconn_browser_bg.wasm +0 -0
- package/dist/wasm/xconn_browser_bg.wasm.d.ts +53 -0
- package/dist/webrtc.d.ts +98 -0
- package/dist/webrtc.js +712 -0
- package/dist/webtransport.d.ts +31 -0
- package/dist/webtransport.js +242 -0
- package/package.json +47 -4
|
@@ -0,0 +1,1467 @@
|
|
|
1
|
+
/* @ts-self-types="./xconn_browser.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The same bounded message assembler used by the native WebRTC transport.
|
|
5
|
+
*/
|
|
6
|
+
export class ChannelFraming {
|
|
7
|
+
__destroy_into_raw() {
|
|
8
|
+
const ptr = this.__wbg_ptr;
|
|
9
|
+
this.__wbg_ptr = 0;
|
|
10
|
+
ChannelFramingFinalization.unregister(this);
|
|
11
|
+
return ptr;
|
|
12
|
+
}
|
|
13
|
+
free() {
|
|
14
|
+
const ptr = this.__destroy_into_raw();
|
|
15
|
+
wasm.__wbg_channelframing_free(ptr, 0);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @param {Uint8Array} message
|
|
19
|
+
* @returns {Array<any>}
|
|
20
|
+
*/
|
|
21
|
+
encode(message) {
|
|
22
|
+
try {
|
|
23
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
24
|
+
const ptr0 = passArray8ToWasm0(message, wasm.__wbindgen_export);
|
|
25
|
+
const len0 = WASM_VECTOR_LEN;
|
|
26
|
+
wasm.channelframing_encode(retptr, this.__wbg_ptr, ptr0, len0);
|
|
27
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
28
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
29
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
30
|
+
if (r2) {
|
|
31
|
+
throw takeObject(r1);
|
|
32
|
+
}
|
|
33
|
+
return takeObject(r0);
|
|
34
|
+
} finally {
|
|
35
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @param {Uint8Array} chunk
|
|
40
|
+
* @returns {Uint8Array | undefined}
|
|
41
|
+
*/
|
|
42
|
+
feed(chunk) {
|
|
43
|
+
try {
|
|
44
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
45
|
+
const ptr0 = passArray8ToWasm0(chunk, wasm.__wbindgen_export);
|
|
46
|
+
const len0 = WASM_VECTOR_LEN;
|
|
47
|
+
wasm.channelframing_feed(retptr, this.__wbg_ptr, ptr0, len0);
|
|
48
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
49
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
50
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
51
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
52
|
+
if (r3) {
|
|
53
|
+
throw takeObject(r2);
|
|
54
|
+
}
|
|
55
|
+
let v2;
|
|
56
|
+
if (r0 !== 0) {
|
|
57
|
+
v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
58
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
59
|
+
}
|
|
60
|
+
return v2;
|
|
61
|
+
} finally {
|
|
62
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @param {number | null} [maximum]
|
|
67
|
+
*/
|
|
68
|
+
constructor(maximum) {
|
|
69
|
+
try {
|
|
70
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
71
|
+
wasm.channelframing_new(retptr, isLikeNone(maximum) ? Number.MAX_SAFE_INTEGER : (maximum) >>> 0);
|
|
72
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
73
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
74
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
75
|
+
if (r2) {
|
|
76
|
+
throw takeObject(r1);
|
|
77
|
+
}
|
|
78
|
+
this.__wbg_ptr = r0;
|
|
79
|
+
ChannelFramingFinalization.register(this, this.__wbg_ptr, this);
|
|
80
|
+
return this;
|
|
81
|
+
} finally {
|
|
82
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (Symbol.dispose) ChannelFraming.prototype[Symbol.dispose] = ChannelFraming.prototype.free;
|
|
87
|
+
|
|
88
|
+
export class ClientProtocol {
|
|
89
|
+
__destroy_into_raw() {
|
|
90
|
+
const ptr = this.__wbg_ptr;
|
|
91
|
+
this.__wbg_ptr = 0;
|
|
92
|
+
ClientProtocolFinalization.unregister(this);
|
|
93
|
+
return ptr;
|
|
94
|
+
}
|
|
95
|
+
free() {
|
|
96
|
+
const ptr = this.__destroy_into_raw();
|
|
97
|
+
wasm.__wbg_clientprotocol_free(ptr, 0);
|
|
98
|
+
}
|
|
99
|
+
check_challenge() {
|
|
100
|
+
try {
|
|
101
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
102
|
+
wasm.clientprotocol_check_challenge(retptr, this.__wbg_ptr);
|
|
103
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
104
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
105
|
+
if (r1) {
|
|
106
|
+
throw takeObject(r0);
|
|
107
|
+
}
|
|
108
|
+
} finally {
|
|
109
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* @returns {any}
|
|
114
|
+
*/
|
|
115
|
+
details() {
|
|
116
|
+
try {
|
|
117
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
118
|
+
wasm.clientprotocol_details(retptr, this.__wbg_ptr);
|
|
119
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
120
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
121
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
122
|
+
if (r2) {
|
|
123
|
+
throw takeObject(r1);
|
|
124
|
+
}
|
|
125
|
+
return takeObject(r0);
|
|
126
|
+
} finally {
|
|
127
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* @returns {any}
|
|
132
|
+
*/
|
|
133
|
+
hello() {
|
|
134
|
+
try {
|
|
135
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
136
|
+
wasm.clientprotocol_hello(retptr, this.__wbg_ptr);
|
|
137
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
138
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
139
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
140
|
+
if (r2) {
|
|
141
|
+
throw takeObject(r1);
|
|
142
|
+
}
|
|
143
|
+
return takeObject(r0);
|
|
144
|
+
} finally {
|
|
145
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* @returns {boolean}
|
|
150
|
+
*/
|
|
151
|
+
joined() {
|
|
152
|
+
const ret = wasm.clientprotocol_joined(this.__wbg_ptr);
|
|
153
|
+
return ret !== 0;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* @param {string} realm
|
|
157
|
+
* @param {string} codec
|
|
158
|
+
* @param {string} method
|
|
159
|
+
* @param {string} authid
|
|
160
|
+
* @param {any} extra
|
|
161
|
+
*/
|
|
162
|
+
constructor(realm, codec, method, authid, extra) {
|
|
163
|
+
try {
|
|
164
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
165
|
+
const ptr0 = passStringToWasm0(realm, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
166
|
+
const len0 = WASM_VECTOR_LEN;
|
|
167
|
+
const ptr1 = passStringToWasm0(codec, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
168
|
+
const len1 = WASM_VECTOR_LEN;
|
|
169
|
+
const ptr2 = passStringToWasm0(method, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
170
|
+
const len2 = WASM_VECTOR_LEN;
|
|
171
|
+
const ptr3 = passStringToWasm0(authid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
172
|
+
const len3 = WASM_VECTOR_LEN;
|
|
173
|
+
wasm.clientprotocol_new(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, addHeapObject(extra));
|
|
174
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
175
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
176
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
177
|
+
if (r2) {
|
|
178
|
+
throw takeObject(r1);
|
|
179
|
+
}
|
|
180
|
+
this.__wbg_ptr = r0;
|
|
181
|
+
ClientProtocolFinalization.register(this, this.__wbg_ptr, this);
|
|
182
|
+
return this;
|
|
183
|
+
} finally {
|
|
184
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* @param {any} wire
|
|
189
|
+
* @returns {any}
|
|
190
|
+
*/
|
|
191
|
+
receive(wire) {
|
|
192
|
+
try {
|
|
193
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
194
|
+
wasm.clientprotocol_receive(retptr, this.__wbg_ptr, addHeapObject(wire));
|
|
195
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
196
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
197
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
198
|
+
if (r2) {
|
|
199
|
+
throw takeObject(r1);
|
|
200
|
+
}
|
|
201
|
+
return takeObject(r0);
|
|
202
|
+
} finally {
|
|
203
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* @param {any} wire
|
|
208
|
+
*/
|
|
209
|
+
set_authentication(wire) {
|
|
210
|
+
try {
|
|
211
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
212
|
+
wasm.clientprotocol_set_authentication(retptr, this.__wbg_ptr, addHeapObject(wire));
|
|
213
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
214
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
215
|
+
if (r1) {
|
|
216
|
+
throw takeObject(r0);
|
|
217
|
+
}
|
|
218
|
+
} finally {
|
|
219
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if (Symbol.dispose) ClientProtocol.prototype[Symbol.dispose] = ClientProtocol.prototype.free;
|
|
224
|
+
|
|
225
|
+
export class NativeAuthenticator {
|
|
226
|
+
__destroy_into_raw() {
|
|
227
|
+
const ptr = this.__wbg_ptr;
|
|
228
|
+
this.__wbg_ptr = 0;
|
|
229
|
+
NativeAuthenticatorFinalization.unregister(this);
|
|
230
|
+
return ptr;
|
|
231
|
+
}
|
|
232
|
+
free() {
|
|
233
|
+
const ptr = this.__destroy_into_raw();
|
|
234
|
+
wasm.__wbg_nativeauthenticator_free(ptr, 0);
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* @param {any} wire
|
|
238
|
+
* @returns {any}
|
|
239
|
+
*/
|
|
240
|
+
authenticate(wire) {
|
|
241
|
+
try {
|
|
242
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
243
|
+
wasm.nativeauthenticator_authenticate(retptr, this.__wbg_ptr, addHeapObject(wire));
|
|
244
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
245
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
246
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
247
|
+
if (r2) {
|
|
248
|
+
throw takeObject(r1);
|
|
249
|
+
}
|
|
250
|
+
return takeObject(r0);
|
|
251
|
+
} finally {
|
|
252
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* @returns {any}
|
|
257
|
+
*/
|
|
258
|
+
extra() {
|
|
259
|
+
try {
|
|
260
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
261
|
+
wasm.nativeauthenticator_extra(retptr, this.__wbg_ptr);
|
|
262
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
263
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
264
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
265
|
+
if (r2) {
|
|
266
|
+
throw takeObject(r1);
|
|
267
|
+
}
|
|
268
|
+
return takeObject(r0);
|
|
269
|
+
} finally {
|
|
270
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* @param {string} method
|
|
275
|
+
* @param {string} authid
|
|
276
|
+
* @param {string} secret
|
|
277
|
+
* @param {any} extra
|
|
278
|
+
*/
|
|
279
|
+
constructor(method, authid, secret, extra) {
|
|
280
|
+
try {
|
|
281
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
282
|
+
const ptr0 = passStringToWasm0(method, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
283
|
+
const len0 = WASM_VECTOR_LEN;
|
|
284
|
+
const ptr1 = passStringToWasm0(authid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
285
|
+
const len1 = WASM_VECTOR_LEN;
|
|
286
|
+
const ptr2 = passStringToWasm0(secret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
287
|
+
const len2 = WASM_VECTOR_LEN;
|
|
288
|
+
wasm.nativeauthenticator_new(retptr, ptr0, len0, ptr1, len1, ptr2, len2, addHeapObject(extra));
|
|
289
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
290
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
291
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
292
|
+
if (r2) {
|
|
293
|
+
throw takeObject(r1);
|
|
294
|
+
}
|
|
295
|
+
this.__wbg_ptr = r0;
|
|
296
|
+
NativeAuthenticatorFinalization.register(this, this.__wbg_ptr, this);
|
|
297
|
+
return this;
|
|
298
|
+
} finally {
|
|
299
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
if (Symbol.dispose) NativeAuthenticator.prototype[Symbol.dispose] = NativeAuthenticator.prototype.free;
|
|
304
|
+
|
|
305
|
+
export class NativeCodec {
|
|
306
|
+
__destroy_into_raw() {
|
|
307
|
+
const ptr = this.__wbg_ptr;
|
|
308
|
+
this.__wbg_ptr = 0;
|
|
309
|
+
NativeCodecFinalization.unregister(this);
|
|
310
|
+
return ptr;
|
|
311
|
+
}
|
|
312
|
+
free() {
|
|
313
|
+
const ptr = this.__destroy_into_raw();
|
|
314
|
+
wasm.__wbg_nativecodec_free(ptr, 0);
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* @param {Uint8Array} payload
|
|
318
|
+
* @returns {any}
|
|
319
|
+
*/
|
|
320
|
+
decode(payload) {
|
|
321
|
+
try {
|
|
322
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
323
|
+
const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_export);
|
|
324
|
+
const len0 = WASM_VECTOR_LEN;
|
|
325
|
+
wasm.nativecodec_decode(retptr, this.__wbg_ptr, ptr0, len0);
|
|
326
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
327
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
328
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
329
|
+
if (r2) {
|
|
330
|
+
throw takeObject(r1);
|
|
331
|
+
}
|
|
332
|
+
return takeObject(r0);
|
|
333
|
+
} finally {
|
|
334
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* @param {any} wire
|
|
339
|
+
* @returns {Uint8Array}
|
|
340
|
+
*/
|
|
341
|
+
encode(wire) {
|
|
342
|
+
try {
|
|
343
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
344
|
+
wasm.nativecodec_encode(retptr, this.__wbg_ptr, addHeapObject(wire));
|
|
345
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
346
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
347
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
348
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
349
|
+
if (r3) {
|
|
350
|
+
throw takeObject(r2);
|
|
351
|
+
}
|
|
352
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
353
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
354
|
+
return v1;
|
|
355
|
+
} finally {
|
|
356
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* @param {string} name
|
|
361
|
+
*/
|
|
362
|
+
constructor(name) {
|
|
363
|
+
try {
|
|
364
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
365
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
366
|
+
const len0 = WASM_VECTOR_LEN;
|
|
367
|
+
wasm.nativecodec_new(retptr, ptr0, len0);
|
|
368
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
369
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
370
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
371
|
+
if (r2) {
|
|
372
|
+
throw takeObject(r1);
|
|
373
|
+
}
|
|
374
|
+
this.__wbg_ptr = r0;
|
|
375
|
+
NativeCodecFinalization.register(this, this.__wbg_ptr, this);
|
|
376
|
+
return this;
|
|
377
|
+
} finally {
|
|
378
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
if (Symbol.dispose) NativeCodec.prototype[Symbol.dispose] = NativeCodec.prototype.free;
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Static adapters allocate no persistent WASM resource handles.
|
|
386
|
+
*/
|
|
387
|
+
export class PacketCrypto {
|
|
388
|
+
__destroy_into_raw() {
|
|
389
|
+
const ptr = this.__wbg_ptr;
|
|
390
|
+
this.__wbg_ptr = 0;
|
|
391
|
+
PacketCryptoFinalization.unregister(this);
|
|
392
|
+
return ptr;
|
|
393
|
+
}
|
|
394
|
+
free() {
|
|
395
|
+
const ptr = this.__destroy_into_raw();
|
|
396
|
+
wasm.__wbg_packetcrypto_free(ptr, 0);
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* @param {Uint8Array} packet
|
|
400
|
+
* @param {Uint8Array} key
|
|
401
|
+
* @param {Uint8Array} additional_data
|
|
402
|
+
* @returns {Uint8Array}
|
|
403
|
+
*/
|
|
404
|
+
static decrypt(packet, key, additional_data) {
|
|
405
|
+
try {
|
|
406
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
407
|
+
const ptr0 = passArray8ToWasm0(packet, wasm.__wbindgen_export);
|
|
408
|
+
const len0 = WASM_VECTOR_LEN;
|
|
409
|
+
const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_export);
|
|
410
|
+
const len1 = WASM_VECTOR_LEN;
|
|
411
|
+
const ptr2 = passArray8ToWasm0(additional_data, wasm.__wbindgen_export);
|
|
412
|
+
const len2 = WASM_VECTOR_LEN;
|
|
413
|
+
wasm.packetcrypto_decrypt(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
414
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
415
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
416
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
417
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
418
|
+
if (r3) {
|
|
419
|
+
throw takeObject(r2);
|
|
420
|
+
}
|
|
421
|
+
var v4 = getArrayU8FromWasm0(r0, r1).slice();
|
|
422
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
423
|
+
return v4;
|
|
424
|
+
} finally {
|
|
425
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* @param {Uint8Array} secret
|
|
430
|
+
* @param {Uint8Array} info
|
|
431
|
+
* @returns {Uint8Array}
|
|
432
|
+
*/
|
|
433
|
+
static derive_key(secret, info) {
|
|
434
|
+
try {
|
|
435
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
436
|
+
const ptr0 = passArray8ToWasm0(secret, wasm.__wbindgen_export);
|
|
437
|
+
const len0 = WASM_VECTOR_LEN;
|
|
438
|
+
const ptr1 = passArray8ToWasm0(info, wasm.__wbindgen_export);
|
|
439
|
+
const len1 = WASM_VECTOR_LEN;
|
|
440
|
+
wasm.packetcrypto_derive_key(retptr, ptr0, len0, ptr1, len1);
|
|
441
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
442
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
443
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
444
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
445
|
+
if (r3) {
|
|
446
|
+
throw takeObject(r2);
|
|
447
|
+
}
|
|
448
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
449
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
450
|
+
return v3;
|
|
451
|
+
} finally {
|
|
452
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* @param {Uint8Array} plaintext
|
|
457
|
+
* @param {Uint8Array} key
|
|
458
|
+
* @param {Uint8Array} additional_data
|
|
459
|
+
* @returns {Uint8Array}
|
|
460
|
+
*/
|
|
461
|
+
static encrypt(plaintext, key, additional_data) {
|
|
462
|
+
try {
|
|
463
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
464
|
+
const ptr0 = passArray8ToWasm0(plaintext, wasm.__wbindgen_export);
|
|
465
|
+
const len0 = WASM_VECTOR_LEN;
|
|
466
|
+
const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_export);
|
|
467
|
+
const len1 = WASM_VECTOR_LEN;
|
|
468
|
+
const ptr2 = passArray8ToWasm0(additional_data, wasm.__wbindgen_export);
|
|
469
|
+
const len2 = WASM_VECTOR_LEN;
|
|
470
|
+
wasm.packetcrypto_encrypt(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
471
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
472
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
473
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
474
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
475
|
+
if (r3) {
|
|
476
|
+
throw takeObject(r2);
|
|
477
|
+
}
|
|
478
|
+
var v4 = getArrayU8FromWasm0(r0, r1).slice();
|
|
479
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
480
|
+
return v4;
|
|
481
|
+
} finally {
|
|
482
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* @returns {any}
|
|
487
|
+
*/
|
|
488
|
+
static key_pair() {
|
|
489
|
+
try {
|
|
490
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
491
|
+
wasm.packetcrypto_key_pair(retptr);
|
|
492
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
493
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
494
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
495
|
+
if (r2) {
|
|
496
|
+
throw takeObject(r1);
|
|
497
|
+
}
|
|
498
|
+
return takeObject(r0);
|
|
499
|
+
} finally {
|
|
500
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* @param {Uint8Array} _private
|
|
505
|
+
* @param {Uint8Array} _public
|
|
506
|
+
* @returns {Uint8Array}
|
|
507
|
+
*/
|
|
508
|
+
static shared_secret(_private, _public) {
|
|
509
|
+
try {
|
|
510
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
511
|
+
const ptr0 = passArray8ToWasm0(_private, wasm.__wbindgen_export);
|
|
512
|
+
const len0 = WASM_VECTOR_LEN;
|
|
513
|
+
const ptr1 = passArray8ToWasm0(_public, wasm.__wbindgen_export);
|
|
514
|
+
const len1 = WASM_VECTOR_LEN;
|
|
515
|
+
wasm.packetcrypto_shared_secret(retptr, ptr0, len0, ptr1, len1);
|
|
516
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
517
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
518
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
519
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
520
|
+
if (r3) {
|
|
521
|
+
throw takeObject(r2);
|
|
522
|
+
}
|
|
523
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
524
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
525
|
+
return v3;
|
|
526
|
+
} finally {
|
|
527
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
if (Symbol.dispose) PacketCrypto.prototype[Symbol.dispose] = PacketCrypto.prototype.free;
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* RawSocket negotiation and bounded headers shared by browser transports.
|
|
535
|
+
*/
|
|
536
|
+
export class RawSocketFraming {
|
|
537
|
+
__destroy_into_raw() {
|
|
538
|
+
const ptr = this.__wbg_ptr;
|
|
539
|
+
this.__wbg_ptr = 0;
|
|
540
|
+
RawSocketFramingFinalization.unregister(this);
|
|
541
|
+
return ptr;
|
|
542
|
+
}
|
|
543
|
+
free() {
|
|
544
|
+
const ptr = this.__destroy_into_raw();
|
|
545
|
+
wasm.__wbg_rawsocketframing_free(ptr, 0);
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* @param {Uint8Array} data
|
|
549
|
+
*/
|
|
550
|
+
accept_handshake(data) {
|
|
551
|
+
try {
|
|
552
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
553
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
|
|
554
|
+
const len0 = WASM_VECTOR_LEN;
|
|
555
|
+
wasm.rawsocketframing_accept_handshake(retptr, this.__wbg_ptr, ptr0, len0);
|
|
556
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
557
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
558
|
+
if (r1) {
|
|
559
|
+
throw takeObject(r0);
|
|
560
|
+
}
|
|
561
|
+
} finally {
|
|
562
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* @returns {Uint8Array}
|
|
567
|
+
*/
|
|
568
|
+
handshake() {
|
|
569
|
+
try {
|
|
570
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
571
|
+
wasm.rawsocketframing_handshake(retptr, this.__wbg_ptr);
|
|
572
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
573
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
574
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
575
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
576
|
+
if (r3) {
|
|
577
|
+
throw takeObject(r2);
|
|
578
|
+
}
|
|
579
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
580
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
581
|
+
return v1;
|
|
582
|
+
} finally {
|
|
583
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* @param {number} kind
|
|
588
|
+
* @param {number} length
|
|
589
|
+
* @returns {Uint8Array}
|
|
590
|
+
*/
|
|
591
|
+
header(kind, length) {
|
|
592
|
+
try {
|
|
593
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
594
|
+
wasm.rawsocketframing_header(retptr, this.__wbg_ptr, kind, length);
|
|
595
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
596
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
597
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
598
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
599
|
+
if (r3) {
|
|
600
|
+
throw takeObject(r2);
|
|
601
|
+
}
|
|
602
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
603
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
604
|
+
return v1;
|
|
605
|
+
} finally {
|
|
606
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* @param {string} codec
|
|
611
|
+
* @param {number | null} [maximum]
|
|
612
|
+
*/
|
|
613
|
+
constructor(codec, maximum) {
|
|
614
|
+
try {
|
|
615
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
616
|
+
const ptr0 = passStringToWasm0(codec, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
617
|
+
const len0 = WASM_VECTOR_LEN;
|
|
618
|
+
wasm.rawsocketframing_new(retptr, ptr0, len0, isLikeNone(maximum) ? Number.MAX_SAFE_INTEGER : (maximum) >>> 0);
|
|
619
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
620
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
621
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
622
|
+
if (r2) {
|
|
623
|
+
throw takeObject(r1);
|
|
624
|
+
}
|
|
625
|
+
this.__wbg_ptr = r0;
|
|
626
|
+
RawSocketFramingFinalization.register(this, this.__wbg_ptr, this);
|
|
627
|
+
return this;
|
|
628
|
+
} finally {
|
|
629
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* @param {Uint8Array} data
|
|
634
|
+
* @returns {Uint32Array}
|
|
635
|
+
*/
|
|
636
|
+
parse_header(data) {
|
|
637
|
+
try {
|
|
638
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
639
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
|
|
640
|
+
const len0 = WASM_VECTOR_LEN;
|
|
641
|
+
wasm.rawsocketframing_parse_header(retptr, this.__wbg_ptr, ptr0, len0);
|
|
642
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
643
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
644
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
645
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
646
|
+
if (r3) {
|
|
647
|
+
throw takeObject(r2);
|
|
648
|
+
}
|
|
649
|
+
var v2 = getArrayU32FromWasm0(r0, r1).slice();
|
|
650
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
651
|
+
return v2;
|
|
652
|
+
} finally {
|
|
653
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* @returns {number}
|
|
658
|
+
*/
|
|
659
|
+
send_limit() {
|
|
660
|
+
const ret = wasm.rawsocketframing_send_limit(this.__wbg_ptr);
|
|
661
|
+
return ret >>> 0;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
if (Symbol.dispose) RawSocketFraming.prototype[Symbol.dispose] = RawSocketFraming.prototype.free;
|
|
665
|
+
|
|
666
|
+
export class RequestIds {
|
|
667
|
+
__destroy_into_raw() {
|
|
668
|
+
const ptr = this.__wbg_ptr;
|
|
669
|
+
this.__wbg_ptr = 0;
|
|
670
|
+
RequestIdsFinalization.unregister(this);
|
|
671
|
+
return ptr;
|
|
672
|
+
}
|
|
673
|
+
free() {
|
|
674
|
+
const ptr = this.__destroy_into_raw();
|
|
675
|
+
wasm.__wbg_requestids_free(ptr, 0);
|
|
676
|
+
}
|
|
677
|
+
constructor() {
|
|
678
|
+
const ret = wasm.requestids_new();
|
|
679
|
+
this.__wbg_ptr = ret;
|
|
680
|
+
RequestIdsFinalization.register(this, this.__wbg_ptr, this);
|
|
681
|
+
return this;
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* @returns {number}
|
|
685
|
+
*/
|
|
686
|
+
next() {
|
|
687
|
+
const ret = wasm.requestids_next(this.__wbg_ptr);
|
|
688
|
+
return ret;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
if (Symbol.dispose) RequestIds.prototype[Symbol.dispose] = RequestIds.prototype.free;
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* @returns {number}
|
|
695
|
+
*/
|
|
696
|
+
export function channel_message_limit() {
|
|
697
|
+
const ret = wasm.channel_message_limit();
|
|
698
|
+
return ret >>> 0;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
/**
|
|
702
|
+
* @returns {number}
|
|
703
|
+
*/
|
|
704
|
+
export function channel_packet_limit() {
|
|
705
|
+
const ret = wasm.channel_packet_limit();
|
|
706
|
+
return ret >>> 0;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
/**
|
|
710
|
+
* @returns {boolean}
|
|
711
|
+
*/
|
|
712
|
+
export function has_binary_codecs() {
|
|
713
|
+
const ret = wasm.has_binary_codecs();
|
|
714
|
+
return ret !== 0;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* @param {any} wire
|
|
719
|
+
* @returns {any}
|
|
720
|
+
*/
|
|
721
|
+
export function inspect_message(wire) {
|
|
722
|
+
try {
|
|
723
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
724
|
+
wasm.inspect_message(retptr, addHeapObject(wire));
|
|
725
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
726
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
727
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
728
|
+
if (r2) {
|
|
729
|
+
throw takeObject(r1);
|
|
730
|
+
}
|
|
731
|
+
return takeObject(r0);
|
|
732
|
+
} finally {
|
|
733
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* @param {number} code
|
|
739
|
+
* @param {any} value
|
|
740
|
+
* @returns {any}
|
|
741
|
+
*/
|
|
742
|
+
export function make_message(code, value) {
|
|
743
|
+
try {
|
|
744
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
745
|
+
wasm.make_message(retptr, code, addHeapObject(value));
|
|
746
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
747
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
748
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
749
|
+
if (r2) {
|
|
750
|
+
throw takeObject(r1);
|
|
751
|
+
}
|
|
752
|
+
return takeObject(r0);
|
|
753
|
+
} finally {
|
|
754
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* @returns {string}
|
|
760
|
+
*/
|
|
761
|
+
export function raw_channel_protocol() {
|
|
762
|
+
let deferred1_0;
|
|
763
|
+
let deferred1_1;
|
|
764
|
+
try {
|
|
765
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
766
|
+
wasm.raw_channel_protocol(retptr);
|
|
767
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
768
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
769
|
+
deferred1_0 = r0;
|
|
770
|
+
deferred1_1 = r1;
|
|
771
|
+
return getStringFromWasm0(r0, r1);
|
|
772
|
+
} finally {
|
|
773
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
774
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* @returns {number}
|
|
780
|
+
*/
|
|
781
|
+
export function rawsocket_receive_limit() {
|
|
782
|
+
const ret = wasm.rawsocket_receive_limit();
|
|
783
|
+
return ret >>> 0;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
/**
|
|
787
|
+
* @param {string} text
|
|
788
|
+
* @returns {any}
|
|
789
|
+
*/
|
|
790
|
+
export function signaling_decode(text) {
|
|
791
|
+
try {
|
|
792
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
793
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
794
|
+
const len0 = WASM_VECTOR_LEN;
|
|
795
|
+
wasm.signaling_decode(retptr, ptr0, len0);
|
|
796
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
797
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
798
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
799
|
+
if (r2) {
|
|
800
|
+
throw takeObject(r1);
|
|
801
|
+
}
|
|
802
|
+
return takeObject(r0);
|
|
803
|
+
} finally {
|
|
804
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
/**
|
|
809
|
+
* WebRTC signaling uses Rust JSON, independently of the WAMP session codec.
|
|
810
|
+
* @param {any} value
|
|
811
|
+
* @returns {string}
|
|
812
|
+
*/
|
|
813
|
+
export function signaling_encode(value) {
|
|
814
|
+
let deferred2_0;
|
|
815
|
+
let deferred2_1;
|
|
816
|
+
try {
|
|
817
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
818
|
+
wasm.signaling_encode(retptr, addHeapObject(value));
|
|
819
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
820
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
821
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
822
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
823
|
+
var ptr1 = r0;
|
|
824
|
+
var len1 = r1;
|
|
825
|
+
if (r3) {
|
|
826
|
+
ptr1 = 0; len1 = 0;
|
|
827
|
+
throw takeObject(r2);
|
|
828
|
+
}
|
|
829
|
+
deferred2_0 = ptr1;
|
|
830
|
+
deferred2_1 = len1;
|
|
831
|
+
return getStringFromWasm0(ptr1, len1);
|
|
832
|
+
} finally {
|
|
833
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
834
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
function __wbg_get_imports() {
|
|
838
|
+
const import0 = {
|
|
839
|
+
__proto__: null,
|
|
840
|
+
__wbg_Error_30c8987f7c2ed4e2: function(arg0, arg1) {
|
|
841
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
842
|
+
return addHeapObject(ret);
|
|
843
|
+
},
|
|
844
|
+
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
845
|
+
const ret = String(getObject(arg1));
|
|
846
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
847
|
+
const len1 = WASM_VECTOR_LEN;
|
|
848
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
849
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
850
|
+
},
|
|
851
|
+
__wbg___wbindgen_bigint_get_as_i64_a2383202b9353e4c: function(arg0, arg1) {
|
|
852
|
+
const v = getObject(arg1);
|
|
853
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
854
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
855
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
856
|
+
},
|
|
857
|
+
__wbg___wbindgen_boolean_get_5b446f51afd21013: function(arg0) {
|
|
858
|
+
const v = getObject(arg0);
|
|
859
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
860
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
861
|
+
},
|
|
862
|
+
__wbg___wbindgen_debug_string_4687d8d8c2017d52: function(arg0, arg1) {
|
|
863
|
+
const ret = debugString(getObject(arg1));
|
|
864
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
865
|
+
const len1 = WASM_VECTOR_LEN;
|
|
866
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
867
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
868
|
+
},
|
|
869
|
+
__wbg___wbindgen_in_92f62ee1427d9e49: function(arg0, arg1) {
|
|
870
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
871
|
+
return ret;
|
|
872
|
+
},
|
|
873
|
+
__wbg___wbindgen_is_bigint_b123553bed3bb382: function(arg0) {
|
|
874
|
+
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
875
|
+
return ret;
|
|
876
|
+
},
|
|
877
|
+
__wbg___wbindgen_is_function_1f9d30630b8b1d3d: function(arg0) {
|
|
878
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
879
|
+
return ret;
|
|
880
|
+
},
|
|
881
|
+
__wbg___wbindgen_is_null_e343b7d08827ba72: function(arg0) {
|
|
882
|
+
const ret = getObject(arg0) === null;
|
|
883
|
+
return ret;
|
|
884
|
+
},
|
|
885
|
+
__wbg___wbindgen_is_object_3c45d4f2dde4e749: function(arg0) {
|
|
886
|
+
const val = getObject(arg0);
|
|
887
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
888
|
+
return ret;
|
|
889
|
+
},
|
|
890
|
+
__wbg___wbindgen_is_string_90b56bc79aad6f6c: function(arg0) {
|
|
891
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
892
|
+
return ret;
|
|
893
|
+
},
|
|
894
|
+
__wbg___wbindgen_is_undefined_8865fb403f8fe9d8: function(arg0) {
|
|
895
|
+
const ret = getObject(arg0) === undefined;
|
|
896
|
+
return ret;
|
|
897
|
+
},
|
|
898
|
+
__wbg___wbindgen_jsval_eq_02babf21faa37971: function(arg0, arg1) {
|
|
899
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
900
|
+
return ret;
|
|
901
|
+
},
|
|
902
|
+
__wbg___wbindgen_jsval_loose_eq_677f21e468d6b461: function(arg0, arg1) {
|
|
903
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
904
|
+
return ret;
|
|
905
|
+
},
|
|
906
|
+
__wbg___wbindgen_number_get_2e0e7dee9f701a71: function(arg0, arg1) {
|
|
907
|
+
const obj = getObject(arg1);
|
|
908
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
909
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
910
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
911
|
+
},
|
|
912
|
+
__wbg___wbindgen_string_get_0380ccaa2f57f0d9: function(arg0, arg1) {
|
|
913
|
+
const obj = getObject(arg1);
|
|
914
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
915
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
916
|
+
var len1 = WASM_VECTOR_LEN;
|
|
917
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
918
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
919
|
+
},
|
|
920
|
+
__wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
|
|
921
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
922
|
+
},
|
|
923
|
+
__wbg_call_187d372bd5fdd4aa: function() { return handleError(function (arg0, arg1, arg2) {
|
|
924
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
925
|
+
return addHeapObject(ret);
|
|
926
|
+
}, arguments); },
|
|
927
|
+
__wbg_call_6137034ef55c9d0f: function() { return handleError(function (arg0, arg1) {
|
|
928
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
929
|
+
return addHeapObject(ret);
|
|
930
|
+
}, arguments); },
|
|
931
|
+
__wbg_create_7febfb959f8c7046: function(arg0) {
|
|
932
|
+
const ret = Object.create(getObject(arg0));
|
|
933
|
+
return addHeapObject(ret);
|
|
934
|
+
},
|
|
935
|
+
__wbg_crypto_38df2bab126b63dc: function(arg0) {
|
|
936
|
+
const ret = getObject(arg0).crypto;
|
|
937
|
+
return addHeapObject(ret);
|
|
938
|
+
},
|
|
939
|
+
__wbg_done_b41a1d26cdb37fb6: function(arg0) {
|
|
940
|
+
const ret = getObject(arg0).done;
|
|
941
|
+
return ret;
|
|
942
|
+
},
|
|
943
|
+
__wbg_entries_fb6397112b1de25f: function(arg0) {
|
|
944
|
+
const ret = Object.entries(getObject(arg0));
|
|
945
|
+
return addHeapObject(ret);
|
|
946
|
+
},
|
|
947
|
+
__wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
|
|
948
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
949
|
+
}, arguments); },
|
|
950
|
+
__wbg_get_658f6698067d9515: function() { return handleError(function (arg0, arg1) {
|
|
951
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
952
|
+
return addHeapObject(ret);
|
|
953
|
+
}, arguments); },
|
|
954
|
+
__wbg_get_6c896e0571ddae51: function(arg0, arg1) {
|
|
955
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
956
|
+
return addHeapObject(ret);
|
|
957
|
+
},
|
|
958
|
+
__wbg_get_unchecked_288889d017702237: function(arg0, arg1) {
|
|
959
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
960
|
+
return addHeapObject(ret);
|
|
961
|
+
},
|
|
962
|
+
__wbg_instanceof_ArrayBuffer_a99f175873e5d9b8: function(arg0) {
|
|
963
|
+
let result;
|
|
964
|
+
try {
|
|
965
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
966
|
+
} catch (_) {
|
|
967
|
+
result = false;
|
|
968
|
+
}
|
|
969
|
+
const ret = result;
|
|
970
|
+
return ret;
|
|
971
|
+
},
|
|
972
|
+
__wbg_instanceof_Map_b2611749102d7ba3: function(arg0) {
|
|
973
|
+
let result;
|
|
974
|
+
try {
|
|
975
|
+
result = getObject(arg0) instanceof Map;
|
|
976
|
+
} catch (_) {
|
|
977
|
+
result = false;
|
|
978
|
+
}
|
|
979
|
+
const ret = result;
|
|
980
|
+
return ret;
|
|
981
|
+
},
|
|
982
|
+
__wbg_instanceof_Uint8Array_828cef2aaacafc31: function(arg0) {
|
|
983
|
+
let result;
|
|
984
|
+
try {
|
|
985
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
986
|
+
} catch (_) {
|
|
987
|
+
result = false;
|
|
988
|
+
}
|
|
989
|
+
const ret = result;
|
|
990
|
+
return ret;
|
|
991
|
+
},
|
|
992
|
+
__wbg_isArray_e15a2ff68ffdbef2: function(arg0) {
|
|
993
|
+
const ret = Array.isArray(getObject(arg0));
|
|
994
|
+
return ret;
|
|
995
|
+
},
|
|
996
|
+
__wbg_isSafeInteger_717808ad6a54bd9e: function(arg0) {
|
|
997
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
998
|
+
return ret;
|
|
999
|
+
},
|
|
1000
|
+
__wbg_iterator_e3c31c892080e444: function() {
|
|
1001
|
+
const ret = Symbol.iterator;
|
|
1002
|
+
return addHeapObject(ret);
|
|
1003
|
+
},
|
|
1004
|
+
__wbg_length_7f3c00c40364105e: function(arg0) {
|
|
1005
|
+
const ret = getObject(arg0).length;
|
|
1006
|
+
return ret;
|
|
1007
|
+
},
|
|
1008
|
+
__wbg_length_d4bdea10311bd9cf: function(arg0) {
|
|
1009
|
+
const ret = getObject(arg0).length;
|
|
1010
|
+
return ret;
|
|
1011
|
+
},
|
|
1012
|
+
__wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
|
|
1013
|
+
const ret = getObject(arg0).msCrypto;
|
|
1014
|
+
return addHeapObject(ret);
|
|
1015
|
+
},
|
|
1016
|
+
__wbg_new_1dbf7428bba60a42: function(arg0) {
|
|
1017
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
1018
|
+
return addHeapObject(ret);
|
|
1019
|
+
},
|
|
1020
|
+
__wbg_new_ee2291f50781bf1d: function() {
|
|
1021
|
+
const ret = new Array();
|
|
1022
|
+
return addHeapObject(ret);
|
|
1023
|
+
},
|
|
1024
|
+
__wbg_new_from_slice_9a868026ffa4208a: function(arg0, arg1) {
|
|
1025
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
1026
|
+
return addHeapObject(ret);
|
|
1027
|
+
},
|
|
1028
|
+
__wbg_new_with_length_3da0ad195f6f63ba: function(arg0) {
|
|
1029
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
1030
|
+
return addHeapObject(ret);
|
|
1031
|
+
},
|
|
1032
|
+
__wbg_next_33784799010f1bbe: function(arg0) {
|
|
1033
|
+
const ret = getObject(arg0).next;
|
|
1034
|
+
return addHeapObject(ret);
|
|
1035
|
+
},
|
|
1036
|
+
__wbg_next_f4aac29c42af995c: function() { return handleError(function (arg0) {
|
|
1037
|
+
const ret = getObject(arg0).next();
|
|
1038
|
+
return addHeapObject(ret);
|
|
1039
|
+
}, arguments); },
|
|
1040
|
+
__wbg_node_84ea875411254db1: function(arg0) {
|
|
1041
|
+
const ret = getObject(arg0).node;
|
|
1042
|
+
return addHeapObject(ret);
|
|
1043
|
+
},
|
|
1044
|
+
__wbg_process_44c7a14e11e9f69e: function(arg0) {
|
|
1045
|
+
const ret = getObject(arg0).process;
|
|
1046
|
+
return addHeapObject(ret);
|
|
1047
|
+
},
|
|
1048
|
+
__wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
|
|
1049
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
1050
|
+
},
|
|
1051
|
+
__wbg_push_2baf45db356cf468: function(arg0, arg1) {
|
|
1052
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
1053
|
+
return ret;
|
|
1054
|
+
},
|
|
1055
|
+
__wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
|
|
1056
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
1057
|
+
}, arguments); },
|
|
1058
|
+
__wbg_require_b4edbdcf3e2a1ef0: function() { return handleError(function () {
|
|
1059
|
+
const ret = module.require;
|
|
1060
|
+
return addHeapObject(ret);
|
|
1061
|
+
}, arguments); },
|
|
1062
|
+
__wbg_set_145a351398b48c65: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1063
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
1064
|
+
return ret;
|
|
1065
|
+
}, arguments); },
|
|
1066
|
+
__wbg_static_accessor_GLOBAL_266715b9d96ba635: function() {
|
|
1067
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
1068
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1069
|
+
},
|
|
1070
|
+
__wbg_static_accessor_GLOBAL_THIS_10fb7dc1ae063179: function() {
|
|
1071
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
1072
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1073
|
+
},
|
|
1074
|
+
__wbg_static_accessor_SELF_0b583911f537483a: function() {
|
|
1075
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
1076
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1077
|
+
},
|
|
1078
|
+
__wbg_static_accessor_WINDOW_d7f903d1508cbdc4: function() {
|
|
1079
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
1080
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1081
|
+
},
|
|
1082
|
+
__wbg_subarray_002b94d5e13d1411: function(arg0, arg1, arg2) {
|
|
1083
|
+
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1084
|
+
return addHeapObject(ret);
|
|
1085
|
+
},
|
|
1086
|
+
__wbg_value_f3c585ee8f5ba40c: function(arg0) {
|
|
1087
|
+
const ret = getObject(arg0).value;
|
|
1088
|
+
return addHeapObject(ret);
|
|
1089
|
+
},
|
|
1090
|
+
__wbg_versions_276b2795b1c6a219: function(arg0) {
|
|
1091
|
+
const ret = getObject(arg0).versions;
|
|
1092
|
+
return addHeapObject(ret);
|
|
1093
|
+
},
|
|
1094
|
+
__wbindgen_generic_0000000000000001: function(arg0) {
|
|
1095
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
1096
|
+
const ret = arg0;
|
|
1097
|
+
return addHeapObject(ret);
|
|
1098
|
+
},
|
|
1099
|
+
__wbindgen_generic_0000000000000002: function(arg0) {
|
|
1100
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
1101
|
+
const ret = arg0;
|
|
1102
|
+
return addHeapObject(ret);
|
|
1103
|
+
},
|
|
1104
|
+
__wbindgen_generic_0000000000000003: function(arg0, arg1) {
|
|
1105
|
+
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
1106
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
1107
|
+
return addHeapObject(ret);
|
|
1108
|
+
},
|
|
1109
|
+
__wbindgen_generic_0000000000000004: function(arg0, arg1) {
|
|
1110
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1111
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1112
|
+
return addHeapObject(ret);
|
|
1113
|
+
},
|
|
1114
|
+
__wbindgen_generic_0000000000000005: function(arg0) {
|
|
1115
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
1116
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
1117
|
+
return addHeapObject(ret);
|
|
1118
|
+
},
|
|
1119
|
+
__wbindgen_object_clone_ref: function(arg0) {
|
|
1120
|
+
const ret = getObject(arg0);
|
|
1121
|
+
return addHeapObject(ret);
|
|
1122
|
+
},
|
|
1123
|
+
__wbindgen_object_drop_ref: function(arg0) {
|
|
1124
|
+
takeObject(arg0);
|
|
1125
|
+
},
|
|
1126
|
+
};
|
|
1127
|
+
return {
|
|
1128
|
+
__proto__: null,
|
|
1129
|
+
"./xconn_browser_bg.js": import0,
|
|
1130
|
+
};
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
const ChannelFramingFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1134
|
+
? { register: () => {}, unregister: () => {} }
|
|
1135
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_channelframing_free(ptr, 1));
|
|
1136
|
+
const ClientProtocolFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1137
|
+
? { register: () => {}, unregister: () => {} }
|
|
1138
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_clientprotocol_free(ptr, 1));
|
|
1139
|
+
const NativeAuthenticatorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1140
|
+
? { register: () => {}, unregister: () => {} }
|
|
1141
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_nativeauthenticator_free(ptr, 1));
|
|
1142
|
+
const NativeCodecFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1143
|
+
? { register: () => {}, unregister: () => {} }
|
|
1144
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_nativecodec_free(ptr, 1));
|
|
1145
|
+
const PacketCryptoFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1146
|
+
? { register: () => {}, unregister: () => {} }
|
|
1147
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_packetcrypto_free(ptr, 1));
|
|
1148
|
+
const RawSocketFramingFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1149
|
+
? { register: () => {}, unregister: () => {} }
|
|
1150
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_rawsocketframing_free(ptr, 1));
|
|
1151
|
+
const RequestIdsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1152
|
+
? { register: () => {}, unregister: () => {} }
|
|
1153
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_requestids_free(ptr, 1));
|
|
1154
|
+
|
|
1155
|
+
function addHeapObject(obj) {
|
|
1156
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
1157
|
+
const idx = heap_next;
|
|
1158
|
+
heap_next = heap[idx];
|
|
1159
|
+
|
|
1160
|
+
heap[idx] = obj;
|
|
1161
|
+
return idx;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
function debugString(val) {
|
|
1165
|
+
// primitive types
|
|
1166
|
+
const type = typeof val;
|
|
1167
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
1168
|
+
return `${val}`;
|
|
1169
|
+
}
|
|
1170
|
+
if (type == 'string') {
|
|
1171
|
+
return `"${val}"`;
|
|
1172
|
+
}
|
|
1173
|
+
if (type == 'symbol') {
|
|
1174
|
+
const description = val.description;
|
|
1175
|
+
if (description == null) {
|
|
1176
|
+
return 'Symbol';
|
|
1177
|
+
} else {
|
|
1178
|
+
return `Symbol(${description})`;
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
if (type == 'function') {
|
|
1182
|
+
const name = val.name;
|
|
1183
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
1184
|
+
return `Function(${name})`;
|
|
1185
|
+
} else {
|
|
1186
|
+
return 'Function';
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
// objects
|
|
1190
|
+
if (Array.isArray(val)) {
|
|
1191
|
+
const length = val.length;
|
|
1192
|
+
let debug = '[';
|
|
1193
|
+
if (length > 0) {
|
|
1194
|
+
debug += debugString(val[0]);
|
|
1195
|
+
}
|
|
1196
|
+
for(let i = 1; i < length; i++) {
|
|
1197
|
+
debug += ', ' + debugString(val[i]);
|
|
1198
|
+
}
|
|
1199
|
+
debug += ']';
|
|
1200
|
+
return debug;
|
|
1201
|
+
}
|
|
1202
|
+
// Test for built-in
|
|
1203
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
1204
|
+
let className;
|
|
1205
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
1206
|
+
className = builtInMatches[1];
|
|
1207
|
+
} else {
|
|
1208
|
+
// Failed to match the standard '[object ClassName]'
|
|
1209
|
+
return toString.call(val);
|
|
1210
|
+
}
|
|
1211
|
+
if (className == 'Object') {
|
|
1212
|
+
// we're a user defined class or Object
|
|
1213
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
1214
|
+
// easier than looping through ownProperties of `val`.
|
|
1215
|
+
try {
|
|
1216
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
1217
|
+
} catch (_) {
|
|
1218
|
+
return 'Object';
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
// errors
|
|
1222
|
+
if (val instanceof Error) {
|
|
1223
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
1224
|
+
}
|
|
1225
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
1226
|
+
return className;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
function dropObject(idx) {
|
|
1230
|
+
if (idx < 1028) return;
|
|
1231
|
+
heap[idx] = heap_next;
|
|
1232
|
+
heap_next = idx;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
function getArrayU32FromWasm0(ptr, len) {
|
|
1236
|
+
ptr = ptr >>> 0;
|
|
1237
|
+
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
1241
|
+
ptr = ptr >>> 0;
|
|
1242
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
let cachedDataViewMemory0 = null;
|
|
1246
|
+
function getDataViewMemory0() {
|
|
1247
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
1248
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
1249
|
+
}
|
|
1250
|
+
return cachedDataViewMemory0;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
function getStringFromWasm0(ptr, len) {
|
|
1254
|
+
return decodeText(ptr >>> 0, len);
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
let cachedUint32ArrayMemory0 = null;
|
|
1258
|
+
function getUint32ArrayMemory0() {
|
|
1259
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
1260
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
1261
|
+
}
|
|
1262
|
+
return cachedUint32ArrayMemory0;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
let cachedUint8ArrayMemory0 = null;
|
|
1266
|
+
function getUint8ArrayMemory0() {
|
|
1267
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
1268
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
1269
|
+
}
|
|
1270
|
+
return cachedUint8ArrayMemory0;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
function getObject(idx) { return heap[idx]; }
|
|
1274
|
+
|
|
1275
|
+
function handleError(f, args) {
|
|
1276
|
+
try {
|
|
1277
|
+
return f.apply(this, args);
|
|
1278
|
+
} catch (e) {
|
|
1279
|
+
wasm.__wbindgen_export3(addHeapObject(e));
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
let heap = new Array(1024).fill(undefined);
|
|
1284
|
+
heap.push(undefined, null, true, false);
|
|
1285
|
+
|
|
1286
|
+
let heap_next = heap.length;
|
|
1287
|
+
|
|
1288
|
+
function isLikeNone(x) {
|
|
1289
|
+
return x === undefined || x === null;
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
1293
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
1294
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
1295
|
+
WASM_VECTOR_LEN = arg.length;
|
|
1296
|
+
return ptr;
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
1300
|
+
if (realloc === undefined) {
|
|
1301
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1302
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
1303
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
1304
|
+
WASM_VECTOR_LEN = buf.length;
|
|
1305
|
+
return ptr;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
let len = arg.length;
|
|
1309
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
1310
|
+
|
|
1311
|
+
const mem = getUint8ArrayMemory0();
|
|
1312
|
+
|
|
1313
|
+
let offset = 0;
|
|
1314
|
+
|
|
1315
|
+
for (; offset < len; offset++) {
|
|
1316
|
+
const code = arg.charCodeAt(offset);
|
|
1317
|
+
if (code > 0x7F) break;
|
|
1318
|
+
mem[ptr + offset] = code;
|
|
1319
|
+
}
|
|
1320
|
+
if (offset !== len) {
|
|
1321
|
+
if (offset !== 0) {
|
|
1322
|
+
arg = arg.slice(offset);
|
|
1323
|
+
}
|
|
1324
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
1325
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
1326
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
1327
|
+
|
|
1328
|
+
offset += ret.written;
|
|
1329
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
WASM_VECTOR_LEN = offset;
|
|
1333
|
+
return ptr;
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
function takeObject(idx) {
|
|
1337
|
+
const ret = getObject(idx);
|
|
1338
|
+
dropObject(idx);
|
|
1339
|
+
return ret;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1343
|
+
cachedTextDecoder.decode();
|
|
1344
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
1345
|
+
let numBytesDecoded = 0;
|
|
1346
|
+
function decodeText(ptr, len) {
|
|
1347
|
+
numBytesDecoded += len;
|
|
1348
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
1349
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1350
|
+
cachedTextDecoder.decode();
|
|
1351
|
+
numBytesDecoded = len;
|
|
1352
|
+
}
|
|
1353
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
const cachedTextEncoder = new TextEncoder();
|
|
1357
|
+
|
|
1358
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
1359
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
1360
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1361
|
+
view.set(buf);
|
|
1362
|
+
return {
|
|
1363
|
+
read: arg.length,
|
|
1364
|
+
written: buf.length
|
|
1365
|
+
};
|
|
1366
|
+
};
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
let WASM_VECTOR_LEN = 0;
|
|
1370
|
+
|
|
1371
|
+
let wasmModule, wasmInstance, wasm;
|
|
1372
|
+
function __wbg_finalize_init(instance, module) {
|
|
1373
|
+
wasmInstance = instance;
|
|
1374
|
+
wasm = instance.exports;
|
|
1375
|
+
wasmModule = module;
|
|
1376
|
+
cachedDataViewMemory0 = null;
|
|
1377
|
+
cachedUint32ArrayMemory0 = null;
|
|
1378
|
+
cachedUint8ArrayMemory0 = null;
|
|
1379
|
+
return wasm;
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
async function __wbg_load(module, imports) {
|
|
1383
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
1384
|
+
if (!module.ok) {
|
|
1385
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1389
|
+
try {
|
|
1390
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1391
|
+
} catch (e) {
|
|
1392
|
+
const validResponse = expectedResponseType(module.type);
|
|
1393
|
+
|
|
1394
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
1395
|
+
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);
|
|
1396
|
+
|
|
1397
|
+
} else { throw e; }
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
const bytes = await module.arrayBuffer();
|
|
1402
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
1403
|
+
} else {
|
|
1404
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
1405
|
+
|
|
1406
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1407
|
+
return { instance, module };
|
|
1408
|
+
} else {
|
|
1409
|
+
return instance;
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
function expectedResponseType(type) {
|
|
1414
|
+
switch (type) {
|
|
1415
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
1416
|
+
}
|
|
1417
|
+
return false;
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
function initSync(module) {
|
|
1422
|
+
if (wasm !== undefined) return wasm;
|
|
1423
|
+
|
|
1424
|
+
|
|
1425
|
+
if (module !== undefined) {
|
|
1426
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
1427
|
+
({module} = module)
|
|
1428
|
+
} else {
|
|
1429
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
const imports = __wbg_get_imports();
|
|
1434
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
1435
|
+
module = new WebAssembly.Module(module);
|
|
1436
|
+
}
|
|
1437
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
1438
|
+
return __wbg_finalize_init(instance, module);
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
async function __wbg_init(module_or_path) {
|
|
1442
|
+
if (wasm !== undefined) return wasm;
|
|
1443
|
+
|
|
1444
|
+
|
|
1445
|
+
if (module_or_path !== undefined) {
|
|
1446
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1447
|
+
({module_or_path} = module_or_path)
|
|
1448
|
+
} else {
|
|
1449
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
if (module_or_path === undefined) {
|
|
1454
|
+
module_or_path = new URL('xconn_browser_bg.wasm', import.meta.url);
|
|
1455
|
+
}
|
|
1456
|
+
const imports = __wbg_get_imports();
|
|
1457
|
+
|
|
1458
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
1459
|
+
module_or_path = fetch(module_or_path);
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
1463
|
+
|
|
1464
|
+
return __wbg_finalize_init(instance, module);
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
export { initSync, __wbg_init as default };
|