import type { EventNames } from "../core/Evented.js";
import type { ResourceHandle } from "../core/Handles.js";
import type { SceneViewEventTypes } from "./types.js";

export interface Viewport2DMixinProperties {}

export type Viewport2DMixinEvents = SceneViewEventTypes;

/** Mixin that adds event handling capabilities to [View2D](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View2D.html) and [VideoView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-VideoView.html). */
export abstract class Viewport2DMixin {
  constructor(...args: any[]);
  /**
   * @deprecated
   * Do not directly reference this property.
   * Use EventNames and EventTypes helpers from \@arcgis/core/Evented
   */
  "@eventTypes": Viewport2DMixinEvents;
  /**
   * Registers an event handler on the instance. Call this method to hook an
   * event with a listener. See the [Events summary table](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-Viewport2DMixin.html#events-summary)
   * for a list of listened events.
   *
   * @param type - The name of the event or events to listen for.
   * @param listener - The function to call when the event is fired, if modifiers were specified.
   * @returns Returns an event handler with a `remove()` method that
   * can be called to stop listening for the event.
   *
   * Property | Type | Description
   * ------------|--------|----------------
   * remove | Function | When called, removes the listener from the event.
   * @example
   * view.on("click", function(event){
   *   // event is the event handle returned after the event fires.
   *   console.log(event.mapPoint);
   * });
   *
   * // Fires `pointer-move` event when user clicks on "Shift"
   * // key and moves the pointer on the view.
   * view.on("pointer-move", ["Shift"], function(event){
   *   let point = view2d.toMap({x: event.x, y: event.y});
   *   bufferPoint(point);
   * });
   */
  on<Type extends EventNames<this>>(type: Type, listener: (event: this["@eventTypes"][Type]) => void): ResourceHandle;
  /**
   * @param type - The name of the event or events to listen for.
   * @param modifiers - Additional modifier keys to filter events.
   * Please see [Key Values](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values)
   * for possible values. All the standard key values are supported.
   * Alternatively, if no modifiers are required, the function will call when the event fires.
   *
   * The following events don't support modifier keys: `blur`, `focus`, `layerview-create`, `layerview-destroy`,
   * `resize`.
   * @param listener - The function to call when the event is fired, if modifiers were specified.
   * @returns Returns an event handler with a `remove()` method that
   * can be called to stop listening for the event.
   *
   * Property | Type | Description
   * ------------|--------|----------------
   * remove | Function | When called, removes the listener from the event.
   */
  on<Type extends EventNames<this>>(type: Type, modifiers: string[], listener: (event: this["@eventTypes"][Type]) => void): ResourceHandle;
}