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

export interface LocationToAddressParametersProperties extends JSONSupportMixinProperties, 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.
   *
   * @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.
   *
   * @see [ArcGIS REST APIs | reverseGeocode | outSR](https://developers.arcgis.com/rest/geocode/reverse-geocode/#outsr)
   */
  outSpatialReference?: SpatialReferenceProperties | null;
}

export default abstract class LocationToAddressParameters extends JSONSupport {
  /**
   * 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.
   *
   * @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).
   *
   * @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.
   *
   * @see [ArcGIS REST APIs | reverseGeocode | outSR](https://developers.arcgis.com/rest/geocode/reverse-geocode/#outsr)
   */
  get outSpatialReference(): SpatialReference | null;
  set outSpatialReference(value: SpatialReferenceProperties | null);
}