{
  "id": "@typed/template/Html#renderToHtmlString",
  "canonicalId": "@typed/template#renderToHtmlString",
  "symbol": {
    "id": "@typed/template/Html#renderToHtmlString",
    "packageName": "@typed/template",
    "moduleName": "Html",
    "exportName": "renderToHtmlString",
    "kind": "function",
    "signatures": [
      "export declare function renderToHtmlString<const T extends Renderable.Any>(renderable: T): Effect.Effect<string, Renderable.Error<T>, Renderable.Services<T>>;"
    ],
    "summary": "Renders a stream of `RenderEvent`s into a single HTML string.\n\nThis is a convenience function that collects all events from `renderToHtml` and joins them\ninto a single string. It is an Effect that resolves when the stream completes.",
    "sections": {
      "Why": "This is the finite-response convenience over `renderToHtml`: it preserves\nordered chunks but buffers them when the caller needs one complete body.",
      "Ownership and lifetime": "The returned Effect runs and finalizes the source Fx. The resulting string is\ncaller-owned; errors and required services remain in the Effect type.",
      "Cost model": "Collection requires memory proportional to the complete rendered response.\nPrefer `renderToHtml` when the transport can stream chunks."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport { html } from \"@typed/template\"\nimport { renderToHtmlString, HtmlRenderTemplate } from \"@typed/template/Html\"\n\nconst program = Effect.scoped(Effect.gen(function* () {\n  const template = html`<div>\n    <h1>Hello</h1>\n    <p>World</p>\n  </div>`\n\n  // Render to single HTML string\n  const htmlString = yield* renderToHtmlString(template).pipe(\n    Effect.provide(HtmlRenderTemplate)\n  )\n\n  console.log(htmlString)\n  // \"<div><h1>Hello</h1><p>World</p></div>\"\n}))"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/template/src/Html.ts",
      "line": 144
    },
    "since": "1.0.0",
    "category": "Buffered HTML"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/template/Html#renderToHtmlString",
    "packageName": "@typed/template",
    "packageVersion": "1.0.0-beta.7",
    "moduleName": "Html",
    "consumerSpecifier": "@typed/template/Html",
    "exportName": "renderToHtmlString",
    "qualifiedName": "renderToHtmlString",
    "declarationKey": "declaration:b6d625c576d0a97dc5f9bd92",
    "family": "function",
    "signatures": [
      "export declare function renderToHtmlString<const T extends Renderable.Any>(renderable: T): Effect.Effect<string, Renderable.Error<T>, Renderable.Services<T>>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/template/src/Html.ts",
        "start": {
          "line": 144,
          "column": 1
        },
        "end": {
          "line": 151,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/template#renderToHtmlString"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:b6d625c576d0a97dc5f9bd92",
    "name": "renderToHtmlString",
    "family": "function",
    "facets": [
      {
        "family": "function",
        "syntaxKind": "FunctionDeclaration",
        "signatures": [
          "export declare function renderToHtmlString<const T extends Renderable.Any>(renderable: T): Effect.Effect<string, Renderable.Error<T>, Renderable.Services<T>>;"
        ],
        "typeParameters": [
          "const T extends Renderable.Any"
        ],
        "sourceSpans": [
          {
            "file": "packages/template/src/Html.ts",
            "start": {
              "line": 144,
              "column": 1
            },
            "end": {
              "line": 151,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function renderToHtmlString<const T extends Renderable.Any>(renderable: T): Effect.Effect<string, Renderable.Error<T>, Renderable.Services<T>>;"
    ],
    "typeParameters": [
      "const T extends Renderable.Any"
    ],
    "summary": "Renders a stream of `RenderEvent`s into a single HTML string.\n\nThis is a convenience function that collects all events from `renderToHtml` and joins them\ninto a single string. It is an Effect that resolves when the stream completes.",
    "sections": {
      "Why": "This is the finite-response convenience over `renderToHtml`: it preserves\nordered chunks but buffers them when the caller needs one complete body.",
      "Ownership and lifetime": "The returned Effect runs and finalizes the source Fx. The resulting string is\ncaller-owned; errors and required services remain in the Effect type.",
      "Cost model": "Collection requires memory proportional to the complete rendered response.\nPrefer `renderToHtml` when the transport can stream chunks."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport { html } from \"@typed/template\"\nimport { renderToHtmlString, HtmlRenderTemplate } from \"@typed/template/Html\"\n\nconst program = Effect.scoped(Effect.gen(function* () {\n  const template = html`<div>\n    <h1>Hello</h1>\n    <p>World</p>\n  </div>`\n\n  // Render to single HTML string\n  const htmlString = yield* renderToHtmlString(template).pipe(\n    Effect.provide(HtmlRenderTemplate)\n  )\n\n  console.log(htmlString)\n  // \"<div><h1>Hello</h1><p>World</p></div>\"\n}))"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/template/src/Html.ts",
        "start": {
          "line": 144,
          "column": 1
        },
        "end": {
          "line": 151,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Buffered HTML"
  }
}
