@@ -26382,16 +26382,16 @@ declare namespace WebAssembly {
2638226382 };
2638326383
2638426384 /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Global) */
26385- interface Global {
26385+ interface Global<T extends ValueType = ValueType> {
2638626386 /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Global/value) */
26387- value: any ;
26387+ value: ValueTypeMap[T] ;
2638826388 /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Global/valueOf) */
26389- valueOf(): any ;
26389+ valueOf(): ValueTypeMap[T] ;
2639026390 }
2639126391
2639226392 var Global: {
2639326393 prototype: Global;
26394- new(descriptor: GlobalDescriptor, v?: any ): Global;
26394+ new<T extends ValueType = ValueType> (descriptor: GlobalDescriptor<T> , v?: ValueTypeMap[T] ): Global<T> ;
2639526395 };
2639626396
2639726397 /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance) */
@@ -26468,9 +26468,9 @@ declare namespace WebAssembly {
2646826468 new(descriptor: TableDescriptor, value?: any): Table;
2646926469 };
2647026470
26471- interface GlobalDescriptor {
26471+ interface GlobalDescriptor<T extends ValueType = ValueType> {
2647226472 mutable?: boolean;
26473- value: ValueType ;
26473+ value: T ;
2647426474 }
2647526475
2647626476 interface MemoryDescriptor {
@@ -26496,19 +26496,29 @@ declare namespace WebAssembly {
2649626496 maximum?: number;
2649726497 }
2649826498
26499+ interface ValueTypeMap {
26500+ anyfunc: Function;
26501+ externref: any;
26502+ f32: number;
26503+ f64: number;
26504+ i32: number;
26505+ i64: bigint;
26506+ v128: never;
26507+ }
26508+
2649926509 interface WebAssemblyInstantiatedSource {
2650026510 instance: Instance;
2650126511 module: Module;
2650226512 }
2650326513
2650426514 type ImportExportKind = "function" | "global" | "memory" | "table";
2650526515 type TableKind = "anyfunc" | "externref";
26506- type ValueType = "anyfunc" | "externref" | "f32" | "f64" | "i32" | "i64" | "v128";
2650726516 type ExportValue = Function | Global | Memory | Table;
2650826517 type Exports = Record<string, ExportValue>;
2650926518 type ImportValue = ExportValue | number;
2651026519 type Imports = Record<string, ModuleImports>;
2651126520 type ModuleImports = Record<string, ImportValue>;
26521+ type ValueType = keyof ValueTypeMap;
2651226522 /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compile) */
2651326523 function compile(bytes: BufferSource): Promise<Module>;
2651426524 /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compileStreaming) */
0 commit comments