import { TurboModule, TurboModuleRegistry } from 'react-native'; import { BatchInboxFetcher, BatchUserAttribute, IInboxNotification } from './Batch'; export interface Spec extends TurboModule { addListener: (eventName: string) => void; removeListeners: (count: number) => void; getConstants(): { NOTIFICATION_TYPES: { NONE: number; SOUND: number; VIBRATE: number; LIGHTS: number; ALERT: number; }; }; // Core Module optIn(): Promise; optOut(): Promise; optOutAndWipeData(): Promise; isOptedOut(): Promise; updateAutomaticDataCollection(dataCollection: Object): void; showDebugView(): void; // Push Module push_setShowNotifications(enabled: boolean): void; push_shouldShowNotifications(): Promise; push_clearBadge(): void; push_dismissNotifications(): void; push_getLastKnownPushToken(): Promise; push_requestNotificationAuthorization(): void; push_requestProvisionalNotificationAuthorization(): void; push_refreshToken(): void; push_setShowForegroundNotification(enabled: boolean): void; push_getInitialDeeplink(): Promise; // Messaging Module messaging_showPendingMessage(): Promise; messaging_setNotDisturbed(active: boolean): Promise; messaging_disableDoNotDisturbAndShowPendingMessage(): Promise; messaging_setFontOverride( normalFontName?: string | null, boldFontName?: string | null, italicFontName?: string | null, italicBoldFontName?: string | null ): Promise; // Inbox Module inbox_getFetcher(options: Object): Promise; inbox_fetcher_destroy(fetcherIdentifier: string): Promise; inbox_fetcher_hasMore(fetcherIdentifier: string): Promise; inbox_fetcher_markAllAsRead(fetcherIdentifier: string): Promise; inbox_fetcher_markAsRead(fetcherIdentifier: string, notificationIdentifier: string): Promise; inbox_fetcher_markAsDeleted(fetcherIdentifier: string, notificationIdentifier: string): Promise; inbox_fetcher_fetchNewNotifications(fetcherIdentifier: string): Promise<{ notifications: IInboxNotification[]; endReached: boolean; foundNewNotifications: boolean; }>; inbox_fetcher_fetchNextPage(fetcherIdentifier: string): Promise<{ notifications: IInboxNotification[]; endReached: boolean; }>; inbox_fetcher_displayLandingMessage(fetcherIdentifier: string, notificationIdentifier: string): Promise; inbox_fetcher_setFilterSilentNotifications(fetcherIdentifier: string, filterSilentNotifications: boolean): Promise; // User Module user_getInstallationId(): Promise; user_getIdentifier(): Promise; user_getRegion(): Promise; user_getLanguage(): Promise; user_getAttributes(): Promise<{ [key: string]: BatchUserAttribute }>; user_getTags(): Promise<{ [key: string]: string[] }>; user_clearInstallationData(): void; // Profile Module profile_identify(identifier: string | null): void; profile_trackEvent(name: string, data?: Object): Promise; profile_trackLocation(serializedLocation: Object): void; profile_saveEditor(actions: Object[]): void; } export default TurboModuleRegistry.get('RNBatchModule') as Spec | null;