/// <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 type { h, EventHandler } from "@arcgis/lumina";

interface LuminaArcgisCkeditor5 extends Partial<Pick<ArcgisCkeditor5, "canResizeVertically" | "currentLanguage" | "customConfig" | "customExpressionCheck" | "editorType" | "groupFieldsAndExpressions" | "intlExpressionsGroupHeading" | "intlFieldsGroupHeading" | "intlTextPlaceHolder" | "mentionFields" | "readOnly" | "textData">>, h.JSX.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 LuminaArcgisCkeditor5Popover extends Partial<Pick<ArcgisCkeditor5Popover, "guid" | "intlCancel" | "intlLabel" | "intlOk" | "refElement">>, h.JSX.HTMLAttributes<ArcgisCkeditor5Popover> {
  onarcgisCkeditor5PopoverClosed?: EventHandler<ArcgisCkeditor5Popover["arcgisCkeditor5PopoverClosed"]>;
  onarcgisPopoverClosed?: EventHandler<ArcgisCkeditor5Popover["arcgisPopoverClosed"]>;
}

interface LuminaArcgisColorInput extends Partial<Pick<ArcgisColorInput, "clearable" | "color" | "compact" | "disabled" | "hideRecentColors" | "messageOverrides" | "placement" | "popoverProps" | "showTransparency" | "storageId">>, h.JSX.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 LuminaArcgisFieldInfo extends Partial<Pick<ArcgisFieldInfo, "fieldName" | "hideAlias" | "hideNumericFormat" | "hideStatistics" | "layer" | "view">>, h.JSX.HTMLAttributes<ArcgisFieldInfo> {
  onarcgisComplete?: EventHandler<ArcgisFieldInfo["arcgisComplete"]>;
  onarcgisFieldInfoComplete?: EventHandler<ArcgisFieldInfo["arcgisFieldInfoComplete"]>;
}

interface LuminaArcgisFieldPickList 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">>, h.JSX.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 LuminaArcgisHistogram extends Partial<Pick<ArcgisHistogram, "average" | "bins" | "colorBlendingEnabled" | "colorStops" | "dataLines" | "icon" | "label" | "labelFormatFunction" | "layout" | "max" | "messageOverrides" | "min" | "standardDeviation">>, h.JSX.HTMLAttributes<ArcgisHistogram> {
}

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

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

interface LuminaArcgisRampColor extends Partial<Pick<ArcgisRampColor, "layout" | "max" | "min" | "stops">>, h.JSX.HTMLAttributes<ArcgisRampColor> {
}

interface LuminaArcgisRampColorBreak extends Partial<Pick<ArcgisRampColorBreak, "layout" | "max" | "min" | "stops">>, h.JSX.HTMLAttributes<ArcgisRampColorBreak> {
}

interface LuminaArcgisRampOpacity extends Partial<Pick<ArcgisRampOpacity, "fillColor" | "layout" | "max" | "min" | "stops">>, h.JSX.HTMLAttributes<ArcgisRampOpacity> {
}

interface LuminaArcgisSlider 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">>, h.JSX.HTMLAttributes<ArcgisSlider> {
  onarcgisActiveValueChange?: EventHandler<ArcgisSlider["arcgisActiveValueChange"]>;
  onarcgisChange?: EventHandler<ArcgisSlider["arcgisChange"]>;
  onarcgisInput?: EventHandler<ArcgisSlider["arcgisInput"]>;
  onarcgisRangeChange?: EventHandler<ArcgisSlider["arcgisRangeChange"]>;
}

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

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

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

declare module "@arcgis/lumina" {
  export namespace h.JSX {
    interface IntrinsicElements {
      "arcgis-ckeditor5": LuminaArcgisCkeditor5;
      "arcgis-ckeditor5-popover": LuminaArcgisCkeditor5Popover;
      "arcgis-color-input": LuminaArcgisColorInput;
      "arcgis-field-info": LuminaArcgisFieldInfo;
      "arcgis-field-pick-list": LuminaArcgisFieldPickList;
      "arcgis-histogram": LuminaArcgisHistogram;
      "arcgis-label-input": LuminaArcgisLabelInput;
      "arcgis-picker-input": LuminaArcgisPickerInput;
      "arcgis-ramp-color": LuminaArcgisRampColor;
      "arcgis-ramp-color-break": LuminaArcgisRampColorBreak;
      "arcgis-ramp-opacity": LuminaArcgisRampOpacity;
      "arcgis-slider": LuminaArcgisSlider;
      "arcgis-slider-input": LuminaArcgisSliderInput;
      "arcgis-ticks": LuminaArcgisTicks;
      "arcgis-unique-values-list": LuminaArcgisUniqueValuesList;
    }
  }
}