Interface ImportModuleDynamicallyCallback

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ImportModuleDynamicallyCallback
Callback for dynamic import syntax (corresponds to HostImportModuleDynamically).
  • Method Details

    • importModuleDynamically

      JSDynamicObject importModuleDynamically(JSRealm realm, ScriptOrModule referrer, Module.ModuleRequest moduleRequest)
      Executes the embedder-provided callback to resolve a dynamically imported module.
      Parameters:
      realm - The caller realm.
      referrer - Script or Module that calls import().
      moduleRequest - The name of the module to be imported and its assertions.
      Returns:
      a promise from the module loader that will be resolved with the module namespace object when the module is loaded successfully or rejected on error.