Skip to content

Commit

Permalink
Merge pull request #954 from martonlederer/main
Browse files Browse the repository at this point in the history
fix(loader): update types & point to the correct declaration file
  • Loading branch information
TillaTheHun0 authored Aug 9, 2024
2 parents 5ef3b45 + 6e3db4a commit d913d35
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"sideEffects": false,
"type": "module",
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"types": "./dist/index.d.cts",
"files": [
"./dist"
],
Expand Down
25 changes: 15 additions & 10 deletions loader/src/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

/**
Expand All @@ -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<HandleResponse>}
*/

/**
* @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<handleFunction>}
*/
module.exports = async function (binary, options) {
Expand Down

0 comments on commit d913d35

Please sign in to comment.