Internal types used to represent Elm Html in pure Elm
Text tags just contain text
A node contains the tag as a string, the children, the facts (e.g attributes) and descendantsCount
Custom nodes contain facts (e.g attributes) and a json value for the model
A markdown node contains facts (e.g attributes) and the model used by markdown
Facts contain various dictionaries and values for a node
Tagger holds the map function when Html.Map is used, the tagger should then be applied to events comming from descendant nodes, it is basically a javascript function.
EventHandler holds the function that is called when an event is triggered, it is basically a javascript object like this:
{ decoder: [Function] }
Type for representing the five kinds of elements according to HTML 5 spec. Used to handle different rendering behavior depending on the type of element.
Type for representing Elm's Attributes
Html.Attributes.colspan. These values
are applied using element.setAttribute(key, value) during a patch.Svg.Attributes.xlinkHrefHtml.Attributes.class, and can
hold any encoded value. Unlike attributes, where element.setAttribute() is
used during the patch, properties are applied directly as
element[key] = value.Html.Event.Options for the eventAttribute contains a string key and a string value
NamespacedAttribute contains a string key, string namespace and string value
Property contains a string key and a value with an arbitrary type
Event contains a string key, a decoder for a msg and event options
decode a json object into ElmHtml, you have to pass a function that decodes events from Html Nodes. If you don't want to decode event msgs, you can ignore it:
decodeElmHtml (_ _ -> ()) jsonHtml
if you do want to decode them, you will probably need to write some native code like elm-html-test does to extract the function inside those.
Just empty facts
Identify the kind of element. Helper to convert an tag name into a type for pattern matching.
Decode a JSON object into an Attribute. You have to pass a function that decodes events from event attributes. If you don't want to decode event msgs, you can ignore it:
decodeAttribute (\_ -> ()) jsonHtmlIf you do want to decode them, you will probably need to write some native code like elm-html-test does to extract the function inside those.
Type tree for representing Elm's Html