import type { Popover } from "@esri/calcite-components/dist/components/calcite-popover";

/** @internal */
export type OverlayPositioning = Popover["overlayPositioning"];

/** @internal */
export type LogicalPlacement = Popover["placement"];

/**
 * Properties used for calcite-popover.
 *
 * @internal
 */
export interface IPopoverProps {
  refElement: HTMLElement;
  placement?: LogicalPlacement;
  offsetDistance?: number;
  offsetSkidding?: number;
  popoverWidth?: number;
  overlayPositioning?: OverlayPositioning;
  flipDisabled?: boolean;
  triggerDisabled?: boolean;
  autoClose?: boolean;
  maxHeight?: string;
  zIndex?: number;
}

/**
 * Object to be passed to arcgis-field-pick-list containing info about a field.
 * Use type:"none" to add non-sortable items, without info options, to the bottom of the list.
 *
 * @internal
 */
export interface IPickListFieldInfo {
  name: string;
  alias?: string | null;
  type: string;
  description?: string | null;
  hideFieldName?: boolean;
  hideDescription?: boolean;
  showEditAction?: boolean;
  showDeleteAction?: boolean;
}

/**
 * Object to be passed to arcgis-field-pick-list containing a group of fields.
 *
 * @internal
 */
export interface IPickListGroupInfo {
  title?: string;
  fields: IPickListFieldInfo[];
}

/** @internal */
export type LastSortBy = "default" | "display" | "field" | "type";

/** @internal */
export type VisualizationSource = "feature-reduction" | undefined;

/** @internal */
export const FieldInfoPrefix: {
    expression: string;
    relationship: string;
    raster: string;
};