/** * Consent Manager * * Tracks and manages user consent for data processing activities. * Implements GDPR Article 6 legal basis requirements. * * Added by Pantheon Security for enterprise compliance support. */ import type { ConsentRecord, ConsentPurpose, LegalBasis } from "./types.js"; /** * Consent Manager class */ export declare class ConsentManager { private static instance; private consentFile; private consents; private loaded; private consentVersion; private requireConsent; private constructor(); /** * Get singleton instance */ static getInstance(): ConsentManager; /** * Load consents from storage */ private load; /** * Save consents to storage */ private save; /** * Check if this is the first run (no consent recorded) */ isFirstRun(): Promise; /** * Check if consent is required for this installation */ isConsentRequired(): boolean; /** * Grant consent for specified purposes */ grantConsent(purposes: ConsentPurpose[], options?: { legalBasis?: LegalBasis; method?: "explicit" | "implicit" | "contractual"; evidence?: string; expiresAt?: string; }): Promise; /** * Revoke consent */ revokeConsent(consentId: string, reason?: string): Promise; /** * Check if consent exists for a specific purpose */ hasConsent(purpose: ConsentPurpose): Promise; /** * Get all active (non-revoked, non-expired) consents */ getActiveConsents(): Promise; /** * Get full consent history (for DSAR) */ getConsentHistory(): Promise; /** * Export consent records for DSAR */ exportConsents(): Promise; /** * Check if privacy notice needs to be shown (new version or first run) */ needsPrivacyNotice(): Promise; /** * Record acknowledgment of privacy notice */ acknowledgePrivacyNotice(): Promise; /** * Get consent status summary */ getConsentSummary(): Promise<{ firstRun: boolean; consentVersion: string; activeConsents: number; revokedConsents: number; purposes: Record; lastConsentDate?: string; }>; /** * Delete all consent records (for data erasure) */ deleteAllConsents(): Promise; /** * Determine appropriate legal basis for purposes */ private determineLegalBasis; /** * Validate that all required consents are in place */ validateConsents(): Promise<{ valid: boolean; missing: ConsentPurpose[]; }>; } /** * Get the consent manager instance */ export declare function getConsentManager(): ConsentManager; /** * Check if this is the first run */ export declare function isFirstRun(): Promise; /** * Check if consent exists for a purpose */ export declare function hasConsent(purpose: ConsentPurpose): Promise; /** * Grant consent for purposes */ export declare function grantConsent(purposes: ConsentPurpose[], options?: { legalBasis?: LegalBasis; method?: "explicit" | "implicit" | "contractual"; evidence?: string; expiresAt?: string; }): Promise; /** * Revoke a consent */ export declare function revokeConsent(consentId: string, reason?: string): Promise;