/**
 * This object contains helper methods for generating data-driven visualizations with continuous
 * color or class breaks based on a field value or expression from features in a [Layer](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/).
 * The methods in this module generate renderer or visual variable objects that may be applied directly to a supported layer. The
 * renderers specify how features should be visualized based on data values and colors compatible with the view's background.
 *
 * > [!WARNING]
 * >
 * > **Known Limitations**
 * >
 * > [SceneLayers](https://developers.arcgis.com/javascript/latest/references/core/layers/SceneLayer/) must have the `supportsRenderer` and `supportsLayerQuery` capabilities enabled unless a predefined [statistics](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/statistics/types/#SummaryStatisticsResult) object is provided to the `statistics` parameter of the method. To check a SceneLayer's capabilities, use the [SceneLayer.getFieldUsageInfo()](https://developers.arcgis.com/javascript/latest/references/core/layers/SceneLayer/#getFieldUsageInfo) method.
 * > You cannot generate renderers and visual variables using SQL expressions for client-side [FeatureLayers](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/)
 * > in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
 *
 * @since 4.2
 * @see [Styles and data visualization](https://developers.arcgis.com/javascript/latest/visualization/)
 */
import type Basemap from "../../Basemap.js";
import type PointCloudLayer from "../../layers/PointCloudLayer.js";
import type FeatureFilter from "../../layers/support/FeatureFilter.js";
import type ClassBreaksRenderer from "../../renderers/ClassBreaksRenderer.js";
import type PointCloudRGBRenderer from "../../renderers/PointCloudRGBRenderer.js";
import type PointCloudStretchRenderer from "../../renderers/PointCloudStretchRenderer.js";
import type AuthoringInfo from "../../renderers/support/AuthoringInfo.js";
import type ColorVariable from "../../renderers/visualVariables/ColorVariable.js";
import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js";
import type { AbortOptions } from "../../core/promiseUtils.js";
import type { DateProperties } from "../../intl/date.js";
import type { ClassificationMethod, NormalizationType, VisualVariableLegendOptions as IVisualVariableLegendOptions } from "../../renderers/types.js";
import type { StandardDeviationInterval, RendererLegendTitleOption } from "../../renderers/support/types.js";
import type { SupportedLayer, SmartMappingTimeUnit } from "../types.js";
import type { ClassBreaksResult, SummaryStatisticsResult } from "../statistics/types.js";
import type { FeatureLikeLayerOrAdapter } from "../support/adapters/types.js";
import type { BasemapTheme, ColorScheme } from "../symbology/types.js";

/**
 * This method generates a color visual variable
 * with default stops that are optimally chosen based on the statistics
 * queried for the indicated field or expression and colors determined by the view's background.
 *
 * There are two different ways this method may be called. The most common case is by
 * providing a `layer`, `view`, `field`, and `theme`. This is the scenario where
 * the statistics of the data aren't well known and the user doesn't know what colors
 * to use. You can optionally use a `valueExpression` instead of a field to visualize
 * features based on a numeric value returned from a script executed at runtime.
 *
 * The other options are provided for convenience for more involved custom visualization authoring
 * applications. For example, if you already generated statistics in another operation, you
 * can pass the object in the `statistics` parameter to avoid making an extra call to the server.
 * You can also provide a `colorScheme` if you don't want one picked for you. In this case the `view` and
 * `theme` options would be ignored.
 *
 * @param parameters - Input parameters for generating a color visual variable based on data
 * returned from a given field or expression.
 * @returns Resolves to an instance of [VisualVariableResult](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/renderers/color/#VisualVariableResult).
 * @example
 * let layer = new FeatureLayer({
 *   url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/counties_politics_poverty/FeatureServer/0"
 * });
 *
 * // visualization based on field and normalization field
 * let colorParams = {
 *   layer: layer,
 *   view: view,
 *   field: "POP_POVERTY",
 *   normalizationField: "TOTPOP_CY",
 *   theme: "above-and-below"
 * };
 *
 * // when the promise resolves, apply the visual variable to the renderer
 * colorRendererCreator.createVisualVariable(colorParams)
 *   .then(function(response){
 *     let renderer = layer.renderer.clone();
 *     renderer.visualVariables = [ response.visualVariable ];
 *     layer.renderer = renderer;
 *   });
 * @example
 * let layer = new FeatureLayer({
 *   url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/counties_politics_poverty/FeatureServer/0"
 * });
 *
 * // visualization based off Arcade expression
 * let colorParams = {
 *   layer: layer,
 *   view: view,
 *   valueExpression: "($feature.POP_POVERTY / $feature.TOTPOP_CY) * 100",
 *   sqlWhere: "TOTPOP_CY > 0",
 *   legendOptions: {
 *     title: "% of people living in poverty"
 *   }
 * };
 *
 * // when the promise resolves, apply the visual variable to the renderer
 * colorRendererCreator.createVisualVariable(colorParams)
 *   .then(function(response){
 *     let renderer = layer.renderer.clone();
 *     renderer.visualVariables = [ response.visualVariable ];
 *     layer.renderer = renderer;
 *   });
 */
export function createVisualVariable(parameters: VisualVariableParameters): Promise<VisualVariableResult>;

