import type Widget from "./Widget.js";
import type ZoomViewModel from "./Zoom/ZoomViewModel.js";
import type { Icon } from "@esri/calcite-components/components/calcite-icon";
import type { MapViewOrSceneView } from "../views/MapViewOrSceneView.js";
import type { WidgetProperties } from "./Widget.js";
import type { ZoomViewModelProperties } from "./Zoom/ZoomViewModel.js";

export interface ZoomProperties extends WidgetProperties, Partial<Pick<Zoom, "layout" | "view">> {
  /**
   * Icon which represents the widget. It is typically used when the widget is controlled by another
   * one (e.g. in the Expand widget).
   *
   * @default "magnifying-glass-plus"
   * @since 4.27
   * @see [Calcite Icon Search](https://developers.arcgis.com/calcite-design-system/icons/)
   * @see [Calcite Icon Search](https://developers.arcgis.com/calcite-design-system/icons/)
   */
  icon?: Icon["icon"] | null;
  /**
   * The widget's default label.
   *
   * @since 4.7
   */
  label?: string | null;
  /**
   * The view model for this widget. This is a class that contains all the logic
   * (properties and methods) that controls this widget's behavior. See the
   * [ZoomViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Zoom/ZoomViewModel/) class to access
   * all properties and methods on the widget.
   */
  viewModel?: ZoomViewModelProperties;
}

export type ZoomLayout = "vertical" | "horizontal";

/**
 * The Zoom widget allows users to zoom in/out within a view.
 *
 * An instance of the Zoom widget is available in every
 * [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) and [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) by default.
 * See [DefaultUI](https://developers.arcgis.com/javascript/latest/references/core/views/ui/DefaultUI/) for details on how to place the Zoom widget
 * in other parts of the view.
 *
 * @deprecated since version 4.32. Use the [Zoom component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-zoom/) instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/).
 * @since 4.0
 * @see [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/)
 * @see [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/)
 * @see [ZoomViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Zoom/ZoomViewModel/)
 * @see [DefaultUI](https://developers.arcgis.com/javascript/latest/references/core/views/ui/DefaultUI/)
 */
export default class Zoom extends Widget {
  constructor(properties?: ZoomProperties);
  /**
   * Icon which represents the widget. It is typically used when the widget is controlled by another
   * one (e.g. in the Expand widget).
   *
   * @default "magnifying-glass-plus"
   * @since 4.27
   * @see [Calcite Icon Search](https://developers.arcgis.com/calcite-design-system/icons/)
   * @see [Calcite Icon Search](https://developers.arcgis.com/calcite-design-system/icons/)
   */
  get icon(): Icon["icon"];
  set icon(value: Icon["icon"] | null | undefined);
  /**
   * The widget's default label.
   *
   * @since 4.7
   */
  get label(): string;
  set label(value: string | null | undefined);
  /**
   * Determines the layout/orientation of the Zoom widget.
   *
   * @default "vertical"
   * @since 4.5
   */
  accessor layout: ZoomLayout;
  /** 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/). Set this to link the widget to a specific view. */
  accessor view: MapViewOrSceneView | null | undefined;
  /**
   * The view model for this widget. This is a class that contains all the logic
   * (properties and methods) that controls this widget's behavior. See the
   * [ZoomViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Zoom/ZoomViewModel/) class to access
   * all properties and methods on the widget.
   */
  get viewModel(): ZoomViewModel;
  set viewModel(value: ZoomViewModelProperties);
  /** Zooms the view in by an LOD factor of 0.5. */
  zoomIn(): void;
  /** Zooms the view out by an LOD factor of 2. */
  zoomOut(): void;
}