mizchi/luna/dom/static does not have a README file
pub enum ServerNode {
Sync(Node[Unit, String])
Async(async () -> Node[Unit, String])
Group(Array[ServerNode])
WithAssets(styles~ : Array[String], scripts~ : Array[String], child~ : ServerNode)
}fn ServerNode::with_assets(self : ServerNode, styles? : Array[String], scripts? : Array[String]) -> ServerNodepub(all) struct TrustedScript {
content : String
}pub(all) struct TrustedStyle {
content : String
}fn[T : ToJson] client(cref : ComponentRef[T], children : Array[Node[Unit, String]], styles? : String) -> Node[Unit, String]// In app/__gen__/types/types.mbt (generated)
pub fn counter(props: CounterProps) -> @core.ComponentRef[CounterProps] {
@luna.component_ref("/static/counter.js", props)
}
// In server component
client(
@types.counter({ initial_count: 42 }),
[text("Loading...")],
)document(
lang="en",
head_[
title("My App"),
meta(charset="UTF-8"),
],
body_[
h1([text("Hello!")]),
],
)fn script_trusted(content : TrustedScript, type_? : String, id? : String, class? : String, style? : String, attrs? : Array[(String, Attr[Unit, String])]) -> Node[Unit, String]fn style_trusted(content : TrustedStyle, type_? : String, id? : String, class? : String, style? : String, attrs? : Array[(String, Attr[Unit, String])]) -> Node[Unit, String]fn svg(width? : String, height? : String, viewBox? : String, xmlns? : String, fill? : String, stroke? : String, role? : String, aria_label? : String, aria_labelledby? : String, aria_describedby? : String, id? : String, class? : String, style? : String, attrs? : Array[(String, Attr[Unit, String])], children : Array[Node[Unit, String]]) -> Node[Unit, String]fn svg_text(x? : String, y? : String, dx? : String, dy? : String, text_anchor? : String, dominant_baseline? : String, fill? : String, font_size? : String, font_family? : String, id? : String, class? : String, style? : String, attrs? : Array[(String, Attr[Unit, String])], children : Array[Node[Unit, String]]) -> Node[Unit, String]fn uat_lg(property : String, value : String) -> Stringfn uat_md(property : String, value : String) -> Stringfn ucss(property : String, value : String) -> Stringfn uon(pseudo : String, property : String, value : String) -> Stringfn wc_island(name : String, url : String, children : Array[Node[Unit, String]], styles? : String, state? : String, trigger? : TriggerType) -> Node[Unit, String]wc_island(
"wc-counter",
"/static/wc-counter.js",
[text("Loading...")],
styles=":host { display: block; }",
state="{\"count\":0}",
)