UNPKG

react-cookie-manager

Version:

🍪 The ultimate React cookie consent solution. Automatically block trackers, manage consent preferences, and protect user privacy with an elegant UI. Perfect for modern web applications.

32 lines 1.45 kB
import { TFunction } from '../translations'; /** * Sets the translation function used by the blocked-content placeholder. */ export declare const setBlockingTranslationFunction: (t: TFunction | null) => void; /** * Enables or disables DOM-level content blocking immediately. */ export declare const setBlockingEnabled: (enabled: boolean) => void; /** * Creates a placeholder for blocked content * @param iframe The iframe element to block * @param originalSrc The original source URL of the iframe * @returns The created wrapper element containing the placeholder */ export declare const createContentPlaceholder: (iframe: HTMLIFrameElement, originalSrc: string) => HTMLDivElement; /** * Blocks tracking scripts and iframes based on keywords * @param trackingKeywords Array of keywords to block * @returns MutationObserver that watches for new elements */ export declare const blockTrackingScripts: (trackingKeywords: string[]) => MutationObserver; /** * Ensures that all placeholders remain visible and properly styled */ export declare const ensurePlaceholdersVisible: () => void; /** * Restores previously blocked iframes whose original src no longer matches current blocked keywords. * @param currentBlockedKeywords The keywords that should remain blocked. Others will be restored. */ export declare const unblockPreviouslyBlockedContent: (currentBlockedKeywords: string[]) => void; //# sourceMappingURL=content-blocker.d.ts.map