import { PlotArea } from '../../../types'; import { TooltipPosition, TooltipMeasurement, TooltipPlacement } from './types'; export interface PositionerConfig { /** Offset from target point */ offset: { x: number; y: number; }; /** Preferred placement */ preferredPosition: TooltipPlacement; /** Keep within plot area */ constrainToPlotArea: boolean; /** Keep within container */ constrainToContainer: boolean; /** Flip if not enough space */ autoFlip: boolean; /** Show arrow pointing to target */ showArrow: boolean; /** Arrow size */ arrowSize: number; } export declare const DEFAULT_POSITIONER_CONFIG: PositionerConfig; /** * TooltipPositioner calculates optimal tooltip positions */ export declare class TooltipPositioner { private config; private containerWidth; private containerHeight; private plotArea; constructor(config?: Partial); /** * Update container dimensions */ setContainerSize(width: number, height: number): void; /** * Update plot area bounds */ setPlotArea(plotArea: PlotArea): void; /** * Update configuration */ configure(config: Partial): void; /** * Calculate optimal tooltip position * * @param targetX - Target X coordinate (where tooltip points to) * @param targetY - Target Y coordinate * @param measurement - Tooltip dimensions * @returns Calculated position with arrow configuration */ calculatePosition(targetX: number, targetY: number, measurement: TooltipMeasurement): TooltipPosition; /** * Determine best position based on available space */ private determinePosition; /** * Calculate tooltip coordinates for a given position */ private calculateCoordinates; /** * Get the opposite position for flipping */ private flipPosition; /** * Check if tooltip fits within bounds */ private fitsInBounds; /** * Constrain position to stay within bounds */ private constrainToBounds; /** * Get the bounds to constrain tooltip within */ private getConstraintBounds; /** * Calculate position for crosshair tooltip (follows cursor vertically) */ calculateCrosshairPosition(cursorX: number, cursorY: number, measurement: TooltipMeasurement): TooltipPosition; } export declare function createTooltipPositioner(config?: Partial): TooltipPositioner;