libfw-client 0.1.3 → 0.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 +36 -9
- package/index.d.ts +36 -4
- package/index.js +31 -3
- package/package.json +1 -1
- package/pkg/libfw_client.d.ts +6 -2
- package/pkg/libfw_client.js +73 -58
- 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,9 +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
|
|
16
|
+
// reduce upload stutter on high-latency links)
|
|
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
|
|
15
20
|
onEvent: (e) => console.log(e), // { type: 'progress', done, total }
|
|
16
21
|
});
|
|
17
22
|
|
|
@@ -35,17 +40,29 @@ client.cancel();
|
|
|
35
40
|
|
|
36
41
|
## How it works
|
|
37
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).
|
|
38
52
|
- `downloadFolder(token, dirPath?)` / `downloadFile(token, filePath)` — the
|
|
39
|
-
engine lists (for folders) and downloads each file
|
|
40
|
-
|
|
41
|
-
|
|
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
|
|
42
57
|
`fileHandle.createWritable()`; without it (or with `downloadMode: 'browser'`)
|
|
43
58
|
the SDK buffers the chunks and saves the result through a traditional
|
|
44
59
|
browser download — a single file as-is, a folder packed into a `.zip`.
|
|
45
60
|
- `upload(token, files?)` — the engine slices each file into fixed-size
|
|
46
|
-
|
|
47
|
-
frame, and
|
|
48
|
-
|
|
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).
|
|
49
66
|
- Resume state (`etag`, `offset`, `size`) is persisted per path in
|
|
50
67
|
IndexedDB and re-validated on every retry.
|
|
51
68
|
- Pause/resume/cancel drive the WASM state machine
|
|
@@ -74,6 +91,16 @@ dist/libfw-client.umd.js UMD bundle (after build:umd)
|
|
|
74
91
|
## API
|
|
75
92
|
|
|
76
93
|
- `new LibfwClient(options?)`
|
|
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).
|
|
77
104
|
- `downloadMode: 'auto' | 'fs' | 'browser'` (default `'auto'`) — `'fs'`
|
|
78
105
|
streams downloads through the File System Access API; `'browser'` buffers
|
|
79
106
|
and triggers a traditional browser download (folders become `.zip`);
|
package/index.d.ts
CHANGED
|
@@ -50,13 +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
|
-
/** Max
|
|
60
|
+
/** Max concurrently-transferring files. Default `4`. */
|
|
56
61
|
concurrency?: number;
|
|
62
|
+
/**
|
|
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`.
|
|
68
|
+
*/
|
|
69
|
+
uploadWindow?: number;
|
|
70
|
+
/**
|
|
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`.
|
|
76
|
+
*/
|
|
77
|
+
downloadWindow?: number;
|
|
78
|
+
/**
|
|
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).
|
|
82
|
+
*/
|
|
83
|
+
downloadChunkSize?: number;
|
|
57
84
|
/** Negotiate zrip compression. Default `true`. */
|
|
58
85
|
compress?: boolean;
|
|
59
|
-
/** Upload
|
|
86
|
+
/** Upload block size in bytes. Default 2 MiB. */
|
|
60
87
|
chunkSize?: number;
|
|
61
88
|
/** Retries per chunk/file before failing. Default `3`. */
|
|
62
89
|
maxRetries?: number;
|
|
@@ -64,8 +91,13 @@ export interface LibfwClientOptions {
|
|
|
64
91
|
baseRetryDelayMs?: number;
|
|
65
92
|
/** Backoff ceiling (ms). Default `30000`. */
|
|
66
93
|
maxRetryDelayMs?: number;
|
|
67
|
-
/** Per-
|
|
94
|
+
/** Per-read timeout (ms). Default `60000`. */
|
|
68
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;
|
|
69
101
|
/**
|
|
70
102
|
* Explicit URL of `libfw_client_bg.wasm`. When omitted it is resolved
|
|
71
103
|
* automatically for both ESM and classic-`<script>`/UMD consumers.
|
package/index.js
CHANGED
|
@@ -187,14 +187,34 @@ 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
|
|
191
|
-
*
|
|
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.
|
|
194
|
+
* @param {number} [options.concurrency=4] max concurrently-transferring files
|
|
195
|
+
* @param {number} [options.uploadWindow=8] in-flight chunk window for a
|
|
196
|
+
* single file's upload; independent of `concurrency`, keeps a
|
|
197
|
+
* high-latency link saturated (raise it to reduce upload stutter;
|
|
198
|
+
* keep within your server's connection limit, ~6 for HTTP/1.1)
|
|
199
|
+
* @param {number} [options.downloadWindow=4] in-flight byte-range window
|
|
200
|
+
* for a single file's download. Large files are fetched as
|
|
201
|
+
* `downloadWindow` concurrent `Range` GETs (tus-style parallel
|
|
202
|
+
* transfer), so a single file's throughput is bounded by bandwidth
|
|
203
|
+
* instead of one connection's `chunkSize / RTT` on high-latency
|
|
204
|
+
* links. `1` disables parallelism (sequential downloads).
|
|
205
|
+
* @param {number} [options.downloadChunkSize=262144] byte range size for
|
|
206
|
+
* parallel downloads (256 KiB default). Smaller than the upload
|
|
207
|
+
* chunk on purpose: the engine reorders in-flight chunks in memory
|
|
208
|
+
* (worst case ≈ `downloadWindow * downloadChunkSize` bytes) so the
|
|
209
|
+
* SDK still receives data strictly in order.
|
|
192
210
|
* @param {boolean} [options.compress=true] negotiate zrip compression
|
|
193
211
|
* @param {number} [options.chunkSize=2097152] upload chunk size in bytes
|
|
194
212
|
* @param {number} [options.maxRetries=3] retries per chunk/file before failing
|
|
195
213
|
* @param {number} [options.baseRetryDelayMs=500] initial backoff (ms)
|
|
196
214
|
* @param {number} [options.maxRetryDelayMs=30000] backoff ceiling (ms)
|
|
197
|
-
* @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`
|
|
198
218
|
* @param {string} [options.wasmUrl] explicit URL of `libfw_client_bg.wasm`;
|
|
199
219
|
* when omitted it is resolved automatically for both ESM and
|
|
200
220
|
* classic-`<script>`/UMD consumers (see {@link LibfwClient#_wasmUrl})
|
|
@@ -216,12 +236,16 @@ export class LibfwClient {
|
|
|
216
236
|
this._options = {
|
|
217
237
|
baseUrl: '',
|
|
218
238
|
concurrency: 4,
|
|
239
|
+
uploadWindow: 8,
|
|
240
|
+
downloadWindow: 4,
|
|
241
|
+
downloadChunkSize: 256 * 1024,
|
|
219
242
|
compress: true,
|
|
220
243
|
chunkSize: 2 * 1024 * 1024,
|
|
221
244
|
maxRetries: 3,
|
|
222
245
|
baseRetryDelayMs: 500,
|
|
223
246
|
maxRetryDelayMs: 30000,
|
|
224
247
|
timeoutMs: 60000,
|
|
248
|
+
wsUrl: null,
|
|
225
249
|
wasmUrl: null,
|
|
226
250
|
downloadMode: 'auto',
|
|
227
251
|
maxFallbackBytes: 512 * 1024 * 1024,
|
|
@@ -272,12 +296,16 @@ export class LibfwClient {
|
|
|
272
296
|
await this._initPromise;
|
|
273
297
|
const engine = new WasmEngine({
|
|
274
298
|
concurrency: this._options.concurrency,
|
|
299
|
+
uploadWindow: this._options.uploadWindow,
|
|
300
|
+
downloadWindow: this._options.downloadWindow,
|
|
301
|
+
downloadChunkSize: this._options.downloadChunkSize,
|
|
275
302
|
compress: this._options.compress,
|
|
276
303
|
chunkSize: this._options.chunkSize,
|
|
277
304
|
maxRetries: this._options.maxRetries,
|
|
278
305
|
baseRetryDelayMs: this._options.baseRetryDelayMs,
|
|
279
306
|
maxRetryDelayMs: this._options.maxRetryDelayMs,
|
|
280
307
|
timeoutMs: this._options.timeoutMs,
|
|
308
|
+
wsUrl: this._options.wsUrl,
|
|
281
309
|
});
|
|
282
310
|
engine.set_callbacks(this._makeCallbacks());
|
|
283
311
|
this._engine = engine;
|
package/package.json
CHANGED
package/pkg/libfw_client.d.ts
CHANGED
|
@@ -33,8 +33,9 @@ export class LibfwClient {
|
|
|
33
33
|
has_callbacks(): boolean;
|
|
34
34
|
/**
|
|
35
35
|
* Create an engine. `options` may include:
|
|
36
|
-
* `{ concurrency,
|
|
37
|
-
*
|
|
36
|
+
* `{ concurrency, uploadWindow, downloadWindow, downloadChunkSize,
|
|
37
|
+
* compress, chunkSize, maxRetries, baseRetryDelayMs, maxRetryDelayMs,
|
|
38
|
+
* timeoutMs }`.
|
|
38
39
|
*/
|
|
39
40
|
constructor(opts: any);
|
|
40
41
|
/**
|
|
@@ -96,6 +97,9 @@ export interface InitOutput {
|
|
|
96
97
|
readonly libfwclient_upload: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
97
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];
|
|
98
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;
|
|
99
103
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
100
104
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
101
105
|
readonly __wbindgen_exn_store: (a: number) => void;
|
package/pkg/libfw_client.js
CHANGED
|
@@ -76,8 +76,9 @@ export class LibfwClient {
|
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* Create an engine. `options` may include:
|
|
79
|
-
* `{ concurrency,
|
|
80
|
-
*
|
|
79
|
+
* `{ concurrency, uploadWindow, downloadWindow, downloadChunkSize,
|
|
80
|
+
* compress, chunkSize, maxRetries, baseRetryDelayMs, maxRetryDelayMs,
|
|
81
|
+
* timeoutMs }`.
|
|
81
82
|
* @param {any} opts
|
|
82
83
|
*/
|
|
83
84
|
constructor(opts) {
|
|
@@ -230,41 +231,18 @@ function __wbg_get_imports() {
|
|
|
230
231
|
const ret = arg0.apply(arg1, arg2);
|
|
231
232
|
return ret;
|
|
232
233
|
}, arguments); },
|
|
233
|
-
__wbg_arrayBuffer_3b637f0fa65c5351: function() { return handleError(function (arg0) {
|
|
234
|
-
const ret = arg0.arrayBuffer();
|
|
235
|
-
return ret;
|
|
236
|
-
}, arguments); },
|
|
237
|
-
__wbg_body_18c9f2ac15ead4b2: function(arg0) {
|
|
238
|
-
const ret = arg0.body;
|
|
239
|
-
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
240
|
-
},
|
|
241
234
|
__wbg_call_a6e5c5dce5018821: function() { return handleError(function (arg0, arg1, arg2) {
|
|
242
235
|
const ret = arg0.call(arg1, arg2);
|
|
243
236
|
return ret;
|
|
244
237
|
}, arguments); },
|
|
245
|
-
|
|
246
|
-
const ret =
|
|
247
|
-
return ret;
|
|
248
|
-
},
|
|
249
|
-
__wbg_fetch_6ecc661950e58d49: function(arg0, arg1) {
|
|
250
|
-
const ret = arg0.fetch(arg1);
|
|
238
|
+
__wbg_data_328de4280640da92: function(arg0) {
|
|
239
|
+
const ret = arg0.data;
|
|
251
240
|
return ret;
|
|
252
241
|
},
|
|
253
242
|
__wbg_from_13e323c65fc8f464: function(arg0) {
|
|
254
243
|
const ret = Array.from(arg0);
|
|
255
244
|
return ret;
|
|
256
245
|
},
|
|
257
|
-
__wbg_getReader_7455d080fa48369b: function(arg0) {
|
|
258
|
-
const ret = arg0.getReader();
|
|
259
|
-
return ret;
|
|
260
|
-
},
|
|
261
|
-
__wbg_get_18e0163e38e5048d: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
262
|
-
const ret = arg1.get(getStringFromWasm0(arg2, arg3));
|
|
263
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
264
|
-
var len1 = WASM_VECTOR_LEN;
|
|
265
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
266
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
267
|
-
}, arguments); },
|
|
268
246
|
__wbg_get_78f252d074a84d0b: function() { return handleError(function (arg0, arg1) {
|
|
269
247
|
const ret = Reflect.get(arg0, arg1);
|
|
270
248
|
return ret;
|
|
@@ -273,10 +251,13 @@ function __wbg_get_imports() {
|
|
|
273
251
|
const ret = arg0[arg1 >>> 0];
|
|
274
252
|
return ret;
|
|
275
253
|
},
|
|
276
|
-
|
|
277
|
-
const ret =
|
|
278
|
-
|
|
279
|
-
|
|
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); },
|
|
280
261
|
__wbg_instanceof_ArrayBuffer_4480b9e0068a8adb: function(arg0) {
|
|
281
262
|
let result;
|
|
282
263
|
try {
|
|
@@ -315,10 +296,10 @@ function __wbg_get_imports() {
|
|
|
315
296
|
const ret = arg0.length;
|
|
316
297
|
return ret;
|
|
317
298
|
},
|
|
318
|
-
|
|
319
|
-
const ret =
|
|
299
|
+
__wbg_location_c9a2271428996698: function(arg0) {
|
|
300
|
+
const ret = arg0.location;
|
|
320
301
|
return ret;
|
|
321
|
-
},
|
|
302
|
+
},
|
|
322
303
|
__wbg_new_32b398fb48b6d94a: function() {
|
|
323
304
|
const ret = new Array();
|
|
324
305
|
return ret;
|
|
@@ -345,6 +326,10 @@ function __wbg_get_imports() {
|
|
|
345
326
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
346
327
|
return ret;
|
|
347
328
|
},
|
|
329
|
+
__wbg_new_bf8729ffe10e9ee7: function() { return handleError(function (arg0, arg1) {
|
|
330
|
+
const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
|
|
331
|
+
return ret;
|
|
332
|
+
}, arguments); },
|
|
348
333
|
__wbg_new_cd45aabdf6073e84: function(arg0) {
|
|
349
334
|
const ret = new Uint8Array(arg0);
|
|
350
335
|
return ret;
|
|
@@ -375,14 +360,17 @@ function __wbg_get_imports() {
|
|
|
375
360
|
state0.a = 0;
|
|
376
361
|
}
|
|
377
362
|
},
|
|
378
|
-
__wbg_new_with_str_and_init_d95cbe11ce28e65e: function() { return handleError(function (arg0, arg1, arg2) {
|
|
379
|
-
const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
|
|
380
|
-
return ret;
|
|
381
|
-
}, arguments); },
|
|
382
363
|
__wbg_of_5f1b88183ddb5d94: function(arg0, arg1) {
|
|
383
364
|
const ret = Array.of(arg0, arg1);
|
|
384
365
|
return ret;
|
|
385
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); },
|
|
386
374
|
__wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
|
|
387
375
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
388
376
|
},
|
|
@@ -401,14 +389,13 @@ function __wbg_get_imports() {
|
|
|
401
389
|
const ret = Promise.race(arg0);
|
|
402
390
|
return ret;
|
|
403
391
|
},
|
|
404
|
-
__wbg_read_8afa15f12a160ef8: function(arg0) {
|
|
405
|
-
const ret = arg0.read();
|
|
406
|
-
return ret;
|
|
407
|
-
},
|
|
408
392
|
__wbg_resolve_2191a4dfe481c25b: function(arg0) {
|
|
409
393
|
const ret = Promise.resolve(arg0);
|
|
410
394
|
return ret;
|
|
411
395
|
},
|
|
396
|
+
__wbg_send_a321b376d40ec867: function() { return handleError(function (arg0, arg1, arg2) {
|
|
397
|
+
arg0.send(getArrayU8FromWasm0(arg1, arg2));
|
|
398
|
+
}, arguments); },
|
|
412
399
|
__wbg_setTimeout_725a27c387d005c7: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
413
400
|
const ret = arg0.setTimeout(arg1, arg2, arg3);
|
|
414
401
|
return ret;
|
|
@@ -417,21 +404,24 @@ function __wbg_get_imports() {
|
|
|
417
404
|
const ret = arg0.setTimeout(arg1, arg2);
|
|
418
405
|
return ret;
|
|
419
406
|
}, arguments); },
|
|
420
|
-
__wbg_set_0de9c62c23d04ad5: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
421
|
-
arg0.set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
422
|
-
}, arguments); },
|
|
423
407
|
__wbg_set_8535240470bf2500: function() { return handleError(function (arg0, arg1, arg2) {
|
|
424
408
|
const ret = Reflect.set(arg0, arg1, arg2);
|
|
425
409
|
return ret;
|
|
426
410
|
}, arguments); },
|
|
427
|
-
|
|
428
|
-
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;
|
|
429
416
|
},
|
|
430
|
-
|
|
431
|
-
arg0.
|
|
417
|
+
__wbg_set_onerror_9f5773fd31512333: function(arg0, arg1) {
|
|
418
|
+
arg0.onerror = arg1;
|
|
432
419
|
},
|
|
433
|
-
|
|
434
|
-
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;
|
|
435
425
|
},
|
|
436
426
|
__wbg_static_accessor_GLOBAL_4ef717fb391d88b7: function() {
|
|
437
427
|
const ret = typeof global === 'undefined' ? null : global;
|
|
@@ -449,10 +439,6 @@ function __wbg_get_imports() {
|
|
|
449
439
|
const ret = typeof window === 'undefined' ? null : window;
|
|
450
440
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
451
441
|
},
|
|
452
|
-
__wbg_status_c45b3b9b3033184a: function(arg0) {
|
|
453
|
-
const ret = arg0.status;
|
|
454
|
-
return ret;
|
|
455
|
-
},
|
|
456
442
|
__wbg_then_16d107c451e9905d: function(arg0, arg1, arg2) {
|
|
457
443
|
const ret = arg0.then(arg1, arg2);
|
|
458
444
|
return ret;
|
|
@@ -462,16 +448,31 @@ function __wbg_get_imports() {
|
|
|
462
448
|
return ret;
|
|
463
449
|
},
|
|
464
450
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
465
|
-
// 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`.
|
|
466
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_);
|
|
467
453
|
return ret;
|
|
468
454
|
},
|
|
469
|
-
__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) {
|
|
470
471
|
// Cast intrinsic for `F64 -> Externref`.
|
|
471
472
|
const ret = arg0;
|
|
472
473
|
return ret;
|
|
473
474
|
},
|
|
474
|
-
|
|
475
|
+
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
|
475
476
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
476
477
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
477
478
|
return ret;
|
|
@@ -492,6 +493,18 @@ function __wbg_get_imports() {
|
|
|
492
493
|
};
|
|
493
494
|
}
|
|
494
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
|
+
|
|
495
508
|
function wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___wasm_bindgen_1e05ddb24c0b7df4___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_1e05ddb24c0b7df4___JsError___true_(arg0, arg1, arg2) {
|
|
496
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);
|
|
497
510
|
if (ret[1]) {
|
|
@@ -503,6 +516,8 @@ function wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___js_sys_b
|
|
|
503
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);
|
|
504
517
|
}
|
|
505
518
|
|
|
519
|
+
|
|
520
|
+
const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
|
|
506
521
|
const LibfwClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
507
522
|
? { register: () => {}, unregister: () => {} }
|
|
508
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;
|