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 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: '/api', // where libfw-server routes are mounted
13
- concurrency: 4, // max parallel file transfers
14
- uploadWindow: 8, // in-flight chunks per single file upload (raise to
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 byte-range GETs per single file download
17
- // (tus-style parallel download: one file's throughput
18
- // isn't bounded by a single connection's RTT)
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 with `Range`/`If-Range`
45
- resume, decompresses the zrip stream, and pushes `Uint8Array` chunks to the
46
- SDK. Large files use the **tus-style parallel path**: `downloadWindow`
47
- concurrent byte-range GETs, reordered in memory so the SDK still receives
48
- bytes strictly in order (append-mode `createWritable()`, no `.crswap`
49
- churn), with per-chunk independent retries. With the File System Access API
50
- the SDK streams them to disk via `fileHandle.createWritable()`; without it
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
- chunks, reads them via `readFile`, compresses each chunk into one zstd
56
- frame, and POSTs them with an absolute `x-libfw-offset` into a shared
57
- per-session temp file. Up to `uploadWindow` chunks of one file are kept in
58
- flight concurrently (independent of the cross-file `concurrency`), so a
59
- high-latency link stays saturated. Uploads are **tus-style
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 byte-range GETs per
94
- single file download; `1` disables parallelism.
95
- - `downloadChunkSize: number` (default `262144`, 256 KiB) — byte range size
96
- for parallel downloads; the engine reorders in-flight chunks in memory
97
- (worst case `downloadWindow * downloadChunkSize` bytes) so the SDK
98
- still receives data in order.
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
- /** Base URL the libfw server routes are mounted under. Default `''`. */
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 chunk window for a single file's upload, independent of
59
- * `concurrency`. A higher value keeps high-latency links saturated and
60
- * reduces upload stutter; keep it within your server's connection limit
61
- * (~6 for HTTP/1.1). Default `8`.
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 byte-range window for a single file's download. Large files
66
- * are fetched as `downloadWindow` concurrent `Range` GETs (tus-style
67
- * parallel transfer), so a single file's throughput is bounded by
68
- * bandwidth instead of one connection's `chunkSize / RTT` on high-latency
69
- * links. `1` disables parallelism. Default `4`.
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
- * Byte range size for parallel downloads. Smaller than the upload chunk
74
- * on purpose: the engine reorders in-flight chunks in memory (worst case
75
- * `downloadWindow * downloadChunkSize` bytes) so the SDK still receives
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 chunk size in bytes. Default 2 MiB. */
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-request timeout (ms). Default `60000`. */
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 routes are mounted under
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-request timeout (ms)
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libfw-client",
3
- "version": "0.1.4",
3
+ "version": "0.2.1",
4
4
  "description": "High-performance streaming file & folder transfer SDK for the browser (libfw WASM engine + File System Access API + IndexedDB resume).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -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;
@@ -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
- __wbg_encodeURIComponent_d0140ae6e13eb27b: function(arg0, arg1) {
247
- const ret = encodeURIComponent(getStringFromWasm0(arg0, arg1));
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
- __wbg_headers_cf9c80f30e2a4eff: function(arg0) {
278
- const ret = arg0.headers;
279
- return ret;
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
- __wbg_new_0d809930cd1354c6: function() { return handleError(function () {
320
- const ret = new Headers();
299
+ __wbg_location_c9a2271428996698: function(arg0) {
300
+ const ret = arg0.location;
321
301
  return ret;
322
- }, arguments); },
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
- __wbg_set_body_029f2d171e0a005f: function(arg0, arg1) {
429
- arg0.body = arg1;
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
- __wbg_set_headers_9c61d123c3ee1f10: function(arg0, arg1) {
432
- arg0.headers = arg1;
417
+ __wbg_set_onerror_9f5773fd31512333: function(arg0, arg1) {
418
+ arg0.onerror = arg1;
433
419
  },
434
- __wbg_set_method_5532d59b92d76467: function(arg0, arg1, arg2) {
435
- arg0.method = getStringFromWasm0(arg1, arg2);
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: 145, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
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
- __wbindgen_cast_0000000000000003: function(arg0, arg1) {
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));
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;
package/pkg/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "libfw-client",
3
3
  "type": "module",
4
4
  "description": "WASM engine + JS SDK for libfw browser clients",
5
- "version": "0.1.4",
5
+ "version": "0.2.1",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",