import * as react_jsx_runtime from 'react/jsx-runtime'; import React from 'react'; interface UTMParams { source?: string; medium?: string; campaign?: string; term?: string; content?: string; _custom?: boolean; } interface NohmoConfig { projectId: string; apiKey: string; flushInterval?: number; debug?: boolean; autoPageView?: boolean; autoScrollDepth?: boolean; autoTimeSpent?: boolean; autoCapture?: boolean; /** * Automatically capture uncaught JS errors, unhandled promise rejections, * failed network requests (fetch/XHR 4xx/5xx), and resource 404s as * JS_ERROR / HTTP_ERROR events. Defaults to true. Set false to disable. */ autoErrors?: boolean; /** * Custom URL parameter names to treat as attribution when no utm_* params * are present. Checked in order; the first match becomes source and the * param name itself becomes medium so it's identifiable in the dashboard. * Defaults to ['ref']. * Example: ['ref', 'reference', 'src', 'from'] */ attributionParams?: string[]; } interface NohmoEvent { deviceId: string; userId: string | null; sessionId: string; event: string; data: Record; page: string; referrer: string; ts: number; utm?: UTMParams; } interface NohmoUser { userId: string; email?: string; meta?: Record; } interface NohmoState { deviceId: string | null; userId: string | null; sessionId: string; ready: boolean; } declare class NohmoTracker { private config; private state; private queue; private pageStart; private autoCapture; private errorCapture; private pendingEvents; private initResolve; private readonly initPromise; constructor(config: NohmoConfig); init(): Promise; send(event: string, data?: Record): void; linkUser(userId: string, email?: string, meta?: Record): Promise; trackConversion(slug: string, properties?: Record): void; trackPageView(path?: string): void; trackTimeSpent(path?: string): void; startScrollTracking(): () => void; private sendBatch; private generateSessionId; private log; getState(): NohmoState; /** Flush queued events immediately. Used by error capture so a crash-class * event isn't lost to the periodic batch if the page is about to unload. */ flushNow(): void; destroy(): void; } interface TrackerSender { send(event: string, data?: Record): void; } declare class AutoCapture { private tracker; private clickCounts; private cleanupFns; constructor(tracker: TrackerSender); start(): void; stop(): void; private captureClick; private captureSubmit; private captureInput; private getRelevantElement; private extractElementProps; private getCleanText; private getSelector; } interface NohmoContextValue { send: (event: string, data?: Record) => void; trackConversion: (slug: string, properties?: Record) => void; trackTimeSpent: (path?: string) => void; linkUser: (userId: string, email?: string, meta?: Record) => Promise; } interface NohmoProviderProps { children: React.ReactNode; projectId: string; apiKey: string; options?: Partial; } declare function NohmoProvider({ children, projectId, apiKey, options, }: NohmoProviderProps): react_jsx_runtime.JSX.Element; declare function useNohmo(): NohmoContextValue; declare function usePageView(path?: string): void; interface NohmoNextProviderProps { children: React.ReactNode; projectId: string; apiKey: string; options?: Partial; } declare function NohmoNextProvider({ children, projectId, apiKey, options, }: NohmoNextProviderProps): react_jsx_runtime.JSX.Element; export { AutoCapture, NohmoConfig, NohmoEvent, NohmoNextProvider, NohmoProvider, NohmoState, NohmoTracker, NohmoUser, useNohmo, useNohmo as useNohmoNext, usePageView };