/** * `SchemaEditor` — the shared control for AUTHORING a JSON Schema. It is a VALIDATED * code editor, NOT a visual builder: the operator writes the schema as JSON in a * textarea, and the editor gives loud parse feedback, a structural lint (top-level * object; a `"title"` when `requireTitle`), and a live PREVIEW of the authored shape * through the same {@link SchemaForm} renderer the run side uses (falling back to a * {@link JsonTree} of the schema dict when the shape is not form-renderable). * * A JSON Schema is more expressive than any builder UI (`$defs`, `anyOf`, constraint * keywords), and the backend rejects an invalid schema LOUDLY — so full meta-schema * validation stays server-side and this control adds no schema-validation dependency. * * CONTROLLED-BY-SEED: `value` seeds the editor's text ONCE (on mount); thereafter the * text is the source of truth and every edit reports up through `onChange`. Validity * is exposed there too so the consumer can gate its submit — always alongside a * VISIBLE inline message, never a silently disabled button. The parsed dict is passed * through untouched, so a schema the editor does not understand round-trips exactly. * * SAFETY: the schema text is operator-authored and every derived value renders as * React TEXT (through the DS controls / `JsonTree` / `SchemaForm`), never an HTML sink. */ import { type ReactNode } from 'react'; /** What {@link SchemaEditor} reports up on every edit. */ export interface SchemaEditorChange { /** The authored schema dict when valid and non-empty; `null` when the editor is empty. */ readonly schema: Record | null; /** False when the text is non-empty but unparseable or failing lint — gate submit on this. */ readonly valid: boolean; } export interface SchemaEditorProps { /** The schema dict to seed the editor with, or `null` for an empty editor. */ readonly value: Record | null; /** Fired on every edit with the parsed schema (or `null`) and its validity. */ readonly onChange: (change: SchemaEditorChange) => void; /** When true, a top-level `"title"` is required (the `response_format` contract). */ readonly requireTitle: boolean; readonly label?: string; readonly description?: string; readonly disabled?: boolean; readonly idPrefix?: string; /** * Render the field label for ASSISTIVE TECH ONLY — visually hidden but still the editor's * accessible name. Used when a host control already draws the visible label above this * editor (e.g. an authored-body control whose inline editor this is), so the heading is not * drawn twice. Forwarded to the underlying {@link Field}. */ readonly hideLabel?: boolean; } export declare function SchemaEditor({ value, onChange, requireTitle, label, description, disabled, idPrefix, hideLabel, }: SchemaEditorProps): ReactNode; //# sourceMappingURL=SchemaEditor.d.ts.map