rust-fetch 2.1.1 → 2.2.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/README.md +464 -105
- package/llms.txt +91 -0
- package/node.js +113 -9
- package/package.json +31 -6
- package/rust_fetch.d.ts +152 -11
- package/rust_fetch.js +280 -11
- package/rust_fetch_bg.wasm +0 -0
- package/rust_fetch_bg.wasm.d.ts +13 -0
package/rust_fetch.js
CHANGED
|
@@ -325,9 +325,147 @@ export class WasmClient {
|
|
|
325
325
|
const ret = wasm.wasmclient_request(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(headers) ? 0 : addToExternrefTable0(headers), isLikeNone(body) ? 0 : addToExternrefTable0(body), isLikeNone(options) ? 0 : addToExternrefTable0(options));
|
|
326
326
|
return ret;
|
|
327
327
|
}
|
|
328
|
+
/**
|
|
329
|
+
* Open a WebSocket connection. Relative URLs are resolved against the
|
|
330
|
+
* base URL, with `http:` and `https:` becoming `ws:` and `wss:`.
|
|
331
|
+
* @param {string} url
|
|
332
|
+
* @param {WebSocketOptions | null} [options]
|
|
333
|
+
* @returns {WebSocketConnection}
|
|
334
|
+
*/
|
|
335
|
+
websocket(url, options) {
|
|
336
|
+
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
337
|
+
const len0 = WASM_VECTOR_LEN;
|
|
338
|
+
const ret = wasm.wasmclient_websocket(this.__wbg_ptr, ptr0, len0, isLikeNone(options) ? 0 : addToExternrefTable0(options));
|
|
339
|
+
if (ret[2]) {
|
|
340
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
341
|
+
}
|
|
342
|
+
return WebSocketConnection.__wrap(ret[0]);
|
|
343
|
+
}
|
|
328
344
|
}
|
|
329
345
|
if (Symbol.dispose) WasmClient.prototype[Symbol.dispose] = WasmClient.prototype.free;
|
|
330
346
|
|
|
347
|
+
/**
|
|
348
|
+
* A WebSocket connection created by `WasmClient.websocket()`
|
|
349
|
+
*/
|
|
350
|
+
export class WebSocketConnection {
|
|
351
|
+
static __wrap(ptr) {
|
|
352
|
+
const obj = Object.create(WebSocketConnection.prototype);
|
|
353
|
+
obj.__wbg_ptr = ptr;
|
|
354
|
+
WebSocketConnectionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
355
|
+
return obj;
|
|
356
|
+
}
|
|
357
|
+
__destroy_into_raw() {
|
|
358
|
+
const ptr = this.__wbg_ptr;
|
|
359
|
+
this.__wbg_ptr = 0;
|
|
360
|
+
WebSocketConnectionFinalization.unregister(this);
|
|
361
|
+
return ptr;
|
|
362
|
+
}
|
|
363
|
+
free() {
|
|
364
|
+
const ptr = this.__destroy_into_raw();
|
|
365
|
+
wasm.__wbg_websocketconnection_free(ptr, 0);
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Bytes queued by the socket but not yet sent
|
|
369
|
+
* @returns {number}
|
|
370
|
+
*/
|
|
371
|
+
get bufferedAmount() {
|
|
372
|
+
const ret = wasm.websocketconnection_buffered_amount(this.__wbg_ptr);
|
|
373
|
+
return ret;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Close the connection and stop reconnecting. `code` is 1000 (the
|
|
377
|
+
* default) or 3000-4999; `reason` is at most 123 bytes of UTF-8.
|
|
378
|
+
* @param {number | null} [code]
|
|
379
|
+
* @param {string | null} [reason]
|
|
380
|
+
*/
|
|
381
|
+
close(code, reason) {
|
|
382
|
+
var ptr0 = isLikeNone(reason) ? 0 : passStringToWasm0(reason, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
383
|
+
var len0 = WASM_VECTOR_LEN;
|
|
384
|
+
const ret = wasm.websocketconnection_close(this.__wbg_ptr, isLikeNone(code) ? 0xFFFFFF : code, ptr0, len0);
|
|
385
|
+
if (ret[1]) {
|
|
386
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Resolves with the close code and reason once the connection is closed for good
|
|
391
|
+
* @returns {Promise<WebSocketCloseInfo>}
|
|
392
|
+
*/
|
|
393
|
+
get closed() {
|
|
394
|
+
const ret = wasm.websocketconnection_closed(this.__wbg_ptr);
|
|
395
|
+
return ret;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Resolves when the first connection opens; rejects if it never does
|
|
399
|
+
* @returns {Promise<void>}
|
|
400
|
+
*/
|
|
401
|
+
get opened() {
|
|
402
|
+
const ret = wasm.websocketconnection_opened(this.__wbg_ptr);
|
|
403
|
+
return ret;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* The subprotocol the server selected, or `""`
|
|
407
|
+
* @returns {string}
|
|
408
|
+
*/
|
|
409
|
+
get protocol() {
|
|
410
|
+
let deferred1_0;
|
|
411
|
+
let deferred1_1;
|
|
412
|
+
try {
|
|
413
|
+
const ret = wasm.websocketconnection_protocol(this.__wbg_ptr);
|
|
414
|
+
deferred1_0 = ret[0];
|
|
415
|
+
deferred1_1 = ret[1];
|
|
416
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
417
|
+
} finally {
|
|
418
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Send a value as JSON text
|
|
423
|
+
* @param {any} value
|
|
424
|
+
*/
|
|
425
|
+
sendJson(value) {
|
|
426
|
+
const ret = wasm.websocketconnection_sendJson(this.__wbg_ptr, value);
|
|
427
|
+
if (ret[1]) {
|
|
428
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Send a message. Before the connection opens (or while reconnecting),
|
|
433
|
+
* messages are queued and sent once it does.
|
|
434
|
+
* @param {WebSocketData} data
|
|
435
|
+
*/
|
|
436
|
+
send(data) {
|
|
437
|
+
const ret = wasm.websocketconnection_send(this.__wbg_ptr, data);
|
|
438
|
+
if (ret[1]) {
|
|
439
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* `connecting`, `open`, `reconnecting`, `closing` or `closed`
|
|
444
|
+
* @returns {WebSocketState}
|
|
445
|
+
*/
|
|
446
|
+
get state() {
|
|
447
|
+
const ret = wasm.websocketconnection_state(this.__wbg_ptr);
|
|
448
|
+
return ret;
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* The connection URL (`ws:` or `wss:`)
|
|
452
|
+
* @returns {string}
|
|
453
|
+
*/
|
|
454
|
+
get url() {
|
|
455
|
+
let deferred1_0;
|
|
456
|
+
let deferred1_1;
|
|
457
|
+
try {
|
|
458
|
+
const ret = wasm.websocketconnection_url(this.__wbg_ptr);
|
|
459
|
+
deferred1_0 = ret[0];
|
|
460
|
+
deferred1_1 = ret[1];
|
|
461
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
462
|
+
} finally {
|
|
463
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
if (Symbol.dispose) WebSocketConnection.prototype[Symbol.dispose] = WebSocketConnection.prototype.free;
|
|
468
|
+
|
|
331
469
|
/**
|
|
332
470
|
* Create a configured HTTP client (exported for advanced use)
|
|
333
471
|
* @returns {WasmClient}
|
|
@@ -473,6 +611,10 @@ function __wbg_get_imports() {
|
|
|
473
611
|
const ret = typeof(val) === 'object' && val !== null;
|
|
474
612
|
return ret;
|
|
475
613
|
},
|
|
614
|
+
__wbg___wbindgen_is_string_90b56bc79aad6f6c: function(arg0) {
|
|
615
|
+
const ret = typeof(arg0) === 'string';
|
|
616
|
+
return ret;
|
|
617
|
+
},
|
|
476
618
|
__wbg___wbindgen_is_undefined_8865fb403f8fe9d8: function(arg0) {
|
|
477
619
|
const ret = arg0 === undefined;
|
|
478
620
|
return ret;
|
|
@@ -500,6 +642,9 @@ function __wbg_get_imports() {
|
|
|
500
642
|
__wbg_abort_334e7f918b7c5047: function(arg0, arg1) {
|
|
501
643
|
arg0.abort(arg1);
|
|
502
644
|
},
|
|
645
|
+
__wbg_abort_d41cc73c8955bf84: function() { return handleError(function (arg0) {
|
|
646
|
+
arg0.abort();
|
|
647
|
+
}, arguments); },
|
|
503
648
|
__wbg_abort_f78b99d80248bacb: function(arg0) {
|
|
504
649
|
arg0.abort();
|
|
505
650
|
},
|
|
@@ -525,6 +670,10 @@ function __wbg_get_imports() {
|
|
|
525
670
|
const ret = arg0.buffer;
|
|
526
671
|
return ret;
|
|
527
672
|
},
|
|
673
|
+
__wbg_buffered_amount_81bf7df4be61dbbc: function(arg0) {
|
|
674
|
+
const ret = arg0.bufferedAmount;
|
|
675
|
+
return ret;
|
|
676
|
+
},
|
|
528
677
|
__wbg_byobRequest_54f7ce41d584549a: function(arg0) {
|
|
529
678
|
const ret = arg0.byobRequest;
|
|
530
679
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
@@ -561,16 +710,22 @@ function __wbg_get_imports() {
|
|
|
561
710
|
const ret = clearTimeout(arg0);
|
|
562
711
|
return ret;
|
|
563
712
|
},
|
|
564
|
-
|
|
713
|
+
__wbg_clearTimeout_74da542cc655a2ad: function(arg0) {
|
|
565
714
|
clearTimeout(arg0);
|
|
566
715
|
},
|
|
567
716
|
__wbg_close_185286988f30f252: function() { return handleError(function (arg0) {
|
|
568
717
|
arg0.close();
|
|
569
718
|
}, arguments); },
|
|
719
|
+
__wbg_close_3ea8ba2231fba59a: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
720
|
+
arg0.close(arg1, getStringFromWasm0(arg2, arg3));
|
|
721
|
+
}, arguments); },
|
|
722
|
+
__wbg_close_6f5e9e043c59d9d2: function(arg0) {
|
|
723
|
+
arg0.close();
|
|
724
|
+
},
|
|
570
725
|
__wbg_close_748f26698dabe269: function() { return handleError(function (arg0) {
|
|
571
726
|
arg0.close();
|
|
572
727
|
}, arguments); },
|
|
573
|
-
|
|
728
|
+
__wbg_decode_ed35e86ae4034b52: function() { return handleError(function (arg0, arg1) {
|
|
574
729
|
const ret = arg0.decode(arg1);
|
|
575
730
|
return ret;
|
|
576
731
|
}, arguments); },
|
|
@@ -589,7 +744,7 @@ function __wbg_get_imports() {
|
|
|
589
744
|
const ret = Object.entries(arg0);
|
|
590
745
|
return ret;
|
|
591
746
|
},
|
|
592
|
-
|
|
747
|
+
__wbg_fetch_50baebaa97d57d77: function() { return handleError(function (arg0) {
|
|
593
748
|
const ret = fetch(arg0);
|
|
594
749
|
return ret;
|
|
595
750
|
}, arguments); },
|
|
@@ -613,6 +768,13 @@ function __wbg_get_imports() {
|
|
|
613
768
|
const ret = Array.from(arg0);
|
|
614
769
|
return ret;
|
|
615
770
|
},
|
|
771
|
+
__wbg_getAllResponseHeaders_537d007c37d53dba: function() { return handleError(function (arg0, arg1) {
|
|
772
|
+
const ret = arg1.getAllResponseHeaders();
|
|
773
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
774
|
+
const len1 = WASM_VECTOR_LEN;
|
|
775
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
776
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
777
|
+
}, arguments); },
|
|
616
778
|
__wbg_getReader_9facd4f899beac89: function() { return handleError(function (arg0) {
|
|
617
779
|
const ret = arg0.getReader();
|
|
618
780
|
return ret;
|
|
@@ -692,6 +854,10 @@ function __wbg_get_imports() {
|
|
|
692
854
|
const ret = Symbol.iterator;
|
|
693
855
|
return ret;
|
|
694
856
|
},
|
|
857
|
+
__wbg_lengthComputable_0c360fba2e78c440: function(arg0) {
|
|
858
|
+
const ret = arg0.lengthComputable;
|
|
859
|
+
return ret;
|
|
860
|
+
},
|
|
695
861
|
__wbg_length_7f3c00c40364105e: function(arg0) {
|
|
696
862
|
const ret = arg0.length;
|
|
697
863
|
return ret;
|
|
@@ -700,10 +866,18 @@ function __wbg_get_imports() {
|
|
|
700
866
|
const ret = arg0.length;
|
|
701
867
|
return ret;
|
|
702
868
|
},
|
|
869
|
+
__wbg_loaded_29f94ac40d975528: function(arg0) {
|
|
870
|
+
const ret = arg0.loaded;
|
|
871
|
+
return ret;
|
|
872
|
+
},
|
|
703
873
|
__wbg_new_1dbf7428bba60a42: function(arg0) {
|
|
704
874
|
const ret = new Uint8Array(arg0);
|
|
705
875
|
return ret;
|
|
706
876
|
},
|
|
877
|
+
__wbg_new_2d2d2b3f295a37c7: function() { return handleError(function (arg0, arg1, arg2) {
|
|
878
|
+
const ret = new WebSocket(getStringFromWasm0(arg0, arg1), arg2);
|
|
879
|
+
return ret;
|
|
880
|
+
}, arguments); },
|
|
707
881
|
__wbg_new_2e41357094e99294: function() { return handleError(function () {
|
|
708
882
|
const ret = new AbortController();
|
|
709
883
|
return ret;
|
|
@@ -734,7 +908,7 @@ function __wbg_get_imports() {
|
|
|
734
908
|
const ret = new Object();
|
|
735
909
|
return ret;
|
|
736
910
|
},
|
|
737
|
-
|
|
911
|
+
__wbg_new_783a124f27c64ff9: function() {
|
|
738
912
|
const ret = new TextDecoder();
|
|
739
913
|
return ret;
|
|
740
914
|
},
|
|
@@ -742,6 +916,14 @@ function __wbg_get_imports() {
|
|
|
742
916
|
const ret = new Headers();
|
|
743
917
|
return ret;
|
|
744
918
|
}, arguments); },
|
|
919
|
+
__wbg_new_d1d1f48568532d74: function() { return handleError(function () {
|
|
920
|
+
const ret = new XMLHttpRequest();
|
|
921
|
+
return ret;
|
|
922
|
+
}, arguments); },
|
|
923
|
+
__wbg_new_ee2291f50781bf1d: function() {
|
|
924
|
+
const ret = new Array();
|
|
925
|
+
return ret;
|
|
926
|
+
},
|
|
745
927
|
__wbg_new_from_slice_9a868026ffa4208a: function(arg0, arg1) {
|
|
746
928
|
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
747
929
|
return ret;
|
|
@@ -792,14 +974,24 @@ function __wbg_get_imports() {
|
|
|
792
974
|
const ret = Array.of(arg0, arg1);
|
|
793
975
|
return ret;
|
|
794
976
|
},
|
|
977
|
+
__wbg_open_f0c8628338345808: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
978
|
+
arg0.open(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), arg5 !== 0);
|
|
979
|
+
}, arguments); },
|
|
795
980
|
__wbg_parse_0fc53dead14b3b42: function() { return handleError(function (arg0, arg1) {
|
|
796
981
|
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
797
982
|
return ret;
|
|
798
983
|
}, arguments); },
|
|
799
|
-
|
|
984
|
+
__wbg_parse_21392d15db1c5d0c: function() { return handleError(function (arg0) {
|
|
800
985
|
const ret = JSON.parse(arg0);
|
|
801
986
|
return ret;
|
|
802
987
|
}, arguments); },
|
|
988
|
+
__wbg_protocol_55a8185efbd50d71: function(arg0, arg1) {
|
|
989
|
+
const ret = arg1.protocol;
|
|
990
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
991
|
+
const len1 = WASM_VECTOR_LEN;
|
|
992
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
993
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
994
|
+
},
|
|
803
995
|
__wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
|
|
804
996
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
805
997
|
},
|
|
@@ -839,7 +1031,30 @@ function __wbg_get_imports() {
|
|
|
839
1031
|
__wbg_respond_c102fabcc79e5ef0: function() { return handleError(function (arg0, arg1) {
|
|
840
1032
|
arg0.respond(arg1 >>> 0);
|
|
841
1033
|
}, arguments); },
|
|
842
|
-
|
|
1034
|
+
__wbg_responseURL_ec5cfdd2025cc9f4: function(arg0, arg1) {
|
|
1035
|
+
const ret = arg1.responseURL;
|
|
1036
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1037
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1038
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1039
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1040
|
+
},
|
|
1041
|
+
__wbg_response_ce3feafb4716c448: function() { return handleError(function (arg0) {
|
|
1042
|
+
const ret = arg0.response;
|
|
1043
|
+
return ret;
|
|
1044
|
+
}, arguments); },
|
|
1045
|
+
__wbg_send_27717f7429d15105: function() { return handleError(function (arg0, arg1) {
|
|
1046
|
+
arg0.send(arg1);
|
|
1047
|
+
}, arguments); },
|
|
1048
|
+
__wbg_send_3fc9adb1344e67de: function() { return handleError(function (arg0, arg1) {
|
|
1049
|
+
arg0.send(arg1);
|
|
1050
|
+
}, arguments); },
|
|
1051
|
+
__wbg_send_9d00bd9d7a2c90b5: function() { return handleError(function (arg0) {
|
|
1052
|
+
arg0.send();
|
|
1053
|
+
}, arguments); },
|
|
1054
|
+
__wbg_setRequestHeader_733b74e99bf9b791: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
1055
|
+
arg0.setRequestHeader(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
1056
|
+
}, arguments); },
|
|
1057
|
+
__wbg_setTimeout_6495560518c28a55: function(arg0, arg1) {
|
|
843
1058
|
const ret = setTimeout(arg0, arg1);
|
|
844
1059
|
return ret;
|
|
845
1060
|
},
|
|
@@ -857,6 +1072,9 @@ function __wbg_get_imports() {
|
|
|
857
1072
|
__wbg_set_af5932e3f78b5648: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
858
1073
|
arg0.set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
859
1074
|
}, arguments); },
|
|
1075
|
+
__wbg_set_binary_type_1cef636f29dd023b: function(arg0, arg1, arg2) {
|
|
1076
|
+
arg0.binaryType = getStringFromWasm0(arg1, arg2);
|
|
1077
|
+
},
|
|
860
1078
|
__wbg_set_body_1fb0f1008bfc7df6: function(arg0, arg1) {
|
|
861
1079
|
arg0.body = arg1;
|
|
862
1080
|
},
|
|
@@ -881,12 +1099,36 @@ function __wbg_get_imports() {
|
|
|
881
1099
|
__wbg_set_name_2c630595dc90a7aa: function(arg0, arg1, arg2) {
|
|
882
1100
|
arg0.name = getStringFromWasm0(arg1, arg2);
|
|
883
1101
|
},
|
|
1102
|
+
__wbg_set_onclose_e2556d542aa60ba1: function(arg0, arg1) {
|
|
1103
|
+
arg0.onclose = arg1;
|
|
1104
|
+
},
|
|
1105
|
+
__wbg_set_onerror_5f014019e4fa2820: function(arg0, arg1) {
|
|
1106
|
+
arg0.onerror = arg1;
|
|
1107
|
+
},
|
|
1108
|
+
__wbg_set_onerror_7818920a16c7d2c4: function(arg0, arg1) {
|
|
1109
|
+
arg0.onerror = arg1;
|
|
1110
|
+
},
|
|
1111
|
+
__wbg_set_onload_2cbb4e46b9492f82: function(arg0, arg1) {
|
|
1112
|
+
arg0.onload = arg1;
|
|
1113
|
+
},
|
|
1114
|
+
__wbg_set_onmessage_a3fa7ae62ff9ffc7: function(arg0, arg1) {
|
|
1115
|
+
arg0.onmessage = arg1;
|
|
1116
|
+
},
|
|
1117
|
+
__wbg_set_onopen_3463d91386441653: function(arg0, arg1) {
|
|
1118
|
+
arg0.onopen = arg1;
|
|
1119
|
+
},
|
|
1120
|
+
__wbg_set_onprogress_6da9421890668006: function(arg0, arg1) {
|
|
1121
|
+
arg0.onprogress = arg1;
|
|
1122
|
+
},
|
|
884
1123
|
__wbg_set_referrer_efd0fb956d6b70b2: function(arg0, arg1, arg2) {
|
|
885
1124
|
arg0.referrer = getStringFromWasm0(arg1, arg2);
|
|
886
1125
|
},
|
|
887
1126
|
__wbg_set_referrer_policy_465382f52c1a03d3: function(arg0, arg1) {
|
|
888
1127
|
arg0.referrerPolicy = __wbindgen_enum_ReferrerPolicy[arg1];
|
|
889
1128
|
},
|
|
1129
|
+
__wbg_set_responseType_1f631c1316f4c16e: function(arg0, arg1) {
|
|
1130
|
+
arg0.responseType = __wbindgen_enum_XmlHttpRequestResponseType[arg1];
|
|
1131
|
+
},
|
|
890
1132
|
__wbg_set_signal_2dbd377604627f26: function(arg0, arg1) {
|
|
891
1133
|
arg0.signal = arg1;
|
|
892
1134
|
},
|
|
@@ -910,6 +1152,10 @@ function __wbg_get_imports() {
|
|
|
910
1152
|
const ret = typeof window === 'undefined' ? null : window;
|
|
911
1153
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
912
1154
|
},
|
|
1155
|
+
__wbg_status_734f92f48f0f8b78: function() { return handleError(function (arg0) {
|
|
1156
|
+
const ret = arg0.status;
|
|
1157
|
+
return ret;
|
|
1158
|
+
}, arguments); },
|
|
913
1159
|
__wbg_status_ce0a98d3c57125f3: function(arg0) {
|
|
914
1160
|
const ret = arg0.status;
|
|
915
1161
|
return ret;
|
|
@@ -934,6 +1180,14 @@ function __wbg_get_imports() {
|
|
|
934
1180
|
const ret = arg0.toString(arg1);
|
|
935
1181
|
return ret;
|
|
936
1182
|
}, arguments); },
|
|
1183
|
+
__wbg_total_c37263de22b97fdd: function(arg0) {
|
|
1184
|
+
const ret = arg0.total;
|
|
1185
|
+
return ret;
|
|
1186
|
+
},
|
|
1187
|
+
__wbg_upload_9fdbbcb96e9e681d: function() { return handleError(function (arg0) {
|
|
1188
|
+
const ret = arg0.upload;
|
|
1189
|
+
return ret;
|
|
1190
|
+
}, arguments); },
|
|
937
1191
|
__wbg_url_8e28edeab4cd6bed: function(arg0, arg1) {
|
|
938
1192
|
const ret = arg1.url;
|
|
939
1193
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -950,26 +1204,31 @@ function __wbg_get_imports() {
|
|
|
950
1204
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
951
1205
|
},
|
|
952
1206
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
953
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
1207
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 255, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
954
1208
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6b82e471f4a4091b___convert__closures_____invoke___wasm_bindgen_6b82e471f4a4091b___JsValue______true_);
|
|
955
1209
|
return ret;
|
|
956
1210
|
},
|
|
957
1211
|
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
958
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
1212
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 375, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
959
1213
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6b82e471f4a4091b___convert__closures_____invoke___wasm_bindgen_6b82e471f4a4091b___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_6b82e471f4a4091b___JsError___true_);
|
|
960
1214
|
return ret;
|
|
961
1215
|
},
|
|
962
1216
|
__wbindgen_generic_0000000000000003: function(arg0, arg1) {
|
|
963
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
1217
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("ProgressEvent")], shim_idx: 143, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1218
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6b82e471f4a4091b___convert__closures_____invoke___web_sys_697c1c02b79bdc2c___features__gen_ProgressEvent__ProgressEvent______true_);
|
|
1219
|
+
return ret;
|
|
1220
|
+
},
|
|
1221
|
+
__wbindgen_generic_0000000000000004: function(arg0, arg1) {
|
|
1222
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 221, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
964
1223
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6b82e471f4a4091b___convert__closures_____invoke_______true_);
|
|
965
1224
|
return ret;
|
|
966
1225
|
},
|
|
967
|
-
|
|
1226
|
+
__wbindgen_generic_0000000000000005: function(arg0) {
|
|
968
1227
|
// Cast intrinsic for `F64 -> Externref`.
|
|
969
1228
|
const ret = arg0;
|
|
970
1229
|
return ret;
|
|
971
1230
|
},
|
|
972
|
-
|
|
1231
|
+
__wbindgen_generic_0000000000000006: function(arg0, arg1) {
|
|
973
1232
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
974
1233
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
975
1234
|
return ret;
|
|
@@ -998,6 +1257,10 @@ function wasm_bindgen_6b82e471f4a4091b___convert__closures_____invoke___wasm_bin
|
|
|
998
1257
|
wasm.wasm_bindgen_6b82e471f4a4091b___convert__closures_____invoke___wasm_bindgen_6b82e471f4a4091b___JsValue______true_(arg0, arg1, arg2);
|
|
999
1258
|
}
|
|
1000
1259
|
|
|
1260
|
+
function wasm_bindgen_6b82e471f4a4091b___convert__closures_____invoke___web_sys_697c1c02b79bdc2c___features__gen_ProgressEvent__ProgressEvent______true_(arg0, arg1, arg2) {
|
|
1261
|
+
wasm.wasm_bindgen_6b82e471f4a4091b___convert__closures_____invoke___web_sys_697c1c02b79bdc2c___features__gen_ProgressEvent__ProgressEvent______true_(arg0, arg1, arg2);
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1001
1264
|
function wasm_bindgen_6b82e471f4a4091b___convert__closures_____invoke___wasm_bindgen_6b82e471f4a4091b___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_6b82e471f4a4091b___JsError___true_(arg0, arg1, arg2) {
|
|
1002
1265
|
const ret = wasm.wasm_bindgen_6b82e471f4a4091b___convert__closures_____invoke___wasm_bindgen_6b82e471f4a4091b___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_6b82e471f4a4091b___JsError___true_(arg0, arg1, arg2);
|
|
1003
1266
|
if (ret[1]) {
|
|
@@ -1023,6 +1286,9 @@ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
|
1023
1286
|
|
|
1024
1287
|
|
|
1025
1288
|
const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
|
|
1289
|
+
|
|
1290
|
+
|
|
1291
|
+
const __wbindgen_enum_XmlHttpRequestResponseType = ["", "arraybuffer", "blob", "document", "json", "text"];
|
|
1026
1292
|
const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1027
1293
|
? { register: () => {}, unregister: () => {} }
|
|
1028
1294
|
: new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr, 1));
|
|
@@ -1035,6 +1301,9 @@ const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undef
|
|
|
1035
1301
|
const WasmClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1036
1302
|
? { register: () => {}, unregister: () => {} }
|
|
1037
1303
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmclient_free(ptr, 1));
|
|
1304
|
+
const WebSocketConnectionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1305
|
+
? { register: () => {}, unregister: () => {} }
|
|
1306
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_websocketconnection_free(ptr, 1));
|
|
1038
1307
|
|
|
1039
1308
|
function addToExternrefTable0(obj) {
|
|
1040
1309
|
const idx = wasm.__externref_table_alloc();
|
package/rust_fetch_bg.wasm
CHANGED
|
Binary file
|
package/rust_fetch_bg.wasm.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export const __wbg_intounderlyingbytesource_free: (a: number, b: number) => void
|
|
|
5
5
|
export const __wbg_intounderlyingsink_free: (a: number, b: number) => void;
|
|
6
6
|
export const __wbg_intounderlyingsource_free: (a: number, b: number) => void;
|
|
7
7
|
export const __wbg_wasmclient_free: (a: number, b: number) => void;
|
|
8
|
+
export const __wbg_websocketconnection_free: (a: number, b: number) => void;
|
|
8
9
|
export const create_client: () => [number, number, number];
|
|
9
10
|
export const fetch_json: (a: number, b: number) => any;
|
|
10
11
|
export const fetch_json_promise: (a: number, b: number) => any;
|
|
@@ -40,9 +41,20 @@ export const wasmclient_post_json: (a: number, b: number, c: number, d: any, e:
|
|
|
40
41
|
export const wasmclient_put: (a: number, b: number, c: number, d: number) => any;
|
|
41
42
|
export const wasmclient_put_json: (a: number, b: number, c: number, d: any, e: number) => any;
|
|
42
43
|
export const wasmclient_request: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => any;
|
|
44
|
+
export const wasmclient_websocket: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
45
|
+
export const websocketconnection_buffered_amount: (a: number) => number;
|
|
46
|
+
export const websocketconnection_close: (a: number, b: number, c: number, d: number) => [number, number];
|
|
47
|
+
export const websocketconnection_closed: (a: number) => any;
|
|
48
|
+
export const websocketconnection_opened: (a: number) => any;
|
|
49
|
+
export const websocketconnection_protocol: (a: number) => [number, number];
|
|
50
|
+
export const websocketconnection_send: (a: number, b: any) => [number, number];
|
|
51
|
+
export const websocketconnection_sendJson: (a: number, b: any) => [number, number];
|
|
52
|
+
export const websocketconnection_state: (a: number) => any;
|
|
53
|
+
export const websocketconnection_url: (a: number) => [number, number];
|
|
43
54
|
export const wasm_bindgen_6b82e471f4a4091b___convert__closures_____invoke___js_sys_6c670598d03a71fc___Function_fn_wasm_bindgen_6b82e471f4a4091b___JsValue_____wasm_bindgen_6b82e471f4a4091b___sys__Undefined___js_sys_6c670598d03a71fc___Function_fn_wasm_bindgen_6b82e471f4a4091b___JsValue_____wasm_bindgen_6b82e471f4a4091b___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
|
|
44
55
|
export const wasm_bindgen_6b82e471f4a4091b___convert__closures_____invoke___wasm_bindgen_6b82e471f4a4091b___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_6b82e471f4a4091b___JsError___true_: (a: number, b: number, c: any) => [number, number];
|
|
45
56
|
export const wasm_bindgen_6b82e471f4a4091b___convert__closures_____invoke___wasm_bindgen_6b82e471f4a4091b___JsValue______true_: (a: number, b: number, c: any) => void;
|
|
57
|
+
export const wasm_bindgen_6b82e471f4a4091b___convert__closures_____invoke___web_sys_697c1c02b79bdc2c___features__gen_ProgressEvent__ProgressEvent______true_: (a: number, b: number, c: any) => void;
|
|
46
58
|
export const wasm_bindgen_6b82e471f4a4091b___convert__closures_____invoke_______true_: (a: number, b: number) => void;
|
|
47
59
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
48
60
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
@@ -51,4 +63,5 @@ export const __externref_table_alloc: () => number;
|
|
|
51
63
|
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
52
64
|
export const __wbindgen_destroy_closure: (a: number, b: number) => void;
|
|
53
65
|
export const __externref_table_dealloc: (a: number) => void;
|
|
66
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
54
67
|
export const __wbindgen_start: () => void;
|