/**
 * Generates a [Renderer](https://developers.arcgis.com/javascript/latest/references/core/renderers/Renderer/) that may be applied directly to the
 * layer used to call this method. The
 * renderer contains a continuous color visual variable that maps optimal colors based on the view's background
 * to specific stop values based on queried statistics from the indicated field or expression.
 *
 * In most cases you will provide a `layer`, `view`, `field`, and `theme` to generate this renderer.
 * This is a scenario in which
 * the statistics of the data aren't well known and the user doesn't know what colors
 * to use in the visualization. You can also use a `valueExpression` instead of a `field` to visualize
 * features based on a value returned from a script executed at runtime.
 *
 * The other options are provided for convenience for more involved custom visualization authoring
 * applications. For example, if you already generated statistics in another operation, you
 * can pass the statistics object to the `statistics` parameter to avoid making an extra call to the server.
 *
 * @param parameters - Input parameters for generating a continuous color visualization based on data
 * returned from a given field or expression.
 * @returns Resolves to an instance of [ContinuousRendererResult](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/renderers/color/#ContinuousRendererResult).
 * @example
 * let layer = new FeatureLayer({
 *   url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/counties_politics_poverty/FeatureServer/0"
 * });
 *
 * // visualization based on field and normalization field
 * let colorParams = {
 *   layer: layer,
 *   view: view,
 *   field: "POP_POVERTY",
 *   normalizationField: "TOTPOP_CY",
 *   theme: "above-and-below"
 * };
 *
 * // when the promise resolves, apply the renderer to the layer
 * colorRendererCreator.createContinuousRenderer(colorParams)
 *   .then(function(response){
 *     layer.renderer = response.renderer;
 *   });
 * @example
 * let layer = new FeatureLayer({
 *   url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/counties_politics_poverty/FeatureServer/0"
 * });
 *
 * // visualization based off Arcade expression
 * let colorParams = {
 *   layer: layer,
 *   valueExpression: "($feature.POP_POVERTY / $feature.TOTPOP_CY) * 100",
 *   view: view,
 *   sqlWhere: "TOTPOP_CY > 0",
 *   legendOptions: {
 *     title: "% of people living in poverty"
 *   }
 * };
 *
 * // when the promise resolves, apply the renderer to the layer
 * colorRendererCreator.createContinuousRenderer(colorParams)
 *   .then(function(response){
 *     layer.renderer = response.renderer;
 *   });
 * @example
 * // visualization based off time series definition
 * const colorParams = {
 *   layer,
 *   dataSeriesName: "ts0",
 *   view,
 * };
 *
 * const { renderer } = await colorRendererCreator.createContinuousRenderer(colorParams);
 * layer.renderer = renderer;
 */
export function createContinuousRenderer(parameters: ContinuousRendererParameters): Promise<ContinuousRendererResult>;

/**
 * Generates a [ClassBreaksRenderer](https://developers.arcgis.com/javascript/latest/references/core/renderers/ClassBreaksRenderer/) that may be applied directly to the
 * layer used to call this method. The resulting renderer defines the symbol color of each feature
 * based on the value of the given `field` value. A default color scheme is determined based on the view's background.
 * Depending on the `classificationMethod`, class breaks (or data ranges) are generated based on the statistics of the data.
 * Each feature is assigned a color based on the class break in which the value of the `field` falls.
 *
 * In most cases you will provide a `layer`, `view`, `field`, and `classificationMethod` to generate this renderer.
 * This is a scenario in which
 * the statistics of the data aren't well known and the user doesn't know what colors
 * to use in the visualization. You can also use a `valueExpression` instead of a `field` to visualize
 * features based on a value returned from a script executed at runtime.
 *
 * The other options are provided for convenience for more involved custom visualization authoring
 * applications.
 *
 * @param parameters - Input parameters for generating a classed color visualization based on data
 * returned from a given field or expression.
 * @returns Resolves to an instance of [ClassBreaksRendererResult](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/renderers/color/#ClassBreaksRendererResult).
 * @since 4.6
 * @example
 * let layer = new FeatureLayer({
 *   url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/counties_politics_poverty/FeatureServer/0"
 * });
 *
 * // visualization based on field and normalization field
 * let colorParams = {
 *   layer: layer,
 *   view: view,
 *   field: "POP_POVERTY",
 *   normalizationField: "TOTPOP_CY",
 *   classificationMethod: "quantile",
 *   numClasses: 4
 * };
 *
 * // when the promise resolves, apply the renderer to the layer
 * colorRendererCreator.createClassBreaksRenderer(colorParams)
 *   .then(function(response){
 *     layer.renderer = response.renderer;
 *   });
 * @example
 * let layer = new FeatureLayer({
 *   url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/counties_politics_poverty/FeatureServer/0"
 * });
 *
 * // visualization based off Arcade expression
 * let colorParams = {
 *   layer: layer,
 *   valueExpression: "($feature.POP_POVERTY / $feature.TOTPOP_CY) * 100",
 *   view: view,
 *   sqlWhere: "TOTPOP_CY > 0",
 *   legendOptions: {
 *     title: "% of people living in poverty"
 *   }
 * };
 *
 * // when the promise resolves, apply the renderer to the layer
 * colorRendererCreator.createClassBreaksRenderer(colorParams)
 *   .then(function(response){
 *     layer.renderer = response.renderer;
 *   });
 * @example
 * // visualization based off time series definition
 * const colorParams = {
 *   layer,
 *   dataSeriesName: "ts0",
 *   view,
 *   classificationMethod: "equal-interval",
 *   numClasses: 4
 * };
 *
 * const { renderer } = await colorRendererCreator.createClassBreaksRenderer(colorParams);
 * layer.renderer = renderer;
 */
export function createClassBreaksRenderer(parameters: ClassBreaksRendererParameters): Promise<ClassBreaksRendererResult>;

/**
 * Generates a [PointCloudRGBRenderer](https://developers.arcgis.com/javascript/latest/references/core/renderers/PointCloudRGBRenderer/) based on the `RGB` field of a given
 * [PointCloudLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/PointCloudLayer/). This method simplifies the
 * experience of creating a [PointCloudRGBRenderer](https://developers.arcgis.com/javascript/latest/references/core/renderers/PointCloudRGBRenderer/) manually. All that's required is
 * a layer instance. You can optionally set the size and density
 * of the points to suit the needs of the desired visualization.
 *
 * @param parameters - Input parameters for generating a true color visualization based on the `RGB`
 *   field of the input layer.
 * @returns Resolves to an object containing the renderer to set on the input layer. See
 *   [PCTrueColorRendererResult](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/renderers/color/#PCTrueColorRendererResult) for more details.
 * @since 4.5
 * @example
 * let layer = new PointCloudLayer({
 *   url: "https://tiles.arcgis.com/tiles/V6ZHFr6zdgNZuVG0/arcgis/rest/services/BARNEGAT_BAY_LiDAR_UTM/SceneServer"
 * });
 *
 * // generates an RGB renderer using default values for the given layer.
 * colorRendererCreator.createPCTrueColorRenderer({
 *   layer: layer
 * }).then(function(response){
 *   layer.renderer = response.renderer;
 * });
 * @example
 * let layer = new PointCloudLayer({
 *   url: "https://tiles.arcgis.com/tiles/V6ZHFr6zdgNZuVG0/arcgis/rest/services/BARNEGAT_BAY_LiDAR_UTM/SceneServer"
 * });
 *
 * // sets options for configuring size of points
 * let parameters = {
 *   layer: layer,
 *   density: 25,  // points per square inch
 *   size: "100%"  // minimizes gap between points
 * };
 *
 * // when the promise resolves, apply the renderer to the layer
 * colorRendererCreator.createPCTrueColorRenderer(parameters)
 *   .then(function(response){
 *     layer.renderer = response.renderer;
 *   });
 */
