/// <reference path="../../index.d.ts" />
/// <reference types="@arcgis/core/interfaces.d.ts" />
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
import type { UniqueValueCountInfo } from "@arcgis/core/smartMapping/statistics/types.js";
import type { SupportedLayer } from "./utils/basic.js";
import type { VisualizationSource } from "../../utils/types.js";
import type { T9nMeta } from "@arcgis/lumina/controllers";

/**
 * Displays a list of unique values taking into account field type formatting and field domains.
 *
 * @internal
 */
export abstract class ArcgisUniqueValuesList extends LitElement {
  /** @internal */
  protected _messages: {
      searchValues: string;
      sortValues: string;
      values: string;
      sortByCount: string;
      sortAlphabetical: string;
      sortAscending: string;
      sortSelected: string;
      errors: { tooManyUniqueValues: string; };
  } & T9nMeta<{
      searchValues: string;
      sortValues: string;
      values: string;
      sortByCount: string;
      sortAlphabetical: string;
      sortAscending: string;
      sortSelected: string;
      errors: { tooManyUniqueValues: string; };
  }>;
  /** Field name, required if uniqueValues is not provided, if component needs to format values, or needs to check for field domains. */
  accessor fieldName: string | undefined;
  /** Layer instance, required if uniqueValues is not provided, if component needs to format values, or needs to check for field domains. */
  accessor layer: SupportedLayer | undefined;
  /** Optional, max height of list in pixel. */
  accessor maxHeight: number | undefined;
  /**
   * Multiple selections allowed?
   *
   * @default false
   */
  accessor multiple: boolean | undefined;
  /**
   * Optional format options if values are numbers.
   *
   * e.g.
   *      {
   *        style: "decimal",
   *        useGrouping: true,
   *        minimumFractionDigits: 0,
   *        maximumFractionDigits: 2
   *      }
   *
   *      {
   *        style: "percent",
   *        useGrouping: true
   *      }
   *
   *      {
   *        style: "currency",
   *        currency: "EUR",
   *        currencyDisplay: "symbol"
   *      }
   */
  accessor numberFormatOptions: Intl.NumberFormatOptions | undefined;
  /**
   * Too many values? If true then it displays a message below the list. Only required if uniqueValues is provided.
   *
   * @default false
   */
  accessor partialUniqueValues: boolean | undefined;
  /** Lists of selected values */
  accessor selectedValues: (number | string)[] | undefined;
  /**
   * If true, displays the filter option based on the number of fields.
   *
   * @default 10
   */
  accessor showFilterLength: number;
  /** Sort by default setting */
  accessor sortBy: "count" | "name" | "selected" | undefined;
  /**
   * List of all unique values. If not provided component will get the unique values from the layer.
   * An empty list would mean that there are no unique values for this field on the layer. The component renders nothing then.
   */
  accessor uniqueValues: UniqueValueCountInfo[] | undefined;
  /** MapView instance, required if uniqueValues is not provided and/or to display dates in the correct timezone */
  accessor view: __esri.MapView | __esri.SceneView | undefined;
  /** Optional, specify visualization source other than the layer itself. */
  accessor visualizationSource: VisualizationSource | undefined;
  /**
   * Get all unique values.
   * E.g. to be used to limit how often these unique values need to be requested from the layer.
   */
  getUniqueValues(): Promise<{
      uniqueValues: UniqueValueCountInfo[];
      partialUniqueValues: boolean;
  } | undefined>;
  /** Sets focus on component */
  setFocus(): Promise<void>;
  /** Emitted if selection has changed */
  readonly arcgisChange: import("@arcgis/lumina").TargetedEvent<this, (number | string)[]>;
  /** Emitted once the component is loaded. Useful when no uniqueValues were passed in. */
  readonly arcgisLoad: import("@arcgis/lumina").TargetedEvent<this, void>;
  /** Emitted if the sort order has changed */
  readonly arcgisSortByChange: import("@arcgis/lumina").TargetedEvent<this, string | undefined>;
  readonly "@eventTypes": {
    arcgisChange: ArcgisUniqueValuesList["arcgisChange"]["detail"];
    arcgisLoad: ArcgisUniqueValuesList["arcgisLoad"]["detail"];
    arcgisSortByChange: ArcgisUniqueValuesList["arcgisSortByChange"]["detail"];
  };
}