SyntheticJSModule

Synthetic JavaScript Module

Describes a "synthetic" JavaScript module, which is a module that surfaces as a built-in for guest JavaScript code, and which is typically implemented in Kotlin or generally on JVM. Synthetic modules are resolved at their built-in name and routed to the appropriate implementation.

This interface defines the API contract which is used to understand the module and to dynamically load it into a suite of exports. It is not a requirement that the synthetic facade for a module be the same as the module's actual implementation.

Parameters

T

Type/shape of the module.

See also

ESM interface for synthetic modules.

CJS interface for synthetic modules.

Types

Link copied to clipboard
data class ExportedSymbol(val name: String, val kind: SyntheticJSModule.ExportKind, val from: String? = null) : Record

Describes a symbol which is exported from a synthetic module; such symbols are used when initializing the module object in ESM mode, and used for generating bindings in string form for CJS mode.

Link copied to clipboard

Describes different types of exports.

Functions

Link copied to clipboard

Exported symbols provided by this module.

Link copied to clipboard
abstract override fun provide(): T & Any

Provide the module instance.

Link copied to clipboard

Build a provider for this module.

Link copied to clipboard
open override fun resolve(info: ModuleInfo): T & Any

Given a suite of module info for a built-in module, resolve the module implementation and provide it as the return value.