export function createPCTrueColorRenderer(parameters: PCTrueColorRendererParameters): Promise<PCTrueColorRendererResult>;

/**
 * Generates a [PointCloudStretchRenderer](https://developers.arcgis.com/javascript/latest/references/core/renderers/PointCloudStretchRenderer/) with a color scheme best-suited
 * for the view's background based on statistics returned from a given field of a
 * [PointCloudLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/PointCloudLayer/). All that's required is
 * a layer instance, field name, and basemap id. You can optionally set the size and density
 * of the points to suit the needs of the desired visualization.
 *
 * @param parameters - Input parameters for generating a renderer based on the given
 *   field of the input layer.
 * @returns Resolves to an object containing the renderer to set on the input layer. See
 *   [PCContinuousRendererResult](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/renderers/color/#PCContinuousRendererResult) for more details.
 * @since 4.5
 * @example
 * let layer = new PointCloudLayer({
 *   url: "https://tiles.arcgis.com/tiles/V6ZHFr6zdgNZuVG0/arcgis/rest/services/BARNEGAT_BAY_LiDAR_UTM/SceneServer"
 * });
 *
 * let parameters = {
 *   layer: layer,
 *   field: "INTENSITY",
 *   basemap: "satellite"
 * };
 *
 * // when the promise resolves, apply the renderer to the layer
 * colorRendererCreator.createPCContinuousRenderer(parameters)
 *   .then(function(response){
 *     layer.renderer = response.renderer;
 *   });
 */
export function createPCContinuousRenderer(parameters: PCContinuousRendererParameters): Promise<PCContinuousRendererResult>;

/**
 * Generates a continuous color [Renderer](https://developers.arcgis.com/javascript/latest/references/core/renderers/Renderer/) representing the age of features based
 * on one or more fields. The age of a feature is calculated based on a given `startTime` and `endTime`, one of which
 * must be a date field in the input `layer`. This method generates an Arcade expression and calculates statistics on the
 * output of the expression to accomplish this. The resulting
 * renderer contains a continuous color visual variable that maps optimal colors based on the view's background
 * to data values based on the resulting statistics of the expression.
 *
 * You are required to provide a `layer`, `view`, `startTime`, and `endTime` to generate this renderer. Optionally, you can
 * set a `unit` and a `theme` for the visualization. Other options are provided for convenience for more involved custom visualization authoring
 * applications. For example, if you already generated statistics in another operation, you
 * can pass the statistics object to the `statistics` parameter to avoid making an extra call to the server.
 *
 * @param parameters - Input parameters for generating a continuous color visualization of age for time data
 * returned from start and/or end date field(s).
 * @returns Resolves to an instance of [AgeRendererResult](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/renderers/color/#AgeRendererResult).
 * @since 4.9
 * @example
 * const layer = new FeatureLayer({
 *   url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/311_Service_Requests_from_2015_50k/FeatureServer/0"
 * });
 *
 * // visualization based age of incidents closed passed their due date
 * // or the number of days an incident was overdue at the time of closure.
 *
 * const ageParams = {
 *   layer: layer,
 *   view: view,
 *   startTime: "Due_Date",
 *   endTime: "Closed_Date",
 *   unit: "days",
 *   theme: "above-and-below"
 * };
 *
 * // when the promise resolves, apply the renderer to the layer
 * colorRendererCreator.createAgeRenderer(ageParams)
 *   .then(function(response){
 *     layer.renderer = response.renderer;
 *   });
 * @example
 * const layer = new CSVLayer({
 *   url: "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.csv",
 *   copyright: "USGS Earthquakes"
 * });
 *
 * // visualization based off current age of incident
 * const ageParams = {
 *   layer: layer,
 *   view: view,
 *   startTime: "time",
 *   endTime: Date.now(),
 *   legendOptions: {
 *     title: "Time since earthquake struck"
 *   }
 * };
 *
 * // when the promise resolves, apply the renderer to the layer
 * colorRendererCreator.createAgeRenderer(ageParams)
 *   .then(function(response){
 *     layer.renderer = response.renderer;
 *   });
 */
export function createAgeRenderer(parameters: AgeRendererParameters): Promise<AgeRendererResult>;

