/**
 * `<heatmap-ui>` — Grid heatmap with 5-bucket data ramp — supports day-grid (GitHub contributions), matrix, and density modes.
 *
 * @see https://ui-kit.exe.xyz/site/components/heatmap
 *
 * 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 type HeatmapCellClickEvent = CustomEvent<unknown>;
export type HeatmapCellHoverEvent = CustomEvent<unknown>;
export type HeatmapChartHoverEvent = CustomEvent<unknown>;
export type HeatmapChartLeaveEvent = CustomEvent<unknown>;
export type HeatmapChartSelectEvent = CustomEvent<unknown>;

export class UIHeatmap extends UIElement {
  /** Heatmap type */
  type: 'day-grid' | 'matrix' | 'density';
  /** Aspect ratio */
  aspect: 'square' | 'wide';
  /** Color ramp */
  colorScheme: 'accent' | 'success' | 'warning' | 'danger' | 'info' | 'data-ramp';
  /** Column count */
  cols: number;
  /** Hide the Less/More legend strip */
  noLegend: boolean;
  /** Row count */
  rows: number;
  /** Value-to-bucket scale */
  scale: 'linear' | 'log' | 'quantile';
  /** ISO start date; labels months in day-grid mode */
  startDate: string;

  addEventListener<K extends keyof HTMLElementEventMap>(
    type: K,
    listener: (this: UIHeatmap, ev: HTMLElementEventMap[K]) => unknown,
    options?: boolean | AddEventListenerOptions,
  ): void;
  addEventListener(type: 'cell-click', listener: (ev: HeatmapCellClickEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
  addEventListener(type: 'cell-hover', listener: (ev: HeatmapCellHoverEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
  addEventListener(type: 'chart-hover', listener: (ev: HeatmapChartHoverEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
  addEventListener(type: 'chart-leave', listener: (ev: HeatmapChartLeaveEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
  addEventListener(type: 'chart-select', listener: (ev: HeatmapChartSelectEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
}
