You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Web API type definition issue] Wasm64 Support #2485
WebAssembly.AddressValue should be number | bigint instead of number
Expected vs. Actual Behavior
There are a bunch of APIs relying on the type definition of WebAssembly.AddressValue:
WebAssembly.Memory.grow()
WebAssembly.Table.*
`WebAssembly.MemoryDescriptor.*
WebAssembly.TableDescriptor.*
With Wasm64 memory and tables can be 64-bit, requiring some of the parameters and properties to be bigint instead of number. Currently AddressValue is defines as number, but it should be number | bigint instead.
Maybe the API could be further improved with a separate table or memory type, in which the constructor with the help of WebAssembly.MemoryDescriptor or WebAssembly.TableDescriptor can determine which type we are dealing with.
Playground Link
No response
Browser Support
This API is supported in at least two major browser engines (not two Chromium-based browsers).
Have Tried The Latest Releases
This issue applies to the latest release of TypeScript.
This issue applies to the latest release of @types/web.
Additional Context
This has been explicitly overwritten internally here.
I checked it with TypeScript 7.0.2 and Chromium 158: a 64-bit memory or table needs bigints at runtime, but the types only accept numbers, so valid code doesn't compile.
The override comment mentions es2015 compat, but bigint is already used elsewhere in the WebAssembly types and still compiles with TypeScript 5.5.4 on old targets. What would actually break is existing 32-bit code doing math on grow()'s result.
So I propose we keep number by default and only switch to bigint when the descriptor says address: "i64", the same way #2592 handles shared.
Activity
MartinFerret commentedon Dec 1, 2026
Kagami Sascha Rosylight (@saschanaz) I'd like to take this one. :)
I checked it with TypeScript 7.0.2 and Chromium 158: a 64-bit memory or table needs bigints at runtime, but the types only accept numbers, so valid code doesn't compile.
The override comment mentions es2015 compat, but
bigintis already used elsewhere in the WebAssembly types and still compiles with TypeScript 5.5.4 on old targets. What would actually break is existing 32-bit code doing math ongrow()'s result.So I propose we keep
numberby default and only switch tobigintwhen the descriptor saysaddress: "i64", the same way #2592 handlesshared.What do you think about that approach?
saschanaz commentedon Dec 1, 2026
Sound good 👀