/** * Page Tracking for Grain Analytics * Automatically tracks page views with consent-aware behavior */ export interface PageTrackingConfig { stripQueryParams: boolean; stripHash?: boolean; debug?: boolean; tenantId: string; } export interface PageTracker { trackSystemEvent(eventName: string, properties: Record): void; hasConsent(category?: string): boolean; getEffectiveUserId(): string; getEphemeralSessionId(): string; getSessionId(): string; } export declare class PageTrackingManager { private config; private tracker; private isDestroyed; private currentPath; private originalPushState; private originalReplaceState; private previousPage; private landingPage; private pageViewCount; constructor(tracker: PageTracker, config: PageTrackingConfig); /** * Setup History API listeners (pushState, replaceState, popstate) */ private setupHistoryListeners; /** * Setup hash change listener */ private setupHashChangeListener; /** * Handle popstate event (back/forward navigation) */ private handlePopState; /** * Handle hash change event */ private handleHashChange; /** * Track the current page */ private trackCurrentPage; /** * Extract domain from URL */ private extractDomain; /** * Detect browser name */ private getBrowser; /** * Detect operating system */ private getOS; /** * Detect device type (Mobile, Tablet, Desktop) */ private getDeviceType; /** * Extract path from URL, optionally stripping query parameters * Privacy-first: strips query params by default */ private extractPath; /** * Clean URL for privacy (strip query params based on config) */ private cleanUrl; /** * Get the current page path */ getCurrentPage(): string | null; /** * Manually track a page view (for custom navigation) */ trackPage(page: string, properties?: Record): void; /** * Get page view count for current session */ getPageViewCount(): number; /** * Destroy the page tracker */ destroy(): void; } //# sourceMappingURL=page-tracking.d.ts.map