{
  "id": "@typed/template#RenderEvent",
  "canonicalId": "@typed/template#RenderEvent",
  "symbol": {
    "id": "@typed/template#RenderEvent",
    "packageName": "@typed/template",
    "moduleName": ".",
    "exportName": "RenderEvent",
    "kind": "type",
    "signatures": [
      "export type RenderEvent = DomRenderEvent | HtmlRenderEvent;"
    ],
    "summary": "Represents the result of a rendering operation.\nCan be either a DOM-based event (containing actual Nodes) or an HTML-based event (containing strings).",
    "sections": {
      "Why": "`RenderEvent` is the small output boundary shared by Typed renderers. Once a\nproducer exposes `Fx<RenderEvent, E, R>`, DOM templates, streamed SSR, routers,\nand external renderers compose without a virtual component-tree protocol.\nThe Fx still carries every failure and required Effect service.",
      "Ownership and lifetime": "A RenderEvent transports output; it does not acquire or retain the producer.\nThe producing Fx and its running Effect `Scope` own subscriptions,\ninterruption, ordering, and finalization. A consumer owns only the DOM range\nor HTML stream position to which it applies the event.",
      "Representation": "`DomRenderEvent` preserves existing DOM identity. `HtmlRenderEvent` carries\ntrusted renderer-owned HTML chunks for server output. Consumers can branch on\nthe public discriminant without hidden renderer state. DOM handler events are\na separate concern and use EventSource's documented forwarding `Proxy`."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { html } from \"@typed/template\"\nimport {\n  isDomRenderEvent,\n  isHtmlRenderEvent\n} from \"@typed/template/RenderEvent\"\nimport { Fx } from \"@typed/fx\"\nimport { Option } from \"effect\"\n\nconst template = html`<div>Hello</div>`;\n\n// Render events are emitted by the template Fx\nconst program = Fx.gen(function* () {\n  const maybeEvent = yield* Fx.first(template);\n\n  return Option.match(maybeEvent, {\n    onNone: () => Fx.empty,\n    onSome: (event) => {\n      if (isDomRenderEvent(event)) {\n        const nodes = event.valueOf();\n        console.log(nodes);\n      } else if (isHtmlRenderEvent(event)) {\n        const html = event.toString();\n        console.log(html);\n      }\n\n      // Fx.gen setup must return the Fx that runs afterward.\n      return Fx.succeed(event);\n    },\n  });\n});"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/template/src/RenderEvent.ts",
      "line": 67
    },
    "since": "1.0.0",
    "category": "Renderer output protocol"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/template#RenderEvent",
    "packageName": "@typed/template",
    "packageVersion": "1.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/template",
    "exportName": "RenderEvent",
    "qualifiedName": "RenderEvent",
    "declarationKey": "declaration:43d661e580500d15199f8c53",
    "family": "type-alias",
    "signatures": [
      "export type RenderEvent = DomRenderEvent | HtmlRenderEvent;"
    ],
    "sourceSpans": [
      {
        "file": "packages/template/src/RenderEvent.ts",
        "start": {
          "line": 67,
          "column": 1
        },
        "end": {
          "line": 67,
          "column": 60
        }
      }
    ],
    "aliases": [
      "@typed/template/RenderEvent#RenderEvent"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:43d661e580500d15199f8c53",
    "name": "RenderEvent",
    "family": "type-alias",
    "facets": [
      {
        "family": "type-alias",
        "syntaxKind": "TypeAliasDeclaration",
        "signatures": [
          "export type RenderEvent = DomRenderEvent | HtmlRenderEvent;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/template/src/RenderEvent.ts",
            "start": {
              "line": 67,
              "column": 1
            },
            "end": {
              "line": 67,
              "column": 60
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export type RenderEvent = DomRenderEvent | HtmlRenderEvent;"
    ],
    "typeParameters": [],
    "summary": "Represents the result of a rendering operation.\nCan be either a DOM-based event (containing actual Nodes) or an HTML-based event (containing strings).",
    "sections": {
      "Why": "`RenderEvent` is the small output boundary shared by Typed renderers. Once a\nproducer exposes `Fx<RenderEvent, E, R>`, DOM templates, streamed SSR, routers,\nand external renderers compose without a virtual component-tree protocol.\nThe Fx still carries every failure and required Effect service.",
      "Ownership and lifetime": "A RenderEvent transports output; it does not acquire or retain the producer.\nThe producing Fx and its running Effect `Scope` own subscriptions,\ninterruption, ordering, and finalization. A consumer owns only the DOM range\nor HTML stream position to which it applies the event.",
      "Representation": "`DomRenderEvent` preserves existing DOM identity. `HtmlRenderEvent` carries\ntrusted renderer-owned HTML chunks for server output. Consumers can branch on\nthe public discriminant without hidden renderer state. DOM handler events are\na separate concern and use EventSource's documented forwarding `Proxy`."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { html } from \"@typed/template\"\nimport {\n  isDomRenderEvent,\n  isHtmlRenderEvent\n} from \"@typed/template/RenderEvent\"\nimport { Fx } from \"@typed/fx\"\nimport { Option } from \"effect\"\n\nconst template = html`<div>Hello</div>`;\n\n// Render events are emitted by the template Fx\nconst program = Fx.gen(function* () {\n  const maybeEvent = yield* Fx.first(template);\n\n  return Option.match(maybeEvent, {\n    onNone: () => Fx.empty,\n    onSome: (event) => {\n      if (isDomRenderEvent(event)) {\n        const nodes = event.valueOf();\n        console.log(nodes);\n      } else if (isHtmlRenderEvent(event)) {\n        const html = event.toString();\n        console.log(html);\n      }\n\n      // Fx.gen setup must return the Fx that runs afterward.\n      return Fx.succeed(event);\n    },\n  });\n});"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/template/src/RenderEvent.ts",
        "start": {
          "line": 67,
          "column": 1
        },
        "end": {
          "line": 67,
          "column": 60
        }
      }
    ],
    "since": "1.0.0",
    "category": "Renderer output protocol"
  }
}
