/// <reference types="../index.d.ts" />
import type { ArcgisCkeditor5 } from "../components/arcgis-ckeditor5/customElement.js";
import type { ArcgisCkeditor5Popover } from "../components/arcgis-ckeditor5-popover/customElement.js";
import type { ArcgisColorInput } from "../components/arcgis-color-input/customElement.js";
import type { ArcgisFieldInfo } from "../components/arcgis-field-info/customElement.js";
import type { ArcgisFieldPickList } from "../components/arcgis-field-pick-list/customElement.js";
import type { ArcgisHistogram } from "../components/arcgis-histogram/customElement.js";
import type { ArcgisLabelInput } from "../components/arcgis-label-input/customElement.js";
import type { ArcgisPickerInput } from "../components/arcgis-picker-input/customElement.js";
import type { ArcgisRampColor } from "../components/arcgis-ramp-color/customElement.js";
import type { ArcgisRampColorBreak } from "../components/arcgis-ramp-color-break/customElement.js";
import type { ArcgisRampOpacity } from "../components/arcgis-ramp-opacity/customElement.js";
import type { ArcgisSlider } from "../components/arcgis-slider/customElement.js";
import type { ArcgisSliderInput } from "../components/arcgis-slider-input/customElement.js";
import type { ArcgisTicks } from "../components/arcgis-ticks/customElement.js";
import type { ArcgisUniqueValuesList } from "../components/arcgis-unique-values-list/customElement.js";
import { HTMLAttributes } from "preact";
import type { EventHandler } from "@arcgis/lumina";

interface PreactArcgisCkeditor5 extends Partial<Pick<ArcgisCkeditor5, 'canResizeVertically' | 'currentLanguage' | 'customConfig' | 'customExpressionCheck' | 'editorType' | 'groupFieldsAndExpressions' | 'intlExpressionsGroupHeading' | 'intlFieldsGroupHeading' | 'intlTextPlaceHolder' | 'mentionFields' | 'readOnly' | 'textData'>>, HTMLAttributes<HTMLArcgisCkeditor5Element> {
  onarcgisCkeditor5Created?: EventHandler<HTMLArcgisCkeditor5Element["arcgisCkeditor5Created"]>;
  onarcgisCkeditor5DataUpdated?: EventHandler<HTMLArcgisCkeditor5Element["arcgisCkeditor5DataUpdated"]>;
  onarcgisCkeditor5SourceEditingChanged?: EventHandler<HTMLArcgisCkeditor5Element["arcgisCkeditor5SourceEditingChanged"]>;
  onarcgisCreated?: EventHandler<HTMLArcgisCkeditor5Element["arcgisCreated"]>;
  onarcgisDataUpdated?: EventHandler<HTMLArcgisCkeditor5Element["arcgisDataUpdated"]>;
  onarcgisSourceEditingChanged?: EventHandler<HTMLArcgisCkeditor5Element["arcgisSourceEditingChanged"]>;
}

interface PreactArcgisCkeditor5Popover extends Partial<Pick<ArcgisCkeditor5Popover, 'guid' | 'intlCancel' | 'intlLabel' | 'intlOk' | 'refElement'>>, HTMLAttributes<HTMLArcgisCkeditor5PopoverElement> {
  onarcgisCkeditor5PopoverClosed?: EventHandler<HTMLArcgisCkeditor5PopoverElement["arcgisCkeditor5PopoverClosed"]>;
  onarcgisPopoverClosed?: EventHandler<HTMLArcgisCkeditor5PopoverElement["arcgisPopoverClosed"]>;
}

interface PreactArcgisColorInput extends Partial<Pick<ArcgisColorInput, 'clearable' | 'color' | 'compact' | 'disabled' | 'hideRecentColors' | 'messageOverrides' | 'placement' | 'popoverProps' | 'showTransparency' | 'storageId'>>, HTMLAttributes<HTMLArcgisColorInputElement> {
  onarcgisChange?: EventHandler<HTMLArcgisColorInputElement["arcgisChange"]>;
  onarcgisColorInputChange?: EventHandler<HTMLArcgisColorInputElement["arcgisColorInputChange"]>;
  onarcgisColorInputPopoverClose?: EventHandler<HTMLArcgisColorInputElement["arcgisColorInputPopoverClose"]>;
  onarcgisColorInputPopoverOpen?: EventHandler<HTMLArcgisColorInputElement["arcgisColorInputPopoverOpen"]>;
  onarcgisColorInputSwatchUpdate?: EventHandler<HTMLArcgisColorInputElement["arcgisColorInputSwatchUpdate"]>;
  onarcgisPickerClose?: EventHandler<HTMLArcgisColorInputElement["arcgisPickerClose"]>;
  onarcgisPickerOpen?: EventHandler<HTMLArcgisColorInputElement["arcgisPickerOpen"]>;
  onarcgisSwatchUpdate?: EventHandler<HTMLArcgisColorInputElement["arcgisSwatchUpdate"]>;
}

