/**
 * `<agent-artifact-ui>` — Inline container for structured agent artifacts (A2UI, JSON, tickets, code). Renders inside <chat-thread-ui> message bodies or <inspector-ui> panes as a labeled, optionally collapsible block with content-type-aware rendering. Use for agent-emitted structured payloads; for free-text agent output use <text-ui> or <richtext-ui> instead.
 *
 * @see https://ui-kit.exe.xyz/site/components/agent-artifact
 *
 * 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 AgentArtifactArtifactToggleEventDetail {
  /** New collapsed state after the toggle. */
  collapsed: boolean;
}

export type AgentArtifactArtifactToggleEvent = CustomEvent<AgentArtifactArtifactToggleEventDetail>;

export class UIAgentArtifact extends UIElement {
  /** Header title. */
  title: string;
  /** Start collapsed. */
  collapsed: boolean;
  /** icon-ui name in header. */
  icon: string;
  /** Badge label; value is normalized to uppercase before rendering. */
  kind: string;
  /** neutral | accent | warning | danger */
  tone: string;

  addEventListener<K extends keyof HTMLElementEventMap>(
    type: K,
    listener: (this: UIAgentArtifact, ev: HTMLElementEventMap[K]) => unknown,
    options?: boolean | AddEventListenerOptions,
  ): void;
  addEventListener(type: 'artifact-toggle', listener: (ev: AgentArtifactArtifactToggleEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
}