export interface VisualVariableParametersBase extends AbortOptions {
  /**
   * The layer for which the visualization
   * is generated. When a client-side layer type is provided, attribute and spatial statistics are calculated
   * only from features in the view's extent. When a server-side layer type is provided, the statistics
   * are calculated from the entire layer, unless a `valueExpression` is provided.
   */
  layer: SupportedLayer;
  /**
   * The name of the field whose data will be queried for statistics and used for
   * the basis of the data-driven visualization.
   *   This property is ignored if a `valueExpression` is used.
   */
  field?: string | null;
  /**
   * The name of the field to normalize the values of the given
   * `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data
   * so all features are visualized with minimal bias due to area differences or count variation. This option is
   * commonly used when visualizing densities.
   */
  normalizationField?: string | null;
  /**
   * In authoring apps,
   * the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one
   * based on a `theme` and the view's background.
   */
  colorScheme?: ColorScheme | null;
  /**
   * Determines which values will be emphasized in the continuous ramp and the map.
   * Possible values are listed below.
   * | Value | Description | Example |
   * | ----- | ----------- | ------- |
   * | high-to-low | High values are emphasized with strong colors. The data values above one standard deviation from the mean are assigned the strongest color. Data values below one standard deviation from the mean are assigned the weakest color. All other values are interpolated. | ![high-to-low](https://developers.arcgis.com/javascript/latest/assets/references/core/renderers/sm-high-to-low.avif) |
   * | above | High values are emphasized with strong colors. The max data value is assigned the strongest color. The middle or average data value is assigned the weakest color. All other values are interpolated. | ![above](https://developers.arcgis.com/javascript/latest/assets/references/core/renderers/sm-above.avif) |
   * | below | Low values are emphasized with strong colors. The min data value is assigned the strongest color. The middle or average data value is assigned the weakest color. All other values are interpolated. | ![below](https://developers.arcgis.com/javascript/latest/assets/references/core/renderers/sm-below.avif) |
   * | above-and-below | Values centered on a meaningful data value (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. All other values are interpolated. | ![above-and-below](https://developers.arcgis.com/javascript/latest/assets/references/core/renderers/sm-above-and-below.avif) |
   * | centered-on | Values centered on a meaningful data value  (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. All other values are interpolated. | ![centered-on](https://developers.arcgis.com/javascript/latest/assets/references/core/renderers/sm-centered-on.avif) |
   * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. All other values are interpolated. | ![extremes](https://developers.arcgis.com/javascript/latest/assets/references/core/renderers/sm-extremes.avif) |
   *
   * @default high-to-low
   */
  theme?: ColorTheme | null;
  /**
   * An [Arcade](https://developers.arcgis.com/javascript/latest/arcade/) expression following
   * the specification defined by the [Arcade Visualization Profile](https://developers.arcgis.com/javascript/latest/arcade/#visualization).
   * Expressions may reference field values using the `$feature` profile variable and must return
   * a number. This property overrides the `field` property and therefore is used instead of an input `field` value.
   * The `view` parameter is required if specifying a `valueExpression`. When using a `valueExpression`, client-side
   * statistics are calculated based on the features in the view's extent. To generate statistics for the entire layer,
   * set an equivalent `sqlExpression`.
   */
  valueExpression?: string | null;
  /**
   * Text describing the value returned from the `valueExpression`.
   * This is used by the [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/).
   */
  valueExpressionTitle?: string | null;
  /**
   * Name of a configured entry in [DataSeriesLayer.dataSeriesInfos](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/DataSeriesLayer/#dataSeriesInfos).
   * When provided, the renderer creator reads the Arcade expression from the matching
   * data series info and uses mapped fields to calculate statistics. Set this as an alternative to `field`
   * or `valueExpression` when working with a layer that has data series configured.
   * If all three of `field`, `valueExpression`, and `dataSeriesName` are provided, then the
   * precedence is `dataSeriesName` over `valueExpression` over `field`.
   */
  dataSeriesName?: string | null;
  /**
   * A SQL expression evaluating to a number. When provided, statistics are
   *   queried from the server for the entire layer. Only use this parameter when generating a renderer based on
   *   an equivalent `valueExpression`. This parameter is ignored for client-side layer types.
   */
  sqlExpression?: string | null;
  /**
   * A SQL where clause used to filter features for the statistics query. For example,
   * this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance
   * visualization.
   */
  sqlWhere?: string | null;
  /**
   * When defined, only features included in the filter
   *   are considered in the attribute and spatial statistics calculations when determining the final renderer.
   *   This is useful when a lot of variation exists in the data
   *   that could result in undesired data ranges. A common use case would be to set a filter that only
   *   includes features in the current extent of the view where the data is most likely to be viewed. Currently, only
   *   geometry filters with an `intersects` spatial relationship are supported. All other filter types (including `where`) are ignored.
   *
   * @since 4.31
   */
  filter?: FeatureFilter | null;
  /**
   * Provides options for setting a title to a field when an expression is provided
   * instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/).
   */
  legendOptions?: IVisualVariableLegendOptions | null;
  /**
   * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/statistics/summaryStatistics/) function.
   * If statistics for the field have already been generated, then pass the object here to avoid making a second statistics
   * query to the server.
   */
  statistics?: SummaryStatisticsResult | null;
  /**
   * A custom minimum value set by the user. Use this in conjunction with `maxValue` to
   * generate statistics between lower and upper bounds. This will be the lowest stop in the returned color visual variable.
   */
  minValue?: number | null;
  /**
   * A custom maximum value set by the user. Use this in conjunction with `minValue` to
   * generate statistics between lower and upper bounds. This will be the uppermost stop in the returned color visual variable.
   */
  maxValue?: number | null;
  /**
   * Indicates whether the generated renderer is for a binning or clustering visualization.
   *   If `true`, then the input field(s) in this method should refer to [aggregate fields](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AggregateField/) defined in the `featureReduction` property of the layer.
   */
  forBinning?: boolean | null;
  /**
   * The view where the input layer is rendered. This method
   *   inspects the view's background (i.e. basemap, web map background, or view container) to determine optimal
   *   colors for the output renderer. This parameter should always be set in practice, but if not provided this method
   *   will assume the generated renderer will display on a light background. This parameter is required when creating
   *   renderers using a `valueExpression` or for renderers intended for display in a SceneView.
   */
  view?: MapViewOrSceneView | null;
}

export interface VisualVariableResultBase {
  /**
   * A color visual
   * variable configured based on the statistics of the data and the background of the view.
   */
  visualVariable: ColorVariable;
  /**
   * The color scheme
   * used by the visual variable.
   */
  colorScheme: ColorScheme;
  /**
   * Indicates whether default values are used in the absence of sufficient
   * data and/or statistics from the layer. Default values are typically used when all features have the same field
   * value or no value at all.
   */
  defaultValuesUsed: boolean;
  /** Basic statistics returned from a query to the service for data from the given field name or expression. */
  statistics: SummaryStatisticsResult;
  /** The ID of the basemap used to determine the optimal fill color of the features. */
  basemapId?: string | null;
  /** Indicates whether the average color of the input view's basemap is `light` or `dark`. */
  basemapTheme?: BasemapTheme | null;
}

