import type { FormEventType } from '@entrolytics/shared'; export type { FormEventType }; export interface FormEventData { eventType: FormEventType; formId: string; formName?: string; urlPath?: string; fieldName?: string; fieldType?: string; fieldIndex?: number; timeOnField?: number; timeSinceStart?: number; errorMessage?: string; success?: boolean; } export interface UseFormTrackingOptions { formId: string; formName?: string; autoTrack?: boolean; trackTiming?: boolean; trackAbandonment?: boolean; } /** * Hook for tracking form interactions in Next.js * * @example * ```tsx * 'use client'; * import { useFormTracking } from '@entrolytics/nextjs'; * * export function ContactForm() { * const { formRef, trackSubmit } = useFormTracking({ * formId: 'contact-form', * formName: 'Contact Form' * }); * * const handleSubmit = async (e) => { * e.preventDefault(); * const success = await submitForm(); * trackSubmit(success); * }; * * return ( *
* ); * } * ``` */ export declare function useFormTracking(options: UseFormTrackingOptions): { formRef: import("react").RefObject