@@ -30,6 +30,10 @@ interface EventListenerOptions {
3030 capture ?: boolean ;
3131}
3232
33+ interface ExceptionOptions {
34+ traceStack ?: boolean ;
35+ }
36+
3337interface MessageEventInit < T = any > extends EventInit {
3438 data ?: T ;
3539 lastEventId ?: string ;
@@ -125,6 +129,10 @@ interface StructuredSerializeOptions {
125129 transfer ?: Transferable [ ] ;
126130}
127131
132+ interface TagType {
133+ parameters : ValueType [ ] ;
134+ }
135+
128136interface TextDecodeOptions {
129137 stream ?: boolean ;
130138}
@@ -178,6 +186,11 @@ interface UnderlyingSource<R = any> {
178186 type ?: ReadableStreamType ;
179187}
180188
189+ interface WebAssemblyCompileOptions {
190+ builtins ?: string [ ] ;
191+ importedStringConstants ?: string | null ;
192+ }
193+
181194/**
182195 * The **`AbortController`** interface represents a controller object that allows you to abort one or more Web requests as and when desired.
183196 *
@@ -1540,6 +1553,37 @@ declare namespace WebAssembly {
15401553 ( message ?: string ) : CompileError ;
15411554 } ;
15421555
1556+ /**
1557+ * The **`WebAssembly.Exception`** object represents a runtime exception thrown from WebAssembly to JavaScript, or thrown from JavaScript to a WebAssembly exception handler.
1558+ *
1559+ * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Exception)
1560+ */
1561+ interface Exception {
1562+ /**
1563+ * The read-only **`stack`** property of an object instance of type `WebAssembly.Exception` _may_ contain a stack trace.
1564+ *
1565+ * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Exception/stack)
1566+ */
1567+ readonly stack : string | undefined ;
1568+ /**
1569+ * The **`getArg()`** prototype method of the `Exception` object can be used to get the value of a specified item in the exception's data arguments.
1570+ *
1571+ * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Exception/getArg)
1572+ */
1573+ getArg ( index : number ) : any ;
1574+ /**
1575+ * The **`is()`** prototype method of the `Exception` object can be used to test if the `Exception` matches a given tag.
1576+ *
1577+ * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Exception/is)
1578+ */
1579+ is ( exceptionTag : Tag ) : boolean ;
1580+ }
1581+
1582+ var Exception : {
1583+ prototype : Exception ;
1584+ new ( exceptionTag : Tag , payload : any [ ] , options ?: ExceptionOptions ) : Exception ;
1585+ } ;
1586+
15431587 /**
15441588 * A **`WebAssembly.Global`** object represents a global variable instance, accessible from both JavaScript and importable/exportable across one or more `WebAssembly.Module` instances.
15451589 *
@@ -1600,7 +1644,7 @@ declare namespace WebAssembly {
16001644 *
16011645 * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Memory/grow)
16021646 */
1603- grow ( delta : number ) : number ;
1647+ grow ( delta : AddressValue ) : AddressValue ;
16041648 }
16051649
16061650 var Memory : {
@@ -1618,7 +1662,7 @@ declare namespace WebAssembly {
16181662
16191663 var Module : {
16201664 prototype : Module ;
1621- new ( bytes : BufferSource ) : Module ;
1665+ new ( bytes : BufferSource , options ?: WebAssemblyCompileOptions ) : Module ;
16221666 /**
16231667 * The **`WebAssembly.Module.customSections()`** static method returns a copy of the contents of all custom sections in the given module with the given string name.
16241668 *
@@ -1659,40 +1703,54 @@ declare namespace WebAssembly {
16591703 *
16601704 * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/length)
16611705 */
1662- readonly length : number ;
1706+ readonly length : AddressValue ;
16631707 /**
16641708 * The **`get()`** prototype method of the `WebAssembly.Table()` object retrieves the element stored at a given index.
16651709 *
16661710 * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/get)
16671711 */
1668- get ( index : number ) : any ;
1712+ get ( index : AddressValue ) : any ;
16691713 /**
16701714 * The **`grow()`** prototype method of the `WebAssembly.Table` object increases the size of the `Table` instance by a specified number of elements, filled with the provided value.
16711715 *
16721716 * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/grow)
16731717 */
1674- grow ( delta : number , value ?: any ) : number ;
1718+ grow ( delta : AddressValue , value ?: any ) : AddressValue ;
16751719 /**
16761720 * The **`set()`** prototype method of the `WebAssembly.Table` object mutates a reference stored at a given index to a different value.
16771721 *
16781722 * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/set)
16791723 */
1680- set ( index : number , value ?: any ) : void ;
1724+ set ( index : AddressValue , value ?: any ) : void ;
16811725 }
16821726
16831727 var Table : {
16841728 prototype : Table ;
16851729 new ( descriptor : TableDescriptor , value ?: any ) : Table ;
16861730 } ;
16871731
1732+ /**
1733+ * The **`WebAssembly.Tag`** object defines a _type_ of a WebAssembly exception that can be thrown to/from WebAssembly code.
1734+ *
1735+ * [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Tag)
1736+ */
1737+ interface Tag {
1738+ }
1739+
1740+ var Tag : {
1741+ prototype : Tag ;
1742+ new ( type : TagType ) : Tag ;
1743+ } ;
1744+
16881745 interface GlobalDescriptor < T extends ValueType = ValueType > {
16891746 mutable ?: boolean ;
16901747 value : T ;
16911748 }
16921749
16931750 interface MemoryDescriptor {
1694- initial : number ;
1695- maximum ?: number ;
1751+ address ?: AddressType ;
1752+ initial : AddressValue ;
1753+ maximum ?: AddressValue ;
16961754 shared ?: boolean ;
16971755 }
16981756
@@ -1708,9 +1766,10 @@ declare namespace WebAssembly {
17081766 }
17091767
17101768 interface TableDescriptor {
1769+ address ?: AddressType ;
17111770 element : TableKind ;
1712- initial : number ;
1713- maximum ?: number ;
1771+ initial : AddressValue ;
1772+ maximum ?: AddressValue ;
17141773 }
17151774
17161775 interface ValueTypeMap {
@@ -1728,7 +1787,7 @@ declare namespace WebAssembly {
17281787 module : Module ;
17291788 }
17301789
1731- type ImportExportKind = "function" | "global" | "memory" | "table" ;
1790+ type ImportExportKind = "function" | "global" | "memory" | "table" | "tag" ;
17321791 type TableKind = "anyfunc" | "externref" ;
17331792 type ExportValue = Function | Global | Memory | Table ;
17341793 type Exports = Record < string , ExportValue > ;
@@ -1737,12 +1796,12 @@ declare namespace WebAssembly {
17371796 type ModuleImports = Record < string , ImportValue > ;
17381797 type ValueType = keyof ValueTypeMap ;
17391798 /** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/compile_static) */
1740- function compile ( bytes : BufferSource ) : Promise < Module > ;
1799+ function compile ( bytes : BufferSource , options ?: WebAssemblyCompileOptions ) : Promise < Module > ;
17411800 /** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/instantiate_static) */
1742- function instantiate ( bytes : BufferSource , importObject ?: Imports ) : Promise < WebAssemblyInstantiatedSource > ;
1801+ function instantiate ( bytes : BufferSource , importObject ?: Imports , options ?: WebAssemblyCompileOptions ) : Promise < WebAssemblyInstantiatedSource > ;
17431802 function instantiate ( moduleObject : Module , importObject ?: Imports ) : Promise < Instance > ;
17441803 /** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/validate_static) */
1745- function validate ( bytes : BufferSource ) : boolean ;
1804+ function validate ( bytes : BufferSource , options ?: WebAssemblyCompileOptions ) : boolean ;
17461805}
17471806
17481807/** The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox). */
@@ -1943,6 +2002,7 @@ declare var sampleRate: number;
19432002 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletGlobalScope/registerProcessor)
19442003 */
19452004declare function registerProcessor ( name : string , processorCtor : AudioWorkletProcessorConstructor ) : void ;
2005+ type AddressValue = any ;
19462006type AllowSharedBufferSource = ArrayBufferLike | ArrayBufferView < ArrayBufferLike > ;
19472007type BufferSource = ArrayBufferView < ArrayBuffer > | ArrayBuffer ;
19482008type DOMHighResTimeStamp = number ;
@@ -1952,6 +2012,7 @@ type ReadableStreamController<T> = ReadableStreamDefaultController<T> | Readable
19522012type ReadableStreamReadResult < T > = ReadableStreamReadValueResult < T > | ReadableStreamReadDoneResult < T > ;
19532013type ReadableStreamReader < T > = ReadableStreamDefaultReader < T > | ReadableStreamBYOBReader ;
19542014type Transferable = MessagePort | ReadableStream | WritableStream | TransformStream | ArrayBuffer ;
2015+ type AddressType = "i32" | "i64" ;
19552016type CompressionFormat = "deflate" | "deflate-raw" | "gzip" ;
19562017type ReadableStreamReaderMode = "byob" ;
19572018type ReadableStreamType = "bytes" ;
0 commit comments