virtual-machine 0.2.2 → 0.3.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.
@@ -206,17 +206,17 @@ if (!("encodeInto" in cachedTextEncoder)) {
206
206
  };
207
207
  }
208
208
  var WASM_VECTOR_LEN = 0;
209
- function wasm_bindgen__convert__closures_____invoke__h74d7f37f0b0d661d(arg0, arg1, arg2) {
210
- wasm.wasm_bindgen__convert__closures_____invoke__h74d7f37f0b0d661d(arg0, arg1, arg2);
211
- }
212
- function wasm_bindgen__convert__closures_____invoke__h9f0ee31d317d33d7(arg0, arg1) {
213
- wasm.wasm_bindgen__convert__closures_____invoke__h9f0ee31d317d33d7(arg0, arg1);
209
+ function wasm_bindgen__convert__closures_____invoke__he00a4f55faf9050f(arg0, arg1) {
210
+ wasm.wasm_bindgen__convert__closures_____invoke__he00a4f55faf9050f(arg0, arg1);
214
211
  }
215
212
  function wasm_bindgen__convert__closures_____invoke__h260170fb96639bcf(arg0, arg1, arg2) {
216
213
  wasm.wasm_bindgen__convert__closures_____invoke__h260170fb96639bcf(arg0, arg1, arg2);
217
214
  }
218
- function wasm_bindgen__convert__closures_____invoke__h97b9bec6245a8424(arg0, arg1) {
219
- wasm.wasm_bindgen__convert__closures_____invoke__h97b9bec6245a8424(arg0, arg1);
215
+ function wasm_bindgen__convert__closures_____invoke__hd159192dfee36a06(arg0, arg1) {
216
+ wasm.wasm_bindgen__convert__closures_____invoke__hd159192dfee36a06(arg0, arg1);
217
+ }
218
+ function wasm_bindgen__convert__closures_____invoke__hedae94b906f728f2(arg0, arg1, arg2) {
219
+ wasm.wasm_bindgen__convert__closures_____invoke__hedae94b906f728f2(arg0, arg1, arg2);
220
220
  }
221
221
  var __wbindgen_enum_WorkerType = ["classic", "module"];
222
222
  var WasmVmFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
@@ -443,6 +443,25 @@ var WasmVm = class _WasmVm {
443
443
  const ret = wasm.wasmvm_get_memory_usage(this.__wbg_ptr);
444
444
  return BigInt.asUintN(64, ret);
445
445
  }
446
+ /**
447
+ * Send a mouse event to the guest.
448
+ *
449
+ * # Arguments
450
+ * * `x` - X position (0-799)
451
+ * * `y` - Y position (0-599)
452
+ * * `buttons` - Button state bitmask (bit 0 = left, bit 1 = right, bit 2 = middle)
453
+ * * `prev_buttons` - Previous button state to detect changes
454
+ *
455
+ * Returns true if the event was sent successfully.
456
+ * @param {number} x
457
+ * @param {number} y
458
+ * @param {number} buttons
459
+ * @returns {boolean}
460
+ */
461
+ send_mouse_event(x, y, buttons) {
462
+ const ret = wasm.wasmvm_send_mouse_event(this.__wbg_ptr, x, y, buttons);
463
+ return ret !== 0;
464
+ }
446
465
  /**
447
466
  * Get the total disk capacity from attached VirtIO block devices.
448
467
  * Returns total bytes across all block devices.
@@ -461,6 +480,20 @@ var WasmVm = class _WasmVm {
461
480
  const ret = wasm.wasmvm_get_shared_buffer(this.__wbg_ptr);
462
481
  return ret;
463
482
  }
483
+ /**
484
+ * Send a mouse button event to the guest.
485
+ *
486
+ * # Arguments
487
+ * * `button` - Button number (0 = left, 1 = right, 2 = middle)
488
+ * * `pressed` - true for press, false for release
489
+ * @param {number} button
490
+ * @param {boolean} pressed
491
+ * @returns {boolean}
492
+ */
493
+ send_mouse_button(button, pressed) {
494
+ const ret = wasm.wasmvm_send_mouse_button(this.__wbg_ptr, button, pressed);
495
+ return ret !== 0;
496
+ }
464
497
  /**
465
498
  * Terminate all workers.
466
499
  */
@@ -1197,24 +1230,24 @@ function __wbg_get_imports() {
1197
1230
  return ret;
1198
1231
  }, arguments);
1199
1232
  };
1200
- imports.wbg.__wbindgen_cast_1b00663567edb453 = function(arg0, arg1) {
1201
- const ret = makeClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h01c75dc83ec8dfae, wasm_bindgen__convert__closures_____invoke__h9f0ee31d317d33d7);
1202
- return ret;
1203
- };
1204
1233
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1205
1234
  const ret = getStringFromWasm0(arg0, arg1);
1206
1235
  return ret;
1207
1236
  };
1237
+ imports.wbg.__wbindgen_cast_32327f67251393a4 = function(arg0, arg1) {
1238
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h2f2b52f94c430d4b, wasm_bindgen__convert__closures_____invoke__he00a4f55faf9050f);
1239
+ return ret;
1240
+ };
1208
1241
  imports.wbg.__wbindgen_cast_3d2491109ac86f9d = function(arg0, arg1) {
1209
1242
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h612f8e24953b61d5, wasm_bindgen__convert__closures_____invoke__h260170fb96639bcf);
1210
1243
  return ret;
1211
1244
  };
1212
- imports.wbg.__wbindgen_cast_a93ea42108a71f00 = function(arg0, arg1) {
1213
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h01c75dc83ec8dfae, wasm_bindgen__convert__closures_____invoke__h74d7f37f0b0d661d);
1245
+ imports.wbg.__wbindgen_cast_bbd4dd9b33de0f05 = function(arg0, arg1) {
1246
+ const ret = makeClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h2f2b52f94c430d4b, wasm_bindgen__convert__closures_____invoke__hd159192dfee36a06);
1214
1247
  return ret;
1215
1248
  };
1216
- imports.wbg.__wbindgen_cast_af54cb5d64a8cc15 = function(arg0, arg1) {
1217
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h01c75dc83ec8dfae, wasm_bindgen__convert__closures_____invoke__h97b9bec6245a8424);
1249
+ imports.wbg.__wbindgen_cast_bda31cc20c54b248 = function(arg0, arg1) {
1250
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h2f2b52f94c430d4b, wasm_bindgen__convert__closures_____invoke__hedae94b906f728f2);
1218
1251
  return ret;
1219
1252
  };
1220
1253
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {