DOM serialization
toHtmlfunction
Converts a
Renderedvalue to an HTML string.
Existing range boundaries
fromCommentsvariable
Creates a published advanced Wire from a fragment and exact boundary comments.
Native element recognition
isElementfunction
Checks if a rendered node is an
Element.isHtmlElementfunction
Checks if a rendered node is an
HTMLElement.isSvgElementfunction
Checks if a rendered node is an
SVGElement.
Native node recognition
isAttrfunction
Checks if a rendered node is an
Attrnode.isCommentfunction
Checks if a rendered node is a
Commentnode.isDocumentFragmentfunction
Checks if a rendered node is a
DocumentFragment.isNodefunction
Checks if a rendered node is a standard DOM
Node.isTextfunction
Checks if a rendered node is a
Textnode.
Native output shapes
Renderedtype-alias
A union type representing all possible rendered values. Can be a single Node, a DocumentFragment, a Wire, or an array of these.
Rendered.Elementstype-alias
Extract the elements from a Rendered type
Rendered.Valuetype-alias
Single rendered value type.
Rendered.Valuestype-alias
Extract the values from a Rendered type
Output collection recognition
isArrayfunction
Checks if a rendered value is an array of nodes.
Persistent DOM ranges
Wireinterface
Wire is a data type that serves as a persistent, reusable DocumentFragment.
Unlike a standard
DocumentFragment, which empties itself when appended to the DOM, aWireretains references to its child nodes. This allows it to be moved around the DOM or updated without losing track of its content.It is used internally to manage the lifecycle of template instances.
persistentvariable
Creates a Wire from a DocumentFragment.
If the fragment has only one child, that child is returned directly. If it has multiple children, they are wrapped in a
Wirestructure (bounded by comments) to allow them to be treated as a single unit.
Range recognition
isWirefunction
Checks if a rendered node is a
Wire.
Range reconciliation
diffablevariable
Creates the advanced node adapter used by local DOM reconciliation.
Range traversal
getAllSiblingsBetweenfunction
Gets all sibling nodes between exact range boundaries, excluding both markers.
Rendered element traversal
getElementsfunction
Extracts all Elements from a
Renderedvalue.