-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add webassembly-js-api for *_bg.d.ts. #1312
Conversation
Per #1040, `import 'webassembly-js-api'` is needed for `WebAssembly.Memory`.
Thanks for the PR! This inspired me to write some tests we can run on CI to ensure that this doesn't regress. In making that though I'm wondering if this is necessary? There it looks like just depending on |
Ooh Typescript tests. Nice. So, I'm not super familiar with with TS either. I looked around a bit. Essentially you're asking the TS compiler to introduce something into the global scope automatically. As far as I can tell, that's not a common thing to do. |
I agree yeah it's nonstandard and in general a bad idea, but for this case specifically |
I have a lot of experience with TypeScript. Yeah, this needs to be added to the TypeScript compiler. They already do that for ES6 + DOM APIs. That's the standard way that TypeScript handles globals. They have a tracking issue here: microsoft/TypeScript#29747 |
Thanks for the reference and comment @Pauan! Sounds like we should close this for now but recommend depending on |
Yes, installing If that issue takes too long to fix, we can gently ping the TypeScript team. |
Sounds good to me! @konkers would you be interested in perhaps sending a PR to update our documentation for using TypeScript to indicate this? |
Odd! I though I tried with just |
Yeah, I'll send a PR for a doc update. |
I'm thinking that adding an example using typescript with callouts about |
@konkers an example sounds like a great idea to me! |
Just for the record, apparently one has to install
|
Per #1040,
import 'webassembly-js-api'
is needed forWebAssembly.Memory
.