isometrik-web-tracker
Version:
Production-grade user tracking library with multiple tracking methods
34 lines • 1.06 kB
TypeScript
import { ScrollTrackerOptions } from './types';
export declare class ScrollTracker {
private options;
private isDestroyed;
private lastScrollPosition;
private lastScrollTime;
private scrollVelocity;
private scrollDirection;
private scrollDepth;
private maxScrollDepth;
private scrollTimeoutId?;
constructor(options: ScrollTrackerOptions);
private initialize;
private setupEventListeners;
private handleScroll;
private handleElementScroll;
private handleResize;
private getScrollPosition;
private calculateScrollDepth;
private calculateElementScrollDepth;
private determineScrollDirection;
private resetVelocityAfterDelay;
private calculateMaxScrollDepth;
getCurrentScrollDepth(): number;
getMaxScrollDepth(): number;
getScrollVelocity(): number;
getScrollDirection(): 'up' | 'down' | 'left' | 'right';
scrollToDepth(depth: number): void;
pause(): void;
resume(): void;
destroy(): void;
private log;
}
//# sourceMappingURL=ScrollTracker.d.ts.map