import type { ChoicesSpec, ChoicesValues } from '../../generated/types.js'; /** One enumerated option within a question. */ export interface ChoiceOption { label: string; description?: string; } /** A single question in a `choices` spec (the ergonomic, array-friendly view of * the generated tuple type). */ export interface ChoiceQuestion { question: string; header: string; options: ChoiceOption[]; multiSelect?: boolean; } /** A per-question validation error surfaced from an `interaction_invalid` event. * `field` is the question's `header`. */ export interface ChoiceError { field: string; message: string; } export interface ChoicesCardProps { /** The `choices` spec carried on the `interaction_required` event. */ spec: ChoicesSpec; /** Human-readable reason the agent raised the ask (card header). */ reason?: string; /** Called with the canonical values when the visitor submits a complete answer. */ onSubmit: (values: ChoicesValues) => void; /** Called when the visitor declines the interaction. */ onDecline: () => void; /** Per-question server validation errors (keyed by question `header`). */ errors?: ChoiceError[]; /** Disable all controls (e.g. while a submit is in flight). */ busy?: boolean; className?: string; } /** Per-question working state: chosen enumerated labels + the free-text `other`. */ interface QState { selected: string[]; other: string; } /** * Build the canonical {@link ChoicesValues} from the card's working state. * * Pure + exported so the payload shape is unit-testable without a DOM. Per the * schema Values: `other` is trimmed and dropped when blank; the single-select * OTHER sentinel is stripped so a free-text single answer submits as `other` * alone (options omitted); a question with no selection and no `other` still * emits an entry (the server validator rejects the empty answer, keeping the * turn parked — the UI blocks submit before it gets that far). */ export declare function buildChoicesValues(questions: ChoiceQuestion[], state: Record): ChoicesValues; export declare function ChoicesCard({ spec, reason, onSubmit, onDecline, errors, busy, className }: ChoicesCardProps): import("react/jsx-runtime").JSX.Element; export {}; //# sourceMappingURL=ChoicesCard.d.ts.map