type TrackedDataType = 'page-views' | 'events' | 'conversions' | 'user-identity' | 'session-replay' | 'heatmaps' | 'clicks' | 'scrolls' | 'retargeting' | 'audiences' | 'form-submissions' | 'video-engagement' | 'transactions' | 'errors' | 'tag-injection' | 'ab-testing'; interface ScriptPrivacy { ip: boolean; userAgent: boolean; language: boolean; screen: boolean; timezone: boolean; hardware: boolean; } interface ScriptSizeDetail { url: string; transferKb: number; decodedKb: number; encoding: string; durationMs: number; initiatorType: string; protocol: string; } interface ScriptApis { cookies: boolean; localStorage: boolean; sessionStorage: boolean; indexedDB: boolean; canvas: boolean; webgl: boolean; audioContext: boolean; userAgent: boolean; doNotTrack: boolean; hardwareConcurrency: boolean; deviceMemory: boolean; plugins: boolean; languages: boolean; screen: boolean; timezone: boolean; platform: boolean; vendor: boolean; connection: boolean; maxTouchPoints: boolean; devicePixelRatio: boolean; mediaDevices: boolean; getBattery: boolean; referrer: boolean; windowName: boolean; rtcPeerConnection: boolean; geolocation: boolean; serviceWorker: boolean; cacheApi: boolean; sendBeacon: boolean; fetch: boolean; xhr: boolean; websocket: boolean; mutationObserver: boolean; performanceObserver: boolean; intersectionObserver: boolean; } type PrivacyGrade = 'A+' | 'A' | 'B' | 'C' | 'D' | 'F'; interface PrivacyRating { /** Overall letter grade */ grade: PrivacyGrade; /** 0–100, higher = more invasive */ score: number; /** Breakdown by privacy concern category */ breakdown: { /** Browser fingerprinting APIs — entropy-weighted per AmIUnique/Panopticlick research (0–30) */ fingerprinting: { score: number; apis: string[]; }; /** Persistent storage + cookie tracking (0–25) */ persistence: { score: number; thirdPartyCookies: number; longLivedCookies: number; storageApis: string[]; }; /** Cross-domain data exfiltration & tracking network (0–25) */ network: { score: number; domains: number; outboundBytes: number; trackingPixels: number; }; /** Behavioral observation APIs (0–10) */ monitoring: { score: number; apis: string[]; }; /** Data collection scope — what types of data are tracked (0–10) */ dataScope: { score: number; types: string[]; }; /** Fingerprint exfiltration — heavy FP APIs combined with outbound channels (0–25) */ fpExfiltration: { score: number; heavyApis: string[]; }; }; } interface ScriptCookie { name: string; domain: string; path: string; httpOnly: boolean; secure: boolean; sameSite: string; session: boolean; lifetimeDays: number; firstParty: boolean; } interface NetworkSummary { requestCount: number; domains: string[]; outboundBytes: number; inboundBytes: number; injectedElements: { tag: string; src: string; }[]; } interface CwvEstimate { /** Estimated LCP delay: scriptDurationMs blocks rendering during page load */ lcpImpactMs: number; /** CLS risk: true if script injects visible DOM elements (iframes, images) without reserved space */ clsRisk: boolean; /** Number of visible elements injected that could cause layout shifts */ clsElements: number; /** INP risk level based on script weight + DOM observation */ inpRiskLevel: 'low' | 'medium' | 'high'; } interface PerformanceSummary { taskDurationMs: number; scriptDurationMs: number; heapDeltaKb: number; } type PerformanceGrade = 'A+' | 'A' | 'B' | 'C' | 'D' | 'F'; interface PerformanceRating { /** Overall letter grade */ grade: PerformanceGrade; /** 0–100, higher = worse performance impact */ score: number; /** Breakdown by impact area */ breakdown: { /** Network cost — transfer size relative to performance budgets (0–30) */ networkCost: { score: number; transferKb: number; }; /** Main thread blocking — task duration that delays interactivity (0–30) */ mainThread: { score: number; taskDurationMs: number; scriptDurationMs: number; }; /** Memory pressure — heap allocation impact (0–20) */ memory: { score: number; heapDeltaKb: number; }; /** Connection overhead — additional HTTP requests (0–10) */ connections: { score: number; requestCount: number; }; /** CWV risk — estimated Core Web Vitals impact (0–10) */ cwvRisk: { score: number; lcpImpactMs: number; clsRisk: boolean; inpRiskLevel: string; }; }; } interface ScriptStats { id: string; label: string; category: string; scripts: ScriptSizeDetail[]; totalTransferKb: number; totalDecodedKb: number; trackedData: TrackedDataType[]; collectsWebVitals: boolean; apis: ScriptApis; privacyRating: PrivacyRating; cookies: ScriptCookie[]; network: NetworkSummary; performance: PerformanceSummary; performanceRating: PerformanceRating; cwvEstimate: CwvEstimate; hasBundling: boolean; hasProxy: boolean; proxyDomains: string[]; proxyEndpoints: number; privacy: ScriptPrivacy | null; privacyLevel: 'full' | 'partial' | 'none' | 'unknown'; loadingMethod: 'cdn' | 'npm' | 'dynamic'; } declare function getScriptStats(): Promise; export { getScriptStats }; export type { CwvEstimate, NetworkSummary, PerformanceGrade, PerformanceRating, PerformanceSummary, PrivacyGrade, PrivacyRating, ScriptApis, ScriptCookie, ScriptPrivacy, ScriptSizeDetail, ScriptStats, TrackedDataType };