import 'react-native-get-random-values'; import { DeviceInfo as DeviceInfoType, DeviceContext } from './types'; export declare const STORAGE_KEYS: { VISITOR_ID: string; ANONYMOUS_ID: string; SESSION_ID: string; USER_ID: string; USER_PROPERTIES: string; EVENT_QUEUE: string; DEAD_LETTER_QUEUE: string; ATTRIBUTION_DATA: string; LAST_SESSION_TIME: string; }; /** * Generate a UUID v4 */ export declare const generateUUID: () => string; /** * Derive an ISO-3166-1 alpha-2 country code from a BCP-47 locale tag. * * Server webhooks (Superwall/RevenueCat) have NULL geo on their own row — only * the matched web visitor's lander pageview carries geo via the bridge. For * users who land directly in-app (no web prelander), there's no bridge to * inherit from. Device locale ('en-US', 'pt_BR') is the only zero-config * country signal the SDK can stamp; meta.js USER_DATA_PATHS.country picks up * top-level `country` as its first match key, so this hash slots into CAPI's * `country` user_data field without further changes. * * Returns null when the locale doesn't carry a region (e.g. 'en' alone), so * the caller can decide whether to omit or fall back. */ export declare const deriveCountryFromLocale: (locale: string | undefined | null) => string | null; /** * Dependency-free query-string parser. * * React Native core (Hermes) ships THROWING stubs for `URL.searchParams` / * `URLSearchParams.get/forEach` on bare RN (>=0.72), and its URLSearchParams * constructor ignores string input — so `new URL(url).searchParams` and * `new URLSearchParams(str)` silently drop EVERY deep-link / Play-referrer * attribution parameter (lyr, fbclid, gclid, ttclid, utm_*, gbraid, wbraid). * This parser avoids WHATWG URL entirely: it splits on '?'/'#', then '&'/'=', * and decodeURIComponent's each component individually (so encoded '&'/'=' in a * value survive, and one malformed '%' only loses that single value, not all). * * Pass a full URL (everything before the first '?'/'#' is ignored) or a bare * query string ("a=1&b=2"). Keys are lower-cased; later duplicates win. */ export declare const parseQueryString: (input: string | undefined | null) => Record; /** * Generate a session ID with timestamp */ export declare const generateSessionId: () => string; /** * Hash a string to create a fingerprint */ export declare const hashString: (str: string) => string; /** * Get or create a persistent visitor ID */ export declare const getOrCreateVisitorId: () => Promise; /** * Get or create a persistent anonymous ID * This ID persists across app reinstalls and never changes */ export declare const getOrCreateAnonymousId: () => Promise; /** * Rotate the persistent anonymous ID — generate a fresh `anon_...` and persist it. * * Used by reset() (logout) so the next user does NOT share the previous user's * anonymousId. Without rotation, reset()+identify(userB) links the SAME anon_xxx to * BOTH users in visitor_user_links, and the Meta CAPI identity bridge then resolves * across both — leaking click-ids/PII between users. (RN analog of the web SDK's * privacy rotation and Node's NODE-6 fix.) Returns the new id (memory-only on failure). */ export declare const rotateAnonymousId: () => Promise; /** * Force a brand-new session — clear the stored session id + last-activity time so the * next getOrCreateSessionId() creates (not resumes) one. reset() needs this because the * plain getOrCreateSessionId() resumes any session <30min old (always true at logout), * so post-logout events would otherwise share the previous user's session id. */ export declare const clearSession: () => Promise; /** * Get or create a session ID (with session timeout logic) */ export declare const getOrCreateSessionId: () => Promise; /** * Collect comprehensive device information (cached after first call) * Device info is cached because it rarely changes during app session */ export declare const getDeviceInfo: () => Promise; /** * Clear the cached device info (useful for testing or after app update) */ export declare const clearDeviceInfoCache: () => void; /** * Create device context for attribution */ export declare const createDeviceContext: () => Promise; /** * Get network connection type */ export declare const getNetworkType: () => string; /** * Validate event name */ export declare const validateEventName: (eventName: string) => boolean; /** * Validate event data */ export declare const validateEventData: (eventData: any) => boolean; /** * Debug logging utility */ export declare const debugLog: (message: string, ...args: any[]) => void; /** * Error logging utility */ export declare const errorLog: (message: string, error?: Error) => void; /** * Storage utilities */ export declare const Storage: { setItem(key: string, value: any): Promise; getItem(key: string): Promise; removeItem(key: string): Promise; clear(): Promise; };