/// <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<ArcgisCkeditor5> {
  onarcgisCkeditor5Created?: EventHandler<ArcgisCkeditor5["arcgisCkeditor5Created"]>;
  onarcgisCkeditor5DataUpdated?: EventHandler<ArcgisCkeditor5["arcgisCkeditor5DataUpdated"]>;
  onarcgisCkeditor5SourceEditingChanged?: EventHandler<ArcgisCkeditor5["arcgisCkeditor5SourceEditingChanged"]>;
  onarcgisCreated?: EventHandler<ArcgisCkeditor5["arcgisCreated"]>;
  onarcgisDataUpdated?: EventHandler<ArcgisCkeditor5["arcgisDataUpdated"]>;
  onarcgisSourceEditingChanged?: EventHandler<ArcgisCkeditor5["arcgisSourceEditingChanged"]>;
}

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

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

interface PreactArcgisFieldInfo extends Partial<Pick<ArcgisFieldInfo, "fieldName" | "hideAlias" | "hideNumericFormat" | "hideStatistics" | "layer" | "view">>, HTMLAttributes<ArcgisFieldInfo> {
  onarcgisComplete?: EventHandler<ArcgisFieldInfo["arcgisComplete"]>;
  onarcgisFieldInfoComplete?: EventHandler<ArcgisFieldInfo["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<ArcgisFieldPickList> {
  onarcgisChange?: EventHandler<ArcgisFieldPickList["arcgisChange"]>;
  onarcgisClose?: EventHandler<ArcgisFieldPickList["arcgisClose"]>;
  onarcgisDeleteField?: EventHandler<ArcgisFieldPickList["arcgisDeleteField"]>;
  onarcgisEditField?: EventHandler<ArcgisFieldPickList["arcgisEditField"]>;
  onarcgisFieldPickListChange?: EventHandler<ArcgisFieldPickList["arcgisFieldPickListChange"]>;
  onarcgisFieldPickListDismissed?: EventHandler<ArcgisFieldPickList["arcgisFieldPickListDismissed"]>;
  onarcgisFieldPickListSortByChange?: EventHandler<ArcgisFieldPickList["arcgisFieldPickListSortByChange"]>;
  onarcgisSortByChange?: EventHandler<ArcgisFieldPickList["arcgisSortByChange"]>;
}

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

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

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

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

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

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

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

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

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

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