diff --git a/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift b/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift index 5e764d6c..eca74f0d 100644 --- a/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift @@ -21360,7 +21360,7 @@ extension Script: GlobalAttributes, GlobalEventAttributes, AsynchronouslyAttribu return mutate(source: value) } - public func type(_ value: Values.Media) -> Script { + public func type(_ value: Values.Script) -> Script { return mutate(type: value.rawValue) } diff --git a/Sources/HTMLKit/Abstraction/Tokens/ValueTokens.swift b/Sources/HTMLKit/Abstraction/Tokens/ValueTokens.swift index 39eefe0d..5d8059df 100644 --- a/Sources/HTMLKit/Abstraction/Tokens/ValueTokens.swift +++ b/Sources/HTMLKit/Abstraction/Tokens/ValueTokens.swift @@ -2231,4 +2231,26 @@ public enum Values { /// Permits the content to navigate its top-level browsing context, but only if initiated by user. case allowTopNavigationByUserActivation = "allow-top-navigation-by-user-activation" } + + /// An enumeration of script types. + /// + /// ```swift + /// Script { + /// } + /// .type(.module) + /// ``` + public enum Script: String { + + /// Indicates the script is used as importmap. + case importMap = "importmap" + + /// Indicates the script is used as module. + case module + + /// Indicates the script defines speculation rules. + case speculationRules = "speculationrules" + + /// Indicates the script contains json data. + case data = "application/json" + } }