/**
 * Utilities for creating a SelectionOperation class instance.
 *
 * @internal
 * @internal
 */
import type { SelectableViewUnion } from "../../views/selection/types.js";

/**
 * @internal
 * @internal
 */
export type SelectionOperationType = "add" | "remove" | "replace";

/**
 * @internal
 * @internal
 */
export interface OperationOptions {
  /**
   * The tool to create ("point", "polygon", "circle", or "rectangle"). Defaults to "rectangle" if not specified.
   *
   * @internal
   */
  createTool?: "point" | "polygon" | "circle" | "rectangle";
  /**
   * The operation mode ("click", "freehand", or "hybrid").
   *
   * @internal
   */
  mode?: "click" | "freehand" | "hybrid";
  /**
   * An optional, unique name used to distinguish an operation.
   *
   * @internal
   */
  name?: "rectangle" | "lasso" | "point" | string;
  /**
   * Whether the final selection should update the current selection manager.
   *
   * @internal
   */
  persistSelection?: boolean;
  /**
   * Whether the selected graphics should include geometries. Defaults to true if not specified.
   *
   * @internal
   */
  returnGeometry?: boolean;
  /**
   * Whether to select on complete. Defaults to true if not specified.
   *
   * @internal
   */
  selectOnComplete?: boolean;
  /**
   * The type of selection operation ("add", "remove" or "replace"). Defaults to "add" if not specified.
   *
   * @internal
   */
  type?: SelectionOperationType;
}

/**
 * Factory method for creating a SelectionOperation instance.
 *
 * @param view - The view instance.
 * @param sources - An array of source layers.
 * @param options - Additional tool- and selection-related options for the SelectionOperation.
 * @returns The created SelectionOperation instance.
 * @internal
 * @internal
 */
export function createSelectionOperation(view: SelectableViewUnion, sources: any[] | null | undefined, options?: OperationOptions): any;