function / @typed/template/WebComponent

server

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.

Package version
1.0.0-beta.13
Category
Web Components
Since
1.0.0

Import

import { server } from "@typed/template/WebComponent";

Signatures

export declare function server<F extends Fields, View extends Renderable.Any, Children extends Renderable.Any = undefined>(definition: Definition<F, View>, ...args: {} extends Input<F> ? [
    initial?: Input<F>,
    children?: Children
] : [
    initial: Input<F>,
    children?: Children
]): Fx.Fx<HtmlRenderEvent, Renderable.Error<View> | Renderable.Error<Children>, Renderable.Services<View> | Renderable.Services<Children> | Scope.Scope>;

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source