libfw-client 0.1.4 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -33
- package/index.d.ts +26 -16
- package/index.js +9 -2
- package/package.json +1 -1
- package/pkg/libfw_client.d.ts +3 -0
- package/pkg/libfw_client.js +70 -56
- package/pkg/libfw_client_bg.wasm +0 -0
- package/pkg/libfw_client_bg.wasm.d.ts +3 -0
- package/pkg/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,14 +9,14 @@ WASM engine, the File System Access API and IndexedDB.
|
|
|
9
9
|
import { LibfwClient } from 'libfw-client';
|
|
10
10
|
|
|
11
11
|
const client = new LibfwClient({
|
|
12
|
-
baseUrl: '/
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
baseUrl: '/', // server origin; the engine derives ws(s)://host/ws
|
|
13
|
+
// from it (or set wsUrl explicitly)
|
|
14
|
+
concurrency: 4, // max parallel file transfers (one WS connection each)
|
|
15
|
+
uploadWindow: 8, // in-flight blocks per single file upload (raise to
|
|
15
16
|
// reduce upload stutter on high-latency links)
|
|
16
|
-
downloadWindow: 4, // in-flight
|
|
17
|
-
//
|
|
18
|
-
|
|
19
|
-
compress: true, // zrip streaming compression
|
|
17
|
+
downloadWindow: 4, // in-flight blocks per single file download (raise to
|
|
18
|
+
// reduce download stutter on high-latency links)
|
|
19
|
+
compress: true, // zrip per-block compression
|
|
20
20
|
onEvent: (e) => console.log(e), // { type: 'progress', done, total }
|
|
21
21
|
});
|
|
22
22
|
|
|
@@ -40,28 +40,29 @@ client.cancel();
|
|
|
40
40
|
|
|
41
41
|
## How it works
|
|
42
42
|
|
|
43
|
+
- **One WebSocket per transfer** — the engine talks to the server over
|
|
44
|
+
`ws(s)://…/ws` for **all** control commands (handshake, directory listing,
|
|
45
|
+
metadata) and data. Upload and download use the **same** block protocol:
|
|
46
|
+
the sender pipelines fixed-size blocks with **no per-block ack** (they may
|
|
47
|
+
travel out of order), and the receiver **verifies every block in real time**
|
|
48
|
+
(CRC32 + length + bounds), marks bad blocks (`NAK`) and asks the sender to
|
|
49
|
+
re-add them to its transfer queue; a wave boundary reconciles until every
|
|
50
|
+
block is verified. `downloadWindow`/`uploadWindow` bound the in-flight
|
|
51
|
+
blocks per wave (raise them on high-latency links).
|
|
43
52
|
- `downloadFolder(token, dirPath?)` / `downloadFile(token, filePath)` — the
|
|
44
|
-
engine lists (for folders) and downloads each file
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
(or with `downloadMode: 'browser'`) the SDK buffers the chunks and saves the
|
|
52
|
-
result through a traditional browser download — a single file as-is, a
|
|
53
|
-
folder packed into a `.zip`.
|
|
53
|
+
engine lists (for folders) and downloads each file as a receiver, reorders
|
|
54
|
+
out-of-order blocks in memory and pushes `Uint8Array` chunks to the SDK
|
|
55
|
+
strictly in order (append-mode `createWritable()`, no `.crswap` churn).
|
|
56
|
+
With the File System Access API the SDK streams them to disk via
|
|
57
|
+
`fileHandle.createWritable()`; without it (or with `downloadMode: 'browser'`)
|
|
58
|
+
the SDK buffers the chunks and saves the result through a traditional
|
|
59
|
+
browser download — a single file as-is, a folder packed into a `.zip`.
|
|
54
60
|
- `upload(token, files?)` — the engine slices each file into fixed-size
|
|
55
|
-
|
|
56
|
-
frame, and
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
verify-then-complete**: the server is the source of truth — the client
|
|
61
|
-
probes the byte ranges the server actually persisted and re-sends only the
|
|
62
|
-
still-missing blocks, filling gaps a lost response may have left (and
|
|
63
|
-
re-probing + refilling if a commit fails) before the final `x-libfw-final`
|
|
64
|
-
request merges the temp into place.
|
|
61
|
+
blocks, reads them via `readFile`, compresses each block into one zstd
|
|
62
|
+
frame, and sends them over the WebSocket as the sender. Only the blocks the
|
|
63
|
+
server still misses are sent (`READY.received` seeds resume), so a
|
|
64
|
+
high-latency link stays saturated and interrupted uploads resume
|
|
65
|
+
BitTorrent-style (only the broken/lost parts are re-transmitted).
|
|
65
66
|
- Resume state (`etag`, `offset`, `size`) is persisted per path in
|
|
66
67
|
IndexedDB and re-validated on every retry.
|
|
67
68
|
- Pause/resume/cancel drive the WASM state machine
|
|
@@ -90,12 +91,16 @@ dist/libfw-client.umd.js UMD bundle (after build:umd)
|
|
|
90
91
|
## API
|
|
91
92
|
|
|
92
93
|
- `new LibfwClient(options?)`
|
|
93
|
-
- `downloadWindow: number` (default `4`) — in-flight
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
- `downloadWindow: number` (default `4`) — in-flight blocks per single file
|
|
95
|
+
download (how many blocks the server pipelines per wave before a
|
|
96
|
+
reconciliation round); raise it on high-latency links.
|
|
97
|
+
- `downloadChunkSize: number` (default `262144`, 256 KiB) — block size for
|
|
98
|
+
downloads; the engine reorders out-of-order blocks in memory (worst case
|
|
99
|
+
≈ `downloadWindow * downloadChunkSize` bytes) so the SDK still receives
|
|
100
|
+
data in order.
|
|
101
|
+
- `wsUrl: string` — explicit WebSocket endpoint (`wss://host/ws`); when
|
|
102
|
+
omitted it is derived from `baseUrl` (`http://h:8080` → `ws://h:8080/ws`,
|
|
103
|
+
same-origin when empty).
|
|
99
104
|
- `downloadMode: 'auto' | 'fs' | 'browser'` (default `'auto'`) — `'fs'`
|
|
100
105
|
streams downloads through the File System Access API; `'browser'` buffers
|
|
101
106
|
and triggers a traditional browser download (folders become `.zip`);
|
package/index.d.ts
CHANGED
|
@@ -50,35 +50,40 @@ export interface LibfwEvent {
|
|
|
50
50
|
|
|
51
51
|
/** Options accepted by the {@link LibfwClient} constructor. */
|
|
52
52
|
export interface LibfwClientOptions {
|
|
53
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* Base URL the libfw server is served from. The engine derives the
|
|
55
|
+
* WebSocket endpoint from it (`http://h:8080` → `ws://h:8080/ws`);
|
|
56
|
+
* same-origin when empty. All control commands and data transfer travel
|
|
57
|
+
* over that WebSocket. Default `''`.
|
|
58
|
+
*/
|
|
54
59
|
baseUrl?: string;
|
|
55
60
|
/** Max concurrently-transferring files. Default `4`. */
|
|
56
61
|
concurrency?: number;
|
|
57
62
|
/**
|
|
58
|
-
* In-flight
|
|
59
|
-
* `concurrency`.
|
|
60
|
-
*
|
|
61
|
-
*
|
|
63
|
+
* In-flight block window for a single file's upload, independent of
|
|
64
|
+
* `concurrency`. Blocks are pipelined over one WebSocket without per-block
|
|
65
|
+
* acknowledgments; this bounds how many are in flight before a
|
|
66
|
+
* reconciliation round. A higher value keeps high-latency links saturated.
|
|
67
|
+
* Default `8`.
|
|
62
68
|
*/
|
|
63
69
|
uploadWindow?: number;
|
|
64
70
|
/**
|
|
65
|
-
* In-flight
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
71
|
+
* In-flight block window for a single file's download. The server
|
|
72
|
+
* pipelines up to this many blocks per wave; a higher value keeps
|
|
73
|
+
* high-latency links saturated. The engine reorders out-of-order blocks in
|
|
74
|
+
* memory (worst case ≈ `downloadWindow * downloadChunkSize` bytes) so the
|
|
75
|
+
* SDK still receives data strictly in order. Default `4`.
|
|
70
76
|
*/
|
|
71
77
|
downloadWindow?: number;
|
|
72
78
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* data strictly in order. Default `262144` (256 KiB).
|
|
79
|
+
* Block size for downloads. The engine reorders in-flight blocks in
|
|
80
|
+
* memory (worst case ≈ `downloadWindow * downloadChunkSize` bytes) so the
|
|
81
|
+
* SDK still receives data strictly in order. Default `262144` (256 KiB).
|
|
77
82
|
*/
|
|
78
83
|
downloadChunkSize?: number;
|
|
79
84
|
/** Negotiate zrip compression. Default `true`. */
|
|
80
85
|
compress?: boolean;
|
|
81
|
-
/** Upload
|
|
86
|
+
/** Upload block size in bytes. Default 2 MiB. */
|
|
82
87
|
chunkSize?: number;
|
|
83
88
|
/** Retries per chunk/file before failing. Default `3`. */
|
|
84
89
|
maxRetries?: number;
|
|
@@ -86,8 +91,13 @@ export interface LibfwClientOptions {
|
|
|
86
91
|
baseRetryDelayMs?: number;
|
|
87
92
|
/** Backoff ceiling (ms). Default `30000`. */
|
|
88
93
|
maxRetryDelayMs?: number;
|
|
89
|
-
/** Per-
|
|
94
|
+
/** Per-read timeout (ms). Default `60000`. */
|
|
90
95
|
timeoutMs?: number;
|
|
96
|
+
/**
|
|
97
|
+
* Explicit WebSocket endpoint (e.g. `wss://host/ws`). When omitted it is
|
|
98
|
+
* derived from `baseUrl`.
|
|
99
|
+
*/
|
|
100
|
+
wsUrl?: string;
|
|
91
101
|
/**
|
|
92
102
|
* Explicit URL of `libfw_client_bg.wasm`. When omitted it is resolved
|
|
93
103
|
* automatically for both ESM and classic-`<script>`/UMD consumers.
|
package/index.js
CHANGED
|
@@ -187,7 +187,10 @@ const BUNDLE_SCRIPT_SRC =
|
|
|
187
187
|
export class LibfwClient {
|
|
188
188
|
/**
|
|
189
189
|
* @param {object} [options]
|
|
190
|
-
* @param {string} [options.baseUrl=''] base URL the server
|
|
190
|
+
* @param {string} [options.baseUrl=''] base URL the server is served from. The
|
|
191
|
+
* engine derives the WebSocket endpoint from it (e.g. `http://h:8080`
|
|
192
|
+
* → `ws://h:8080/ws`); same-origin when empty. All control commands
|
|
193
|
+
* and data transfer travel over that WebSocket.
|
|
191
194
|
* @param {number} [options.concurrency=4] max concurrently-transferring files
|
|
192
195
|
* @param {number} [options.uploadWindow=8] in-flight chunk window for a
|
|
193
196
|
* single file's upload; independent of `concurrency`, keeps a
|
|
@@ -209,7 +212,9 @@ export class LibfwClient {
|
|
|
209
212
|
* @param {number} [options.maxRetries=3] retries per chunk/file before failing
|
|
210
213
|
* @param {number} [options.baseRetryDelayMs=500] initial backoff (ms)
|
|
211
214
|
* @param {number} [options.maxRetryDelayMs=30000] backoff ceiling (ms)
|
|
212
|
-
* @param {number} [options.timeoutMs=60000] per-
|
|
215
|
+
* @param {number} [options.timeoutMs=60000] per-read timeout (ms)
|
|
216
|
+
* @param {string} [options.wsUrl] explicit WebSocket endpoint (e.g.
|
|
217
|
+
* `wss://host/ws`); when omitted it is derived from `baseUrl`
|
|
213
218
|
* @param {string} [options.wasmUrl] explicit URL of `libfw_client_bg.wasm`;
|
|
214
219
|
* when omitted it is resolved automatically for both ESM and
|
|
215
220
|
* classic-`<script>`/UMD consumers (see {@link LibfwClient#_wasmUrl})
|
|
@@ -240,6 +245,7 @@ export class LibfwClient {
|
|
|
240
245
|
baseRetryDelayMs: 500,
|
|
241
246
|
maxRetryDelayMs: 30000,
|
|
242
247
|
timeoutMs: 60000,
|
|
248
|
+
wsUrl: null,
|
|
243
249
|
wasmUrl: null,
|
|
244
250
|
downloadMode: 'auto',
|
|
245
251
|
maxFallbackBytes: 512 * 1024 * 1024,
|
|
@@ -299,6 +305,7 @@ export class LibfwClient {
|
|
|
299
305
|
baseRetryDelayMs: this._options.baseRetryDelayMs,
|
|
300
306
|
maxRetryDelayMs: this._options.maxRetryDelayMs,
|
|
301
307
|
timeoutMs: this._options.timeoutMs,
|
|
308
|
+
wsUrl: this._options.wsUrl,
|
|
302
309
|
});
|
|
303
310
|
engine.set_callbacks(this._makeCallbacks());
|
|
304
311
|
this._engine = engine;
|
package/package.json
CHANGED
package/pkg/libfw_client.d.ts
CHANGED
|
@@ -97,6 +97,9 @@ export interface InitOutput {
|
|
|
97
97
|
readonly libfwclient_upload: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
98
98
|
readonly wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___wasm_bindgen_1e05ddb24c0b7df4___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_1e05ddb24c0b7df4___JsError___true_: (a: number, b: number, c: any) => [number, number];
|
|
99
99
|
readonly wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___js_sys_bb6c79d0abe11c10___Function_fn_wasm_bindgen_1e05ddb24c0b7df4___JsValue_____wasm_bindgen_1e05ddb24c0b7df4___sys__Undefined___js_sys_bb6c79d0abe11c10___Function_fn_wasm_bindgen_1e05ddb24c0b7df4___JsValue_____wasm_bindgen_1e05ddb24c0b7df4___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
|
|
100
|
+
readonly wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true_: (a: number, b: number, c: any) => void;
|
|
101
|
+
readonly wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true__2: (a: number, b: number, c: any) => void;
|
|
102
|
+
readonly wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true__3: (a: number, b: number, c: any) => void;
|
|
100
103
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
101
104
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
102
105
|
readonly __wbindgen_exn_store: (a: number) => void;
|
package/pkg/libfw_client.js
CHANGED
|
@@ -231,41 +231,18 @@ function __wbg_get_imports() {
|
|
|
231
231
|
const ret = arg0.apply(arg1, arg2);
|
|
232
232
|
return ret;
|
|
233
233
|
}, arguments); },
|
|
234
|
-
__wbg_arrayBuffer_3b637f0fa65c5351: function() { return handleError(function (arg0) {
|
|
235
|
-
const ret = arg0.arrayBuffer();
|
|
236
|
-
return ret;
|
|
237
|
-
}, arguments); },
|
|
238
|
-
__wbg_body_18c9f2ac15ead4b2: function(arg0) {
|
|
239
|
-
const ret = arg0.body;
|
|
240
|
-
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
241
|
-
},
|
|
242
234
|
__wbg_call_a6e5c5dce5018821: function() { return handleError(function (arg0, arg1, arg2) {
|
|
243
235
|
const ret = arg0.call(arg1, arg2);
|
|
244
236
|
return ret;
|
|
245
237
|
}, arguments); },
|
|
246
|
-
|
|
247
|
-
const ret =
|
|
248
|
-
return ret;
|
|
249
|
-
},
|
|
250
|
-
__wbg_fetch_6ecc661950e58d49: function(arg0, arg1) {
|
|
251
|
-
const ret = arg0.fetch(arg1);
|
|
238
|
+
__wbg_data_328de4280640da92: function(arg0) {
|
|
239
|
+
const ret = arg0.data;
|
|
252
240
|
return ret;
|
|
253
241
|
},
|
|
254
242
|
__wbg_from_13e323c65fc8f464: function(arg0) {
|
|
255
243
|
const ret = Array.from(arg0);
|
|
256
244
|
return ret;
|
|
257
245
|
},
|
|
258
|
-
__wbg_getReader_7455d080fa48369b: function(arg0) {
|
|
259
|
-
const ret = arg0.getReader();
|
|
260
|
-
return ret;
|
|
261
|
-
},
|
|
262
|
-
__wbg_get_18e0163e38e5048d: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
263
|
-
const ret = arg1.get(getStringFromWasm0(arg2, arg3));
|
|
264
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
265
|
-
var len1 = WASM_VECTOR_LEN;
|
|
266
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
267
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
268
|
-
}, arguments); },
|
|
269
246
|
__wbg_get_78f252d074a84d0b: function() { return handleError(function (arg0, arg1) {
|
|
270
247
|
const ret = Reflect.get(arg0, arg1);
|
|
271
248
|
return ret;
|
|
@@ -274,10 +251,13 @@ function __wbg_get_imports() {
|
|
|
274
251
|
const ret = arg0[arg1 >>> 0];
|
|
275
252
|
return ret;
|
|
276
253
|
},
|
|
277
|
-
|
|
278
|
-
const ret =
|
|
279
|
-
|
|
280
|
-
|
|
254
|
+
__wbg_host_21c8d54c9bdcd04a: function() { return handleError(function (arg0, arg1) {
|
|
255
|
+
const ret = arg1.host;
|
|
256
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
257
|
+
const len1 = WASM_VECTOR_LEN;
|
|
258
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
259
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
260
|
+
}, arguments); },
|
|
281
261
|
__wbg_instanceof_ArrayBuffer_4480b9e0068a8adb: function(arg0) {
|
|
282
262
|
let result;
|
|
283
263
|
try {
|
|
@@ -316,10 +296,10 @@ function __wbg_get_imports() {
|
|
|
316
296
|
const ret = arg0.length;
|
|
317
297
|
return ret;
|
|
318
298
|
},
|
|
319
|
-
|
|
320
|
-
const ret =
|
|
299
|
+
__wbg_location_c9a2271428996698: function(arg0) {
|
|
300
|
+
const ret = arg0.location;
|
|
321
301
|
return ret;
|
|
322
|
-
},
|
|
302
|
+
},
|
|
323
303
|
__wbg_new_32b398fb48b6d94a: function() {
|
|
324
304
|
const ret = new Array();
|
|
325
305
|
return ret;
|
|
@@ -346,6 +326,10 @@ function __wbg_get_imports() {
|
|
|
346
326
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
347
327
|
return ret;
|
|
348
328
|
},
|
|
329
|
+
__wbg_new_bf8729ffe10e9ee7: function() { return handleError(function (arg0, arg1) {
|
|
330
|
+
const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
|
|
331
|
+
return ret;
|
|
332
|
+
}, arguments); },
|
|
349
333
|
__wbg_new_cd45aabdf6073e84: function(arg0) {
|
|
350
334
|
const ret = new Uint8Array(arg0);
|
|
351
335
|
return ret;
|
|
@@ -376,14 +360,17 @@ function __wbg_get_imports() {
|
|
|
376
360
|
state0.a = 0;
|
|
377
361
|
}
|
|
378
362
|
},
|
|
379
|
-
__wbg_new_with_str_and_init_d95cbe11ce28e65e: function() { return handleError(function (arg0, arg1, arg2) {
|
|
380
|
-
const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
|
|
381
|
-
return ret;
|
|
382
|
-
}, arguments); },
|
|
383
363
|
__wbg_of_5f1b88183ddb5d94: function(arg0, arg1) {
|
|
384
364
|
const ret = Array.of(arg0, arg1);
|
|
385
365
|
return ret;
|
|
386
366
|
},
|
|
367
|
+
__wbg_protocol_0598aef25eb71eae: function() { return handleError(function (arg0, arg1) {
|
|
368
|
+
const ret = arg1.protocol;
|
|
369
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
370
|
+
const len1 = WASM_VECTOR_LEN;
|
|
371
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
372
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
373
|
+
}, arguments); },
|
|
387
374
|
__wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
|
|
388
375
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
389
376
|
},
|
|
@@ -402,14 +389,13 @@ function __wbg_get_imports() {
|
|
|
402
389
|
const ret = Promise.race(arg0);
|
|
403
390
|
return ret;
|
|
404
391
|
},
|
|
405
|
-
__wbg_read_8afa15f12a160ef8: function(arg0) {
|
|
406
|
-
const ret = arg0.read();
|
|
407
|
-
return ret;
|
|
408
|
-
},
|
|
409
392
|
__wbg_resolve_2191a4dfe481c25b: function(arg0) {
|
|
410
393
|
const ret = Promise.resolve(arg0);
|
|
411
394
|
return ret;
|
|
412
395
|
},
|
|
396
|
+
__wbg_send_a321b376d40ec867: function() { return handleError(function (arg0, arg1, arg2) {
|
|
397
|
+
arg0.send(getArrayU8FromWasm0(arg1, arg2));
|
|
398
|
+
}, arguments); },
|
|
413
399
|
__wbg_setTimeout_725a27c387d005c7: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
414
400
|
const ret = arg0.setTimeout(arg1, arg2, arg3);
|
|
415
401
|
return ret;
|
|
@@ -418,21 +404,24 @@ function __wbg_get_imports() {
|
|
|
418
404
|
const ret = arg0.setTimeout(arg1, arg2);
|
|
419
405
|
return ret;
|
|
420
406
|
}, arguments); },
|
|
421
|
-
__wbg_set_0de9c62c23d04ad5: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
422
|
-
arg0.set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
423
|
-
}, arguments); },
|
|
424
407
|
__wbg_set_8535240470bf2500: function() { return handleError(function (arg0, arg1, arg2) {
|
|
425
408
|
const ret = Reflect.set(arg0, arg1, arg2);
|
|
426
409
|
return ret;
|
|
427
410
|
}, arguments); },
|
|
428
|
-
|
|
429
|
-
arg0.
|
|
411
|
+
__wbg_set_binaryType_a37b086c78ca7c29: function(arg0, arg1) {
|
|
412
|
+
arg0.binaryType = __wbindgen_enum_BinaryType[arg1];
|
|
413
|
+
},
|
|
414
|
+
__wbg_set_onclose_f706475385ecce07: function(arg0, arg1) {
|
|
415
|
+
arg0.onclose = arg1;
|
|
430
416
|
},
|
|
431
|
-
|
|
432
|
-
arg0.
|
|
417
|
+
__wbg_set_onerror_9f5773fd31512333: function(arg0, arg1) {
|
|
418
|
+
arg0.onerror = arg1;
|
|
433
419
|
},
|
|
434
|
-
|
|
435
|
-
arg0.
|
|
420
|
+
__wbg_set_onmessage_836d2f72130b4706: function(arg0, arg1) {
|
|
421
|
+
arg0.onmessage = arg1;
|
|
422
|
+
},
|
|
423
|
+
__wbg_set_onopen_4f65470ae522a61a: function(arg0, arg1) {
|
|
424
|
+
arg0.onopen = arg1;
|
|
436
425
|
},
|
|
437
426
|
__wbg_static_accessor_GLOBAL_4ef717fb391d88b7: function() {
|
|
438
427
|
const ret = typeof global === 'undefined' ? null : global;
|
|
@@ -450,10 +439,6 @@ function __wbg_get_imports() {
|
|
|
450
439
|
const ret = typeof window === 'undefined' ? null : window;
|
|
451
440
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
452
441
|
},
|
|
453
|
-
__wbg_status_c45b3b9b3033184a: function(arg0) {
|
|
454
|
-
const ret = arg0.status;
|
|
455
|
-
return ret;
|
|
456
|
-
},
|
|
457
442
|
__wbg_then_16d107c451e9905d: function(arg0, arg1, arg2) {
|
|
458
443
|
const ret = arg0.then(arg1, arg2);
|
|
459
444
|
return ret;
|
|
@@ -463,16 +448,31 @@ function __wbg_get_imports() {
|
|
|
463
448
|
return ret;
|
|
464
449
|
},
|
|
465
450
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
466
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
451
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 151, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
467
452
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___wasm_bindgen_1e05ddb24c0b7df4___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_1e05ddb24c0b7df4___JsError___true_);
|
|
468
453
|
return ret;
|
|
469
454
|
},
|
|
470
|
-
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
455
|
+
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
456
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 4, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
457
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true_);
|
|
458
|
+
return ret;
|
|
459
|
+
},
|
|
460
|
+
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
461
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 4, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
462
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true__2);
|
|
463
|
+
return ret;
|
|
464
|
+
},
|
|
465
|
+
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
466
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 4, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
467
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true__3);
|
|
468
|
+
return ret;
|
|
469
|
+
},
|
|
470
|
+
__wbindgen_cast_0000000000000005: function(arg0) {
|
|
471
471
|
// Cast intrinsic for `F64 -> Externref`.
|
|
472
472
|
const ret = arg0;
|
|
473
473
|
return ret;
|
|
474
474
|
},
|
|
475
|
-
|
|
475
|
+
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
|
476
476
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
477
477
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
478
478
|
return ret;
|
|
@@ -493,6 +493,18 @@ function __wbg_get_imports() {
|
|
|
493
493
|
};
|
|
494
494
|
}
|
|
495
495
|
|
|
496
|
+
function wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true_(arg0, arg1, arg2) {
|
|
497
|
+
wasm.wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true_(arg0, arg1, arg2);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
function wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true__2(arg0, arg1, arg2) {
|
|
501
|
+
wasm.wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true__2(arg0, arg1, arg2);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
function wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true__3(arg0, arg1, arg2) {
|
|
505
|
+
wasm.wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true__3(arg0, arg1, arg2);
|
|
506
|
+
}
|
|
507
|
+
|
|
496
508
|
function wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___wasm_bindgen_1e05ddb24c0b7df4___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_1e05ddb24c0b7df4___JsError___true_(arg0, arg1, arg2) {
|
|
497
509
|
const ret = wasm.wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___wasm_bindgen_1e05ddb24c0b7df4___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_1e05ddb24c0b7df4___JsError___true_(arg0, arg1, arg2);
|
|
498
510
|
if (ret[1]) {
|
|
@@ -504,6 +516,8 @@ function wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___js_sys_b
|
|
|
504
516
|
wasm.wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___js_sys_bb6c79d0abe11c10___Function_fn_wasm_bindgen_1e05ddb24c0b7df4___JsValue_____wasm_bindgen_1e05ddb24c0b7df4___sys__Undefined___js_sys_bb6c79d0abe11c10___Function_fn_wasm_bindgen_1e05ddb24c0b7df4___JsValue_____wasm_bindgen_1e05ddb24c0b7df4___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
|
|
505
517
|
}
|
|
506
518
|
|
|
519
|
+
|
|
520
|
+
const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
|
|
507
521
|
const LibfwClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
508
522
|
? { register: () => {}, unregister: () => {} }
|
|
509
523
|
: new FinalizationRegistry(ptr => wasm.__wbg_libfwclient_free(ptr, 1));
|
package/pkg/libfw_client_bg.wasm
CHANGED
|
Binary file
|
|
@@ -18,6 +18,9 @@ export const libfwclient_total_bytes: (a: number) => number;
|
|
|
18
18
|
export const libfwclient_upload: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
19
19
|
export const wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___wasm_bindgen_1e05ddb24c0b7df4___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_1e05ddb24c0b7df4___JsError___true_: (a: number, b: number, c: any) => [number, number];
|
|
20
20
|
export const wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___js_sys_bb6c79d0abe11c10___Function_fn_wasm_bindgen_1e05ddb24c0b7df4___JsValue_____wasm_bindgen_1e05ddb24c0b7df4___sys__Undefined___js_sys_bb6c79d0abe11c10___Function_fn_wasm_bindgen_1e05ddb24c0b7df4___JsValue_____wasm_bindgen_1e05ddb24c0b7df4___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
|
|
21
|
+
export const wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true_: (a: number, b: number, c: any) => void;
|
|
22
|
+
export const wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true__2: (a: number, b: number, c: any) => void;
|
|
23
|
+
export const wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true__3: (a: number, b: number, c: any) => void;
|
|
21
24
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
22
25
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
23
26
|
export const __wbindgen_exn_store: (a: number) => void;
|