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
typealias Exports = ReadonlyRecord<ERROR CLASS: Symbol not found for JsString, ExportValue>
Link copied to clipboard
typealias ExportValue = ERROR CLASS: Symbol not found for JsAny
Link copied to clipboard
open class Global<T : ERROR CLASS: Symbol not found for 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 : ERROR CLASS: Symbol not found for JsAny??>
Link copied to clipboard
sealed interface ImportExportKind
Link copied to clipboard
typealias Imports = ReadonlyRecord<ERROR CLASS: Symbol not found for JsString, ModuleImports>
Link copied to clipboard
typealias ImportValue = ERROR CLASS: Symbol not found for 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<B : ArrayBufferLike>(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: AllowSharedBufferSource, 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
typealias ModuleImports = ReadonlyRecord<ERROR CLASS: Symbol not found for JsString, ImportValue>
Link copied to clipboard
class RuntimeError(message: String = definedExternally) : JsError
Link copied to clipboard
open class Table(descriptor: TableDescriptor, value: ERROR CLASS: Symbol not found for 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 : ERROR CLASS: Symbol not found for JsAny??>
Link copied to clipboard

Properties

Link copied to clipboard
val ValueType.Companion.externref: ValueType<ERROR CLASS: Symbol not found for JsAny??>
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: AllowSharedBufferSource): Module
inline suspend fun compile(bytes: AllowSharedBufferSource, options: WebAssemblyCompileOptions?): Module
Link copied to clipboard
external fun compileAsync(bytes: AllowSharedBufferSource, 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(moduleObject: Module, importObject: Imports): Instance
Link copied to clipboard
external fun instantiateAsync(moduleObject: Module, importObject: Imports = definedExternally): Promise<Instance>

external fun instantiateAsync(bytes: AllowSharedBufferSource, 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: AllowSharedBufferSource, options: WebAssemblyCompileOptions? = definedExternally): Boolean