import type Point from "../../geometry/Point.js";
import type SpatialReference from "../../geometry/SpatialReference.js";
import type { JSONSupport } from "../../core/JSONSupport.js";
import type { LocationType } from "../types.js";
import type { PointProperties } from "../../geometry/Point.js";
import type { SpatialReferenceProperties } from "../../geometry/SpatialReference.js";

/** @since 5.0 */
export interface LocationToAddressParametersProperties extends Partial<Pick<LocationToAddressParameters, "locationType">> {
  /**
   * The point at which to search for the closest address. The location
   * should be in the same spatial reference as that of the geocode service.
   *
   * @since 5.0
   * @see [ArcGIS REST APIs | reverseGeocode | location](https://developers.arcgis.com/rest/geocode/reverse-geocode/#location)
   */
  location?: PointProperties | null;
  /**
   * The spatial reference of the output geometries. If not specified, the output geometries are in the spatial reference of
   * the input geometries when performing a reverse geocode and in the default spatial reference returned by the service if
   * finding locations by address.
   *
   * @since 5.0
   * @see [ArcGIS REST APIs | reverseGeocode | outSR](https://developers.arcgis.com/rest/geocode/reverse-geocode/#outsr)
   */
  outSpatialReference?: SpatialReferenceProperties | null;
}

/** @since 5.0 */
export default class LocationToAddressParameters extends JSONSupport {
  constructor(properties?: LocationToAddressParametersProperties);
  /**
   * The point at which to search for the closest address. The location
   * should be in the same spatial reference as that of the geocode service.
   *
   * @since 5.0
   * @see [ArcGIS REST APIs | reverseGeocode | location](https://developers.arcgis.com/rest/geocode/reverse-geocode/#location)
   */
  get location(): Point | null | undefined;
  set location(value: PointProperties | null | undefined);
  /**
   * Specifies whether the output geometry of `"point-address"` and `"sub-address"` matches should be the rooftop point
   * or street entrance location. Valid values are `"rooftop"` and `"street"`. The default value is `"rooftop". See [World Geocoding Service](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm).
   *
   * @since 5.0
   * @see [ArcGIS REST APIs | Category filtering](https://developers.arcgis.com/rest/geocode/category-filtering/)
   * @see [ArcGIS REST APIs | reverseGeocode | locationType](https://developers.arcgis.com/rest/geocode/reverse-geocode/#locationtype)
   */
  accessor locationType: LocationType | null | undefined;
  /**
   * The spatial reference of the output geometries. If not specified, the output geometries are in the spatial reference of
   * the input geometries when performing a reverse geocode and in the default spatial reference returned by the service if
   * finding locations by address.
   *
   * @since 5.0
   * @see [ArcGIS REST APIs | reverseGeocode | outSR](https://developers.arcgis.com/rest/geocode/reverse-geocode/#outsr)
   */
  get outSpatialReference(): SpatialReference | null;
  set outSpatialReference(value: SpatialReferenceProperties | null);
}