Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/HTMLKit/Abstraction/Elements/BodyElements.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
22 changes: 22 additions & 0 deletions Sources/HTMLKit/Abstraction/Tokens/ValueTokens.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}