import { IterablePromise } from '../types'; export declare enum CloseButtonPosition { TopLeft = "top-left", TopRight = "top-right" } export declare enum HandleLinks { OpenAllNewTab = "open-all-new-tab", OpenAllSameTab = "open-all-same-tab", ExternalNewTab = "external-new-tab" } export declare enum DisplayOptions { Immediate = "immediate", Deferred = "deferred" } export declare enum DisplayPosition { Center = "Center", TopRight = "TopRight", BottomRight = "BottomRight", Full = "Full" } export interface InAppDisplaySetting { percentage?: number; displayOption?: string; } export interface WebInAppDisplaySettings { position: DisplayPosition; } export interface InAppMessage { messageId: string; campaignId: number; createdAt: number; expiresAt: number; content: { payload?: Record; html: string | HTMLIFrameElement; inAppDisplaySettings: { top: InAppDisplaySetting; right: InAppDisplaySetting; left: InAppDisplaySetting; bottom: InAppDisplaySetting; bgColor?: { alpha: number; hex: string; }; shouldAnimate?: boolean; }; webInAppDisplaySettings: WebInAppDisplaySettings; }; customPayload: Record; trigger: { type: string; }; saveToInbox: boolean; inboxMetadata: { title: string; subtitle: string; icon: string; }; priorityLevel: number; read: boolean; } export type PaintIframeProps = { /** html you want to paint to the DOM inside the iframe */ html: string; /** screen position the message should appear in */ position: WebInAppDisplaySettings['position']; /** if the in-app should animate in/out */ shouldAnimate?: boolean; /** The message you want the screen reader to read when popping up the message */ srMessage?: string; /** how many px or % buffer between the in-app message and the top of the screen */ topOffset?: string; /** how many px or % buffer between the in-app message and the bottom of the screen */ bottomOffset?: string; /** how many px or % buffer between the in-app message and the right of the screen */ rightOffset?: string; /** An explicitly set max width for the in-app message. * Only applies to `Center`, `TopRight`, and `BottomRight` positions. */ maxWidth?: string; }; type CloseButton = { color?: string; iconPath?: string; isRequiredToDismissMessage?: boolean; position?: CloseButtonPosition; sideOffset?: string; size?: string | number; topOffset?: string; }; interface SDKInAppMessagesParams { displayInterval?: number; onOpenScreenReaderMessage?: string; onOpenNodeToTakeFocus?: string; topOffset?: string; bottomOffset?: string; rightOffset?: string; animationDuration?: number; handleLinks?: HandleLinks; closeButton?: CloseButton; /** messageId of the latest (i.e., most recent) message in the device's local cache */ latestCachedMessageId?: string; /** Set a default max-width style for message iframe. * Only applies to `Center`, `TopRight`, and `BottomRight` positions. */ maxWidth?: string; } export interface InAppMessagesRequestParams extends SDKInAppMessagesParams { count: number; SDKVersion?: string; packageName: string; } export interface InAppMessageResponse { inAppMessages: Partial[]; } export interface GetInAppMessagesResponse { pauseMessageStream: () => void; resumeMessageStream: () => Promise; request: () => IterablePromise; triggerDisplayMessages: (messages: Partial[]) => Promise; } export type CachedMessage = [string, InAppMessage]; export type BrowserStorageEstimate = StorageEstimate & { /** usageDetails not supported in Safari */ usageDetails?: { indexedDB?: number; }; }; export {};