Class JsImportsGenerator
java.lang.Object
com.google.j2cl.transpiler.backend.wasm.JsImportsGenerator
Generates a JavaScript imports mapping for the Wasm module.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents the JavaScript imports for a the Wasm module. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic JsImportsGenerator.ImportscollectImports(com.google.j2cl.transpiler.ast.Library library, com.google.j2cl.common.Problems problems) Collects JavaScript imports that are referenced in the library.static voidgenerateOutputs(com.google.j2cl.common.OutputUtils.Output output, JsImportsGenerator.Imports imports) Generates the JavaScript code to support the imports.static StringgenerateOutputs(Collection<String> requiredModules, Map<String, String> methodImports) Generates the JavaScript code to support the imports.
-
Field Details
-
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.
-