import type Color from "../../../Color.js";
import type { JSONSupport } from "../../../core/JSONSupport.js";
import type { ColorLike } from "../../../Color.js";

export interface ColorSizeStopProperties extends Partial<Pick<ColorSizeStop, "label" | "value">> {
  /** The [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) used to render features with the given [value](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorSizeStop.html#value). */
  color?: ColorLike;
  /**
   * The size value in points used to render features with the given [value](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorSizeStop.html#value).
   * This value may also be autocast from a string in points or pixels.
   */
  size?: number | string;
}

/**
 * Defines how to data values should be represented in the [ColorSizeSlider](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-smartMapping-ColorSizeSlider.html) with an associated color and size.
 *
 * @since 4.12
 * @see [ColorSizeSlider.stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-smartMapping-ColorSizeSlider.html#stops)
 */
export default class ColorSizeStop extends JSONSupport {
  constructor(properties?: ColorSizeStopProperties);
  /** The [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) used to render features with the given [value](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorSizeStop.html#value). */
  get color(): Color;
  set color(value: ColorLike);
  /** A string value used to label the stop in the [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-legend/). */
  accessor label: string | null | undefined;
  /**
   * The size value in points used to render features with the given [value](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorSizeStop.html#value).
   * This value may also be autocast from a string in points or pixels.
   */
  get size(): number;
  set size(value: number | string);
  /** Specifies the data value to map to the given [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorSizeStop.html#size) and [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorSizeStop.html#color). */
  accessor value: number;
  /**
   * Creates a deep clone of the ColorSizeStop.
   *
   * @returns A deep clone of the size
   *   stop that invoked this method.
   * @example
   * // Creates a deep clone of the visual variable
   * const stops = renderer.visualVariables[0].stops.map(function(stop){
   *   return stop.clone();
   * });
   */
  clone(): ColorSizeStop;
}