export interface VisualVariableParameters extends VisualVariableParametersBase {
  /**
   * The layer for which the visualization
   * is generated. When a client-side layer type is provided, attribute and spatial statistics are calculated
   * only from features in the view's extent. When a server-side layer type is provided, the statistics
   * are calculated from the entire layer, unless a `valueExpression` is provided.
   */
  layer: FeatureLikeLayerOrAdapter;
  /**
   * Indicates if the size units of the symbols will be in meters. This should be `true`
   * when generating visualizations with 3D volumetric symbology, except for layers
   * with a `mesh` geometry type. A `view` must be provided if this property is set to `true`.
   */
  worldScale?: boolean;
}

/**
 * The result object of the [createVisualVariable()](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/renderers/color/#createVisualVariable) method. See the table
 * below for details of each property.
 */
export interface VisualVariableResult extends VisualVariableResultBase {
  /** Authoring information related to the creation of the visual variable. This includes information related to UI inputs from sliders and selected themes. */
  authoringInfo: AuthoringInfo;
}

export type SymbolType = "2d" | "3d-flat" | "3d-volumetric" | "3d-volumetric-uniform";

export type ColorMixModeType = "tint" | "replace" | "multiply";

export interface ContinuousRendererParameters extends VisualVariableParametersBase {
  /**
   * The layer for which the visualization
   * is generated. When a client-side layer type is provided, attribute and spatial statistics are calculated
   * only from features in the view's extent. When a server-side layer type is provided, the statistics
   * are calculated from the entire layer, unless a `valueExpression` is provided.
   */
  layer: FeatureLikeLayerOrAdapter;
  /**
   * The type of symbol to generate. This depends on the view
   * in which you are working and the desired visualization. This parameter does not need to be specified for layers
   * with a `mesh` geometry type. Possible values are described below.
   *
   * | Value | Description |
   * | ----- | ----------- |
   * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleMarkerSymbol/), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleLineSymbol/), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleFillSymbol/). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/). |
   * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/IconSymbol3DLayer/), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3DLayer/), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/FillSymbol3DLayer/). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). |
   * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/ObjectSymbol3DLayer/), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/PathSymbol3DLayer/), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/ExtrudeSymbol3DLayer/). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). A SceneView instance must be provided to the `view` parameter if this option is used. |
   * | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) and the symbol should be sizes uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. |
   *
   * @default 2d
   */
  symbolType?: SymbolType | null;
  /**
   * Enables the `defaultSymbol` on the renderer and assigns it to features
   * with no value and features that do not fall within the configured data range.
   *
   * @default true
   */
  defaultSymbolEnabled?: boolean | null;
  /**
   * **This option only applies to generating renderers for mesh SceneLayers**.
   * Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in
   * [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/references/core/symbols/FillSymbol3DLayer/#material) for more context.
   * See the table below for possible values.
   *
   * Value | Description
   * ------|------------
   * tint | Applies the symbol `color` to the unsaturated geometry/texture color.
   * replace | Removes the geometry/texture color and applies the symbol `color`.
   * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same.
   *
   * @default replace
   */
  colorMixMode?: ColorMixModeType | null;
  /**
   * For polygon layers only. Indicates whether the
   *   polygon outline width should vary based on view scale. When set, a valid [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/)
   *   instance must be provided in the `view` parameter. This option is not supported for 3D
   *   [SceneViews](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
   *
   * @default false
   */
  outlineOptimizationEnabled?: boolean | null;
  /**
   * For point and polyline layers only. Indicates whether
   *   symbol sizes should vary based on view scale. When set, a valid [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/)
   *   instance must be provided in the `view` parameter. This option is not supported for 3D
   *   [SceneViews](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
   *
   * @default false
   */
  sizeOptimizationEnabled?: boolean | null;
}

/**
 * The result object of the [createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/renderers/color/#createContinuousRenderer) method. See the table
 * below for details of each property.
 */
export interface ContinuousRendererResult extends VisualVariableResultBase {
  /**
   * The renderer object configured to best
   * match the view's background and the spread of the data. Set this on a layer's `renderer` property
   *   (or the `featureReduction.renderer` property to update its visualization.
   */
  renderer: ClassBreaksRenderer;
}

