/**
 * Point on the screen (x, y) in the DOM/CSS coordinate space. In this space, the origin is at the top/left corner and
 * device pixel ratio scale is not taken into account (i.e. 1px in this space may make up multiple physical pixels).
 *
 * @since 4.11
 * @example const sourcePoint = { x: 80, y: 1732 }
 */
export interface ScreenPoint {
  /**
   * The x coordinate in pixels.
   *
   * @since 5.0
   */
  x: number;
  /**
   * The y coordinate in pixels.
   *
   * @since 5.0
   */
  y: number;
}

/**
 * A custom log interceptor function.
 *
 * @param level - The level of the message.
 * @param module - The module from which the log message originated.
 * @param args - Arguments of any type to be logged.
 * @returns Return true to indicate the log message has been handled and should no longer be processed
 * (neither by other interceptors nor by the default handler which logs messages to the console).
 * @since 5.0
 * @example
 * // Only show error messages, not warnings nor info messages
 * esriConfig.log.level = "error";
 *
 * esriConfig.log.interceptors.push(function(level, module, ...args) {
 *   // Send all messages to a REST end-point
 *   request(loggingUrl, {
 *     method: "post",
 *     body: {
 *             level: level,
 *             module: module,
 *             details: JSON.stringify(args)
 *           }
 *   });
 *
 *   // Return false so that the default log handler still writes log messages to the console
 *   return false;
 * });
 */
export type LogInterceptor = (level: "error" | "warn" | "info", module: string, ...args: any[]) => boolean;