libfw-client 0.2.0

WASM engine + JS SDK for libfw browser clients
Documentation

libfw-client: WASM engine for browser file & folder transfers.

This crate ships the engine that runs inside the browser: it performs the HTTP transfer (via fetch), slices files into chunks, keeps memory constant, retries with exponential backoff, and drives the task state machine (idle → downloading/uploading → paused → resumed → completed/failed).

The [LibfwClient] WASM class is exported through wasm-bindgen and is intended to be wrapped by the accompanying JS SDK (sdk/). The SDK owns WASM instantiation, the File System Access API, IndexedDB persistence and the createWritable byte sink — all data crosses the boundary through the callbacks installed via [LibfwClient::set_callbacks].

Callbacks object

engine.set_callbacks({
  onFileStart(path, size) {},
  onWriteChunk(path, offset, data) {},   // Uint8Array
  onFileCompleted(path) {},
  onProgress(done, total) {},
  loadState(direction, path) { return Promise.resolve(null); }, // IndexedDB
  saveState(direction, path, state) { return Promise.resolve(); },// IndexedDB
  getFileList() { return Promise.resolve([]); },       // uploads
  readFile(path, offset, length) { return Promise.resolve(new Uint8Array(0)); },
  log(msg) {},
});