
export interface CollectionChangeEvent<T = any> {
  /** An array of items added to the collection using either [Collection#add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add) or [Collection#addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#addMany). */
  added: T[];
  /** An array of items that moved in the collection using [Collection#reorder()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#reorder). */
  moved: T[];
  /**
   * An array of items removed from the collection using either [Collection#remove()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#remove),
   * [Collection#removeMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#removeMany), [Collection#removeAt()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#removeAt), or [Collection#removeAll()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#removeAll).
   */
  removed: T[];
}

/**
 * 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. */
  x: number;
  /** The y coordinate in pixels. */
  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).
 * @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;