/** * Consent management for Grain Analytics v2.0 * Privacy-first, cookieless by default * * Consent Modes: * - cookieless: Default mode, daily rotating IDs, no consent needed * - gdpr-strict: Requires explicit consent, falls back to cookieless * - gdpr-opt-out: Permanent IDs by default, cookieless on opt-out */ export type ConsentMode = 'COOKIELESS' | 'GDPR_STRICT' | 'GDPR_OPT_OUT'; export interface ConsentState { granted: boolean; categories: string[]; timestamp: Date; version: string; } export declare const DEFAULT_CONSENT_CATEGORIES: string[]; export declare const CONSENT_VERSION = "1.0.0"; /** * Consent manager for handling user consent state * v2.0: Cookieless by default, privacy-first approach */ export declare class ConsentManager { private consentState; private consentMode; private storageKey; private listeners; constructor(tenantId: string, consentMode?: ConsentMode); /** * Load consent state from localStorage * * GDPR Compliance: localStorage only used for storing consent preferences * (not for tracking), which is a legitimate interest for compliance. */ private loadConsentState; /** * Save consent state to localStorage */ private saveConsentState; /** * Grant consent with optional categories */ grantConsent(categories?: string[]): void; /** * Revoke consent (opt-out) */ revokeConsent(categories?: string[]): void; /** * Get current consent state */ getConsentState(): ConsentState | null; /** * Check if user has granted consent for permanent IDs */ hasConsent(category?: string): boolean; /** * Check if permanent IDs are allowed */ shouldUsePermanentId(): boolean; /** * Check if we should strip query parameters from URLs * Query params stripped unless: * - Mode is gdpr-opt-out, OR * - Mode is gdpr-strict AND consent given */ shouldStripQueryParams(): boolean; /** * Check if we can track events (always true in v2.0) * Even cookieless mode allows basic analytics with daily IDs */ canTrack(): boolean; /** * Check if we should wait for consent before tracking * Only relevant for GDPR Strict mode */ shouldWaitForConsent(): boolean; /** * Add consent change listener */ addListener(listener: (state: ConsentState) => void): void; /** * Remove consent change listener */ removeListener(listener: (state: ConsentState) => void): void; /** * Notify all listeners of consent state change */ private notifyListeners; /** * Clear all consent data */ clearConsent(): void; /** * Get current consent mode */ getConsentMode(): ConsentMode; /** * Get ID mode based on consent state * Returns 'cookieless' or 'permanent' for IdManager */ getIdMode(): 'cookieless' | 'permanent'; } //# sourceMappingURL=consent.d.ts.map