import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js";
import type { GoToOptions2D, GoToTarget2D } from "../../views/types.js";

export interface GoToParameters2D {
  /** Options defining the animation and duration of the navigation. */
  options?: GoToOptions2D;
  /** The target location/viewpoint/extent to animate to. */
  target: GoToTarget2D;
}

export interface GoToParameters3D {}

/** The parameters for the [MapView's goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) method and the [SceneView's goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) method. */
export type GoToParameters = GoToParameters2D
  & GoToParameters3D;

/**
 * The following properties define a `goTo` override function.
 *
 * @param view - A reference to the
 *   [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) where the navigation takes place.
 * @param goToParameters - The overriding target and optional
 *   parameters to pass to the [MapView's goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo)
 *   or [SceneView's goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) method.
 */
export type GoToOverride = (view: MapViewOrSceneView, goToParameters: GoToParameters) => Promise<void>;

/**
 * The heading level used for the HTML heading element.
 *
 * @see [Heading Elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements)
 */
export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;