xtuc / webassemblyjs

Toolchain for WebAssembly
https://webassembly.js.org
MIT License
774 stars 90 forks source link

TypeScript support #957

Open kurai-espoir opened 2 years ago

kurai-espoir commented 2 years ago

It would be great if you added support for TypeScript users

EDIT: I didn't realized there was a types directory. Consider renaming the files from *.js to *.d.ts?

xtuc commented 2 years ago

I believe this types are used by webpack, if we rename the file we need to ensure webpack doesn't break.

Would you mind sending a PR?

kurai-espoir commented 2 years ago

Sure. I'll send one by this week.

pcardune commented 2 years ago

I believe the files in the types directory are only for flowtype and will need more than renaming to make them work with typescript. I'm also interested in having typescript type declarations. Let me know if you'd like some help @kurai-espoir

xtuc commented 2 years ago

Long term I think we should remove flow in the repo and replace with typescript.

gustavohenke commented 1 year ago

Hi @xtuc, how do you see this happening -- by rewriting everything to TS, or by keeping the code as JS + adding TS types?