/// <reference types="@arcgis/core/interfaces.d.ts" />

/**
 * Function used to format labels. This function should be set to the
 * [labelFormatFunction](#labelFormatFunction) property. This function fires
 * every time a label is created or updated on the histogram.
 *
 * @param value - The value for the line on the data axis.
 * @return The formatted value of the label.
 */
export type HistogramLabelFormatFunction = (value: number) => string;

export type DataLine = {
  value: number;
  label?: nullish | number | string;
};

export type HistogramColorStops = HistogramClassedColorStop[] | HistogramContinuousColorStop[];

export type HistogramLayout = "horizontal" | "vertical";

export type HistogramContinuousColorStop = {
  color: HistogramColor;
  value: number;
};

export type HistogramClassedColorStop = {
  color?: HistogramColor;
  minValue: number;
  maxValue: number;
};

export type HistogramColor = number[] | string | {
    r?: number;
    g?: number;
    b?: number;
    a?: number;
};