Import
import { renderToHtmlString } from "@typed/template";Signatures
export declare function renderToHtmlString<const T extends Renderable.Any>(renderable: T): Effect.Effect<string, Renderable.Error<T>, Renderable.Services<T>>;Why
This is the finite-response convenience over renderToHtml: it preserves
ordered 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 caller-owned; errors and required services remain in the Effect type.
Cost model
Collection requires memory proportional to the complete rendered response.
Prefer renderToHtml when the transport can stream chunks.
Examples
import { Effect } from "effect"
import { html } from "@typed/template"
import { renderToHtmlString, HtmlRenderTemplate } from "@typed/template/Html"
const program = Effect.scoped(Effect.gen(function* () {
const template = html`<div>
<h1>Hello</h1>
<p>World</p>
</div>`
// Render to single HTML string
const htmlString = yield* renderToHtmlString(template).pipe(
Effect.provide(HtmlRenderTemplate)
)
console.log(htmlString)
// "<div><h1>Hello</h1><p>World</p></div>"
}))Other public imports
These import paths expose the same declaration. Each page retains its own public name and signature.