import { w as SchemaMeta } from "../types-BBQaEPfE.mjs"; import { t as Diagnostic } from "../diagnostics-mftUZI7c.mjs"; import { r as SchemaIoSide } from "../adapter-ktQaheWB.mjs"; import { d as WidgetMap, i as ComponentResolver } from "../renderer-ab9E52Bp.mjs"; import { f as RejectUnrepresentableZod } from "../typeInference-Y8tNEQJk.mjs"; import { a as InferredValue, t as InferFields } from "../inferValue-eAnh50EM.mjs"; import { ReactNode } from "react"; //#region src/react/SchemaView.d.ts /** * Props accepted by {@link SchemaView}. * * Mirrors `SchemaComponentProps` for the read-only / RSC path — no * `onChange`, no `validate`, and the theme is supplied via the * `resolver` prop because Server Components cannot read React context. * * @group Components */ interface SchemaViewProps { /** * Zod schema, JSON Schema object, or OpenAPI document. * * Subject to the same compile-time rejection of unrepresentable * Zod 4 types as the `schema` prop on `` — see * {@link RejectUnrepresentableZod}. */ schema: RejectUnrepresentableZod; /** * For OpenAPI / JSON Schema documents: a `$ref` string like * `"#/components/schemas/User"`. Named `schemaRef` (not `ref`) to * avoid the React / `preact/compat` reserved prop name. See * {@link SchemaComponentProps.schemaRef}. */ schemaRef?: SchemaRef; /** * Which side of every transform / pipe / codec to render. Mirrors * ``. Defaults to `"output"` — the inferred * shape consumers receive from the server. Switch to `"input"` * to render the INPUT side (omits `readOnly` properties for * JSON Schema inputs, picks the input half of a `z.codec(...)`). * Has no effect for plain JSON Schema or OpenAPI inputs without * codec/transform constructs. */ io?: Mode; /** * Current value to render. Typed against * `InferSchemaValue` so the prop tracks the * schema's inferred shape for the chosen `io` direction. Falls back * to `unknown` for runtime schemas where the value type cannot be * statically inferred. */ value?: InferredValue; /** * Per-field meta overrides — nested object mirroring schema shape. * Typed against {@link InferFields} so a typed `schema` prop drives * autocomplete on the override map, matching ``. */ fields?: InferFields; /** Meta overrides applied to the root schema. */ meta?: SchemaMeta; /** Convenience: sets description on the root. */ description?: string; /** * Theme resolver. In a Server Component you pass this explicitly * since `SchemaProvider` (React context) is unavailable. * Falls back to the headless resolver if omitted. */ resolver?: ComponentResolver; /** Instance-scoped widgets. */ widgets?: WidgetMap; /** Called with each diagnostic emitted during schema processing. */ onDiagnostic?: (diagnostic: Diagnostic) => void; /** When true, any diagnostic becomes a thrown error. */ strict?: boolean; /** * Prefix used for every input `id`/label `htmlFor` in this view subtree. * Defaults to a per-instance value from `useId()`; pass a deterministic * value when stable ids matter (e.g. snapshot tests). */ idPrefix?: string; } /** * Read-only schema renderer that is safe to use inside a React Server * Component. * * Uses no context, state, or effects — the only hook called is * `useId()`, which is RSC-safe. Always renders read-only; pair with * `SchemaComponent` (which requires `"use client"`) when an editable * form is required. Because Server Components cannot read React * context, the theme adapter is passed via the `resolver` prop rather * than `SchemaProvider`. * * @group Components * @example * ```tsx * import { SchemaView } from "schema-components/react/SchemaView"; * * export default async function Page() { * const user = await getUser(); * return ; * } * ``` */ declare function SchemaView({ schema: schemaInput, schemaRef: schemaRefInput, io, value, fields, meta: componentMeta, description, resolver, widgets, onDiagnostic, strict, idPrefix }: SchemaViewProps): ReactNode; //#endregion export { SchemaView, SchemaViewProps };