import { NativeModules , Platform } from 'react-native' ; import { BatchEventEmitter , EmitterSubscription } from './BatchEventEmitter' ; const RNBatch = NativeModules . RNBatch ; export interface BatchMessagingEventPayload { isPositiveAction : boolean ; trackingId ? : string | null ; webViewAnalyticsIdentifier ? : string | null ; deeplink ? : string | null ; } export const BatchMessaging = { /**
     * Shows the currently enqueued message, if any.
     */ showPendingMessage : ( ) : Promise < void > => RNBatch . messaging_showPendingMessage ( ) , param active setNotDisturbed : ( active ) : Promise < void > => RNBatch . messaging_setNotDisturbed ( active ) , /**
     * Disables do not disturb mode and shows the currently enqueued message, if any.
     */ disableDoNotDisturbAndShowPendingMessage : ( ) : Promise < void > => RNBatch . messaging_disableDoNotDisturbAndShowPendingMessage ( ) , param normalFontName param boldFontName param italicFontName param italicBoldFontName setFontOverride : ( normalFontName ? , boldFontName ? , italicFontName ? , italicBoldFontName ? ) : Promise < void > => { if ( Platform . OS === 'android' ) { return RNBatch . messaging_setTypefaceOverride ( normalFontName , boldFontName ) ; } return RNBatch . messaging_setFontOverride ( normalFontName , boldFontName , italicFontName , italicBoldFontName ) ; } , /**
     * Listen for messaging events
     */ addListener ( eventType , callback ) { const subscription = BatchEventEmitter . addListener ( `messaging_${ eventType }` , callback ) ; return { remove : ( ) => subscription . remove ( ) , } ; } , } ;