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; /** * The build currently running, e.g. "2.4.1" or a commit SHA. Reported on init so * Nohmo can build a deploy timeline and line metric movements up against releases * ("conversions fell 18% — that lines up with 2.4.1 shipping"). Optional: without it * the timeline only contains releases reported by CI or added by hand. */ release?: string; /** * 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; /** Which client library produced this event — 'web' | 'react-native' | 'flutter' | * 'server'. Distinct from platform: a Flutter app and a React Native app both * report platform 'android', and without this the server cannot tell them apart. */ sdk?: string; /** The SDK's own package version, stamped at build time. */ sdkVersion?: string; } 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; private contentChanges; private observer; private deadClickTimers; private lastDeadReport; private stopped; constructor(tracker: TrackerSender); start(): void; stop(): void; private startMutationWatch; /** * Whether this element's job is to do something OUTSIDE the current page — open a mail * client, dial a number, start a download, open a new tab, or submit to another origin. * * All of those leave the page's URL, DOM and network untouched, so the dead-click test * would call them broken every single time. They are working exactly as intended; we * simply have no way to observe the outcome, so we decline to judge them. */ private actsOutsideThePage; private isActionable; /** * Watch what a click actually did. Fires DEAD_CLICK only when nothing at all happened: * no navigation, no DOM content change, no network request. * * Deliberately biased toward silence. Every ambiguous signal is read as "the app * responded", so this under-reports rather than crying wolf — a false dead click sends * an engineer hunting for a bug that does not exist, which is worse than missing one. * The server-side detector in the backend catches what this misses. */ private watchForDeadClick; private page; 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 };