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

export interface OffsetParametersProperties extends Partial<Pick<OffsetParameters, "bevelRatio" | "geometries" | "offsetDistance" | "offsetHow" | "offsetUnit">> {}

/**
 * Sets the offset distance, type and other parameters for the [offset()](https://developers.arcgis.com/javascript/latest/references/core/rest/geometryService/#offset) operation.
 *
 * @since 4.0
 * @see [offset()](https://developers.arcgis.com/javascript/latest/references/core/rest/geometryService/#offset)
 * @see [ArcGIS REST API - Offset](https://developers.arcgis.com/rest/services-reference/offset.htm)
 */
export default class OffsetParameters extends JSONSupport {
  constructor(properties?: OffsetParametersProperties);
  /**
   * The `bevelRatio` is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located
   * before it is beveled. When mitered is specified, the value set for `bevelRatio` is ignored and `10` is used internally. If beveled is
   * specified, `1.1` will be used if no value is set for bevelRatio. The bevelRatio is ignored when `rounded` is specified.
   */
  accessor bevelRatio: number | null | undefined;
  /** The array of geometries to be offset. */
  accessor geometries: GeometryUnion[] | null | undefined;
  /**
   * Specifies the planar distance for constructing an offset based on the input geometries. If the `offsetDistance` parameter is positive,
   * the constructed offset will be on the right side of the curve. Left side offsets are constructed with negative values.
   */
  accessor offsetDistance: number | null | undefined;
  /**
   * Options that determine how the ends intersect. Set to one of the following options:
   *
   * Possible Value | Description
   * ---------------|-------------
   * bevelled | Squares off the corner after a given ratio distance.
   * mitered | Attempts to allow extended offsets to naturally intersect. If the intersection occurs too far from a corner, the corner will be beveled off at a fixed distance.
   * rounded | Rounds the corner between extended offsets.
   */
  accessor offsetHow: "bevelled" | "mitered" | "rounded" | null | undefined;
  /** The offset distance unit. For a list of valid units see [esriSRUnitType constants](https://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esriGeometry/esriSRUnitType.htm) or [esriSRUnit2Type constants](https://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esriGeometry/esriSRUnit2Type.htm). */
  accessor offsetUnit: GeometryOperationLengthUnit | null | undefined;
}