/**
 * `<agent-questions-ui>` — Multi-choice clarifying-question card emitted by an agent when it
needs disambiguation before proceeding. Renders the question prompt
+ a slotted list of <button-ui> answer chips (or radio-style cards
when [multi] is set for multi-select). The submit button fires
`answer` with detail.{value(s)} once the user confirms. Use for
agentic clarification turns — not generic form input (use
<field-ui> + form primitives for that).

 *
 * @see https://ui-kit.exe.xyz/site/components/agent-questions
 *
 * Type declarations generated by scripts/build/dts-codegen.mjs from
 * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
 * run `npm run build:components`, then `npm run codegen:dts` to
 * regenerate; or hand-author this file fully if rich event types are
 * needed beyond what the yaml `events:` block can express.
 */

import { UIElement } from '../../core/element.js';

export interface AgentQuestionsQuestionsAnswerEventDetail {
  /** The full selected option object. */
  option: Record<string, unknown>;
  /** Array of selected option IDs. */
  selected: unknown[];
}

export type AgentQuestionsQuestionsAnswerEvent = CustomEvent<AgentQuestionsQuestionsAnswerEventDetail>;

export class UIAgentQuestions extends UIElement {
  /** Helper text. */
  helper: string;
  /** Allow multi-select. */
  multi: boolean;
  /** Headline question. */
  question: string;
  /** Submit button label (multi mode). */
  submitLabel: string;

  addEventListener<K extends keyof HTMLElementEventMap>(
    type: K,
    listener: (this: UIAgentQuestions, ev: HTMLElementEventMap[K]) => unknown,
    options?: boolean | AddEventListenerOptions,
  ): void;
  addEventListener(type: 'questions-answer', listener: (ev: AgentQuestionsQuestionsAnswerEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
}
