/** * TurboModule specification for cm-sdk-react-native-v3 * * This module defines the native interface for the consent management SDK. * All types are defined in this file so codegen can properly parse them. */ import type { TurboModule } from 'react-native'; export type ConsentStatusValue = 'granted' | 'denied' | 'choiceDoesntExist'; /** * Google Consent Mode v2 consent types. * @see https://developers.google.com/tag-platform/security/guides/consent */ export type GoogleConsentType = 'granted' | 'denied'; /** * Event payload for consent received events. */ export type ConsentReceivedEvent = { consent: string; jsonObject: { [key: string]: unknown; }; }; /** * Event payload for error events. */ export type ErrorEvent = { error: string; }; /** * Event payload for link click events. */ export type LinkClickEvent = { url: string; }; /** * Event payload for ATT status change events. */ export type ATTStatusChangeEvent = { oldStatus: number; newStatus: number; lastUpdated: number; }; /** * URL configuration for the CMP endpoint. */ export type UrlConfig = { id: string; domain: string; language: string; appName: string; /** Reserved for specific CMP setups. */ jsonConfig?: string; noHash?: boolean; /** WebView connection timeout in ms. Default 3000. 0 disables timeout. */ webViewConnectionTimeoutMillis?: number; /** Optional regulation override like `GDPR` or `LGPD`. */ forceRegulation?: string; }; /** * WebView position options. */ export declare enum WebViewPosition { FullScreen = "fullScreen", HalfScreenTop = "halfScreenTop", HalfScreenBottom = "halfScreenBottom", Custom = "custom" } /** * Custom rectangle for WebView positioning. */ export type WebViewRect = { x: number; y: number; width: number; height: number; }; /** * Background style types for the consent layer. */ export declare enum BackgroundStyleType { Dimmed = "dimmed", Color = "color", Blur = "blur", None = "none" } /** * Blur effect styles (iOS only). */ export declare enum BlurEffectStyle { Light = "light", Dark = "dark", ExtraLight = "extraLight" } /** * App Tracking Transparency status values (iOS). * Maps to Apple's ATTrackingManagerAuthorizationStatus. */ export declare enum ATTStatus { NotDetermined = 0, Restricted = 1, Denied = 2, Authorized = 3 } /** * Background style configuration for the consent layer. */ export type WebViewBackgroundStyle = { type: 'dimmed'; color?: string | number; opacity?: number; } | { type: 'color'; color: string | number; } | { type: 'blur'; blurEffectStyle?: string; fallbackColor?: string | number; fallbackOpacity?: number; } | { type: 'none'; }; /** * WebView configuration for the consent layer appearance. */ export type WebViewConfig = { position?: string; customRect?: WebViewRect; cornerRadius?: number; respectsSafeArea?: boolean; allowsOrientationChanges?: boolean; darkMode?: boolean; /** Android-only. */ navigationBarColor?: string | number; backgroundStyle?: WebViewBackgroundStyle; }; /** * Comprehensive user consent status information. */ export type UserStatus = { status: string; /** @deprecated Use `status`. Kept for Android backward compatibility. */ hasUserChoice?: string; vendors: { [key: string]: string; }; purposes: { [key: string]: string; }; tcf: string; addtlConsent: string; regulation: string; }; /** * Google Consent Mode v2 status object. * @see https://developers.google.com/tag-platform/security/guides/consent */ export type GoogleConsentModeStatus = { ad_storage?: string; analytics_storage?: string; ad_user_data?: string; ad_personalization?: string; }; export type ThirdPartyConsentStatus = { [key: string]: boolean; }; /** * Helper factory to build strongly-typed background styles. */ export declare const BackgroundStyle: { readonly dimmed: (color?: string | number, opacity?: number) => WebViewBackgroundStyle; readonly color: (color: string | number) => WebViewBackgroundStyle; readonly blur: (blurEffectStyle?: BlurEffectStyle) => WebViewBackgroundStyle; readonly none: () => WebViewBackgroundStyle; }; /** * TurboModule specification for the native consent management module. * Implements the React Native New Architecture TurboModule protocol. */ export interface Spec extends TurboModule { setUrlConfig(config: UrlConfig): Promise; setWebViewConfig(config: WebViewConfig): Promise; setATTStatus(status: number): Promise; checkAndOpen(jumpToSettings: boolean): Promise; forceOpen(jumpToSettings: boolean): Promise; getUserStatus(): Promise; isConsentRequired(): Promise; getStatusForPurpose(purposeId: string): Promise; getStatusForVendor(vendorId: string): Promise; getGoogleConsentModeStatus(): Promise; exportCMPInfo(): Promise; importCMPInfo(cmpString: string): Promise; resetConsentManagementData(): Promise; acceptVendors(vendors: string[]): Promise; rejectVendors(vendors: string[]): Promise; acceptPurposes(purposes: string[], updatePurpose: boolean): Promise; rejectPurposes(purposes: string[], updateVendor: boolean): Promise; rejectAll(): Promise; acceptAll(): Promise; setAutomaticConsentUpdatesEnabled(enabled: boolean): Promise; updateThirdPartyConsent(): Promise; configureAutomaticFirebaseConsentUpdates(enabled: boolean): Promise; setAutomaticFirebaseConsentUpdatesEnabled(enabled: boolean): Promise; isAutomaticFirebaseConsentUpdatesEnabled(): Promise; updateFirebaseConsent(): Promise; isFirebaseAnalyticsAvailable(): Promise; addListener(eventName: string): void; removeListeners(count: number): void; } declare const _default: Spec; export default _default; //# sourceMappingURL=NativeCmSdkReactNativeV3.d.ts.map