import { FloatingCursorConfig, FloatingCursorUpdate } from '../types'; import { FloatingCursorContextType } from '../components/FloatingCursorProvider'; /** * Floating Cursor Manager Mode */ export type FloatingCursorMode = 'web-component' | 'react-context'; /** * Floating Cursor Manager * * Manages the lifecycle and state of the floating cursor. * Supports two modes: * - 'web-component': Creates DOM element (for non-React environments) * - 'react-context': Updates React context (for React environments) * * Mode is automatically detected based on whether React context is provided. */ export declare class FloatingCursorManager { private cursorElement; private reactContext; private config; private isEnabled; private mode; private lastTrackedElementId; /** * Create a new FloatingCursorManager * * Mode is automatically detected: * - If reactContext is provided: use 'react-context' mode * - Otherwise: use 'web-component' mode * * @param config - Floating cursor configuration * @param reactContext - Optional React context (for React mode) */ constructor(config: FloatingCursorConfig, reactContext?: FloatingCursorContextType); /** * Initialize the floating cursor web component (web-component mode only) */ private initializeCursor; /** * Show cursor in resting position (bottom center) */ showResting(text?: string): void; /** * Enable the floating cursor */ enable(): void; /** * Disable the floating cursor */ disable(): void; /** * Check if the cursor is active */ isActive(): boolean; /** * Track an element and show cursor at its position * * @param elementId - Element ID to track * @param actionText - Text to display (e.g., "Clicking button") * @param isIdle - Whether the cursor should appear idle */ trackElement(elementId: string, actionText: string, isIdle?: boolean): void; /** * Show cursor at specific position * * @param update - Cursor position and display data */ showAt(update: FloatingCursorUpdate): void; /** * Hide the cursor */ hide(): void; /** * Show cursor during search operation * * @param query - Search query text */ showSearching(query: string): void; /** * Calculate position of an element as viewport percentage * * @param elementId - Element ID (format: "word1_word2_word3") * @returns Position as percentage or null if element not found */ private calculateElementPosition; /** * Find element by Vowel ID * * Vowel IDs are in format: "word1_word2_word3" where each word is from * the element's accessible text. We need to search for elements with * matching text patterns. * * @param vowelId - Vowel element ID * @returns Element or null */ private findElementByVowelId; /** * Check if an element is visible in the viewport */ private isElementVisible; /** * Get a simple selector for an element (for debugging) */ private getElementSelector; /** * Get text content from element including ARIA labels */ private getElementText; /** * Update configuration * * @param config - New configuration (partial) */ updateConfig(config: Partial): void; /** * Get current configuration */ getConfig(): FloatingCursorConfig; /** * Get last tracked element ID */ getLastTrackedElementId(): string | null; /** * Cleanup and destroy cursor */ destroy(): void; } //# sourceMappingURL=FloatingCursorManager.d.ts.map