From 00b687873c0511cc8289d0519b73a71b0f1fbc86 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Sat, 23 Nov 2024 18:22:58 -0800 Subject: [PATCH] fixup! chore(types): fix Buffer usage in TS 5.7 --- .../lib/supervisor-subprocess-xsnap.js | 4 ++-- packages/xsnap/src/avaXS.js | 2 +- packages/xsnap/src/globals.d.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/swingset-xsnap-supervisor/lib/supervisor-subprocess-xsnap.js b/packages/swingset-xsnap-supervisor/lib/supervisor-subprocess-xsnap.js index d7eb1325744..d150d8da078 100644 --- a/packages/swingset-xsnap-supervisor/lib/supervisor-subprocess-xsnap.js +++ b/packages/swingset-xsnap-supervisor/lib/supervisor-subprocess-xsnap.js @@ -100,11 +100,11 @@ const meterControl = makeMeterControl(); /** * Wrap byte-level protocols with tagged array codec. * - * @param {(cmd: ArrayBuffer) => ArrayBuffer} issueCommand as from xsnap + * @param {(cmd: ArrayBufferLike) => ArrayBuffer} issueCommand as from xsnap * @typedef { [unknown, ...unknown[]] } Tagged tagged array */ function managerPort(issueCommand) { - /** @type { (item: Tagged) => ArrayBuffer } */ + /** @type { (item: Tagged) => ArrayBufferLike } */ const encode = item => { let txt; try { diff --git a/packages/xsnap/src/avaXS.js b/packages/xsnap/src/avaXS.js index 28bb74df5b7..1025c9a9411 100644 --- a/packages/xsnap/src/avaXS.js +++ b/packages/xsnap/src/avaXS.js @@ -112,7 +112,7 @@ async function runTestScript( /** * Handle callback "command" from xsnap subprocess. * - * @type { (msg: ArrayBuffer) => Promise } + * @type { (msg: ArrayBuffer) => Promise> } */ async function handleCommand(message) { /** diff --git a/packages/xsnap/src/globals.d.ts b/packages/xsnap/src/globals.d.ts index 695d772ae08..ec7f661073f 100644 --- a/packages/xsnap/src/globals.d.ts +++ b/packages/xsnap/src/globals.d.ts @@ -1,5 +1,5 @@ -declare var issueCommand: (msg: ArrayBuffer) => ArrayBuffer; +declare var issueCommand: (msg: ArrayBufferLike) => ArrayBuffer; namespace global { - declare var issueCommand: (msg: ArrayBuffer) => ArrayBuffer; + declare var issueCommand: (msg: ArrayBufferLike) => ArrayBuffer; }