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

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

/** @internal */
export interface OperationOptions {
  /** The tool to create ("point", "polygon", "circle", or "rectangle"). Defaults to "rectangle" if not specified. */
  createTool?: "point" | "polygon" | "circle" | "rectangle";
  /** The operation mode ("click", "freehand", or "hybrid"). */
  mode?: "click" | "freehand" | "hybrid";
  /** An optional, unique name used to distinguish an operation. */
  name?: "rectangle" | "lasso" | "point" | string;
  /** Whether the final selection should update the current selection manager. */
  persistSelection?: boolean;
  /** Whether the selected graphics should include geometries. Defaults to true if not specified. */
  returnGeometry?: boolean;
  /** Whether to select on complete. Defaults to true if not specified. */
  selectOnComplete?: boolean;
  /** The type of selection operation ("add", "remove" or "replace"). Defaults to "add" if not specified. */
  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
 */
export function createSelectionOperation(view: MapViewOrSceneView, sources: any[] | null | undefined, options?: OperationOptions): any;