Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 76 additions & 14 deletions baselines/audioworklet.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1543,6 +1543,37 @@ declare namespace WebAssembly {
(message?: string): CompileError;
};

/**
* The **`WebAssembly.Exception`** object represents a runtime exception thrown from WebAssembly to JavaScript, or thrown from JavaScript to a WebAssembly exception handler.
*
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Exception)
*/
interface Exception {
/**
* The read-only **`stack`** property of an object instance of type `WebAssembly.Exception` _may_ contain a stack trace.
*
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Exception/stack)
*/
readonly stack: string | undefined;
/**
* 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.
*
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Exception/getArg)
*/
getArg(index: number): any;
/**
* The **`is()`** prototype method of the `Exception` object can be used to test if the `Exception` matches a given tag.
*
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Exception/is)
*/
is(exceptionTag: Tag): boolean;
}

var Exception: {
prototype: Exception;
new(exceptionTag: Tag, payload: any[], options?: ExceptionOptions): Exception;
};

/**
* A **`WebAssembly.Global`** object represents a global variable instance, accessible from both JavaScript and importable/exportable across one or more `WebAssembly.Module` instances.
*
Expand Down Expand Up @@ -1603,7 +1634,7 @@ declare namespace WebAssembly {
*
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Memory/grow)
*/
grow(delta: number): number;
grow(delta: AddressValue): AddressValue;
}

var Memory: {
Expand All @@ -1621,7 +1652,7 @@ declare namespace WebAssembly {

var Module: {
prototype: Module;
new(bytes: BufferSource): Module;
new(bytes: BufferSource, options?: WebAssemblyCompileOptions): Module;
/**
* 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.
*
Expand Down Expand Up @@ -1662,40 +1693,58 @@ declare namespace WebAssembly {
*
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/length)
*/
readonly length: number;
readonly length: AddressValue;
/**
* The **`get()`** prototype method of the `WebAssembly.Table()` object retrieves the element stored at a given index.
*
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/get)
*/
get(index: number): any;
get(index: AddressValue): any;
/**
* 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.
*
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/grow)
*/
grow(delta: number, value?: any): number;
grow(delta: AddressValue, value?: any): AddressValue;
/**
* The **`set()`** prototype method of the `WebAssembly.Table` object mutates a reference stored at a given index to a different value.
*
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/set)
*/
set(index: number, value?: any): void;
set(index: AddressValue, value?: any): void;
}

var Table: {
prototype: Table;
new(descriptor: TableDescriptor, value?: any): Table;
};

/**
* The **`WebAssembly.Tag`** object defines a _type_ of a WebAssembly exception that can be thrown to/from WebAssembly code.
*
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Tag)
*/
interface Tag {
}

var Tag: {
prototype: Tag;
new(type: TagType): Tag;
};

interface ExceptionOptions {
traceStack?: boolean;
}

interface GlobalDescriptor<T extends ValueType = ValueType> {
mutable?: boolean;
value: T;
}

interface MemoryDescriptor {
initial: number;
maximum?: number;
address?: AddressType;
initial: AddressValue;
maximum?: AddressValue;
shared?: boolean;
}

Expand All @@ -1711,9 +1760,14 @@ declare namespace WebAssembly {
}

interface TableDescriptor {
address?: AddressType;
element: TableKind;
initial: number;
maximum?: number;
initial: AddressValue;
maximum?: AddressValue;
}

interface TagType {
parameters: ValueType[];
}

interface ValueTypeMap {
Expand All @@ -1726,26 +1780,34 @@ declare namespace WebAssembly {
v128: never;
}

interface WebAssemblyCompileOptions {
builtins?: string[];
importedStringConstants?: string | null;
}

interface WebAssemblyInstantiatedSource {
instance: Instance;
module: Module;
}

type ImportExportKind = "function" | "global" | "memory" | "table";
type AddressType = "i32" | "i64";
type ImportExportKind = "function" | "global" | "memory" | "table" | "tag";
type TableKind = "anyfunc" | "externref";
type AddressValue = number;
type ExportValue = Function | Global | Memory | Table;
type Exports = Record<string, ExportValue>;
type ImportValue = ExportValue | number;
type Imports = Record<string, ModuleImports>;
type ModuleImports = Record<string, ImportValue>;
type ValueType = keyof ValueTypeMap;
var JSTag: Tag;
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/compile_static) */
function compile(bytes: BufferSource): Promise<Module>;
function compile(bytes: BufferSource, options?: WebAssemblyCompileOptions): Promise<Module>;
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/instantiate_static) */
function instantiate(bytes: BufferSource, importObject?: Imports): Promise<WebAssemblyInstantiatedSource>;
function instantiate(bytes: BufferSource, importObject?: Imports, options?: WebAssemblyCompileOptions): Promise<WebAssemblyInstantiatedSource>;
function instantiate(moduleObject: Module, importObject?: Imports): Promise<Instance>;
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/validate_static) */
function validate(bytes: BufferSource): boolean;
function validate(bytes: BufferSource, options?: WebAssemblyCompileOptions): boolean;
}

/** The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox). */
Expand Down
Loading