/** * @module cm-sdk-react-native-v3 * @description Consent Management Platform SDK for React Native (New Architecture) * * This module provides a comprehensive interface for managing user consent * in React Native applications, supporting GDPR, CCPA, and other privacy regulations. * * @example * ```typescript * import CmSdkReactNativeV3, { * setUrlConfig, * setWebViewConfig, * addConsentListener, * WebViewPosition, * BackgroundStyle, * } from 'cm-sdk-react-native-v3-new-arch'; * * // Configure and initialize * await setUrlConfig({ id: 'your-id', domain: '...', language: 'EN', appName: 'App' }); * await setWebViewConfig({ position: WebViewPosition.HalfScreenBottom }); * * // Listen for consent * const sub = addConsentListener((consent, data) => console.log(consent)); * * // Show consent layer * await CmSdkReactNativeV3.checkAndOpen(false); * ``` */ import type { EmitterSubscription } from 'react-native'; import { type ConsentReceivedEvent, type ConsentStatusValue, type ErrorEvent, type GoogleConsentType, type LinkClickEvent, type ATTStatusChangeEvent, type UrlConfig, type WebViewConfig, type WebViewRect, type WebViewBackgroundStyle, WebViewPosition, BackgroundStyleType, BlurEffectStyle, ATTStatus, BackgroundStyle, type UserStatus, type GoogleConsentModeStatus, type ThirdPartyConsentStatus } from './NativeCmSdkReactNativeV3'; declare const CmSdkReactNativeV3: import("./NativeCmSdkReactNativeV3").Spec; /** * Indicates whether the TurboModule (New Architecture) is being used. * When `true`, the module is loaded via TurboModuleRegistry for optimal performance. */ export declare const isTurboModuleEnabled: boolean; /** * Registers a listener for consent received events. * Called when the user makes a consent decision in the consent layer. * * @param callback - Function called with the consent string and parsed JSON data * @returns Subscription that should be removed on cleanup * * @example * ```typescript * useEffect(() => { * const subscription = addConsentListener((consent, data) => { * console.log('TCF String:', consent); * console.log('Consent data:', data); * }); * return () => subscription.remove(); * }, []); * ``` */ export declare const addConsentListener: (callback: (consent: string, jsonObject: Record) => void) => EmitterSubscription; /** * Registers a listener for when the consent layer is shown. * * @param callback - Function called when consent layer becomes visible * @returns Subscription that should be removed on cleanup */ export declare const addShowConsentLayerListener: (callback: () => void) => EmitterSubscription; /** * Registers a listener for when the consent layer is closed. * * @param callback - Function called when consent layer is dismissed * @returns Subscription that should be removed on cleanup */ export declare const addCloseConsentLayerListener: (callback: () => void) => EmitterSubscription; /** * Registers a listener for error events from the CMP. * * @param callback - Function called with error message when an error occurs * @returns Subscription that should be removed on cleanup */ export declare const addErrorListener: (callback: (error: string) => void) => EmitterSubscription; /** * Registers a listener for link click events in the consent layer. * Use this to handle external links (e.g., privacy policy) custom behavior. * * @param callback - Function called with the clicked URL * @returns Subscription that should be removed on cleanup */ export declare const addClickLinkListener: (callback: (url: string) => void) => EmitterSubscription; /** * Registers a listener for ATT (App Tracking Transparency) status changes. * iOS only - will not fire on Android. * * @param callback - Function called with old/new status and timestamp * @returns Subscription that should be removed on cleanup */ export declare const addATTStatusChangeListener: (callback: (event: ATTStatusChangeEvent) => void) => EmitterSubscription; /** * Configures the CMP URL endpoint. * Must be called before any other CMP operations. * * @param config - URL configuration object * @returns Promise that resolves when configuration is complete * * @example * ```typescript * await setUrlConfig({ * id: 'your-cmp-id', * domain: 'delivery.consentmanager.net', * language: 'EN', * appName: 'MyApp', * noHash: true, * }); * ``` */ export declare const setUrlConfig: (config: UrlConfig) => Promise; /** * Configures the consent layer WebView appearance. * Call this before opening the consent layer to customize its look. * * @param config - WebView configuration object * @returns Promise that resolves when configuration is complete * * @example * ```typescript * await setWebViewConfig({ * position: WebViewPosition.HalfScreenBottom, * backgroundStyle: BackgroundStyle.blur(BlurEffectStyle.Dark), * cornerRadius: 20, * respectsSafeArea: true, * }); * ``` */ export declare const setWebViewConfig: (config: WebViewConfig) => Promise; /** * Sets the App Tracking Transparency (ATT) status for iOS. * Call this after requesting ATT permission from the user. * Has no effect on Android. * * @param status - ATT authorization status (0-3) * @throws Error if status is not a valid ATTStatus value * @returns Promise that resolves when status is set * * @example * ```typescript * import { ATTStatus } from 'cm-sdk-react-native-v3-new-arch'; * * // After ATT request * await setATTStatus(ATTStatus.Authorized); * ``` */ export declare const setATTStatus: (status: ATTStatus | number) => Promise; /** * Checks if consent is required and opens the consent layer if needed. * * @param jumpToSettings - If true, opens directly to settings/preferences page * @returns Promise resolving to true if consent layer was shown * * @example * ```typescript * // Show consent layer only if needed * const wasShown = await checkAndOpen(false); * * // Jump directly to settings * await checkAndOpen(true); * ``` */ export declare const checkAndOpen: (jumpToSettings: boolean) => Promise; /** * Forces the consent layer to open regardless of current consent state. * * @param jumpToSettings - If true, opens directly to settings/preferences page * @returns Promise resolving to true when consent layer is shown */ export declare const forceOpen: (jumpToSettings: boolean) => Promise; /** * Gets the current user consent status including all vendors and purposes. * * @returns Promise resolving to complete user consent status * * @example * ```typescript * const status = await getUserStatus(); * console.log('TCF String:', status.tcf); * console.log('Vendors:', status.vendors); * console.log('Purposes:', status.purposes); * ``` */ export declare const getUserStatus: () => Promise; /** * Checks if consent is required from the user. * Does not open the consent layer. * * @returns Promise resolving to true if consent is needed */ export declare const isConsentRequired: () => Promise; /** * Gets the consent status for a specific purpose. * * @param purposeId - The purpose ID (e.g., 'c52', 'c53') * @returns Promise resolving to the consent status string */ export declare const getStatusForPurpose: (purposeId: string) => Promise; /** * Gets the consent status for a specific vendor. * * @param vendorId - The vendor ID (e.g., 's2789') * @returns Promise resolving to the consent status string */ export declare const getStatusForVendor: (vendorId: string) => Promise; /** * Gets the Google Consent Mode v2 status. * Useful for Firebase Analytics and Google Ads integration. * * @returns Promise resolving to Google Consent Mode status object * @see https://developers.google.com/tag-platform/security/guides/consent */ export declare const getGoogleConsentModeStatus: () => Promise; /** * Exports the current CMP information as a portable string. * Can be imported later using `importCMPInfo`. * * @returns Promise resolving to the exported CMP string */ export declare const exportCMPInfo: () => Promise; /** * Imports previously exported CMP information. * * @param cmpString - The CMP string from `exportCMPInfo` * @returns Promise resolving to true if import was successful */ export declare const importCMPInfo: (cmpString: string) => Promise; /** * Resets all consent management data. * User will need to provide consent again. * * @returns Promise resolving to true if reset was successful */ export declare const resetConsentManagementData: () => Promise; /** * Accepts consent for specific vendors. * * @param vendors - Array of vendor IDs to accept * @returns Promise resolving to true if successful */ export declare const acceptVendors: (vendors: string[]) => Promise; /** * Rejects consent for specific vendors. * * @param vendors - Array of vendor IDs to reject * @returns Promise resolving to true if successful */ export declare const rejectVendors: (vendors: string[]) => Promise; /** * Accepts consent for specific purposes. * * @param purposes - Array of purpose IDs to accept * @param updatePurpose - Whether to update related purposes * @returns Promise resolving to true if successful */ export declare const acceptPurposes: (purposes: string[], updatePurpose: boolean) => Promise; /** * Rejects consent for specific purposes. * * @param purposes - Array of purpose IDs to reject * @param updateVendor - Whether to update related vendors * @returns Promise resolving to true if successful */ export declare const rejectPurposes: (purposes: string[], updateVendor: boolean) => Promise; /** * Rejects all consent options. * * @returns Promise resolving to true if successful */ export declare const rejectAll: () => Promise; /** * Accepts all consent options. * * @returns Promise resolving to true if successful */ export declare const acceptAll: () => Promise; export declare const setAutomaticConsentUpdatesEnabled: (enabled: boolean) => Promise; export declare const updateThirdPartyConsent: () => Promise; export declare const configureAutomaticFirebaseConsentUpdates: (enabled: boolean) => Promise; export declare const setAutomaticFirebaseConsentUpdatesEnabled: (enabled: boolean) => Promise; export declare const isAutomaticFirebaseConsentUpdatesEnabled: () => Promise; export declare const updateFirebaseConsent: () => Promise; export declare const isFirebaseAnalyticsAvailable: () => Promise; /** * Checks if the React Native New Architecture is enabled. * Useful for debugging and conditional behavior. * * @returns true if New Architecture (TurboModules/Fabric) is enabled */ export declare const isNewArchitectureEnabled: () => boolean; export type { ConsentReceivedEvent, ConsentStatusValue, ErrorEvent, GoogleConsentType, LinkClickEvent, ATTStatusChangeEvent, UrlConfig, WebViewRect, WebViewBackgroundStyle, WebViewConfig, UserStatus, GoogleConsentModeStatus, ThirdPartyConsentStatus, }; export { WebViewPosition, BackgroundStyleType, BlurEffectStyle, ATTStatus, BackgroundStyle, }; export default CmSdkReactNativeV3; //# sourceMappingURL=index.d.ts.map