import { j as WalkedField } from "../types-BBQaEPfE.mjs";
import { u as RenderProps } from "../renderer-ab9E52Bp.mjs";
import { ReactNode } from "react";
//#region src/react/headlessRenderers.d.ts
/**
* Coerce an unknown render result into a React node.
* Returns `null` for unrecognised values.
*/
declare function toReactNode(value: unknown): ReactNode;
/**
* Build a stable, unique input ID from the path.
*
* Re-exported alias for {@link fieldDomId} so external themes (shadcn,
* MUI, mantine, radix) keep importing `inputId` from the React entry
* point. Both the React and HTML renderers must derive the same id from
* the same path — `fieldDomId` in `core/idPath.ts` is the single
* source-of-truth.
*
* Throws on an empty path; see `fieldDomId` for the rationale.
*/
declare function inputId(path: string): string;
/** Headless renderer for `StringField` — plain ` ` / ``. */
declare function renderString(props: RenderProps): ReactNode;
/** Headless renderer for `NumberField` — plain ` `. */
declare function renderNumber(props: RenderProps): ReactNode;
/** Headless renderer for `BooleanField` — plain ` `. */
declare function renderBoolean(props: RenderProps): ReactNode;
/** Headless renderer for `EnumField` — plain `` listing each option. */
declare function renderEnum(props: RenderProps): ReactNode;
/** Headless renderer for `ObjectField` — `` per object with one child per property. */
declare function renderObject(props: RenderProps): ReactNode;
/**
* Compute the default value for a freshly added record entry based on the
* record's value-type schema. Mirrors the read of `defaultValue` used
* elsewhere in the renderer, falling back to a type-appropriate empty value.
*/
declare function defaultRecordValue(valueType: WalkedField): unknown;
/**
* Generate a unique, currently-unused key for a new record entry.
* Picks the first of `key`, `key-1`, `key-2`, … that is not in `existing`.
*/
declare function nextRecordKey(existing: readonly string[], base?: string): string;
/**
* Rename a key in an object while preserving insertion order. Returns the
* original object reference when the rename is a no-op (oldKey === newKey)
* or when newKey collides with an existing key.
*/
declare function renameRecordKey(obj: Record, oldKey: string, newKey: string): Record;
/** Headless renderer for `RecordField` — editable key/value rows with add/remove controls. */
declare function renderRecord(props: RenderProps): ReactNode;
/** Headless renderer for `ArrayField` — ordered list with add/remove controls. */
declare function renderArray(props: RenderProps): ReactNode;
/** Headless renderer for plain `UnionField` — picks the matching option and renders it. */
declare function renderUnion(props: RenderProps): ReactNode;
/** Headless renderer for `DiscriminatedUnionField` — tabbed UI driven by the discriminator. */
declare function renderDiscriminatedUnion(props: RenderProps): ReactNode;
/**
* Pure helper: convert a tab index into the new value the discriminated
* union should emit. Returns `undefined` when the index is out of bounds.
*
* Extracted from `DiscriminatedUnionTabs` so the contract is unit-testable
* without rendering the tabs component (which relies on React hooks).
*/
declare function discriminatedUnionValueForTab(optionLabels: readonly string[], discKey: string, newIndex: number): Record | undefined;
/** Headless renderer for `FileField` — plain ` `. */
declare function renderFile(props: RenderProps): ReactNode;
/**
* Render a literal field — `z.literal("a")` or `{ const: 5 }`.
*
* Literals are non-editable by nature (the value is fixed at the schema
* level), so both read-only and editable modes display the literal value(s).
* Multiple literals (`z.literal(["a", "b"])`) render comma-separated.
*/
declare function renderLiteral(props: RenderProps): ReactNode;
/**
* Render a null field — `z.null()` or `{ type: "null" }`.
*
* The only valid value is `null`, so render an em-dash placeholder
* regardless of mode. There is nothing the user can usefully change.
*/
declare function renderNull(props: RenderProps): ReactNode;
/**
* Render a never field — `z.never()` or `{ not: {} }` / `false` schema.
*
* `never` indicates a position that cannot hold any value. We render a
* visible placeholder rather than throwing because some valid schemas
* intentionally contain `never` branches (e.g. exhaustive discriminated
* unions), and a runtime crash on render would be worse than a visible
* indicator.
*/
declare function renderNever(props: RenderProps): ReactNode;
/**
* Render a tuple field — `z.tuple([z.string(), z.number()])` or
* `{ prefixItems: [...] }`.
*
* Positional rendering: each `prefixItems` entry is rendered at its index.
* The structural index (e.g. `[0]`) is passed as the path suffix so
* children get unique ids and labels.
*/
declare function renderTuple(props: RenderProps): ReactNode;
/**
* Render a conditional field — JSON Schema `if`/`then`/`else`.
*
* Conditional schemas describe constraints rather than a single value
* shape, so the renderer surfaces each clause as a labelled fieldset.
* This mirrors the HTML renderer's annotation approach and gives a
* predictable structure for theme adapters that want to override it.
*/
declare function renderConditional(props: RenderProps): ReactNode;
/**
* Render a negation field — JSON Schema `{ not: { ... } }`.
*
* Negation describes a constraint ("value must NOT match this schema")
* rather than a value shape. The renderer surfaces the negated schema
* beneath an explanatory preamble.
*/
declare function renderNegation(props: RenderProps): ReactNode;
/** Headless renderer for `UnknownField` — JSON-encoded fallback for unconstrained values. */
declare function renderUnknown(props: RenderProps): ReactNode;
//#endregion
export { defaultRecordValue, discriminatedUnionValueForTab, inputId, nextRecordKey, renameRecordKey, renderArray, renderBoolean, renderConditional, renderDiscriminatedUnion, renderEnum, renderFile, renderLiteral, renderNegation, renderNever, renderNull, renderNumber, renderObject, renderRecord, renderString, renderTuple, renderUnion, renderUnknown, toReactNode };