import type PointCloudRenderer from "./PointCloudRenderer.js";
import type RendererLegendOptions from "./support/RendererLegendOptions.js";
import type ColorUniqueValueInfo from "./support/pointCloud/ColorUniqueValueInfo.js";
import type { PointCloudRendererProperties } from "./PointCloudRenderer.js";
import type { FieldTransformType } from "./support/pointCloud/types.js";
import type { ColorUniqueValueInfoProperties } from "./support/pointCloud/ColorUniqueValueInfo.js";
import type { RendererLegendOptionsProperties } from "./support/RendererLegendOptions.js";

export interface PointCloudUniqueValueRendererProperties extends PointCloudRendererProperties, Partial<Pick<PointCloudUniqueValueRenderer, "field" | "fieldTransformType">> {
  /**
   * Each element in the array is an object that matches a unique value
   * with a specific color. Features with equal values to those specified here
   * will be assigned the associated color. For example, you may choose to visualize
   * points representing low vegetation with a green color and points representing power
   * lines with a gray color. Each object has the following specification:
   */
  colorUniqueValueInfos?: ColorUniqueValueInfoProperties[] | null;
  /**
   * An object providing options for displaying the renderer in the Legend.
   *
   * @since 4.6
   * @example
   * renderer.legendOptions = {
   *   title: "Classification (high/low)",
   *   order: "descending-values",
   * };
   */
  legendOptions?: RendererLegendOptionsProperties | null;
}

/**
 * PointCloudUniqueValueRenderer allows you to colorize points in a
 * [PointCloudLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/PointCloudLayer/) based on an attribute value.
 * This is done by assigning unique colors to represent points with equal attribute values.
 * This renderer is used to visualize points of the same type, not interpolate
 * colors along a continuous ramp mapped to numbers.
 *
 * @since 4.2
 * @see [Sample - PointCloudLayer with renderer](https://developers.arcgis.com/javascript/latest/sample-code/layers-pointcloud/)
 */
export default class PointCloudUniqueValueRenderer extends PointCloudRenderer {
  constructor(properties?: PointCloudUniqueValueRendererProperties);
  /**
   * Each element in the array is an object that matches a unique value
   * with a specific color. Features with equal values to those specified here
   * will be assigned the associated color. For example, you may choose to visualize
   * points representing low vegetation with a green color and points representing power
   * lines with a gray color. Each object has the following specification:
   */
  get colorUniqueValueInfos(): ColorUniqueValueInfo[] | null | undefined;
  set colorUniqueValueInfos(value: ColorUniqueValueInfoProperties[] | null | undefined);
  /** The name of the field whose values are used to drive the visualization. */
  accessor field: string | null | undefined;
  /** A transform that is applied to the field value before evaluating the renderer. */
  accessor fieldTransformType: FieldTransformType | null | undefined;
  /**
   * An object providing options for displaying the renderer in the Legend.
   *
   * @since 4.6
   * @example
   * renderer.legendOptions = {
   *   title: "Classification (high/low)",
   *   order: "descending-values",
   * };
   */
  get legendOptions(): RendererLegendOptions | null | undefined;
  set legendOptions(value: RendererLegendOptionsProperties | null | undefined);
  /** The type of Renderer. */
  get type(): "point-cloud-unique-value";
  /**
   * Creates a deep clone of the renderer.
   *
   * @returns A deep clone
   * of the object that invoked this method.
   * @since 4.4
   * @example
   * // Creates a deep clone of the first layer's renderer
   * let renderer = view.map.layers.at(0).renderer.clone();
   */
  clone(): PointCloudUniqueValueRenderer;
}