UNPKG

@primarix/easy-consent

Version:

A lightweight consent management solution for Google Analytics and related services. This is a beta version and should be used with caution.

20 lines (17 loc) 822 B
import { EasyConsent, Config, Options, Mode } from '../index.mjs'; /** * This hook provides a way to manage consent choices for Google Analytics and related services. * It utilizes the EasyConsent class to handle the consent state and updates. * * @param consent - An instance of EasyConsent, which manages the consent state and updates. * @returns An object containing the current consent choices, functions to handle individual choices, change mode, accept all, and reject all. */ declare const useConsent: (consent: EasyConsent) => { choices: Config; changeChoice: (key: Options, value: Mode) => () => void; updateChoices: (new_values: Partial<Config>) => () => void; toggleMode: (mode: Mode) => "denied" | "granted"; grantAll: () => void; denyAll: () => void; }; export { useConsent };