/**
 * `<slider-ui>` — Single-handle slider for numeric input.
 *
 * @see https://ui-kit.exe.xyz/site/components/slider
 */

import { UIFormElement } from '../../core/form.js';

export interface SliderChangeEventDetail {
  value: number;
}
export type SliderChangeEvent = CustomEvent<SliderChangeEventDetail>;
export type SliderInputEvent = CustomEvent<SliderChangeEventDetail>;

export class UISlider extends UIFormElement {
  /** Numeric value — overrides UIFormElement.value (which is String). */
  value: number;
  min: number;
  max: number;
  step: number;
  label: string;
  suffix: string;
  /** §184 (v0.5.5, FEEDBACK-08 §4): debounce `input` event by this many ms. 0 = no throttle. */
  throttle: number;
  /** §184 (v0.5.5, FEEDBACK-08 §4): hint text rendered below the track, wired to aria-describedby. */
  hint: string;

  addEventListener<K extends keyof HTMLElementEventMap>(
    type: K,
    listener: (this: UISlider, ev: HTMLElementEventMap[K]) => unknown,
    options?: boolean | AddEventListenerOptions,
  ): void;
  addEventListener(type: 'change', listener: (ev: SliderChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
  addEventListener(type: 'input', listener: (ev: SliderInputEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
}
