@@ -26382,16 +26382,16 @@ declare namespace WebAssembly {
26382
26382
};
26383
26383
26384
26384
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Global) */
26385
- interface Global {
26385
+ interface Global<T extends ValueType = ValueType> {
26386
26386
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Global/value) */
26387
- value: any ;
26387
+ value: ValueTypeMap[T] ;
26388
26388
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Global/valueOf) */
26389
- valueOf(): any ;
26389
+ valueOf(): ValueTypeMap[T] ;
26390
26390
}
26391
26391
26392
26392
var Global: {
26393
26393
prototype: Global;
26394
- new(descriptor: GlobalDescriptor, v?: any ): Global;
26394
+ new<T extends ValueType = ValueType> (descriptor: GlobalDescriptor<T> , v?: ValueTypeMap[T] ): Global<T> ;
26395
26395
};
26396
26396
26397
26397
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance) */
@@ -26468,9 +26468,9 @@ declare namespace WebAssembly {
26468
26468
new(descriptor: TableDescriptor, value?: any): Table;
26469
26469
};
26470
26470
26471
- interface GlobalDescriptor {
26471
+ interface GlobalDescriptor<T extends ValueType = ValueType> {
26472
26472
mutable?: boolean;
26473
- value: ValueType ;
26473
+ value: T ;
26474
26474
}
26475
26475
26476
26476
interface MemoryDescriptor {
@@ -26496,19 +26496,29 @@ declare namespace WebAssembly {
26496
26496
maximum?: number;
26497
26497
}
26498
26498
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
+
26499
26509
interface WebAssemblyInstantiatedSource {
26500
26510
instance: Instance;
26501
26511
module: Module;
26502
26512
}
26503
26513
26504
26514
type ImportExportKind = "function" | "global" | "memory" | "table";
26505
26515
type TableKind = "anyfunc" | "externref";
26506
- type ValueType = "anyfunc" | "externref" | "f32" | "f64" | "i32" | "i64" | "v128";
26507
26516
type ExportValue = Function | Global | Memory | Table;
26508
26517
type Exports = Record<string, ExportValue>;
26509
26518
type ImportValue = ExportValue | number;
26510
26519
type Imports = Record<string, ModuleImports>;
26511
26520
type ModuleImports = Record<string, ImportValue>;
26521
+ type ValueType = keyof ValueTypeMap;
26512
26522
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compile) */
26513
26523
function compile(bytes: BufferSource): Promise<Module>;
26514
26524
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compileStreaming) */
0 commit comments