Attribute bindings
AttrPartNodeclass
Represents a dynamic attribute (e.g.
src="${url}").
Attribute syntax
Attributetype-alias
Represents every static or dynamic attribute-like AST node.
AttributeNodeclass
Represents a static attribute (e.g.
class="foo").
Boolean attributes
BooleanNodeclass
Represents a boolean attribute (e.g.
disabled).BooleanPartNodeclass
Represents a dynamic boolean attribute (e.g.
?disabled="${isDisabled}").
Buffered HTML
renderToHtmlStringfunction
Renders a stream of
RenderEvents into a single HTML string.This is a convenience function that collects all events from
renderToHtmland joins them into a single string. It is an Effect that resolves when the stream completes.
Class contributions
ClassNamePartNodeclass
Represents a dynamic class name part (e.g.
class="${classes}").SparseClassNameNodeclass
Represents a sparse class name (e.g.
class="foo ${bar}").
Comment bindings
CommentPartNodeclass
Represents a dynamic comment part.
Comment content
Commenttype-alias
Represents static, dynamic, or sparse comment content.
CommentNodeclass
Represents a static comment.
Component construction
componentnamespace
Type-level contracts used by the
componentconstructor.
DOM adoption
attemptHydrationfunction
Locates a compatible SSR template range for an advanced render context.
DOM document selection
CurrentRenderDocumentvariable
A service that provides the
Documentinterface for rendering.Defaults to the global
documentobject. This can be overridden for testing or environments where the global document is not available or desired.
DOM mounting
rendervariable
Mounts any
Renderableto a specific DOM element.This function lifts primitives, arrays, Effects, Streams, and Fx values into a render stream and keeps the target DOM element updated. It handles:
- Mounting the initial content.
- Updating the content as new events are emitted.
- Hydrating the content if hydration context is provided.
DOM output inference
ToRenderedtype-alias
Computes the DOM value represented by a nullable
RenderEvent.
DOM serialization
toHtmlfunction
Converts a
Renderedvalue to an HTML string.
DOM template interpretation
DomRenderTemplatevariable
A Layer that provides the
RenderTemplateservice implemented for DOM rendering.This layer enables templates to be rendered as actual DOM nodes. It handles:
- Parsing templates into DOM fragments.
- Caching parsed templates.
- Hydrating from existing DOM (if applicable).
- Setting up event listeners.
- Managing fine-grained updates to DOM nodes via
Fxstreams.
Dataset contributions
DataPartNodeclass
Represents a data attribute part (e.g.
data-foo="${value}").
Default action control
EventHandler.preventDefaultfunction · Re-export
Modifies an
EventHandlerto callpreventDefault()on the event.
Delegated event sources
EventSourceinterface
An interface for managing event listeners on DOM nodes.
It abstracts the process of adding and removing event listeners, ensuring that they are properly cleaned up when the scope is closed or the element is removed.
makeEventSourcefunction
Creates a new
EventSource.The created
EventSourcecan efficiently manage multiple event listeners, grouping them by event type and handling setup/teardown lifecycles.
Document structure
DocTypeclass
Represents a parsed DOCTYPE declaration.
Dynamic HTML chunks
HtmlPartChunkinterface
A chunk representing a dynamic part (interpolation).
Dynamic child positions
NodePartclass
Represents a dynamic insertion point within the node structure (e.g.
<div>${content}</div>).
Dynamic positions
PartNodetype-alias
Represents a single dynamic interpolation part in the template AST.
Element references
RefPartNodeclass
Represents a reference capture (e.g.
ref="${ref}").
Element structure
ElementNodeclass
Represents an HTML, SVG, MathML, or foreign-content element with children.
ParentNodetype-alias
Represents an AST node that can structurally contain template children.
SelfClosingElementNodeclass
Represents a self-closing HTML element (e.g.
<br />,<img />).
Event handler creation
EventHandler.makefunction · Re-export
Creates a new
EventHandler.
Event handler protocol
EventHandler.EventHandlerTypeIdvariable · Re-export
The global symbol used to identify
EventHandlervalues across module copies.EventHandler.isEventHandlerfunction · Re-export
Checks if a value is an
EventHandler.
Event handlers
EventHandler.EventHandlerinterface · Re-export
Represents a DOM event handler that returns an Effect.
It encapsulates the event handler logic and any options (like
preventDefault,once, etc.) that should be applied when the event is triggered.
Existing range boundaries
fromCommentsvariable
Creates a published advanced Wire from a fragment and exact boundary comments.
Frame scheduling
RequestAnimationFrameRenderQueueclass
A RenderQueue that schedules tasks using
requestAnimationFrame. Good for visual updates that should happen before the next repaint.
Generator overloads
component.Gentype-alias
The overloaded callable type of
component.
HTML chunk assembly
HtmlChunksBuilderclass
Advanced mutable builder used by the published template-to-chunk compiler.
HTML chunk protocol
HtmlChunktype-alias
Represents a piece of a pre-compiled HTML template.
Chunks allow the renderer to stream static parts of the HTML immediately while waiting for dynamic parts to be resolved.
HTML compilation
templateToHtmlChunksfunction
Converts a parsed
Templateinto a sequence ofHtmlChunks. This optimization pre-calculates the static HTML strings to minimize work at render time.
HTML rendering policy
StaticRenderingvariable
A boolean service that indicates whether the current rendering context is static.
If
true, the HTML renderer will optimize for static output, potentially skipping dynamic placeholder generation or other interactive features not needed for static HTML.
HTML transport recognition
isHtmlRenderEventfunction
Checks if a value is an
HtmlRenderEvent.
HTML transport trust
HtmlRenderTransportBrandvariable
The published advanced brand identifying renderer-owned HTML transport.
Handler failure recovery
EventHandler.catchCausevariable · Re-export
Recovers from errors in the
EventHandler.
Handler failures
EventHandler.Errortype-alias · Re-export
Extracts the typed error channel of an
EventHandler.
Handler normalization
EventHandler.fromEffectOrEventHandlerfunction · Re-export
Helper to ensure a value is an
EventHandler.If the input is already an
EventHandler, it is returned as is. If it is anEffect, it is wrapped in anEventHandlerthat ignores the event argument.
Handler requirements
EventHandler.Servicestype-alias · Re-export
Extracts the Effect service requirements of an
EventHandler.
Handler service provision
EventHandler.providevariable · Re-export
Provides services to the
EventHandler.This allows you to inject dependencies into the effect returned by the event handler.
Hydratable HTML rendering
HtmlRenderTemplatevariable
A Layer that provides the
RenderTemplateservice implemented for HTML string generation.Using this layer enables templates to be rendered as HTML strings (e.g., for SSR) rather than DOM nodes. It sets the
RefSubject.CurrentComputedBehaviorto"one", indicating a single-pass render approach typical for HTML generation.
Hydration context
HydrateContexttype-alias
Advanced renderer state describing the current hydration range.
makeHydrateContextvariable
Creates a hydration context starting from a root element.
This context allows the renderer to “attach” to existing DOM nodes (SSR output) instead of creating new ones.
Hydration markers
addTemplateHashfunction
Wraps the HTML chunks with comments containing the template hash. This is crucial for hydration to identify which template rendered a section of HTML.
Idle scheduling
RequestIdleCallbackRenderQueueclass
A RenderQueue that schedules tasks using
requestIdleCallback. Good for low-priority background work.
Immediate scheduling
SyncRenderQueueclass
A RenderQueue that executes tasks synchronously and immediately.
Keyed collection protocol
ManyTypeIdvariable
Identifies a keyed collection descriptor without starting its source.
isManyfunction
Recognizes a descriptor before a target chooses its keyed rendering path. This guard does not subscribe to the collection or validate its current keys; key uniqueness is checked when the target receives an array.
Keyed collection rendering
Manyinterface
A collection source, stable key function, and per-item view supplied to a renderer. Describing the collection acquires nothing; the active target owns subscription and child lifetimes.
The DOM target retains each key’s subject and scope across moves. The HTML target consumes an initial collection for finite response output. Construct descriptors with
manyrather than assembling this protocol by hand.manyfunction
Efficiently renders a reactive list of items by using keys to minimize DOM operations and maintain component state.
manyreturns a renderer descriptor rather than anFx. The active renderer consumes its source directly and can therefore retain keyed entries without flattening each child back through a generic collection stream.
Keyed hydration markers
MANY_HOLEvariable
Produces the closing hydration marker for a keyed-list item.
Listener lifetime
EventHandler.oncefunction · Re-export
Modifies an
EventHandlerto run only once.
Mixed scheduling
MixedRenderQueueclass
A composite RenderQueue that directs tasks to different queues based on their priority.
- High priority: Sync
- Medium priority: RAF (or setTimeout fallback)
- Low priority: IdleCallback (or setTimeout fallback)
Native DOM output
DomRenderEventinterface
A RenderEvent containing DOM nodes.
Native DOM recognition
isDomRenderEventfunction
Checks if a value is a
DomRenderEvent.
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 event bindings
EventPartNodeclass
Represents an event listener part (e.g.
@click="${handler}").
Native event control
EventHandler.handleEventOptionsfunction · Re-export
Applies event options to a native DOM event.
Native event types
EventHandler.EventOftype-alias · Re-export
Extracts the native event type accepted by an
EventHandler.
Native listener policy
EventHandler.EventOptionstype-alias · Re-export
Options for applying native event behavior before an Effect handler runs.
EventHandler.passivefunction · Re-export
Modifies an
EventHandlerto be passive (improves scrolling performance).
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.
Propagation control
EventHandler.stopImmediatePropagationfunction · Re-export
Modifies an
EventHandlerto callstopImmediatePropagation()on the event.EventHandler.stopPropagationfunction · Re-export
Modifies an
EventHandlerto callstopPropagation()on the event.
Property bindings
PropertyPartNodeclass
Represents a property assignment (e.g.
.value="${value}").
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.
Render priorities
RenderPriorityvariable
Defines priority levels for rendering tasks.
Render scheduling
CurrentRenderPriorityvariable
A service that provides the default priority for rendering tasks.
The default value is
RenderPriority.Raf(10), which typically schedules updates to occur before the next repaint.CurrentRenderQueuevariable
A service that manages the queue of DOM updates.
It ensures that DOM updates are batched and executed efficiently, often coordinating with browser painting cycles (e.g., via
requestAnimationFrame).
Renderable failures
Renderable.Errortype-alias
Extracts the error type from a Renderable type.
Renderable.ErrorFromObjecttype-alias
Traverse all keys in an object and extract the error from each value. If the value is a function, extract the error from the return type of the function.
Renderable inputs
Renderabletype-alias
Represents any value that can be rendered into a template.
This includes:
- Primitives (string, number, boolean, null, undefined)
- Arrays of Renderables
- Effects that produce a Renderable
- Streams (Fx or Stream) that emit Renderables
- Objects (typically for setting properties or attributes)
Renderable.Anytype-alias
A type alias for any Renderable value with any error/context.
Renderable normalization
liftRenderableToFxfunction
Converts any Renderable into an Fx while preserving its nested errors and service requirements.
Renderable output inference
Renderable.Successtype-alias
Recursively computes the terminal value emitted by a Renderable.
Renderable producers
Renderable.Effectstype-alias
The Effect ecosystem producers recognized as reactive Renderables.
Renderable requirements
Renderable.Servicestype-alias
Extracts the required services from a Renderable type.
Renderable.ServicesFromObjecttype-alias
Traverse all keys in an object and extract the services from each value. If the value is a function, extract the services from the return type of the function.
Rendered element traversal
getElementsfunction
Extracts all Elements from a
Renderedvalue.
Renderer output protocol
RenderEventtype-alias
Represents the result of a rendering operation. Can be either a DOM-based event (containing actual Nodes) or an HTML-based event (containing strings).
RenderEventTypeIdvariable
The global discriminant key shared by DOM and HTML render events.
Renderer output recognition
isRenderEventfunction
Checks if a value is a
RenderEvent.
Root event propagation
CurrentRootEventsvariable
Default event propagation policy for integration roots. Defaults to false. Override through Effect services; no global browser listeners are installed.
RootEventOptionstype-alias
Selects native event names whose bubbling stops at an integration root. false disables every boundary listener. Within a record, true stops that event and false allows it, overriding an inherited setting for that name.
RootEvents.CurrentRootEventsvariable · Re-export
Default event propagation policy for integration roots. Defaults to false. Override through Effect services; no global browser listeners are installed.
RootEvents.RootEventOptionstype-alias · Re-export
Selects native event names whose bubbling stops at an integration root. false disables every boundary listener. Within a record, true stops that event and false allows it, overriding an inherited setting for that name.
RootEvents.rootEventsvariable · Re-export
Installs scoped native bubbling listeners on a root. Undefined options inherit CurrentRootEvents, records override inherited event names individually, and false disables the inherited policy entirely.
Only stopPropagation is called. Target handlers, other listeners on this same root, and browser default actions remain available. Ancestor capture handlers have already run; events that do not bubble to the root are not intercepted. This is an event bubbling policy, not a security or complete event-isolation boundary. Each listener is removed when the calling Scope closes.
rootEventsvariable
Installs scoped native bubbling listeners on a root. Undefined options inherit CurrentRootEvents, records override inherited event names individually, and false disables the inherited policy entirely.
Only stopPropagation is called. Target handlers, other listeners on this same root, and browser default actions remain available. Ancestor capture handlers have already run; events that do not bubble to the root are not intercepted. This is an event bubbling policy, not a security or complete event-isolation boundary. Each listener is removed when the calling Scope closes.
Scheduled render work
RenderQueueclass
An abstract base class for managing the execution of rendering tasks. It allows prioritizing updates and scheduling them using different strategies (e.g.,
requestAnimationFrame,requestIdleCallback,setTimeout, or synchronous execution).
Scheduling protocol
RenderQueueTypeIdvariable
The nominal key implemented by every Typed render queue.
Serialized HTML output
HtmlRenderEventinterface
A RenderEvent containing an HTML string.
Sparse HTML chunks
HtmlSparsePartChunkinterface
A chunk representing a sparse part (mixed static/dynamic text).
Sparse attributes
SparseAttrNodeclass
Represents a sparse attribute (e.g.
class="foo ${bar}").
Sparse comments
SparseCommentNodeclass
Represents a sparse comment.
Sparse expressions
SparsePartNodetype-alias
Represents a “sparse” part, which is a text or attribute value composed of mix of static text and dynamic parts (e.g.
id="prefix-${id}").
Sparse text
SparseTextNodeclass
Represents sparse text content (e.g.
Hello ${name}!).
Spread bindings
PropertiesPartNodeclass
Represents a spread of properties (e.g.
${...props}).
Spread serialization
isSerializableSpreadKeyfunction
Reports whether a dynamic spread key may be serialized into SSR HTML.
Static HTML chunks
HtmlTextChunkinterface
A static text chunk.
Static HTML rendering
StaticHtmlRenderTemplatevariable
A variant of
HtmlRenderTemplatethat enables static rendering optimizations.This layer provides the
RenderTemplateservice for HTML generation but also setsStaticRenderingtotrue, enabling optimizations for static content.
Streaming HTML
renderToHtmlfunction
Renders a stream of
RenderEvents into a stream of HTML strings.This function transforms the output of a template rendering process (which produces
RenderEvents) into a stream of strings suitable for HTML output (e.g., for Server-Side Rendering).
Template authoring
htmlfunction
The main template tag function.
It creates a reactive
Fxstream that renders the template. The actual rendering logic depends on the providedRenderTemplateservice.
Template interpretation
RenderTemplateclass
A service that defines how templates are rendered.
Different implementations can be provided for different environments (e.g.,
DomRenderTemplatefor browsers,HtmlRenderTemplatefor SSR).
Template parsing
parsefunction
Parses a template string array (from a tagged template literal) into a reusable
Templateobject.This parser handles:
- Standard HTML structure (elements, attributes, text, comments).
- Custom part syntax for interpolation (e.g.,
${value}). - Special attributes like
.property,@event,?boolean. - Self-closing tags and text-only elements (script, style).
Each call returns a new
Templateinstance containing the static AST and dynamic part locations. Render targets cache their compiled DOM fragments or HTML chunks independently by template-literal identity.
Template run context
TemplateContexttype-alias
Advanced per-template DOM rendering state used by renderer extensions.
Template structure
Terminal renderable values
Renderable.Primitivetype-alias
The basic primitive types that can be rendered directly.
Text bindings
TextPartNodeclass
Represents a dynamic text part (e.g.
${text}).
Text content
Text contexts
TextOnlyElementclass
Represents an element that contains only text (e.g.
<script>,<style>).
Timer scheduling
SetTimeoutRenderQueueclass
A RenderQueue that schedules tasks using
setTimeout(..., 0).
Web Components
WebComponent.CurrentShadowRootvariable · Re-export
Selects an open shadow root by default. Provide false for light DOM. The selection is captured when the registration layer or server view runs.
WebComponent.Definitioninterface · Re-export
An inert definition shared by browser registration and server rendering. Schemas supply optionality and defaults. Inputs are parent-owned; local writable state can be created in an Effect returned by render.
WebComponent.Elementinterface · Re-export
A registered element accepts typed input through its props property. Assign a new object to update; nested mutation is not observed.
WebComponent.Fieldstype-alias · Re-export
Schema fields for attributes and dot-prefixed DOM properties. Attribute schemas encode strings; property schemas accept decoded values.
WebComponent.Inputtype-alias · Re-export
Typed initial values; only schema-optional or defaulted inputs may be omitted.
WebComponent.Propstype-alias · Re-export
Decoded inputs, with the dot removed from property names.
WebComponent.RegistrationErrorclass · Re-export
A browser registry could not accept a definition.
WebComponent.RenderPropstype-alias · Re-export
Each field is a read-only computed value, including optional fields.
WebComponent.ShadowRootOptionstype-alias · Re-export
Shadow settings supported by both attachShadow and declarative shadow DOM.
WebComponent.makefunction · Re-export
Defines a custom element without reading any browser globals. Custom-element names use a conservative ASCII subset of the HTML grammar.
WebComponent.registerfunction · Re-export
Registers in CurrentRenderDocument’s registry and captures the layer’s services. Provides no services; use the custom element through ordinary HTML templates. The layer’s Scope owns every connected instance. Closing it stops rendering and deactivates this class; browsers cannot unregister a custom element. Disconnect interrupts subscriptions/listeners; reconnect waits for cleanup before starting a fresh view. Failures dispatch typed:error with a Cause in CustomEvent.detail. Native template event handlers work without an adapter. Shadow roots retain slotted light children. Light mode owns all host children.
WebComponent.serverfunction · Re-export
Produces a server Renderable with a custom-element host and hydratable content. Shadow mode emits declarative shadow DOM followed by optional slot content. Light mode owns all host children and rejects supplied slot content. Only properties declared in the attribute schema are serialized; match CurrentShadowRoot on the client. Body and slot chunks retain their order, errors, services, and calling Scope. Use Typed’s renderToHtml to stream or renderToHtmlString to collect the result.
namespace
EventHandlernamespace · Re-export
Public namespace exposed as EventHandler from @typed/template.
RootEventsnamespace · Re-export
Public namespace exposed as RootEvents from @typed/template.
WebComponentnamespace · Re-export
Public namespace exposed as WebComponent from @typed/template.
variable
rootIdentityvariable
Allocate an island identity per execution and restore it through native hydration. Requires the caller’s Scope and RandomValues service; no entropy provider is installed here.