import { w as SchemaMeta } from "../types-BBQaEPfE.mjs"; import { r as SchemaIoSide } from "../adapter-ktQaheWB.mjs"; import { s as HtmlResolver } from "../renderer-ab9E52Bp.mjs"; import { f as RejectUnrepresentableZod } from "../typeInference-Y8tNEQJk.mjs"; import { a as InferredValue, t as InferFields } from "../inferValue-eAnh50EM.mjs"; //#region src/html/renderToHtmlStream.d.ts /** * Options accepted by the streaming HTML renderers * ({@link renderToHtmlChunks}, {@link renderToHtmlStream}, * {@link renderToHtmlReadable}). * * The generic parameters mirror `` so a typed * `schema` argument drives typed `value`, `ref`, and `fields` options. * * @group HTML */ interface StreamRenderOptions { /** * The data value to render. Typed against `InferredValue` * so a typed `schema` argument drives the rendered value's shape. */ value?: InferredValue; /** For OpenAPI: a ref string like "#/components/schemas/User". */ ref?: Ref; /** * Per-field meta overrides — nested object mirroring schema shape. * Typed against {@link InferFields} so a typed `schema` argument * drives autocomplete on the override map. */ fields?: InferFields; /** Meta overrides applied to the root schema. */ meta?: SchemaMeta; /** Force all fields read-only. */ readOnly?: boolean; /** Force all fields as inputs. */ writeOnly?: boolean; /** Root description. */ description?: string; /** Custom HTML resolver. Falls back to defaultHtmlResolver. */ resolver?: HtmlResolver; } /** * Render a schema as a synchronous iterable of HTML string chunks. Each * chunk is a self-contained HTML fragment, ready to write to a stream * or concatenate into a single string. Use when the host can flush * output incrementally but does not need cooperative scheduling. * * @group HTML * @example * ```tsx * import { renderToHtmlChunks } from "schema-components/html/renderToHtmlStream"; * * for (const chunk of renderToHtmlChunks(userSchema, { value: user })) { * response.write(chunk); * } * ``` */ declare function renderToHtmlChunks(schema: RejectUnrepresentableZod, options?: StreamRenderOptions): Iterable; /** * Render a schema as an async iterable of HTML string chunks. Yields * back to the event loop between chunks via a microtask so other tasks * (queued I/O, timers) can run between fragments. * * @group HTML */ declare function renderToHtmlStream(schema: RejectUnrepresentableZod, options?: StreamRenderOptions): AsyncIterable; /** * Render a schema as a web `ReadableStream` so it can be piped * into a `Response` body. Pulls chunks lazily from the synchronous * chunk iterator under the hood. * * @group HTML * @example * ```tsx * import { renderToHtmlReadable } from "schema-components/html/renderToHtmlStream"; * * return new Response(renderToHtmlReadable(userSchema, { value: user }), { * headers: { "content-type": "text/html" }, * }); * ``` */ declare function renderToHtmlReadable(schema: RejectUnrepresentableZod, options?: StreamRenderOptions): ReadableStream; //#endregion export { StreamRenderOptions, renderToHtmlChunks, renderToHtmlReadable, renderToHtmlStream };