import type { JSONSupport } from "../../core/JSONSupport.js";
import type { GeometryUnion } from "../../geometry/types.js";
import type { DeviationUnit } from "./types.js";

export interface GeneralizeParametersProperties extends Partial<Pick<GeneralizeParameters, "deviationUnit" | "geometries" | "maxDeviation">> {}

/**
 * Sets the geometries, maximum deviation and units for the
 * [generalize()](https://developers.arcgis.com/javascript/latest/references/core/rest/geometryService/#generalize) operation.
 *
 * @since 4.20
 * @see [generalize()](https://developers.arcgis.com/javascript/latest/references/core/rest/geometryService/#generalize)
 * @see [ArcGIS REST API - Generalize](https://developers.arcgis.com/rest/services-reference/generalize.htm)
 */
export default class GeneralizeParameters extends JSONSupport {
  constructor(properties?: GeneralizeParametersProperties);
  /**
   * The maximum deviation unit. If the unit is not specified, units are derived from the
   * spatial reference.
   * Use one of the possible values listed below or any of the
   * [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/reference/com/esri/arcgisruntime/geometry/LinearUnitId.html#CENTIMETERS).
   */
  accessor deviationUnit: DeviationUnit | null | undefined;
  /**
   * The array of input geometries to generalize. All geometries in this array must be of the same
   * geometry type (e.g. `esriGeometryPolyline` or `esriGeometryPolygon`).
   */
  accessor geometries: GeometryUnion[] | null | undefined;
  /** The maximum deviation for constructing a generalized geometry based on the input geometries. */
  accessor maxDeviation: number | null | undefined;
}