/** * Consent Manager * * Manages user consent state for analytics, marketing, and advertising. * Stores consent in a first-party cookie (_vtilt_consent) and provides * consent properties to attach to every event. * * When `requireConsent` is true in config, the CaptureManager gates * non-essential events until setConsent() is called. */ export interface ConsentState { analytics?: boolean; marketing?: boolean; advertising?: boolean; } export interface ConsentHost { _emitter?: { emit(event: string, payload?: unknown): void; }; getConfig(): { require_consent?: boolean; }; } export declare class ConsentManager { private _host; private _state; private _hasBeenSet; constructor(host: ConsentHost); /** * Set consent state. Merges with existing state. * Persists to cookie and emits consent:updated. */ setConsent(consent: ConsentState): void; /** * Get current consent state. * Returns undefined fields for categories not yet set. */ getConsent(): ConsentState; /** * Whether setConsent() has been called (or consent was loaded from cookie). * Used by CaptureManager to gate events when requireConsent is true. */ hasConsent(): boolean; /** * Apply default-all-granted state when no explicit consent exists. * Sets all categories to true in memory but does NOT persist to cookie * (implicit defaults don't need storage — only explicit user choices do). */ setDefaultGranted(): void; /** * Returns event properties to attach to every captured event. * Only includes fields that have been explicitly set. */ getConsentProperties(): Record; /** * Reset consent state (e.g. on user logout). */ reset(): void; private _readFromCookie; private _writeToCookie; private _removeCookie; }