import { type ConsentData } from '@farfetch/blackout-analytics'; import { type GoogleConsentModeConfig } from './types.js'; /** * GoogleConsentMode handles with Google Consent Mode v2. */ export declare class GoogleConsentMode { private dataLayer; private configWithConsentOnly; private consentDataLayerCommands; private waitForUpdate?; private regions?; private hasConfig; constructor(dataLayer: string, initConsent: ConsentData | null, config?: GoogleConsentModeConfig); /** * Tries to load shared consent from cookies if available * and writes it to the dataLayer. * This method is only supposed to be called if no google * consent config was passed. */ private loadSharedConsentFromCookies; /** * Loads default values from the configuration and * writes them in a cookie for sharing. * * @param initConsent - The consent data available, which can be null if the user has not yet given consent. */ private loadDefaultsFromConfig; /** * Try to set consent types with dataLayer. If a valid * config was passed, default values for the consent * types are used. Else, try to load the commands * set from the cookie if it is available. * * @param initConsent - The consent data available, which can be null if the user has not yet given consent. */ private initialize; /** * Writes consent updates to the dataLayer * by applying the configuration (if any) to * the passed consent data. * * @param consentData - Consent data obtained from the user or null if not available. */ updateConsent(consentData: ConsentData | null): void; /** * Saves calculated google consent mode to a cookie * for sharing consent between apps in same * domain. */ saveConsent(): void; /** * Handles consent by updating the data layer with consent information. * * @param consent - The consent command "consent". * @param command - The command "default" or "update". * @param consentParams - The consent arguments. */ private write; } export default GoogleConsentMode;