/** * Smart Prefetch Algorithm * Recognizes scroll patterns and predicts data loading needs */ export interface ScrollPattern { type: 'fast-scroll' | 'slow-scroll' | 'paused' | 'oscillating' | 'steady'; velocity: number; acceleration: number; direction: 'up' | 'down' | 'stationary'; confidence: number; } export interface PrefetchPrediction { shouldPrefetch: boolean; prefetchDistance: number; batchSize: number; priority: 'low' | 'normal' | 'high' | 'critical'; confidence: number; } export declare class SmartPrefetchAlgorithm { private velocityHistory; private directionHistory; private readonly HISTORY_SIZE; private lastPrefetchTime; private prefetchCooldown; /** * Analyze scroll pattern */ analyzeScrollPattern(velocity: number, acceleration: number, direction: 'up' | 'down' | 'stationary'): ScrollPattern; /** * Predict prefetch needs based on scroll pattern */ predictPrefetchNeeds(pattern: ScrollPattern, visibleEnd: number, totalLoaded: number): PrefetchPrediction; /** * Track velocity history */ private trackVelocity; /** * Track direction history */ private trackDirection; /** * Get average velocity */ private getAverageVelocity; /** * Get velocity variance */ private getVelocityVariance; /** * Count direction changes */ private countDirectionChanges; /** * Reset history */ reset(): void; /** * Get prediction confidence */ getConfidence(): number; } export default SmartPrefetchAlgorithm; //# sourceMappingURL=SmartPrefetchAlgorithm.d.ts.map