JimModule

sealed interface JimModule

A compiled, loaded module. Engine-agnostic surface: its manifest/dir, the names of its exported functions, and a uniform JimCallback for any one of them. Two implementations:

  • BytecodeModule — swc4j compiled the TS to JVM classes; functions are static methods.

  • GraalModule — GraalJS evaluated the (transpiled) JS module; functions live on its namespace.

Inheritors

Properties

Link copied to clipboard
abstract val directory: Path
Link copied to clipboard

Names of the module's exported/callable functions.

Link copied to clipboard
abstract val manifest: JimManifest
Link copied to clipboard
open val name: String

Functions

Link copied to clipboard
abstract fun callbackFor(functionName: String): JimCallback?

A callable handle to an exported function, or null if it doesn't exist.

Link copied to clipboard
open fun hasFunction(functionName: String): Boolean

Whether the module exports a callable function with this name.