Class JsImportsGenerator

java.lang.Object
com.google.j2cl.transpiler.backend.wasm.JsImportsGenerator

public final class JsImportsGenerator extends Object
Generates a JavaScript imports mapping for the Wasm module.
  • Field Details

    • MODULE

      public static final String MODULE
      Top-level module name in the imports map containing all generated imports.
      See Also:
  • Method Details

    • collectImports

      public static JsImportsGenerator.Imports collectImports(com.google.j2cl.transpiler.ast.Library library, com.google.j2cl.common.Problems problems)
      Collects JavaScript imports that are referenced in the library.
    • generateOutputs

      public static void generateOutputs(com.google.j2cl.common.OutputUtils.Output output, JsImportsGenerator.Imports imports)
      Generates the JavaScript code to support the imports.
    • generateOutputs

      public static String generateOutputs(Collection<String> requiredModules, Map<String,String> methodImports)
      Generates the JavaScript code to support the imports.