export interface ClassBreaksRendererParameters extends AbortOptions {
  /**
   * The layer for which the visualization
   * is generated. When a client-side layer type is provided, attribute and spatial statistics are calculated
   * only from features in the view's extent. When a server-side layer type is provided, the statistics
   * are calculated from the entire layer, unless a `valueExpression` is provided.
   */
  layer: FeatureLikeLayerOrAdapter;
  /**
   * The name of the field whose data will be queried for statistics and classified.
   *   This property is ignored if a `valueExpression` is used.
   */
  field?: string | null;
  /**
   * An [Arcade](https://developers.arcgis.com/javascript/latest/arcade/) expression following
   * the specification defined by the [Arcade Visualization Profile](https://developers.arcgis.com/javascript/latest/arcade/#visualization).
   * Expressions may reference field values using the `$feature` profile variable and must return
   * a number. This property overrides the `field` property and therefore is used instead of an input `field` value.
   * The `view` parameter is required if specifying a `valueExpression`. When using a `valueExpression`, client-side
   * statistics are calculated based on the features in the view's extent.
   */
  valueExpression?: string | null;
  /**
   * Text describing the value returned from the `valueExpression`.
   * This is used by the [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/).
   */
  valueExpressionTitle?: string | null;
  /**
   * Name of a configured entry in [DataSeriesLayer.dataSeriesInfos](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/DataSeriesLayer/#dataSeriesInfos).
   * When provided, the renderer creator reads the Arcade expression from the matching
   * data series info and uses mapped fields to calculate statistics. Set this as an alternative to `field`
   * or `valueExpression` when working with a layer that has data series configured.
   * If all three of `field`, `valueExpression`, and `dataSeriesName` are provided, then the
   * precedence is `dataSeriesName` over `valueExpression` over `field`.
   */
  dataSeriesName?: string | null;
  /**
   * Indicates how the data is normalized.
   * The data value obtained from the `field`
   * is normalized in one of the following ways before it is compared with the class breaks. See the
   * table below for a list of possible values.
   *
   * Possible Value | Description
   * ---------------|------------
   * field | Divides the `field` value by the value of `normalizationField`. This value is set by default if the `normalizationField` is provided.
   * log | Computes the base 10 logarithm of the data value. This can be a useful approach for some data distributions because it reduces the influence of very large data values.
   * percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use `normalizationTotal` to define the total value by which to normalize. This value is set by default if the `normalizationTotal` is provided.
   *
   * With the exception of `log` normalization, data normalization creates a ratio by dividing two values.
   * When comparing attribute values between features, normalization minimizes the effect of varying
   * map areas and the number of observations. For example, dividing the 18 to 30 year old population by the
   * area of a polygon feature yields a density value that can be compared evenly with other features,
   * regardless of their size.
   */
  normalizationType?: NormalizationType | null;
  /**
   * The name of the field to normalize the values of the given
   * `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data
   * so all features are visualized with minimal bias due to area differences or count variation. This option is
   * commonly used when visualizing densities.
   */
  normalizationField?: string | null;
  /** When `normalizationType` is `percent-of-total`, this property contains the total of all data values. */
  normalizationTotal?: number | null;
  /**
   * The classification method used for generating breaks.
   * See the table below for a list of possible values.
   *
   * Possible Value | Description
   * ---------------|------------
   * equal-interval | Divides the range of attribute values into equal-sized subranges. For example, if you specify three classes for a field whose values range from 0 to 300, this method will create three classes with ranges of 0–100, 101–200, and 201–300. Equal interval is best applied to familiar data ranges, such as percentages and temperature. This method emphasizes the amount of an attribute value relative to other values. For example, it could show if a store is part of the group of stores that make up the top one-third of all sales.
   * natural-breaks | Groups similar values that maximize the differences between classes. Features are divided into classes whose boundaries are set where there are relatively big differences in the data values. Natural breaks are data-specific classifications and not useful for comparing multiple maps built from different underlying information.
   * quantile | Assigns the same number of data values to each class. This is well suited to linearly distributed data. Because features are grouped in equal numbers in each class, the resulting map can often be misleading. Similar features can potentially be placed in adjacent classes, or features with widely different values can be put in the same class. You can minimize this distortion by increasing the number of classes.
   * standard-deviation | Creates class breaks with equal value ranges that are a proportion of the standard deviation. This is usually done at intervals of one, one-half, one-third, or one-fourth standard deviations from the mean.
   *
   * @default equal-interval
   */
  classificationMethod?: ClassificationMethod | null;
  /**
   * If a `standard-deviation` classification method is used, then this indicates the interval by which to generate class breaks.
   *
   * **Possible Values:** 1 | 0.5 | 0.33 | 0.25
   *
   * @default 1
   */
  standardDeviationInterval?: StandardDeviationInterval | null;
  /**
   * The number of class breaks to generate. This is ignored if a `standard-deviation` classification method is specified.
   *
   * @default 5
   */
  numClasses?: number | null;
  /**
   * In authoring apps,
   * the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one
   * based on the view's background.
   */
  colorScheme?: ColorScheme | null;
  /**
   * Provides options for setting a title to describe a field
   * instead of using the field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/).
   */
  legendOptions?: RendererLegendTitleOption | null;
  /**
   * The type of symbol to generate. This depends on the view
   * in which you are working and the desired visualization. This parameter does not need to be specified for layers
   * with a `mesh` geometry type. Possible values are described below.
   *
   * | Value | Description |
   * | ----- | ----------- |
   * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleMarkerSymbol/), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleLineSymbol/), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleFillSymbol/). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/). |
   * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/IconSymbol3DLayer/), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3DLayer/), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/FillSymbol3DLayer/). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). |
   * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/ObjectSymbol3DLayer/), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/PathSymbol3DLayer/), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/ExtrudeSymbol3DLayer/). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). A SceneView instance must be provided to the `view` parameter if this option is used. |
   * | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) and the symbol should be sizes uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. |
   *
   * @default 2d
   */
  symbolType?: SymbolType | null;
  /**
   * Enables the `defaultSymbol` on the renderer and assigns it to features
   * with no value and features that do not fall within the configured data range.
   *
   * @default true
   */
  defaultSymbolEnabled?: boolean | null;
  /**
   * **This option only applies to generating renderers for mesh SceneLayers**.
   * Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in
   * [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/references/core/symbols/FillSymbol3DLayer/#material) for more context.
   * See the table below for possible values.
   *
   * Value | Description
   * ------|------------
   * tint | Applies the symbol `color` to the unsaturated geometry/texture color.
   * replace | Removes the geometry/texture color and applies the symbol `color`.
   * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same.
   *
   * @default replace
   */
  colorMixMode?: ColorMixModeType | null;
  /**
   * For polygon layers only. Indicates whether the
   *   polygon outline width should vary based on view scale. When set, a valid [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/)
   *   instance must be provided in the `view` parameter. This option is not supported for 3D
   *   [SceneViews](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
   *
   * @default false
   */
  outlineOptimizationEnabled?: boolean | null;
  /**
   * A minimum value set by the user. Use this in conjunction with `maxValue` to
   * generate class breaks between lower and upper bounds. This will be the lower bound of the lowest class break.
   */
  minValue?: number | null;
  /**
   * A maximum value set by the user. Use this in conjunction with `minValue` to
   * generate class breaks between lower and upper bounds. This will be the upper bound of the highest class break.
   */
  maxValue?: number | null;
  /**
   * Indicates whether the generated renderer is for a binning or clustering visualization.
   *   If `true`, then the input field(s) in this method should refer to [aggregate fields](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AggregateField/) defined in the `featureReduction` property of the layer.
   */
  forBinning?: boolean | null;
  /**
   * When defined, only features included in the filter
   *   are considered in the attribute and spatial statistics calculations when determining the final renderer.
   *   This is useful when a lot of variation exists in the data
   *   that could result in undesired data ranges. A common use case would be to set a filter that only
   *   includes features in the current extent of the view where the data is most likely to be viewed. Currently, only
   *   geometry filters with an `intersects` spatial relationship are supported. All other filter types (including `where`) are ignored.
   *
   * @since 4.31
   */
  filter?: FeatureFilter | null;
  /**
   * The view where the input layer is rendered. This method
   *   inspects the view's background (i.e. basemap, web map background, or view container) to determine optimal
   *   colors for the output renderer. This parameter should always be set in practice, but if not provided this method
   *   will assume the generated renderer will display on a light background. This parameter is required when creating
   *   renderers using a `valueExpression` or for renderers intended for display in a SceneView.
   */
  view?: MapViewOrSceneView | null;
}

