import type { VALID_CURRENCY_CODES } from "./constants"; import type { NotificationSubscriptionTypes } from "./core/notification-subscription-types"; import type { GenderOptions } from "./core/set-user-gender"; import type { ClickAction, CropType, DismissType, ImageStyle, OpenTarget, Orientation, SlideFrom, TextAlignment } from "./models/in-app-messages/constants"; import type { ControlMessage } from "./models/in-app-messages/control-message"; import type { FullScreenMessage } from "./models/in-app-messages/full-screen-message"; import type { HtmlMessage } from "./models/in-app-messages/html-message"; import type { InAppMessage } from "./models/in-app-messages/in-app-message"; import type { InAppMessageButton } from "./models/in-app-messages/in-app-message-button"; import type { ModalMessage } from "./models/in-app-messages/modal-message"; import type { SlideUpMessage } from "./models/in-app-messages/slide-up-message"; import type { StorageKeys } from "./storage-keys"; export type LoggerFunctionType = (message: string) => void; export type BrazeStorageIdKey = (typeof StorageKeys.IDs)[keyof typeof StorageKeys.IDs]; export type BrazeStorageObjectKey = (typeof StorageKeys.Objects)[keyof typeof StorageKeys.Objects]; export type BrazeStorageKey = BrazeStorageIdKey | BrazeStorageObjectKey | typeof StorageKeys.OptOutFlag; export type SubscriptionGroupStatuses = "subscribed" | "unsubscribed"; export type None = null | undefined; export type NonNullValue = string | number | boolean | Date; export type GenericValue = NonNullValue | null; export type GenericObject = { [key: string]: GenericValue | GenericObject | (GenericObject | NonNullValue)[]; }; export type CustomUserAttributeValue = GenericObject | GenericObject[] | GenericValue | string[]; export type RequestImmediateDataFlushCallback = (success?: boolean) => void; export type Genders = (typeof GenderOptions)[keyof typeof GenderOptions]; export type NotificationSubscriptionType = (typeof NotificationSubscriptionTypes)[keyof typeof NotificationSubscriptionTypes]; export type CurrencyCode = (typeof VALID_CURRENCY_CODES)[number]; export type SubscribeToInAppMessageCallbackType = (inAppMessage: InAppMessage | ControlMessage) => void; export type SubscribeToSdkAuthFailureCallbackType = (error: { errorCode: number; reason?: string; userId?: string; signature?: string; }) => void; export type SlideFromOptions = (typeof SlideFrom)[keyof typeof SlideFrom]; export type ClickActionOptions = (typeof ClickAction)[keyof typeof ClickAction]; export type DismissTypeOptions = (typeof DismissType)[keyof typeof DismissType]; export type OpenTargetOptions = (typeof OpenTarget)[keyof typeof OpenTarget]; export type ImageStyleOptions = (typeof ImageStyle)[keyof typeof ImageStyle]; export type OrientationOptions = (typeof Orientation)[keyof typeof Orientation]; export type TextAlignmentOptions = (typeof TextAlignment)[keyof typeof TextAlignment]; export type CropTypeOptions = (typeof CropType)[keyof typeof CropType]; export interface InAppMessageProps { message?: string; messageAlignment?: TextAlignmentOptions; slideFrom?: SlideFromOptions; extras?: Record; triggerId?: string; clickAction?: ClickActionOptions; uri?: string; openTarget?: OpenTargetOptions; dismissType?: DismissTypeOptions; duration?: number; icon?: string; imageUrl?: string; imageStyle?: ImageStyleOptions; iconColor?: number; iconBackgroundColor?: number; backgroundColor?: number; textColor?: number; closeButtonColor?: number; animateIn?: boolean; animateOut?: boolean; header?: string; headerAlignment?: string; headerTextColor?: number; frameColor?: number; buttons?: InAppMessageButton[]; cropType?: CropTypeOptions; orientation?: OrientationOptions; htmlId?: string; css?: string; messageExtras?: Record | None; } export interface HtmlMessageProps extends Omit { messageFields?: Record; } export interface FullScreenMessageProps extends Omit { } export interface ModalMessageProps extends Omit { } export interface SlideUpMessageProps extends Omit { } export type InAppMessageSubclass = ControlMessage | FullScreenMessage | HtmlMessage | ModalMessage | SlideUpMessage; export type WhenTemplatedCallback = (inAppMessage: InAppMessageSubclass) => void;