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

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

/** @since 5.0 */
export interface GoToParameters3D {}

/**
 * The parameters for the [MapView's goTo()](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#goTo) method and the [SceneView's goTo()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#goTo) method.
 *
 * @since 5.0
 */
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/references/core/views/MapView/) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) 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/references/core/views/MapView/#goTo)
 *   or [SceneView's goTo()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#goTo) method.
 * @since 5.0
 */
export type GoToOverride = (view: MapViewOrSceneView, goToParameters: GoToParameters) => Promise<void>;

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