diff --git a/loader/package.json b/loader/package.json index 635db8c55..531317717 100644 --- a/loader/package.json +++ b/loader/package.json @@ -9,7 +9,7 @@ "sideEffects": false, "type": "module", "main": "./dist/index.cjs", - "types": "./dist/index.d.ts", + "types": "./dist/index.d.cts", "files": [ "./dist" ], diff --git a/loader/src/index.cjs b/loader/src/index.cjs index ce064d135..057bdbc21 100644 --- a/loader/src/index.cjs +++ b/loader/src/index.cjs @@ -49,7 +49,7 @@ const Wasm64 = require('./formats/wasm64-emscripten.cjs') /** * @typedef Environment - * @property {{id: string, owner: string, tags: Tag[]}} process + * @property {{Id: string, Owner: string, Tags: Tag[]}} Process */ /** @@ -63,25 +63,30 @@ const Wasm64 = require('./formats/wasm64-emscripten.cjs') /** * @callback handleFunction - * @param {ArrayBuffer | NULL} buffer + * @param {ArrayBuffer | null} buffer * @param {Message} msg * @param {Environment} env - * @returns {HandleResponse} + * @returns {Promise} + */ + +/** + * @typedef {'wasm32-unknown-emscripten'| + * 'wasm32-unknown-emscripten2'| + * 'wasm32-unknown-emscripten3'| + * 'wasm64-unknown-emscripten-draft_2024_02_15'} BinaryFormat */ /** * @typedef Options - * @property {string} format - * @property {string} input - * @property {string} output - * @property {string} memory - * @property {string} compute - * @property {String[]} extensions + * @property {BinaryFormat} [format] + * @property {number} [computeLimit] + * @property {string} [memoryLimit] + * @property {string[]} [extensions] */ /** * @param {ArrayBuffer} binary - * @param {Options} options + * @param {Options} [options] * @returns {Promise} */ module.exports = async function (binary, options) {