interface PreactArcgisFieldInfo extends Partial<Pick<ArcgisFieldInfo, 'fieldName' | 'hideAlias' | 'hideNumericFormat' | 'hideStatistics' | 'layer' | 'view'>>, HTMLAttributes<HTMLArcgisFieldInfoElement> {
  onarcgisComplete?: EventHandler<HTMLArcgisFieldInfoElement["arcgisComplete"]>;
  onarcgisFieldInfoComplete?: EventHandler<HTMLArcgisFieldInfoElement["arcgisFieldInfoComplete"]>;
}

interface PreactArcgisFieldPickList extends Partial<Pick<ArcgisFieldPickList, 'customExpressionCheck' | 'expressionsGroupHeading' | 'fields' | 'fieldsGroupHeading' | 'filterNoResultsText' | 'filterPlaceholderText' | 'groupFieldsAndExpressions' | 'heading' | 'hideCancel' | 'hideSort' | 'layer' | 'listOnly' | 'mapView' | 'multiple' | 'okBtnText' | 'popoverProps' | 'selectedFields' | 'showCancel' | 'showDescription' | 'showFieldInfo' | 'showFieldName' | 'showFieldTypeIcon' | 'showFilterLength' | 'showSelectionAll' | 'showSort' | 'sortBy' | 'view'>>, HTMLAttributes<HTMLArcgisFieldPickListElement> {
  onarcgisChange?: EventHandler<HTMLArcgisFieldPickListElement["arcgisChange"]>;
  onarcgisClose?: EventHandler<HTMLArcgisFieldPickListElement["arcgisClose"]>;
  onarcgisDeleteField?: EventHandler<HTMLArcgisFieldPickListElement["arcgisDeleteField"]>;
  onarcgisEditField?: EventHandler<HTMLArcgisFieldPickListElement["arcgisEditField"]>;
  onarcgisFieldPickListChange?: EventHandler<HTMLArcgisFieldPickListElement["arcgisFieldPickListChange"]>;
  onarcgisFieldPickListDismissed?: EventHandler<HTMLArcgisFieldPickListElement["arcgisFieldPickListDismissed"]>;
  onarcgisFieldPickListSortByChange?: EventHandler<HTMLArcgisFieldPickListElement["arcgisFieldPickListSortByChange"]>;
  onarcgisSortByChange?: EventHandler<HTMLArcgisFieldPickListElement["arcgisSortByChange"]>;
}

interface PreactArcgisHistogram extends Partial<Pick<ArcgisHistogram, 'average' | 'bins' | 'colorBlendingEnabled' | 'colorStops' | 'dataLines' | 'icon' | 'label' | 'labelFormatFunction' | 'layout' | 'max' | 'messageOverrides' | 'min' | 'standardDeviation'>>, HTMLAttributes<HTMLArcgisHistogramElement> {
}

interface PreactArcgisLabelInput extends Partial<Pick<ArcgisLabelInput, 'alignment' | 'labelFormatter' | 'readOnly' | 'value'>>, HTMLAttributes<HTMLArcgisLabelInputElement> {
  onarcgisChange?: EventHandler<HTMLArcgisLabelInputElement["arcgisChange"]>;
}

interface PreactArcgisPickerInput extends Partial<Pick<ArcgisPickerInput, 'disabled' | 'heading' | 'iconEnd' | 'intlDone' | 'label' | 'popoverProps'>>, HTMLAttributes<HTMLArcgisPickerInputElement> {
  onarcgisPopoverClose?: EventHandler<HTMLArcgisPickerInputElement["arcgisPopoverClose"]>;
  onarcgisPopoverOpen?: EventHandler<HTMLArcgisPickerInputElement["arcgisPopoverOpen"]>;
}

interface PreactArcgisRampColor extends Partial<Pick<ArcgisRampColor, 'layout' | 'max' | 'min' | 'stops'>>, HTMLAttributes<HTMLArcgisRampColorElement> {
}

interface PreactArcgisRampColorBreak extends Partial<Pick<ArcgisRampColorBreak, 'layout' | 'max' | 'min' | 'stops'>>, HTMLAttributes<HTMLArcgisRampColorBreakElement> {
}

interface PreactArcgisRampOpacity extends Partial<Pick<ArcgisRampOpacity, 'fillColor' | 'layout' | 'max' | 'min' | 'stops'>>, HTMLAttributes<HTMLArcgisRampOpacityElement> {
}

