65 lines
2.4 KiB
TypeScript
65 lines
2.4 KiB
TypeScript
export interface UserConsent {
|
|
analytics: boolean;
|
|
marketing: boolean;
|
|
}
|
|
|
|
export interface RegionDefault {
|
|
regions: string[];
|
|
ad_storage?: "granted" | "denied";
|
|
analytics_storage?: "granted" | "denied";
|
|
ad_user_data?: "granted" | "denied";
|
|
ad_personalization?: "granted" | "denied";
|
|
functionality_storage?: "granted" | "denied";
|
|
personalization_storage?: "granted" | "denied";
|
|
security_storage?: "granted" | "denied";
|
|
}
|
|
|
|
export interface ConsentConfig {
|
|
storageKey?: string;
|
|
waitForUpdateMs?: number;
|
|
adsDataRedaction?: boolean;
|
|
urlPassthrough?: boolean;
|
|
regionDefaults?: RegionDefault[];
|
|
debug?: boolean;
|
|
}
|
|
|
|
export const DEFAULT_STORAGE_KEY: string;
|
|
export const EVENT_CONSENT_UPDATED: string;
|
|
export const EVENT_OPEN_PREFERENCES: string;
|
|
export const GTM_CONSENT_EVENT: string;
|
|
export const GOOGLE_CONSENT_SIGNALS: readonly string[];
|
|
|
|
export function configureConsent(config?: ConsentConfig): ConsentConfig;
|
|
export function getConsentConfig(): ConsentConfig;
|
|
export function defaultConfig: ConsentConfig;
|
|
|
|
export function getConsent(): UserConsent | null;
|
|
export function setConsent(preferences: Partial<UserConsent>): void;
|
|
export function acceptAll(): void;
|
|
export function rejectAll(): void;
|
|
export function hasAnalyticsConsent(): boolean;
|
|
export function hasMarketingConsent(): boolean;
|
|
export function hasConsentChoice(): boolean;
|
|
export function syncConsentFromStorage(): void;
|
|
export function openPreferences(): void;
|
|
|
|
export function applyConsentDefaults(): void;
|
|
export function applyConsentUpdate(consent: UserConsent | null | undefined): void;
|
|
export function buildGoogleConsentState(consent: UserConsent | null | undefined): Record<string, "granted" | "denied">;
|
|
export function getConsentBootstrapScript(options?: Partial<ConsentConfig>): string;
|
|
|
|
// Legacy aliases
|
|
export const COOKIE_CONSENT_KEY: string;
|
|
export const COOKIE_CONSENT_EVENT: string;
|
|
export const COOKIE_CONSENT_OPEN_EVENT: string;
|
|
export const CONSENT_TYPES: readonly string[];
|
|
export function getCookieConsent(): UserConsent | null;
|
|
export function setCookieConsent(preferences: Partial<UserConsent>): void;
|
|
export function acceptAllCookies(): void;
|
|
export function rejectAllCookies(): void;
|
|
export function hasCookieConsentChoice(): boolean;
|
|
export function syncGoogleConsentFromStorage(): void;
|
|
export function openCookiePreferences(): void;
|
|
export function applyGoogleConsentDefault(): void;
|
|
export function applyGoogleConsent(consent: UserConsent | null | undefined): void;
|