import { Properties, User } from "../core/internal/model/model"; export interface HackleExperiment { key: number; version: number; variations: HackleVariation[]; } export interface HackleVariation { key: string; parameters: Record; } export interface HackleInAppMessageListener { /** * Called before the InAppMessage is presented. */ beforeInAppMessageOpen?(inAppMessage: HackleInAppMessage): void; /** * Called after an InAppMessage is presented. */ afterInAppMessageOpen?(inAppMessage: HackleInAppMessage): void; /** * Called before the InAppMessage is closed. */ beforeInAppMessageClose?(inAppMessage: HackleInAppMessage): void; /** * Called after an InAppMessage is closed. */ afterInAppMessageClose?(inAppMessage: HackleInAppMessage): void; /** * Called when a clickable element is clicked in an InAppMessage. * * @param view The view presenting the InAppMessage * @param inAppMessage The InAppMessage being presented * @param action An action performed by the user by clicking InAppMessage. * * @return boolean indicating whether the click action was custom handled. * If true, Hackle SDK only track a click event and do nothing else. * If false, track click event and handle the click action. */ onInAppMessageClick?(inAppMessage: HackleInAppMessage, view: HackleInAppMessageView, action: HackleInAppMessageAction): boolean; } export interface HackleInAppMessageView { close(): void; inAppMessage: HackleInAppMessage; } export interface HackleInAppMessage { key: number; } export declare type HackleInAppMessageActionType = "CLOSE" | "LINK"; export declare type HackleInAppMessageActionLinkTarget = "CURRENT" | "NEW_TAB" | "NEW_WINDOW"; export interface HackleInAppMessageLink { url: string; target: HackleInAppMessageActionLinkTarget; shouldCloseAfterLink: boolean; } export interface HackleInAppMessageAction { type: HackleInAppMessageActionType; close?: { hideDurationMillis: number | null; }; link?: HackleInAppMessageLink; } export interface HacklePage { pageName: string; properties?: Properties; } export interface HackleSessionPolicy { timeoutMillis?: number; persistCondition?: HackleSessionPersistCondition; } export interface HackleSessionPersistCondition { (oldUser: User, newUser: User): boolean; } export declare const HackleSessionPersistConditions: { readonly ALWAYS_NEW_SESSION: (_oldUser: User, _newUser: User) => boolean; readonly NULL_TO_USER_ID: (oldUser: User, newUser: User) => boolean; };