import { ReactNode } from "react"; interface AnalyticsEvent { name: string; timestamp: number; message?: string; properties?: Record; duration?: number; isError?: boolean; error?: string; } interface CaptureOptions { message?: string; properties?: Record; /** Duration of the operation the event describes, in milliseconds. */ duration?: number; isError?: boolean; error?: string; } /** Inspect, transform, or drop (return `null`) each event before it is buffered for delivery. */ type BeforeSend = (event: AnalyticsEvent) => AnalyticsEvent | null; interface Analytics { /** Queue a custom widget event for delivery to Alpic Analytics. */ capture: (name: string, options?: CaptureOptions) => void; } /** Toggles for the SDK's built-in event capture. Lifecycle and errors are on by default; interactions are opt-in. */ interface AutoCaptureOptions { lifecycle?: boolean; errors?: boolean; interactions?: boolean; } interface AlpicAnalyticsProps { children?: ReactNode; /** Inspect, transform, or drop each event before delivery. Runs synchronously in `capture`. */ beforeSend?: BeforeSend; autoCapture?: AutoCaptureOptions; } /** Provides Alpic Analytics to descendant components, configuring itself from the widget host; events captured before configuration is available are buffered automatically. */ export declare function AlpicAnalytics({ children, beforeSend, autoCapture }: AlpicAnalyticsProps): import("react").JSX.Element; /** Returns the analytics client from the nearest `AlpicAnalytics` provider. */ export declare function useAnalytics(): Analytics; /** The `$` prefix marks events emitted by the SDK itself so the analytics UI can distinguish them from custom `capture()` calls; keep in sync with the server-side reserved namespace. */ export declare const AUTO_EVENT: { readonly loaded: "$loaded"; readonly visible: "$visible"; readonly hidden: "$hidden"; readonly closed: "$closed"; readonly error: "$error"; }; /** Public DOM contract for declarative interaction capture: the attribute value is the event name. */ export declare const INTERACTION_ATTRIBUTE = "data-alpic-event"; export type { AlpicAnalyticsProps, Analytics, AutoCaptureOptions, BeforeSend, CaptureOptions };