Skip to content

Commit

Permalink
Merge pull request #38 from chrispahm/fix-emscripten-module-types
Browse files Browse the repository at this point in the history
🐛 fix missing types for default emscripten module
  • Loading branch information
chrispahm authored Nov 26, 2024
2 parents 70b3f6b + c79deb3 commit b6818ee
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion createTypes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const inputFile = './src/allCFunctions.mjs'
const functionsFile = './src/addGeosFunctions.mjs'
const outputDir = './build/package'
const helpersDir = './build/package/helpers'
const emscriptenTypes = fs.readFileSync('./node_modules/@types/emscripten/index.d.ts', 'utf8')

/* create output directory if it doesn't exist */
if (!fs.existsSync(outputDir)) fs.mkdirSync(outputDir)

Expand Down Expand Up @@ -122,7 +124,9 @@ const allEnums = templateData.map((identifier) => {
}).filter(Boolean)

const output = `
interface Module {
${emscriptenTypes}
interface Module extends EmscriptenModule {
${allModuleFunctions.join('\n ')}
}
Expand Down
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"@turf/center": "7.1.0",
"@turf/meta": "7.1.0",
"@turf/turf": "7.1.0",
"@types/emscripten": "^1.39.13",
"buffer": "^6.0.3",
"cheerio": "^1.0.0",
"d3-geo": "^3.1.1",
Expand Down

0 comments on commit b6818ee

Please sign in to comment.