@@ -30,6 +30,10 @@ interface EventListenerOptions {
30
30
capture ?: boolean ;
31
31
}
32
32
33
+ interface ExceptionOptions {
34
+ traceStack ?: boolean ;
35
+ }
36
+
33
37
interface MessageEventInit < T = any > extends EventInit {
34
38
data ?: T ;
35
39
lastEventId ?: string ;
@@ -125,6 +129,10 @@ interface StructuredSerializeOptions {
125
129
transfer ?: Transferable [ ] ;
126
130
}
127
131
132
+ interface TagType {
133
+ parameters : ValueType [ ] ;
134
+ }
135
+
128
136
interface TextDecodeOptions {
129
137
stream ?: boolean ;
130
138
}
@@ -178,6 +186,11 @@ interface UnderlyingSource<R = any> {
178
186
type ?: ReadableStreamType ;
179
187
}
180
188
189
+ interface WebAssemblyCompileOptions {
190
+ builtins ?: string [ ] ;
191
+ importedStringConstants ?: string | null ;
192
+ }
193
+
181
194
/**
182
195
* The **`AbortController`** interface represents a controller object that allows you to abort one or more Web requests as and when desired.
183
196
*
@@ -1540,6 +1553,37 @@ declare namespace WebAssembly {
1540
1553
( message ?: string ) : CompileError ;
1541
1554
} ;
1542
1555
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
+
1543
1587
/**
1544
1588
* A **`WebAssembly.Global`** object represents a global variable instance, accessible from both JavaScript and importable/exportable across one or more `WebAssembly.Module` instances.
1545
1589
*
@@ -1600,7 +1644,7 @@ declare namespace WebAssembly {
1600
1644
*
1601
1645
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Memory/grow)
1602
1646
*/
1603
- grow ( delta : number ) : number ;
1647
+ grow ( delta : AddressValue ) : AddressValue ;
1604
1648
}
1605
1649
1606
1650
var Memory : {
@@ -1618,7 +1662,7 @@ declare namespace WebAssembly {
1618
1662
1619
1663
var Module : {
1620
1664
prototype : Module ;
1621
- new ( bytes : BufferSource ) : Module ;
1665
+ new ( bytes : BufferSource , options ?: WebAssemblyCompileOptions ) : Module ;
1622
1666
/**
1623
1667
* 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.
1624
1668
*
@@ -1659,40 +1703,54 @@ declare namespace WebAssembly {
1659
1703
*
1660
1704
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/length)
1661
1705
*/
1662
- readonly length : number ;
1706
+ readonly length : AddressValue ;
1663
1707
/**
1664
1708
* The **`get()`** prototype method of the `WebAssembly.Table()` object retrieves the element stored at a given index.
1665
1709
*
1666
1710
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/get)
1667
1711
*/
1668
- get ( index : number ) : any ;
1712
+ get ( index : AddressValue ) : any ;
1669
1713
/**
1670
1714
* 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.
1671
1715
*
1672
1716
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/grow)
1673
1717
*/
1674
- grow ( delta : number , value ?: any ) : number ;
1718
+ grow ( delta : AddressValue , value ?: any ) : AddressValue ;
1675
1719
/**
1676
1720
* The **`set()`** prototype method of the `WebAssembly.Table` object mutates a reference stored at a given index to a different value.
1677
1721
*
1678
1722
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/set)
1679
1723
*/
1680
- set ( index : number , value ?: any ) : void ;
1724
+ set ( index : AddressValue , value ?: any ) : void ;
1681
1725
}
1682
1726
1683
1727
var Table : {
1684
1728
prototype : Table ;
1685
1729
new ( descriptor : TableDescriptor , value ?: any ) : Table ;
1686
1730
} ;
1687
1731
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
+
1688
1745
interface GlobalDescriptor < T extends ValueType = ValueType > {
1689
1746
mutable ?: boolean ;
1690
1747
value : T ;
1691
1748
}
1692
1749
1693
1750
interface MemoryDescriptor {
1694
- initial : number ;
1695
- maximum ?: number ;
1751
+ address ?: AddressType ;
1752
+ initial : AddressValue ;
1753
+ maximum ?: AddressValue ;
1696
1754
shared ?: boolean ;
1697
1755
}
1698
1756
@@ -1708,9 +1766,10 @@ declare namespace WebAssembly {
1708
1766
}
1709
1767
1710
1768
interface TableDescriptor {
1769
+ address ?: AddressType ;
1711
1770
element : TableKind ;
1712
- initial : number ;
1713
- maximum ?: number ;
1771
+ initial : AddressValue ;
1772
+ maximum ?: AddressValue ;
1714
1773
}
1715
1774
1716
1775
interface ValueTypeMap {
@@ -1728,7 +1787,7 @@ declare namespace WebAssembly {
1728
1787
module : Module ;
1729
1788
}
1730
1789
1731
- type ImportExportKind = "function" | "global" | "memory" | "table" ;
1790
+ type ImportExportKind = "function" | "global" | "memory" | "table" | "tag" ;
1732
1791
type TableKind = "anyfunc" | "externref" ;
1733
1792
type ExportValue = Function | Global | Memory | Table ;
1734
1793
type Exports = Record < string , ExportValue > ;
@@ -1737,12 +1796,12 @@ declare namespace WebAssembly {
1737
1796
type ModuleImports = Record < string , ImportValue > ;
1738
1797
type ValueType = keyof ValueTypeMap ;
1739
1798
/** [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 > ;
1741
1800
/** [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 > ;
1743
1802
function instantiate ( moduleObject : Module , importObject ?: Imports ) : Promise < Instance > ;
1744
1803
/** [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 ;
1746
1805
}
1747
1806
1748
1807
/** The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox). */
@@ -1943,6 +2002,7 @@ declare var sampleRate: number;
1943
2002
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletGlobalScope/registerProcessor)
1944
2003
*/
1945
2004
declare function registerProcessor ( name : string , processorCtor : AudioWorkletProcessorConstructor ) : void ;
2005
+ type AddressValue = any ;
1946
2006
type AllowSharedBufferSource = ArrayBufferLike | ArrayBufferView < ArrayBufferLike > ;
1947
2007
type BufferSource = ArrayBufferView < ArrayBuffer > | ArrayBuffer ;
1948
2008
type DOMHighResTimeStamp = number ;
@@ -1952,6 +2012,7 @@ type ReadableStreamController<T> = ReadableStreamDefaultController<T> | Readable
1952
2012
type ReadableStreamReadResult < T > = ReadableStreamReadValueResult < T > | ReadableStreamReadDoneResult < T > ;
1953
2013
type ReadableStreamReader < T > = ReadableStreamDefaultReader < T > | ReadableStreamBYOBReader ;
1954
2014
type Transferable = MessagePort | ReadableStream | WritableStream | TransformStream | ArrayBuffer ;
2015
+ type AddressType = "i32" | "i64" ;
1955
2016
type CompressionFormat = "deflate" | "deflate-raw" | "gzip" ;
1956
2017
type ReadableStreamReaderMode = "byob" ;
1957
2018
type ReadableStreamType = "bytes" ;
0 commit comments