virtual-machine 0.4.1 → 0.4.2
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/build/{chunk-ZJDBYKV4.mjs → chunk-G5L3AIRZ.mjs} +53 -13
- package/build/cli.js +54 -14
- package/build/index.d.ts +35 -4
- package/build/index.js +54 -14
- package/build/index.mjs +3 -3
- package/build/node-worker.js +54 -14
- package/build/{riscv_vm-76YCYKQP.mjs → riscv_vm-G4KJ7P4A.mjs} +1 -1
- package/build/worker.js +14 -14
- package/native/index.mjs +1 -0
- package/native/riscv-vm-native.darwin-arm64.node +0 -0
- package/native/riscv-vm-native.darwin-x64.node +0 -0
- package/native/riscv-vm-native.linux-arm64-gnu.node +0 -0
- package/native/riscv-vm-native.linux-arm64-musl.node +0 -0
- package/native/riscv-vm-native.linux-x64-gnu.node +0 -0
- package/native/riscv-vm-native.linux-x64-musl.node +0 -0
- package/native/riscv-vm-native.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
|
@@ -217,18 +217,18 @@ if (!("encodeInto" in cachedTextEncoder)) {
|
|
|
217
217
|
};
|
|
218
218
|
}
|
|
219
219
|
var WASM_VECTOR_LEN = 0;
|
|
220
|
-
function
|
|
221
|
-
wasm.
|
|
222
|
-
}
|
|
223
|
-
function wasm_bindgen__convert__closures_____invoke__hc52153a78090318a(arg0, arg1, arg2) {
|
|
224
|
-
wasm.wasm_bindgen__convert__closures_____invoke__hc52153a78090318a(arg0, arg1, arg2);
|
|
225
|
-
}
|
|
226
|
-
function wasm_bindgen__convert__closures_____invoke__h8c01b902d0cec50b(arg0, arg1) {
|
|
227
|
-
wasm.wasm_bindgen__convert__closures_____invoke__h8c01b902d0cec50b(arg0, arg1);
|
|
220
|
+
function wasm_bindgen__convert__closures_____invoke__h8f8124f6febb822b(arg0, arg1) {
|
|
221
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h8f8124f6febb822b(arg0, arg1);
|
|
228
222
|
}
|
|
229
223
|
function wasm_bindgen__convert__closures_____invoke__h260170fb96639bcf(arg0, arg1, arg2) {
|
|
230
224
|
wasm.wasm_bindgen__convert__closures_____invoke__h260170fb96639bcf(arg0, arg1, arg2);
|
|
231
225
|
}
|
|
226
|
+
function wasm_bindgen__convert__closures_____invoke__hdb5f2c9fdbbad746(arg0, arg1) {
|
|
227
|
+
wasm.wasm_bindgen__convert__closures_____invoke__hdb5f2c9fdbbad746(arg0, arg1);
|
|
228
|
+
}
|
|
229
|
+
function wasm_bindgen__convert__closures_____invoke__hc92ef0219c4477f2(arg0, arg1, arg2) {
|
|
230
|
+
wasm.wasm_bindgen__convert__closures_____invoke__hc92ef0219c4477f2(arg0, arg1, arg2);
|
|
231
|
+
}
|
|
232
232
|
var __wbindgen_enum_WorkerType = ["classic", "module"];
|
|
233
233
|
var WasmVmFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
234
234
|
}, unregister: () => {
|
|
@@ -348,6 +348,27 @@ var WasmVm = class _WasmVm {
|
|
|
348
348
|
const len0 = WASM_VECTOR_LEN;
|
|
349
349
|
wasm.wasmvm_print_status(this.__wbg_ptr, ptr0, len0);
|
|
350
350
|
}
|
|
351
|
+
/**
|
|
352
|
+
* Send a typed character to the D1 input device.
|
|
353
|
+
*
|
|
354
|
+
* This is the preferred way to send text input because it respects
|
|
355
|
+
* keyboard layouts. For example, Shift+7 produces '/' on German keyboards,
|
|
356
|
+
* and this method sends the actual '/' character.
|
|
357
|
+
*
|
|
358
|
+
* Use this for printable characters typed by the user.
|
|
359
|
+
* Use send_d1_key_event for special keys like Enter, Backspace, arrows.
|
|
360
|
+
*
|
|
361
|
+
* # Arguments
|
|
362
|
+
* * `char_code` - ASCII/Unicode code point (e.g., 47 for '/')
|
|
363
|
+
*
|
|
364
|
+
* Returns true if the character was sent successfully.
|
|
365
|
+
* @param {number} char_code
|
|
366
|
+
* @returns {boolean}
|
|
367
|
+
*/
|
|
368
|
+
send_d1_char(char_code) {
|
|
369
|
+
const ret = wasm.wasmvm_send_d1_char(this.__wbg_ptr, char_code);
|
|
370
|
+
return ret !== 0;
|
|
371
|
+
}
|
|
351
372
|
/**
|
|
352
373
|
* Get CPU count (from kernel-reported value).
|
|
353
374
|
* @returns {number}
|
|
@@ -547,6 +568,25 @@ var WasmVm = class _WasmVm {
|
|
|
547
568
|
const ret = wasm.wasmvm_get_shared_buffer(this.__wbg_ptr);
|
|
548
569
|
return ret;
|
|
549
570
|
}
|
|
571
|
+
/**
|
|
572
|
+
* Send a keyboard event to the D1 input device.
|
|
573
|
+
*
|
|
574
|
+
* This is the primary way to send keyboard input to the VM when using
|
|
575
|
+
* the D1 touch/input device (as opposed to VirtIO input).
|
|
576
|
+
*
|
|
577
|
+
* # Arguments
|
|
578
|
+
* * `js_key_code` - JavaScript keyCode (e.g., 65 for 'A', 13 for Enter)
|
|
579
|
+
* * `pressed` - true for key press, false for key release
|
|
580
|
+
*
|
|
581
|
+
* Returns true if the event was sent successfully.
|
|
582
|
+
* @param {number} js_key_code
|
|
583
|
+
* @param {boolean} pressed
|
|
584
|
+
* @returns {boolean}
|
|
585
|
+
*/
|
|
586
|
+
send_d1_key_event(js_key_code, pressed) {
|
|
587
|
+
const ret = wasm.wasmvm_send_d1_key_event(this.__wbg_ptr, js_key_code, pressed);
|
|
588
|
+
return ret !== 0;
|
|
589
|
+
}
|
|
550
590
|
/**
|
|
551
591
|
* Send a mouse button event to the guest.
|
|
552
592
|
*
|
|
@@ -1392,7 +1432,7 @@ function __wbg_get_imports() {
|
|
|
1392
1432
|
}, arguments);
|
|
1393
1433
|
};
|
|
1394
1434
|
imports.wbg.__wbindgen_cast_041c77978d70bb0a = function(arg0, arg1) {
|
|
1395
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1435
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h747faf247e91d978, wasm_bindgen__convert__closures_____invoke__h8f8124f6febb822b);
|
|
1396
1436
|
return ret;
|
|
1397
1437
|
};
|
|
1398
1438
|
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
@@ -1403,12 +1443,12 @@ function __wbg_get_imports() {
|
|
|
1403
1443
|
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h612f8e24953b61d5, wasm_bindgen__convert__closures_____invoke__h260170fb96639bcf);
|
|
1404
1444
|
return ret;
|
|
1405
1445
|
};
|
|
1406
|
-
imports.wbg.
|
|
1407
|
-
const ret =
|
|
1446
|
+
imports.wbg.__wbindgen_cast_46fd076aabb4c434 = function(arg0, arg1) {
|
|
1447
|
+
const ret = makeClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h747faf247e91d978, wasm_bindgen__convert__closures_____invoke__hdb5f2c9fdbbad746);
|
|
1408
1448
|
return ret;
|
|
1409
1449
|
};
|
|
1410
|
-
imports.wbg.
|
|
1411
|
-
const ret =
|
|
1450
|
+
imports.wbg.__wbindgen_cast_d3f7166d7f91ad34 = function(arg0, arg1) {
|
|
1451
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h747faf247e91d978, wasm_bindgen__convert__closures_____invoke__hc92ef0219c4477f2);
|
|
1412
1452
|
return ret;
|
|
1413
1453
|
};
|
|
1414
1454
|
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|