interface AffiliateParams { utm_source?: string; utm_medium?: string; utm_campaign?: string; utm_term?: string; utm_content?: string; click_id?: string; referrer?: string; gclid?: string; fbclid?: string; msclkid?: string; ttclid?: string; twclid?: string; li_fat_id?: string; affiliate_id?: string; ref?: string; source?: string; [key: string]: string | undefined; } interface AffiliateData { utm_source?: string; utm_medium?: string; utm_campaign?: string; utm_term?: string; utm_content?: string; click_id?: string; referrer?: string; gclid?: string; fbclid?: string; msclkid?: string; ttclid?: string; twclid?: string; li_fat_id?: string; affiliate_id?: string; ref?: string; source?: string; timestamp: number; sessionId: string; attribution: "first-touch" | "last-touch"; url: string; userAgent?: string; [key: string]: string | number | undefined; } interface AffiliateConfig { storageKey?: string; storageType?: "sessionStorage" | "localStorage"; attribution?: "first-touch" | "last-touch"; ttl?: number; customParams?: string[]; enableReferrerCapture?: boolean; enableUserAgentCapture?: boolean; onCapture?: (data: AffiliateData) => void; onError?: (error: Error) => void; } interface AffiliateTrackerHookReturn { affiliateParams: AffiliateData | null; isLoading: boolean; error: Error | null; captureParams: () => void; clearParams: () => void; refreshParams: () => void; } type AffiliateEventType = "capture" | "clear" | "expire"; interface AffiliateEvent { type: AffiliateEventType; data?: AffiliateData; timestamp: number; } interface AffiliateTrackerProps { config?: Partial; autoCapture?: boolean; children?: React.ReactNode; } declare const AffiliateTracker: React.FC; declare function useAffiliateTracker(config?: Partial): AffiliateTrackerHookReturn; declare function useHasAffiliateData(): boolean; declare function useAffiliateSource(): string | null; declare function useAutoCapture(config?: Partial): void; declare function useAffiliateEvents(callback: (event: AffiliateEvent) => void, eventTypes?: Array<"capture" | "clear" | "expire">): void; /** * Constants for the affiliate-tracker writer. * * Storage key MUST match the key the user-enricher middleware reads from * (`packages/events/src/middleware/user-enricher.ts`). That contract is the * whole point of co-locating capture + enrichment in the events package. */ declare const UTM_PARAMETERS: readonly ["utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"]; declare const CLICK_ID_PARAMETERS: readonly ["gclid", "fbclid", "msclkid", "ttclid", "twclid", "li_fat_id"]; declare const AFFILIATE_PARAMETERS: readonly ["click_id", "affiliate_id", "ref", "source", "referrer"]; declare const ALL_AFFILIATE_PARAMETERS: readonly ["utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content", "gclid", "fbclid", "msclkid", "ttclid", "twclid", "li_fat_id", "click_id", "affiliate_id", "ref", "source", "referrer"]; declare const STORAGE_CONFIG: { readonly DEFAULT_KEY: "affiliate_data"; readonly DEFAULT_TTL: number; }; declare const ATTRIBUTION_MODELS: { readonly FIRST_TOUCH: "first-touch"; readonly LAST_TOUCH: "last-touch"; }; declare const STORAGE_TYPES: { readonly SESSION: "sessionStorage"; readonly LOCAL: "localStorage"; }; declare const EVENT_TYPES: { readonly CAPTURE: "capture"; readonly CLEAR: "clear"; readonly EXPIRE: "expire"; }; declare const ATTRIBUTION_CHANNELS: { readonly DIRECT: "direct"; readonly PAID_SEARCH: "paid_search"; readonly ORGANIC_SEARCH: "organic_search"; readonly SOCIAL: "social"; readonly EMAIL: "email"; readonly AFFILIATE: "affiliate"; readonly REFERRAL: "referral"; readonly DISPLAY: "display"; }; declare const SEARCH_ENGINES: readonly ["google.com", "bing.com", "yahoo.com", "duckduckgo.com", "baidu.com", "yandex.com", "ask.com"]; declare const SOCIAL_PLATFORMS: readonly ["facebook", "instagram", "twitter", "linkedin", "tiktok", "youtube", "pinterest", "snapchat"]; type UTMParameter = (typeof UTM_PARAMETERS)[number]; type ClickIdParameter = (typeof CLICK_ID_PARAMETERS)[number]; type AffiliateParameter = (typeof AFFILIATE_PARAMETERS)[number]; type AllAffiliateParameter = (typeof ALL_AFFILIATE_PARAMETERS)[number]; type AttributionModel = (typeof ATTRIBUTION_MODELS)[keyof typeof ATTRIBUTION_MODELS]; type StorageType = (typeof STORAGE_TYPES)[keyof typeof STORAGE_TYPES]; type EventType = (typeof EVENT_TYPES)[keyof typeof EVENT_TYPES]; type AttributionChannel = (typeof ATTRIBUTION_CHANNELS)[keyof typeof ATTRIBUTION_CHANNELS]; declare const DEFAULT_CONFIG: Required; declare function configureAffiliateTracker(config?: Partial): void; declare function addEventListener(listener: (event: AffiliateEvent) => void): () => void; declare function captureAffiliateParams(customConfig?: Partial): AffiliateData | null; declare function getAffiliateParams(): AffiliateData | null; declare function clearAffiliateParams(): void; declare function getAffiliateParamsAsUrlString(): string; declare function appendAffiliateParams(url: string): string; declare function hasAffiliateData(): boolean; declare function getAffiliateSource(): string | null; declare function getConfig(): Required; declare function resetConfig(): void; declare class AffiliateAnalytics { static sendToGA4(eventName?: string, customParams?: Record): void; static sendToCustomEndpoint(endpoint: string, options?: { method?: string; headers?: Record; customData?: Record; }): Promise; } declare class AffiliateUrlUtils { static createAffiliateLink(baseUrl: string, additionalParams?: Record): string; static extractFromUrl(url: string): AffiliateParams; static cleanUrl(url: string): string; } declare class AffiliateAttribution { static getAttributionChannel(data?: AffiliateData): string; private static isSearchEngine; static getAttributionScore(data?: AffiliateData): number; } declare class AffiliateTestUtils { static mockAffiliateData(params?: Partial): AffiliateData; static createTestUrl(baseUrl?: string, params?: AffiliateParams): string; static simulateNavigation(url: string): void; } declare class AffiliateValidation { static validateParams(params: AffiliateParams): { isValid: boolean; errors: string[]; }; static sanitizeParams(params: AffiliateParams): AffiliateParams; } export { AFFILIATE_PARAMETERS, ALL_AFFILIATE_PARAMETERS, ATTRIBUTION_CHANNELS, ATTRIBUTION_MODELS, AffiliateAnalytics, AffiliateAttribution, type AffiliateConfig, type AffiliateData, type AffiliateEvent, type AffiliateEventType, type AffiliateParameter, type AffiliateParams, AffiliateTestUtils, AffiliateTracker, type AffiliateTrackerHookReturn, type AffiliateTrackerProps, AffiliateUrlUtils, AffiliateValidation, type AllAffiliateParameter, type AttributionChannel, type AttributionModel, CLICK_ID_PARAMETERS, type ClickIdParameter, DEFAULT_CONFIG, EVENT_TYPES, type EventType, SEARCH_ENGINES, SOCIAL_PLATFORMS, STORAGE_CONFIG, STORAGE_TYPES, type StorageType, type UTMParameter, UTM_PARAMETERS, addEventListener, appendAffiliateParams, captureAffiliateParams, clearAffiliateParams, configureAffiliateTracker, getAffiliateParams, getAffiliateParamsAsUrlString, getAffiliateSource, getConfig, hasAffiliateData, resetConfig, useAffiliateEvents, useAffiliateSource, useAffiliateTracker, useAutoCapture, useHasAffiliateData };