UNPKG

@junobuild/analytics

Version:

Tracker for Juno analytics

26 lines (25 loc) 1.09 kB
import type { Environment } from '../types/env'; import type { PostMessageInitEnvData } from '../types/post-message'; import type { TrackEvent } from '../types/track'; export declare const initWorker: (env: Environment) => { cleanup: () => void; }; export declare const initTrackPageViews: () => { cleanup: () => void; }; export declare const setPageView: () => Promise<void>; export declare const initTrackPerformance: ({ options }: Environment) => Promise<void>; /** * Tracks a page view in Juno Analytics. * @returns {Promise<void>} A promise that resolves when the page view is tracked. */ export declare const trackPageView: () => Promise<void>; /** * Tracks a custom event in Juno Analytics. * @param {TrackEvent} data - The event details. * @returns {Promise<void>} A promise that resolves when the event is tracked. */ export declare const trackEvent: (data: TrackEvent) => Promise<void>; export declare const initWorkerEnvironment: (env: PostMessageInitEnvData) => void; export declare const startTracking: () => void; export declare const stopTracking: () => void;