/** * @wix/consent-policy-manager - Wix Consent Policy SDK * * This package provides a type-safe interface for managing site visitor cookie preferences * and 3rd-party data transfers for GDPR and CCPA compliance by proxying to the browser's * window.consentPolicyManager methods. */ import type { Policy, PolicyDetails, ConsentPolicy, SetConsentPolicySuccessCallback, SetConsentPolicyErrorCallback } from "./types.js"; /** * Gets the site visitor's consent policy regarding allowed cookies and 3rd-party data transfers for GDPR or CCPA compliance. * * Retrieves the site visitor's consent policy details, including which cookies are allowed and whether data transfer to 3rd parties is permitted. * * @returns Promise that resolves to the current consent policy details * @throws Error if the consent policy manager is not available or if an error occurs * * @example * ```typescript * import { * getCurrentConsentPolicy, * setConsentPolicy, * resetConsentPolicy, * publishPolicyUpdateRequestedEvent * } from '@wix/consent-policy-manager'; * * // Get current policy (synchronous) * const policyDetails = getCurrentConsentPolicy(); * console.log('Current policy:', policyDetails.policy); * * // Set policy using callbacks * setConsentPolicy( * { essential: true, functional: true, analytics: false, advertising: false, dataToThirdParty: false }, * (policyDetails) => console.log('Policy updated:', policyDetails), * (error) => console.error('Error:', error) * ); * * // Set policy using async/await (callbacks optional) * try { * await setConsentPolicy({ * essential: true, * functional: true, * analytics: false, * advertising: false, * dataToThirdParty: false * }); * console.log('Policy updated successfully'); * } catch (error) { * console.error('Error:', error); * } * ``` */ export * from "./consent-policy.js"; export type { Policy, PolicyDetails, ConsentPolicy, SetConsentPolicySuccessCallback, SetConsentPolicyErrorCallback, }; //# sourceMappingURL=index.d.ts.map