import { type PostHogClient } from '@hagicode/hagilight-core/posthog-events'; export interface RouteLocation { pathname: string; search: string; hash: string; } export interface RouteDidUpdate { location: RouteLocation; previousLocation: RouteLocation | null; } export interface PageSnapshot { title: string; location: string; path: string; } export interface RouteReportDeps { getGtag: () => unknown; readPage: () => PageSnapshot; schedule: (task: () => void) => void; } export declare function installClickTracking(target?: Pick): boolean; export interface PostHogPageContext { /** The document language, sent as `locale` when non-empty. */ lang: string; /** The site base path, for example `/docs/`. */ base: string; } /** * Refreshes only `locale` and `page_type` as super properties. Route updates are the only time this * module calls PostHog, and it never initializes the SDK or captures an event. */ export declare function refreshPostHogPageProperties(update: RouteDidUpdate, posthog: PostHogClient | undefined, page: PostHogPageContext): boolean; export declare function reportPageView(gtag: unknown, page: PageSnapshot): boolean; export declare function handleRouteDidUpdate(update: RouteDidUpdate, deps: RouteReportDeps): void; /** * Navigation reports wait for the grant when consent is on: the page then carries the consent descriptor, and * only a granted visitor may send a page_view. Without consent the page reports as before. */ export declare function navigationReportsAllowed(doc?: Pick): boolean; export declare function onRouteDidUpdate(update: RouteDidUpdate): void;