Package-level declarations

Types

Link copied to clipboard
sealed interface AddressType
Link copied to clipboard
typealias AddressValue = Int
Link copied to clipboard
class CompileError(message: String = definedExternally) : JsError
Link copied to clipboard
open class Exception(exceptionTag: Tag, payload: ReadonlyArray<*>, options: ExceptionOptions = definedExternally)

The WebAssembly.Exception object represents a runtime exception thrown from WebAssembly to JavaScript, or thrown from JavaScript to a WebAssembly exception handler.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
typealias ExportValue = JsAny
Link copied to clipboard
open class Global<T : JsAny?>(descriptor: GlobalDescriptor<T>, v: T = definedExternally)

A WebAssembly.Global object represents a global variable instance, accessible from both JavaScript and importable/exportable across one or more WebAssembly.Module instances. This allows dynamic linking of multiple modules.

Link copied to clipboard
interface GlobalDescriptor<T : JsAny?>
Link copied to clipboard
sealed interface ImportExportKind
Link copied to clipboard
Link copied to clipboard
typealias ImportValue = JsAny
Link copied to clipboard
open class Instance(module: Module, importObject: Imports = definedExternally)

A WebAssembly.Instance object is a stateful, executable instance of a WebAssembly.Module. Instance objects contain all the Exported WebAssembly functions that allow calling into WebAssembly code from JavaScript.

Link copied to clipboard
class LinkError(message: String = definedExternally) : JsError
Link copied to clipboard
open class Memory(descriptor: MemoryDescriptor)

The WebAssembly.Memory object is a resizable ArrayBuffer or SharedArrayBuffer that holds raw bytes of memory accessed by a WebAssembly.Instance.

Link copied to clipboard
Link copied to clipboard
open class Module(bytes: BufferSource, options: WebAssemblyCompileOptions = definedExternally)

A WebAssembly.Module object contains stateless WebAssembly code that has already been compiled by the browser — this can be efficiently shared with Workers, and instantiated multiple times.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class RuntimeError(message: String = definedExternally) : JsError
Link copied to clipboard
open class Table(descriptor: TableDescriptor, value: JsAny? = definedExternally)

The WebAssembly.Table object is a JavaScript wrapper object — an array-like structure representing a WebAssembly table, which stores homogeneous references. A table created by JavaScript or in WebAssembly code will be accessible and mutable from both JavaScript and WebAssembly.

Link copied to clipboard
interface TableDescriptor
Link copied to clipboard
sealed interface TableKind
Link copied to clipboard
open class Tag(type: TagType)

The WebAssembly.Tag object defines a type of a WebAssembly exception that can be thrown to/from WebAssembly code.

Link copied to clipboard
interface TagType
Link copied to clipboard
sealed interface ValueType<T : JsAny?>
Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
external val JSTag: Tag
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
inline suspend fun compile(bytes: BufferSource): Module
inline suspend fun compile(bytes: BufferSource, options: WebAssemblyCompileOptions?): Module
Link copied to clipboard
external fun compileAsync(bytes: BufferSource, options: WebAssemblyCompileOptions? = definedExternally): Promise<Module>
Link copied to clipboard
inline suspend fun compileStreaming(source: PromiseLike<Response>): Module
inline suspend fun compileStreaming(source: Response): Module
inline suspend fun compileStreaming(source: PromiseLike<Response>, options: WebAssemblyCompileOptions?): Module
inline suspend fun compileStreaming(source: Response, options: WebAssemblyCompileOptions?): Module
Link copied to clipboard
external fun compileStreamingAsync(source: PromiseLike<Response>, options: WebAssemblyCompileOptions? = definedExternally): Promise<Module>

external fun compileStreamingAsync(source: Response, options: WebAssemblyCompileOptions? = definedExternally): Promise<Module>
Link copied to clipboard
inline suspend fun instantiate(moduleObject: Module): Instance
inline suspend fun instantiate(bytes: BufferSource, importObject: Imports): WebAssemblyInstantiatedSource
inline suspend fun instantiate(moduleObject: Module, importObject: Imports): Instance
inline suspend fun instantiate(bytes: BufferSource, importObject: Imports, options: WebAssemblyCompileOptions?): WebAssemblyInstantiatedSource
Link copied to clipboard
external fun instantiateAsync(moduleObject: Module, importObject: Imports = definedExternally): Promise<Instance>

external fun instantiateAsync(bytes: BufferSource, importObject: Imports = definedExternally, options: WebAssemblyCompileOptions? = definedExternally): Promise<WebAssemblyInstantiatedSource>
Link copied to clipboard
external fun instantiateStreamingAsync(source: PromiseLike<Response>, importObject: Imports = definedExternally, options: WebAssemblyCompileOptions? = definedExternally): Promise<WebAssemblyInstantiatedSource>

external fun instantiateStreamingAsync(source: Response, importObject: Imports = definedExternally, options: WebAssemblyCompileOptions? = definedExternally): Promise<WebAssemblyInstantiatedSource>
Link copied to clipboard
external fun validate(bytes: BufferSource, options: WebAssemblyCompileOptions? = definedExternally): Boolean