interface PreactArcgisSlider extends Partial<Pick<ArcgisSlider, 'allowValuesOverlap' | 'autoDestroyDisabled' | 'disabled' | 'fillPlacement' | 'fullRangeMax' | 'fullRangeMin' | 'labelFormatter' | 'layout' | 'max' | 'messageOverrides' | 'min' | 'mirrored' | 'popoverLabel' | 'popoverPlacement' | 'precision' | 'rangeLabelsEditingEnabled' | 'rangeLabelsPlacement' | 'segmentsDraggingDisabled' | 'showRangeLabels' | 'steps' | 'valueLabelsDisplay' | 'valueLabelsEditingEnabled' | 'valueLabelsPlacement' | 'values'>>, HTMLAttributes<HTMLArcgisSliderElement> {
  onarcgisActiveValueChange?: EventHandler<HTMLArcgisSliderElement["arcgisActiveValueChange"]>;
  onarcgisChange?: EventHandler<HTMLArcgisSliderElement["arcgisChange"]>;
  onarcgisInput?: EventHandler<HTMLArcgisSliderElement["arcgisInput"]>;
  onarcgisRangeChange?: EventHandler<HTMLArcgisSliderElement["arcgisRangeChange"]>;
}

interface PreactArcgisSliderInput extends Partial<Pick<ArcgisSliderInput, 'disabled' | 'flipLabels' | 'label' | 'max' | 'min' | 'step' | 'unitsLabel' | 'value' | 'withSteppers'>>, HTMLAttributes<HTMLArcgisSliderInputElement> {
  onarcgisSliderInputValueChange?: EventHandler<HTMLArcgisSliderInputElement["arcgisSliderInputValueChange"]>;
  onarcgisValueChange?: EventHandler<HTMLArcgisSliderInputElement["arcgisValueChange"]>;
}

interface PreactArcgisTicks extends Partial<Pick<ArcgisTicks, 'interactive' | 'interpolationExponent' | 'labelFormatter' | 'labelPlacement' | 'layout' | 'max' | 'min' | 'mirrored' | 'mode' | 'showBaseline' | 'showLabels' | 'values'>>, HTMLAttributes<HTMLArcgisTicksElement> {
  onarcgisTickClick?: EventHandler<HTMLArcgisTicksElement["arcgisTickClick"]>;
}

interface PreactArcgisUniqueValuesList extends Partial<Pick<ArcgisUniqueValuesList, 'fieldName' | 'layer' | 'maxHeight' | 'multiple' | 'numberFormatOptions' | 'partialUniqueValues' | 'selectedValues' | 'showFilterLength' | 'sortBy' | 'uniqueValues' | 'view'>>, HTMLAttributes<HTMLArcgisUniqueValuesListElement> {
  onarcgisChange?: EventHandler<HTMLArcgisUniqueValuesListElement["arcgisChange"]>;
  onarcgisLoad?: EventHandler<HTMLArcgisUniqueValuesListElement["arcgisLoad"]>;
  onarcgisSortByChange?: EventHandler<HTMLArcgisUniqueValuesListElement["arcgisSortByChange"]>;
}

declare module 'preact' {
  namespace createElement.JSX {
    interface IntrinsicElements {
      "arcgis-ckeditor5": PreactArcgisCkeditor5;
      "arcgis-ckeditor5-popover": PreactArcgisCkeditor5Popover;
      "arcgis-color-input": PreactArcgisColorInput;
      "arcgis-field-info": PreactArcgisFieldInfo;
      "arcgis-field-pick-list": PreactArcgisFieldPickList;
      "arcgis-histogram": PreactArcgisHistogram;
      "arcgis-label-input": PreactArcgisLabelInput;
      "arcgis-picker-input": PreactArcgisPickerInput;
      "arcgis-ramp-color": PreactArcgisRampColor;
      "arcgis-ramp-color-break": PreactArcgisRampColorBreak;
      "arcgis-ramp-opacity": PreactArcgisRampOpacity;
      "arcgis-slider": PreactArcgisSlider;
      "arcgis-slider-input": PreactArcgisSliderInput;
      "arcgis-ticks": PreactArcgisTicks;
      "arcgis-unique-values-list": PreactArcgisUniqueValuesList;
    }
  }
  namespace h.JSX {
    interface IntrinsicElements {
      "arcgis-ckeditor5": PreactArcgisCkeditor5;
      "arcgis-ckeditor5-popover": PreactArcgisCkeditor5Popover;
      "arcgis-color-input": PreactArcgisColorInput;
      "arcgis-field-info": PreactArcgisFieldInfo;
      "arcgis-field-pick-list": PreactArcgisFieldPickList;
      "arcgis-histogram": PreactArcgisHistogram;
      "arcgis-label-input": PreactArcgisLabelInput;
      "arcgis-picker-input": PreactArcgisPickerInput;
      "arcgis-ramp-color": PreactArcgisRampColor;
      "arcgis-ramp-color-break": PreactArcgisRampColorBreak;
      "arcgis-ramp-opacity": PreactArcgisRampOpacity;
      "arcgis-slider": PreactArcgisSlider;
      "arcgis-slider-input": PreactArcgisSliderInput;
      "arcgis-ticks": PreactArcgisTicks;
      "arcgis-unique-values-list": PreactArcgisUniqueValuesList;
    }
  }
}