export type CookieCategory = "strictly-necessary" | "analytics" | "advertising" | "social" | "personalization" | "unknown"; export type ConsentButtonType = "accept" | "reject" | "preferences" | "close" | "unknown"; export interface ScannedCookie { name: string; domain: string; path: string; value: string; expires: number | null; httpOnly: boolean; secure: boolean; sameSite: string | null; category: CookieCategory; requiresConsent: boolean; capturedAt: "before-interaction" | "after-accept" | "after-reject"; } export interface NetworkRequest { url: string; method: string; resourceType: string; initiator: string | null; isThirdParty: boolean; trackerCategory: TrackerCategory | null; trackerName: string | null; requiresConsent: boolean; capturedAt: "before-interaction" | "after-accept" | "after-reject"; responseStatus: number | null; contentType: string | null; } export type TrackerCategory = "analytics" | "advertising" | "social" | "fingerprinting" | "pixel" | "cdn" | "unknown"; export interface ConsentButton { type: ConsentButtonType; text: string; selector: string; isVisible: boolean; boundingBox: { x: number; y: number; width: number; height: number; } | null; fontSize: number | null; backgroundColor: string | null; textColor: string | null; contrastRatio: number | null; clickDepth: number; } export interface ConsentCheckbox { name: string; label: string; isCheckedByDefault: boolean; category: CookieCategory; selector: string; } export interface ConsentModal { detected: boolean; selector: string | null; text: string; buttons: ConsentButton[]; checkboxes: ConsentCheckbox[]; hasGranularControls: boolean; layerCount: number; screenshotPath: string | null; privacyPolicyUrl: string | null; } export interface DarkPatternIssue { type: DarkPatternType; severity: "critical" | "warning" | "info"; description: string; evidence: string; } export type DarkPatternType = "asymmetric-prominence" | "click-asymmetry" | "pre-ticked" | "misleading-wording" | "cookie-wall" | "nudging" | "no-reject-button" | "buried-reject" | "auto-consent" | "missing-info"; export interface ComplianceScore { total: number; breakdown: { consentValidity: number; easyRefusal: number; transparency: number; cookieBehavior: number; }; issues: DarkPatternIssue[]; grade: "A" | "B" | "C" | "D" | "F"; } export type ReportFormat = "md" | "html" | "json" | "pdf" | "csv"; export type ViewportPreset = "desktop" | "tablet" | "mobile"; export interface ScanOptions { url: string; outputDir?: string; timeout: number; /** When true, also capture full-page screenshots after reject and accept interactions. * The consent modal is always screenshotted (cropped to the element) when detected, * regardless of this flag. Requires outputDir. */ screenshots: boolean; locale: string; verbose: boolean; formats: ReportFormat[]; userAgent?: string; viewport?: ViewportPreset; /** Treat unrecognised cookies and unknown third-party requests as requiring consent. Default: false. */ strict?: boolean; } export interface TcfConsentString { raw: string; version: 1 | 2; created: Date; lastUpdated: Date; cmpId: number; cmpVersion: number; consentLanguage: string; vendorListVersion: number; tcfPolicyVersion?: number; isServiceSpecific?: boolean; specialFeatureOptins: number[]; purposesConsent: number[]; purposesLegitimateInterest: number[]; publisherCC?: string; } export interface TcfInfo { detected: boolean; version: 1 | 2 | null; apiPresent: boolean; locatorFramePresent: boolean; cookieName: string | null; cmpId: number | null; consentString: TcfConsentString | null; } export interface ScanResult { url: string; scanDate: string; duration: number; modal: ConsentModal; privacyPolicyUrl: string | null; cookiesBeforeInteraction: ScannedCookie[]; cookiesAfterAccept: ScannedCookie[]; cookiesAfterReject: ScannedCookie[]; networkBeforeInteraction: NetworkRequest[]; networkAfterAccept: NetworkRequest[]; networkAfterReject: NetworkRequest[]; compliance: ComplianceScore; screenshotPaths: string[]; errors: string[]; tcf: TcfInfo; } //# sourceMappingURL=types.d.ts.map