/**
 * Sketch utilities for the WebEditor application.
 *
 * @internal
 */
import type SketchViewModel from "../../widgets/Sketch/SketchViewModel.js";
import type { AbortOptions } from "../../core/promiseUtils.js";

/**
 * Options used to show the tooltip.
 *
 * @internal
 */
export interface ShowTooltipAndFocusFieldOptions extends AbortOptions {
  /** Whether the tooltip should be hidden when it loses focus. */
  hideOnBlur?: boolean;
  /** Callback function that is called when the tooltip is closed. */
  onClose?: () => void;
  /** Callback function that is called when the tooltip is opened. */
  onOpen?: () => void;
  /** The position where the tooltip should be shown. */
  position?: [
      number,
      number
  ];
}

/**
 * Shows a tooltip and focuses on a specific field.
 *
 * @param sketchViewModel - The sketch view model.
 * @param fieldName - The name of the field to focus on in the tooltip.
 * @param options - Options used to show the tooltip.
 * @returns A promise that resolves when the tooltip is closed.
 * @internal
 */
export function showTooltipAndFocusField(sketchViewModel: SketchViewModel, fieldName: "area" | "direction" | "distance" | "elevation" | "orientation" | "radius" | "rotation" | "scale" | "size" | "totalLength" | "x" | "y" | "coordinates", options?: ShowTooltipAndFocusFieldOptions): Promise<void>;

/**
 * Hides all the tooltip visible elements.
 *
 * @param sketchViewModel - The sketch view model.
 * @internal
 */
export function hideAllVisibleElements(sketchViewModel: SketchViewModel): void;