UNPKG

@user-intent-detector/react

Version:

React bindings for the user-intent-detector core library, providing hooks and components to detect user intent like exit, conversion, hesitation, and confusion.

23 lines 1.06 kB
import type { IntentData } from '@user-intent-detector/core'; /** * Options you can pass into a wrapper hook or service. */ export interface UseUserIntentOptions { /** Called whenever an exit intent is detected */ onExit?: (data: IntentData) => void; /** Called whenever an idle intent is detected */ onIdle?: (data: IntentData) => void; /** Called whenever browsing resumes or a click intent happens */ onBrowsing?: (data: IntentData) => void; /** Called when the user is confused (rapid mouse/touch movement, etc.) */ onConfused?: (data: IntentData) => void; /** Called when the user is showing hesitation (pauses before clicking, etc.) */ onHesitation?: (data: IntentData) => void; /** Called when the user is engaged (long hover, click, scroll, etc.) */ onEngaged?: (data: IntentData) => void; /** Idle timeout override (in ms). Defaults to 10,000 */ idleTimeout?: number; /** Enable debug logging for intent updates. Defaults to false */ debug?: boolean; } //# sourceMappingURL=types.d.ts.map