/**
 * The result object of the [createClassBreaksRenderer()](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/renderers/color/#createClassBreaksRenderer) method. See the table
 * below for details of each property.
 *
 * @since 4.6
 */
export interface ClassBreaksRendererResult {
  /**
   * The renderer object configured to best
   * match the background of the view and the spread of the data. Set this on a layer's `renderer` property to
   * update its visualization.
   */
  renderer: ClassBreaksRenderer;
  /**
   * The color scheme
   * used for the class breaks.
   */
  colorScheme: ColorScheme;
  /**
   * Indicates whether default values are used in the absence of sufficient
   * data and/or statistics from the layer. Default values are typically used when all features have the same field
   * value or no value at all.
   */
  defaultValuesUsed: boolean;
  /** The ID of the basemap used to determine the optimal fill color of the features. */
  basemapId?: string | null;
  /** Indicates whether the average color of the input view's basemap is `light` or `dark`. */
  basemapTheme?: BasemapTheme | null;
  /**
   * This object
   * describes class breaks generated from data in a layer for a given field with a specified classification method.
   */
  classBreaksResult: ClassBreaksResult;
}

export interface PCRendererParameters extends AbortOptions {
  /**
   * The layer for which the visualization
   *   is generated.
   */
  layer?: PointCloudLayer | null;
  /**
   * The size of each point expressed as a percentage. This value will determine point sizes
   * scaled based on the given `density` of points. When the value is `100%`, the size
   * of each point is set so that it minimizes the number of gaps between neighboring points. Any value above `100%`
   * will allow for points to overlap neighboring points scaled to the given value. Values below `100%` scale point
   * sizes smaller so there appear to be more gaps between points.
   *
   * @default 100%
   */
  size?: string | null;
  /**
   * The number of points per inch in the view.
   *
   * @default 25
   */
  density?: number | null;
}

export interface PCTrueColorRendererParameters extends PCRendererParameters {}

/**
 * The result object of the [createPCTrueColorRenderer()](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/renderers/color/#createPCTrueColorRenderer) method. See the table
 * below for details of each property.
 */
export interface PCTrueColorRendererResult {
  /**
   * The renderer object configured to
   * represent the true color of each point in the point cloud. This gives the PointCloudLayer a realistic visualization
   * of how it looks in the real world. Set this object on the input layer's `renderer` property to
   * update its visualization.
   */
  renderer: PointCloudRGBRenderer;
}

export interface PCContinuousRendererParameters extends PCRendererParameters {
  /**
   * The name of the field whose data will be queried for statistics and used for
   * the basis of the data-driven visualization. The only field names used for this renderer type are
   * `elevation` and `intensity`.
   */
  field?: string | null;
  /**
   * The [named string](https://developers.arcgis.com/javascript/latest/references/core/Map/#basemap) or basemap object of the Esri basemap
   * that will be paired with the output visualization.
   *
   * @default gray
   */
  basemap?: Basemap | string | null;
  /**
   * In authoring apps,
   * the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one
   * based on the `basemap`.
   */
  colorScheme?: ColorScheme | null;
  /**
   * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/statistics/summaryStatistics/) function.
   * If statistics for the field have already been generated, then pass the stats object here to avoid making a second statistics
   */
  statistics?: SummaryStatisticsResult | null;
}

export interface PCContinuousResultBase {
  /**
   * The color scheme
   * used by the renderer.
   */
  colorScheme: ColorScheme;
  /**
   * Indicates whether default values are used in the absence of sufficient
   * data and/or statistics from the layer. Default values are typically used when all features have the same field
   * value or no value at all.
   */
  defaultValuesUsed: boolean;
  /** Basic statistics returned from a query to the service for data from the given field name. */
  statistics: SummaryStatisticsResult;
  /** The ID of the basemap used to determine the optimal color scheme for the output renderer. */
  basemapId?: string | null;
  /** Indicates whether the average color of the input view's basemap is `light` or `dark`. */
  basemapTheme?: BasemapTheme | null;
}

/**
 * The result object of the [createPCContinuousRenderer()](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/renderers/color/#createPCContinuousRenderer) method. See the table
 * below for details of each property.
 */
export interface PCContinuousRendererResult extends PCContinuousResultBase {
  /**
   * The renderer object configured to best
   * match the background of the view and the spread of the data. Set this object on the input layer's `renderer` property to
   * update its visualization.
   */
  renderer: PointCloudStretchRenderer;
}

