@c15t/react
Version:
Developer-first CMP for React: cookie banner, consent manager, preferences centre. GDPR ready with minimal setup and rich customization
32 lines • 1.06 kB
TypeScript
/**
* @packageDocumentation
* Provides the context for sharing consent management state across components.
*/
import type { ConsentManagerInterface, PrivacyConsentState } from 'c15t';
/**
* The context value provided by ConsentManagerProvider.
*/
export interface ConsentStateContextValue {
/**
* Current consent management state
*/
state: PrivacyConsentState;
/**
* Reference to the consent manager store instance
* We use object type to avoid circular dependencies
*/
store: {
getState: () => PrivacyConsentState;
subscribe: (listener: (state: PrivacyConsentState) => void) => () => void;
setState: (state: Partial<PrivacyConsentState>) => void;
};
/**
* Optional API client instance
*/
manager: ConsentManagerInterface | null;
}
/**
* Context for sharing consent management state across components.
*/
export declare const ConsentStateContext: import("react").Context<ConsentStateContextValue | undefined>;
//# sourceMappingURL=consent-manager-context.d.ts.map