import type { SignalScope } from './runtime.js'; /** The minimal node-factory surface the signal build needs from its document. * Satisfied by a real `Document` (client) AND by a server `DomEnv` (SSR) — so a * single build path renders both in-browser and on the server without casts. */ export interface SignalDoc { createElement(tag: string): Element; createElementNS(ns: string, tag: string): Element; createTextNode(text: string): Text; createComment(text: string): Comment; createDocumentFragment(): DocumentFragment; /** Present on a real client `Document`; absent on a server `DomEnv` (portals * default to it, so a portal with no explicit target is client-only). */ readonly body?: HTMLElement | null; /** Present on a real client `Document`; absent on a server `DomEnv`. The * head-management primitives commit here on the client (and skip when absent, * deferring to the SSR collector seeded via context). */ readonly head?: HTMLHeadElement | null; /** Present on a real client `Document`; the `` root for `htmlAttr`. */ readonly documentElement?: HTMLElement | null; /** Present on a server `DomEnv` (and `browserEnv`): parse an HTML string into a * fragment. Absent on a raw client `Document` (the runtime falls back to a * `