/**
 * `<agent-feedback-bar-ui>` — Agent-response feedback bar — thumbs up / thumbs down rating row
plus an optional Save action, rendered beneath an LLM-generated
message. Composes <button-ui> children for the affordances; emits
`feedback` event with detail.{value, action} on rating. Sits as the
trailing chrome of a chat message bubble or alongside an
<agent-trace-ui> step — used in chat-shell, gen-ui canvas, and
inspector flows.

 *
 * @see https://ui-kit.exe.xyz/site/components/agent-feedback-bar
 *
 * 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 AgentFeedbackBarFeedbackRateEventDetail {
  /** Rating value selected by the user. */
  rating: number;
}

export type AgentFeedbackBarFeedbackRateEvent = CustomEvent<AgentFeedbackBarFeedbackRateEventDetail>;
export type AgentFeedbackBarFeedbackSaveEvent = CustomEvent<unknown>;

export class UIAgentFeedbackBar extends UIElement {
  /** Disable all actions. */
  disabled: boolean;
  /** Save button icon. */
  saveIcon: string;
  /** Save button text; empty hides it. */
  saveLabel: string;

  addEventListener<K extends keyof HTMLElementEventMap>(
    type: K,
    listener: (this: UIAgentFeedbackBar, ev: HTMLElementEventMap[K]) => unknown,
    options?: boolean | AddEventListenerOptions,
  ): void;
  addEventListener(type: 'feedback-rate', listener: (ev: AgentFeedbackBarFeedbackRateEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
  addEventListener(type: 'feedback-save', listener: (ev: AgentFeedbackBarFeedbackSaveEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
}
