/** * Interaction Tracking Manager for Grain Analytics * Automatically attaches click and focus listeners to detected interactive elements */ import type { InteractionConfig } from './types/auto-tracking'; export interface SendEventOptions { flush?: boolean; } export interface InteractionTracker { track(eventName: string, properties?: Record, options?: SendEventOptions): void | Promise; hasConsent(category: 'analytics' | 'marketing' | 'functional'): boolean; log(...args: unknown[]): void; } export interface InteractionTrackingConfig { debug?: boolean; enableMutationObserver?: boolean; mutationDebounceDelay?: number; tenantId?: string; apiUrl?: string; } export declare class InteractionTrackingManager { private tracker; private interactions; private config; private isDestroyed; private attachedListeners; private xpathCache; private mutationObserver; private mutationDebounceTimer; constructor(tracker: InteractionTracker, interactions: InteractionConfig[], config?: InteractionTrackingConfig); /** * Fetch trackers from API and merge with existing interactions */ private fetchAndMergeTrackers; /** * Attach listeners to all configured interactions */ private attachAllListeners; /** * Attach listener to a specific interaction */ private attachInteractionListener; /** * Handle click event on interaction */ private handleInteractionClick; /** * Handle focus event on interaction (for form fields) */ private handleInteractionFocus; /** * Find element by XPath selector */ private findElementByXPath; /** * Setup mutation observer to handle dynamic content */ private setupMutationObserver; /** * Handle DOM mutations */ private handleMutations; /** * Detach listeners from an element */ private detachListeners; /** * Log debug messages */ private log; /** * Update interactions configuration */ updateInteractions(interactions: InteractionConfig[]): void; /** * Cleanup and destroy */ destroy(): void; } //# sourceMappingURL=interaction-tracking.d.ts.map