/** * Analytics utilities for privacy-preserving tracking */ /** * Hash a string using SHA-256 for privacy-preserving analytics * The hash is one-way and cannot be reversed to the original value * * @param value - The string to hash * @returns A hex string of the SHA-256 hash */ export declare function hashString(value: string): Promise; /** * Hash a user ID using SHA-256 for privacy-preserving analytics * Alias for hashString for semantic clarity * * @param userId - The user ID to hash * @returns A hex string of the SHA-256 hash */ export declare const hashUserId: typeof hashString; /** * Strip language prefix from a path * E.g., /en/about -> /about, /zh-hant/docs -> /docs * * @param path - The path to normalize * @returns The path without language prefix */ export declare function stripLanguagePrefix(path: string): string; /** * Get a normalized page name from a path * Converts path segments to underscore-separated names * * @param path - The path to convert * @param pageNames - Optional mapping of paths to custom names * @returns A normalized page name */ export declare function getPageName(path: string, pageNames?: Record): string; /** * Common analytics event names following best practices */ export declare const CommonAnalyticsEvents: { readonly USER_LOGIN: "login"; readonly USER_LOGOUT: "logout"; readonly USER_SIGNUP: "sign_up"; readonly PAGE_VIEW: "page_view"; readonly BUTTON_CLICK: "button_click"; readonly LINK_CLICK: "link_click"; readonly ERROR_OCCURRED: "error_occurred"; readonly ERROR_API_CALL: "error_api_call"; readonly SCROLL_DEPTH: "scroll_depth"; readonly TIME_ON_PAGE: "time_on_page"; readonly FORM_SUBMIT: "form_submit"; readonly SEARCH: "search"; }; export type CommonAnalyticsEventName = (typeof CommonAnalyticsEvents)[keyof typeof CommonAnalyticsEvents]; /** * Common analytics event parameters */ export interface AnalyticsEventParams { user_hash?: string; page_path?: string; page_title?: string; button_name?: string; link_url?: string; error_message?: string; error_code?: string; timestamp?: number; [key: string]: unknown; } /** * Analytics event structure */ export interface AnalyticsEvent { event: string; parameters?: AnalyticsEventParams; } /** * Create an analytics event with common parameters * * @param event - The event name * @param parameters - Event parameters * @returns An analytics event object */ export declare function createAnalyticsEvent(event: string, parameters?: AnalyticsEventParams): AnalyticsEvent; //# sourceMappingURL=analytics-utils.d.ts.map