{
  "id": "@typed/template/Html#renderToHtml",
  "canonicalId": "@typed/template#renderToHtml",
  "symbol": {
    "id": "@typed/template/Html#renderToHtml",
    "packageName": "@typed/template",
    "moduleName": "Html",
    "exportName": "renderToHtml",
    "kind": "function",
    "signatures": [
      "export declare function renderToHtml<const T extends Renderable.Any>(renderable: T): Fx.Fx<string, Renderable.Error<T>, Renderable.Services<T>>;"
    ],
    "summary": "Renders a stream of `RenderEvent`s into a stream of HTML strings.\n\nThis function transforms the output of a template rendering process (which produces `RenderEvent`s)\ninto a stream of strings suitable for HTML output (e.g., for Server-Side Rendering).",
    "sections": {
      "Why": "This keeps SSR push-based: each ordered renderer-owned HTML event becomes an\noutput chunk as it arrives. Unlike DOM rendering, dynamic inputs use the\nHTML layer's single-value computed behavior and do not remain live.",
      "Ownership and lifetime": "The returned Fx owns no response by itself. Its running Effect Scope owns\nsubscriptions and interruption; the caller owns the HTTP response or other\nsink consuming the strings. Typed errors and required services are preserved.",
      "Trust boundary": "Ordinary dynamic template data is contextually escaped. Branded\n`HtmlRenderEvent` values are trusted renderer output, not a raw-HTML API."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport { html } from \"@typed/template\"\nimport { renderToHtml, HtmlRenderTemplate } from \"@typed/template/Html\"\nimport { Fx } from \"@typed/fx\"\n\nconst program = Effect.scoped(Effect.gen(function* () {\n  const template = html`<div>Hello, ${\"world\"}!</div>`\n\n  // Render to HTML string stream\n  const htmlStream = renderToHtml(template).pipe(\n    Fx.provide(HtmlRenderTemplate)\n  )\n\n  // Collect all HTML chunks\n  const chunks = yield* Fx.collectAll(htmlStream)\n  console.log(chunks.join(\"\")) // \"<div>Hello, world!</div>\"\n}))"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/template/src/Html.ts",
      "line": 86
    },
    "since": "1.0.0",
    "category": "Streaming HTML"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/template/Html#renderToHtml",
    "packageName": "@typed/template",
    "packageVersion": "1.0.0-beta.7",
    "moduleName": "Html",
    "consumerSpecifier": "@typed/template/Html",
    "exportName": "renderToHtml",
    "qualifiedName": "renderToHtml",
    "declarationKey": "declaration:b3b56485c0c07d1ec2f5cdaa",
    "family": "function",
    "signatures": [
      "export declare function renderToHtml<const T extends Renderable.Any>(renderable: T): Fx.Fx<string, Renderable.Error<T>, Renderable.Services<T>>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/template/src/Html.ts",
        "start": {
          "line": 86,
          "column": 1
        },
        "end": {
          "line": 93,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/template#renderToHtml"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:b3b56485c0c07d1ec2f5cdaa",
    "name": "renderToHtml",
    "family": "function",
    "facets": [
      {
        "family": "function",
        "syntaxKind": "FunctionDeclaration",
        "signatures": [
          "export declare function renderToHtml<const T extends Renderable.Any>(renderable: T): Fx.Fx<string, Renderable.Error<T>, Renderable.Services<T>>;"
        ],
        "typeParameters": [
          "const T extends Renderable.Any"
        ],
        "sourceSpans": [
          {
            "file": "packages/template/src/Html.ts",
            "start": {
              "line": 86,
              "column": 1
            },
            "end": {
              "line": 93,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function renderToHtml<const T extends Renderable.Any>(renderable: T): Fx.Fx<string, Renderable.Error<T>, Renderable.Services<T>>;"
    ],
    "typeParameters": [
      "const T extends Renderable.Any"
    ],
    "summary": "Renders a stream of `RenderEvent`s into a stream of HTML strings.\n\nThis function transforms the output of a template rendering process (which produces `RenderEvent`s)\ninto a stream of strings suitable for HTML output (e.g., for Server-Side Rendering).",
    "sections": {
      "Why": "This keeps SSR push-based: each ordered renderer-owned HTML event becomes an\noutput chunk as it arrives. Unlike DOM rendering, dynamic inputs use the\nHTML layer's single-value computed behavior and do not remain live.",
      "Ownership and lifetime": "The returned Fx owns no response by itself. Its running Effect Scope owns\nsubscriptions and interruption; the caller owns the HTTP response or other\nsink consuming the strings. Typed errors and required services are preserved.",
      "Trust boundary": "Ordinary dynamic template data is contextually escaped. Branded\n`HtmlRenderEvent` values are trusted renderer output, not a raw-HTML API."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport { html } from \"@typed/template\"\nimport { renderToHtml, HtmlRenderTemplate } from \"@typed/template/Html\"\nimport { Fx } from \"@typed/fx\"\n\nconst program = Effect.scoped(Effect.gen(function* () {\n  const template = html`<div>Hello, ${\"world\"}!</div>`\n\n  // Render to HTML string stream\n  const htmlStream = renderToHtml(template).pipe(\n    Fx.provide(HtmlRenderTemplate)\n  )\n\n  // Collect all HTML chunks\n  const chunks = yield* Fx.collectAll(htmlStream)\n  console.log(chunks.join(\"\")) // \"<div>Hello, world!</div>\"\n}))"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/template/src/Html.ts",
        "start": {
          "line": 86,
          "column": 1
        },
        "end": {
          "line": 93,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Streaming HTML"
  }
}
