import type { ClonableMixin } from "../../core/Clonable.js";
import type { JSONSupport } from "../../core/JSONSupport.js";

export interface AttributeBinsGroupingProperties extends Partial<Pick<AttributeBinsGrouping, "alias" | "type" | "value" | "valueType">> {}

/**
 * Specifies the expected data type of the output from the `stackBy` or `splitBy` parameters.
 * This property is required when the [type](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsGrouping/#type) is set to `expression`.
 */
export type AttributeBinsGroupingType = "integer" | "string";

/**
 * AttributeBinsGrouping is a class that defines the `stackBy` or `splitBy` parameter in the [AttributeBinsQuery.binParameters](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsQuery/#binParameters).
 *
 * @since 4.32
 * @see [AttributeBinsQuery](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsQuery/)
 * @see [Sample - Attribute Bins Query](https://developers.arcgis.com/javascript/latest/sample-code/query-attribute-bins/)
 */
export default class AttributeBinsGrouping extends AttributeBinsGroupingSuperclass {
  constructor(properties?: AttributeBinsGroupingProperties);
  /**
   * The alias is the name assigned to the attribute bin. It is required when the type is set to "expression" to provide a custom label
   * for the bin based on the expression.
   */
  accessor alias: string | null | undefined;
  /**
   * The type specifies how bin series will be created, indicating whether the bin grouping is based on a field, or an expression.
   * When the type is set to `expression`, the [valueType](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsGrouping/#valueType) property is required.
   */
  accessor type: "field" | "expression";
  /** The name of the field or an expression used when the bins are split or stacked. */
  accessor value: string;
  /**
   * Specifies the expected data type of the output from the `stackBy` or `splitBy` parameters.
   * This property is required when the [type](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsGrouping/#type) is set to `expression`.
   */
  valueType?: AttributeBinsGroupingType | null;
}
declare const AttributeBinsGroupingSuperclass: typeof JSONSupport & typeof ClonableMixin