/**
 * A function that queries for unique values from a field in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html).
 *
 * > [!WARNING]
 * >
 * > **Known Limitations**
 * >
 * > [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) must have the `supportsRenderer` and `supportsLayerQuery` capabilities enabled unless a predefined [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-smartMapping-statistics-types.html#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/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) method.
 * > You cannot generate unique values using SQL expressions for client-side [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html)
 * > in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html).
 *
 * @since 4.4
 */
import type { UniqueValuesResult, UniqueValuesParams } from "./types.js";

/**
 * Returns an object containing an array of unique values queried from a given field
 * (or values returned from an expression) in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) along with the total count of features that
 * belong to the given category.
 *
 * @param parameters - See the table below for details of each parameter.
 * @returns Returns a promise that resolves to [UniqueValuesResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-smartMapping-statistics-types.html#UniqueValuesResult).
 * @example
 * let layer = new FeatureLayer({
 *   portalItem: { id: "5ce5374a461e45bab714b43ffedf151d" }
 * });
 *
 * uniqueValues({
 *   layer: layer,
 *   field: "Candidate"
 * }).then(function(response){
 *   // prints each unique value and the count of features containing that value
 *   let infos = response.uniqueValueInfos;
 *   infos.forEach(function(info){
 *     console.log("CANDIDATE: ", info.value, " # OF CAMPAIGN STOPS: ", info.count);
 *   });
 * });
 */
export default function uniqueValues(parameters: UniqueValuesParams): Promise<UniqueValuesResult>;