/** * Interaction & Friction Tracking * * Tracks user interactions: clicks, forms, rage clicks (frustration signal). * Philosophy: Friction points reveal opportunities for improvement. * * @packageDocumentation */ import type { AnalyticsClient } from './client.js'; interface RageClickOptions { /** Number of clicks to trigger rage detection (default: 3) */ threshold?: number; /** Time window in ms (default: 500) */ timeWindow?: number; /** Pixel distance to consider same target (default: 50) */ distanceThreshold?: number; } /** * Creates a rage click detector. * Rage clicks indicate user frustration with unresponsive UI. */ export declare function createRageClickTracker(client: AnalyticsClient, options?: RageClickOptions): () => void; interface FormTrackingOptions { /** Form selector (default: 'form') */ selector?: string; /** Track field-level interactions (default: false) */ trackFields?: boolean; /** Abandon timeout in ms (default: 30000) */ abandonTimeout?: number; } /** * Creates a form interaction tracker. * Tracks form starts, submissions, and abandonment. */ export declare function createFormTracker(client: AnalyticsClient, options?: FormTrackingOptions): () => void; interface CTATrackingOptions { /** Selector for CTA buttons (default: '[data-cta], .cta, button[type="submit"]') */ selector?: string; } /** * Creates a CTA button click tracker. */ export declare function createCTATracker(client: AnalyticsClient, options?: CTATrackingOptions): () => void; interface ErrorTrackingOptions { /** Selector for error messages (default: '[role="alert"], .error, .error-message') */ errorSelector?: string; /** Track validation errors (default: true) */ trackValidation?: boolean; } /** * Creates an error display tracker. * Tracks when error messages are shown to users. */ export declare function createErrorTracker(client: AnalyticsClient, options?: ErrorTrackingOptions): () => void; export interface InteractionTrackerOptions { rageClick?: RageClickOptions | false; forms?: FormTrackingOptions | false; cta?: CTATrackingOptions | false; errors?: ErrorTrackingOptions | false; } /** * Creates a combined interaction tracker. */ export declare function createInteractionTracker(client: AnalyticsClient, options?: InteractionTrackerOptions): () => void; export {};