/** * Section Tracking Manager for Grain Analytics * Intelligent scroll tracking with viewport metrics, visible sections, and engagement analysis */ import type { SectionConfig, SectionTrackingOptions } from './types/auto-tracking'; import type { ActivityDetector } from './activity'; export interface SectionTracker { trackSystemEvent(eventName: string, properties: Record): void; hasConsent(category: 'analytics' | 'marketing' | 'functional'): boolean; getActivityDetector(): ActivityDetector; log(...args: unknown[]): void; } export declare class SectionTrackingManager { private tracker; private sections; private options; private isDestroyed; private sectionStates; private intersectionObserver; private xpathCache; private lastScrollPosition; private lastScrollTime; private scrollVelocity; private scrollDebounceTimer; private pendingEvents; private batchTimer; private sectionTimers; private readonly SPLIT_DURATION; private attentionQuality; constructor(tracker: SectionTracker, sections: SectionConfig[], options?: Partial); /** * Initialize section tracking */ private initialize; /** * Setup IntersectionObserver for section visibility */ private setupIntersectionObserver; /** * Setup scroll listener for velocity calculation */ private setupScrollListener; /** * Initialize sections and start observing */ private initializeSections; /** * Handle intersection observer entry */ private handleIntersection; /** * Handle section entry (became visible) */ private handleSectionEntry; /** * Start periodic tracking for a section (sends events every 3 seconds) */ private startPeriodicTracking; /** * Stop periodic tracking for a section */ private stopPeriodicTracking; /** * Handle section exit (became invisible) */ private handleSectionExit; /** * Update scroll velocity */ private updateScrollVelocity; /** * Calculate current scroll depth as percentage */ private calculateScrollDepth; /** * Determine if section view should be tracked (sanitization) */ private shouldTrackSection; /** * Queue section view for batching */ private queueSectionView; /** * Flush pending section view events */ private flushPendingEvents; /** * Find element by XPath selector */ private findElementByXPath; /** * Log debug messages */ private log; /** * Update sections configuration */ updateSections(sections: SectionConfig[]): void; /** * Cleanup and destroy */ destroy(): void; } //# sourceMappingURL=section-tracking.d.ts.map