/**
 * This object contains helper methods for generating a [UniqueValueRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html) for raster layers (i.e. [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html), [ImageryTileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryTileLayer.html)).
 *
 * The [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-smartMapping-raster-renderers-uniqueValue.html#createRenderer) method in this module generates a renderer that may be applied directly to the input layer.
 *
 * @since 4.20
 */
import type UniqueValueRenderer from "../../../renderers/UniqueValueRenderer.js";
import type AlgorithmicColorRamp from "../../../rest/support/AlgorithmicColorRamp.js";
import type MultipartColorRamp from "../../../rest/support/MultipartColorRamp.js";
import type { Color as ColorJSON } from "../../../portal/jsonTypes.js";
import type { RasterRendererParameters } from "./types.js";

export interface RasterUniqueValuesParameters extends RasterRendererParameters {
  /**
   * A preferred class field name used for
   *   calculating unique values.
   */
  classFieldName?: string;
  /**
   * The colors to apply to each unique value. This must be a
   *   two-dimensional array where each item of the first dimension is an array of 3-4 numbers representing
   *   RGB or RGBA values of each unique value. This overrides `colorRamp`.
   */
  colors?: ColorJSON[];
  /** The color ramp to apply to the renderer. */
  colorRamp?: MultipartColorRamp | AlgorithmicColorRamp;
}

/**
 * The result object of the [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-smartMapping-raster-renderers-uniqueValue.html#createRenderer) method. See the table
 * below for details of each property.
 */
export interface RasterUniqueValuesResult {
  /**
   * The UniqueValueRenderer renderer to apply
   *   to the input layer.
   */
  renderer: UniqueValueRenderer;
  /** The class field name from which the unique value infos were generated. */
  classFieldName?: string | null;
}

/**
 * Generates a [UniqueValueRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html) to render thematic imagery.
 *
 * @param parameters - Input parameters for generating a unique value visualization.
 * @returns Resolves
 *   to an object containing a unique value renderer that can be set on the input layer.
 */
export function createRenderer(parameters: RasterUniqueValuesParameters): Promise<RasterUniqueValuesResult>;