export interface AgeRendererParameters extends AbortOptions {
  /**
   * The layer
   *   for which the visualization is generated. When a client-side layer type is provided, attribute and spatial statistics are calculated
   * only from features in the view's extent. When a server-side layer type is provided, the statistics
   * are calculated from the entire layer.
   */
  layer: FeatureLikeLayerOrAdapter;
  /**
   * The name of the field, or a date value representing the start time in the
   *   age calculation. If a date value is specified, then the `endTime` parameter must reference a Date field in the layer.
   */
  startTime: DateProperties;
  /**
   * The name of the field, or a date value representing the end time in the
   *   age calculation. If a date value is specified, then the `startTime` parameter must reference a Date field in the layer.
   */
  endTime: DateProperties;
  /**
   * The view where the input layer is rendered. This method
   *   inspects the view's background (i.e. basemap, web map background, or view container) to determine optimal
   *   colors for the output renderer.
   */
  view: MapViewOrSceneView;
  /**
   * The time unit used to calculate the difference between `endTime` and `startTime`. If a unit
   *   is not specified, then a suggested unit is determined based on the spread and distribution of the data.
   */
  unit?: SmartMappingTimeUnit | null;
  /**
   * In authoring apps,
   *   the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one
   *   based on a `theme` and the view's background.
   */
  colorScheme?: ColorScheme | null;
  /**
   * Determines which values will be emphasized in the continuous ramp and the map.
   * Possible values are listed below.
   * | Value | Description | Example |
   * | ----- | ----------- | ------- |
   * | high-to-low | High values are emphasized with strong colors. The data values above one standard deviation from the mean are assigned the strongest color. Data values below one standard deviation from the mean are assigned the weakest color. All other values are interpolated. | ![high-to-low](https://developers.arcgis.com/javascript/latest/assets/references/core/renderers/sm-high-to-low.avif) |
   * | above | High values are emphasized with strong colors. The max data value is assigned the strongest color. The middle or average data value is assigned the weakest color. All other values are interpolated. | ![above](https://developers.arcgis.com/javascript/latest/assets/references/core/renderers/sm-above.avif) |
   * | below | Low values are emphasized with strong colors. The min data value is assigned the strongest color. The middle or average data value is assigned the weakest color. All other values are interpolated. | ![below](https://developers.arcgis.com/javascript/latest/assets/references/core/renderers/sm-below.avif) |
   * | above-and-below | Values centered on a meaningful data value (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. All other values are interpolated. | ![above-and-below](https://developers.arcgis.com/javascript/latest/assets/references/core/renderers/sm-above-and-below.avif) |
   * | centered-on | Values centered on a meaningful data value  (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. All other values are interpolated. | ![centered-on](https://developers.arcgis.com/javascript/latest/assets/references/core/renderers/sm-centered-on.avif) |
   * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. All other values are interpolated. | ![extremes](https://developers.arcgis.com/javascript/latest/assets/references/core/renderers/sm-extremes.avif) |
   *
   * @default high-to-low
   */
  theme?: ColorTheme | null;
  /**
   * Provides options for modifying [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/) properties describing
   *   the visualization.
   */
  legendOptions?: IVisualVariableLegendOptions | null;
  /**
   * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/statistics/summaryStatistics/) function.
   *   The `createAgeRenderer()` method generates an Arcade expression and executes a statistics query against the layer for the result of the expression.
   *   If statistics for the expression have already been generated, then pass the object here to avoid making a second statistics
   *   query.
   */
  statistics?: SummaryStatisticsResult | null;
  /**
   * The type of symbol to generate. This depends on the view
   *   in which you are working and the desired visualization. This parameter does not need to be specified for layers
   *   with a `mesh` geometry type. Possible values are described below.
   *
   *   | Value | Description |
   *   | ----- | ----------- |
   *   | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleMarkerSymbol/), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleLineSymbol/), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleFillSymbol/). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/). |
   *   | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/IconSymbol3DLayer/), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/LineSymbol3DLayer/), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/FillSymbol3DLayer/). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). |
   *   | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/ObjectSymbol3DLayer/), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/PathSymbol3DLayer/), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/ExtrudeSymbol3DLayer/). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). A SceneView instance must be provided to the `view` parameter if this option is used. |
   *   | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) and the symbol should be sizes uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. |
   *
   * @default 2d
   */
  symbolType?: SymbolType | null;
  /**
   * Enables the `defaultSymbol` on the renderer and assigns it to features
   *   with no value.
   *
   * @default true
   */
  defaultSymbolEnabled?: boolean | null;
  /**
   * **This option only applies to generating renderers for mesh SceneLayers**.
   *   Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in
   *   [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/references/core/symbols/FillSymbol3DLayer/#material) for more context.
   *   See the table below for possible values.
   *
   *   Value | Description
   *   ------|------------
   *   tint | Applies the symbol `color` to the desaturated geometry/texture color.
   *   replace | Removes the geometry/texture color and applies the symbol `color`.
   *   multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same.
   *
   * @default replace
   */
  colorMixMode?: ColorMixModeType | null;
  /**
   * For polygon layers only. Indicates whether the
   *   polygon outline width should vary based on view scale. When set, a valid [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/)
   *   instance must be provided in the `view` parameter. This option is not supported for 3D
   *   [SceneViews](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
   *
   * @default false
   */
  outlineOptimizationEnabled?: boolean | null;
  /**
   * For point and polyline layers only. Indicates whether
   *   symbol sizes should vary based on view scale. When set, a valid [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/)
   *   instance must be provided in the `view` parameter. This option is not supported for 3D
   *   [SceneViews](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
   *
   * @default false
   */
  sizeOptimizationEnabled?: boolean | null;
  /**
   * Sets a minimum age for the visualization. Even if data exists below this value,
   *   only statistics will be calculated for values between the `minValue` and `maxValue`. Added at version 4.15.
   */
  minValue?: number | null;
  /**
   * Sets a maximum age for the visualization. Even if data exists above this value,
   *   only statistics will be calculated for values between the `minValue` and `maxValue`. Added at version 4.15.
   */
  maxValue?: number | null;
  /**
   * When defined, only features included in the filter
   *   are considered in the attribute and spatial statistics calculations when determining the final renderer.
   *   This is useful when a lot of variation exists in the data
   *   that could result in undesired data ranges. A common use case would be to set a filter that only
   *   includes features in the current extent of the view where the data is most likely to be viewed. Currently, only
   *   geometry filters with an `intersects` spatial relationship are supported. All other filter types (including `where`) are ignored.
   *
   * @since 4.31
   */
  filter?: FeatureFilter | null;
}

export type ColorTheme = "high-to-low" | "above-and-below" | "centered-on" | "extremes" | "above" | "below";

/**
 * The result object of the [createAgeRenderer()](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/renderers/color/#createAgeRenderer) method. See the table
 * below for details of each property.
 *
 * @since 4.9
 */
export interface AgeRendererResult extends ContinuousRendererResult {
  /** The time unit used to represent age in the output `renderer`. */
  unit?: SmartMappingTimeUnit | null;
}