Enum Class JavaScript.Type
- All Implemented Interfaces:
Serializable,Comparable<JavaScript.Type>,Constable
- Enclosing class:
JavaScript
The kind of
<script> tag to render for the dependency.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic JavaScript.TypeReturns the enum constant of this class with the specified name.static JavaScript.Type[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SCRIPT
Render a classic<script>tag. Functions declared in the loaded file become available in the global scope. -
MODULE
Render a<script type="module">tag. The loaded file is treated as an ES module: functions and variables declared in it are private to the module unless explicitly exported. The file is loaded at runtime and is not bundled, even when the URL is a bare relative path. Use this for hand-authored or CDN-hosted modules that should not go through Vite. For build-time bundled ES modules useJsModuleinstead.LoadMode.EAGERandLoadMode.LAZYare supported;LoadMode.INLINEis not, as the browser cannot be given the contents of a module without also losing the module's identity. UseSCRIPTif the contents must be inlined into the page.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-