c15t
Version:
<div align="center"> <img src="https://c15t.com/logo-icon.png" alt="c15t Logo" width="64" height="64" /> <h1>c15t</h1> <p>Transform privacy consent from a compliance checkbox into a fully observable system</p>
30 lines • 1.34 kB
TypeScript
/**
* @packageDocumentation
* Implements automatic blocking of tracking scripts and network requests until user consent is granted.
*
* IMPORTANT: This module overrides global `fetch` and `XMLHttpRequest` APIs to enforce consent requirements.
* While this approach is necessary for proper consent management, it may conflict with other libraries that
* also modify these APIs. This implementation takes precedence to ensure compliance.
*/
import type { AllConsentNames, ConsentState } from '../types';
/**
* Configuration options for the tracking blocker
*/
export interface TrackingBlockerConfig {
/** Whether to disable automatic blocking (defaults to false) */
disableAutomaticBlocking?: boolean;
/** Override the default domain consent map */
overrideDomainConsentMap?: boolean;
/** Map of domains to their required consent types */
domainConsentMap?: Record<string, AllConsentNames>;
}
interface TrackingBlocker {
updateConsents: (newConsents: Partial<ConsentState>) => void;
destroy: () => void;
}
/**
* Creates a tracking blocker instance that handles blocking of tracking scripts and network requests
*/
export declare function createTrackingBlocker(config?: TrackingBlockerConfig, initialConsents?: ConsentState): TrackingBlocker;
export {};
//# sourceMappingURL=tracking-blocker.d.ts.map