/**
 * Object containing helper methods for getting optimal symbol schemes used
 * to create [dot density visualizations](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/renderers/dotDensity/).
 * The [getSchemes()](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/symbology/dotDensity/#getSchemes) returns color schemes best suited to the given basemap for this visualization style.
 *
 * @since 4.12
 */
import type Basemap from "../../Basemap.js";
import type { DotDensityScheme, DotDensitySchemes, BasemapTheme } from "./types.js";

/**
 * Returns a primary scheme and secondary schemes defining symbol properties for dot density-based
 * data-driven visualizations in a [Layer](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/). The `basemap` parameter determines the color of the
 * dots used to visualize each attribute. The `geometryType` determines which type of symbol to return.
 *
 * @param params - The function parameters.
 * @returns Returns an object containing
 *   the optimal type scheme to use for the given basemap; it also contains secondary schemes.
 * @example
 * // gets the primary scheme for the features of the given geometry type and basemap
 * const schemes = dotDensitySchemes.getSchemes({
 *   basemap: map.basemap,
 *   geometryType: featureLayer.geometryType
 * });
 *
 * // the best default scheme for the layer and basemap
 * const primaryScheme = schemes.primaryScheme;
 */
export function getSchemes(params: GetSchemesParameters): DotDensitySchemes | null | undefined;

/**
 * Returns a dot density scheme with the provided name.
 *
 * @param params - The function parameters.
 * @returns Returns the dot density scheme
 *   with the given name.
 * @since 4.12
 * @example
 * // Returns the Galaxy Berries scheme
 * let galaxyBerriesScheme = dotDensitySchemes.getSchemeByName({
 *   basemap: map.basemap,
 *   numColors: 3,
 *   name: "Galaxy Berries"
 * });
 */
export function getSchemeByName(params: GetSchemesByNameParameters): DotDensityScheme | null | undefined;

/**
 * Returns an array of dot density schemes with the provided tags. These schemes define symbol properties for
 * dot density visualizations in any layer that can be rendered with a [DotDensityRenderer](https://developers.arcgis.com/javascript/latest/references/core/renderers/DotDensityRenderer/).
 *
 * @param params - The function parameters.
 * @returns Returns an array of dot density schemes
 *   either including or excluding the provided tags.
 * @since 4.12
 * @example
 * // Returns all the red dot density schemes
 * let schemes = dotDensitySchemes.getSchemesByTag({
 *   basemap: map.basemap,
 *   numColors: 2,
 *   includedTags: [ "reds", "dot-density" ]
 * });
 */
export function getSchemesByTag(params: GetSchemesByTagParameters): DotDensityScheme[];

/**
 * Clones a dot density scheme object.
 *
 * @param scheme - The dot density scheme object to clone.
 * @returns Returns a clone of the given dot density scheme object.
 * @example
 * // clones the primary scheme returned from the getSchemes() method
 * const dotDensityScheme = primaryScheme.clone();
 */
export function cloneScheme(scheme: DotDensityScheme | null | undefined): DotDensityScheme | null | undefined;

export interface GetSchemesParameters {
  /** The number of colors to visualize. */
  numColors: number;
  /**
   * The Esri basemap to pair with the visualization. This
   *   value indicates the best symbol colors for visualizing features against the given basemap. If you have a
   *   non-Esri basemap (e.g. a VectorTileLayer basemap with a custom style) or no basemap at all, then use the `basemapTheme` parameter
   *   instead of this parameter.
   */
  basemap?: Basemap | string | null;
  /**
   * If you have a
   *   non-Esri basemap (e.g. a VectorTileLayer basemap with a custom style) or no basemap at all, use this parameter to indicate
   *   whether the background of the visualization is `light` or `dark`.
   */
  basemapTheme?: BasemapTheme | null;
}

export interface GetSchemesByNameParameters extends GetSchemesParameters {
  /** The name of the scheme to retrieve. */
  name: string;
}

export interface GetSchemesByTagParameters extends GetSchemesParameters {
  /**
   * When provided, only schemes containing all the matching tags will be returned.
   *
   * **Known Tags:** light | dark | reds | yellows | oranges | greens | blues | purples | pinks | browns | grays |
   * bright | subdued | deuteranopia | protanopia | tritanopia | grayscale | types | dot-density
   */
  includedTags?: string[] | null;
  /**
   * When provided, only schemes missing all the provided tags will be returned.
   *
   * **Known Tags:** light | dark | reds | yellows | oranges | greens | blues | purples | pinks | browns | grays |
   * bright | subdued | deuteranopia | protanopia | tritanopia | grayscale | types | dot-density
   */
  excludedTags?: string[] | null;
}