export type EventHandlers = { onCallerIdMatchFailed: Function; onCallerIdMatchSucceeded: Function; onCreateEngagementFailed: Function; onCreateEngagementSucceeded: Function; onDialNumber: Function; onEndCall: Function; onEngagementCreated: Function; onInitiateCallIdFailed: Function; onInitiateCallIdSucceeded: Function; onNavigateToRecordFailed: Function; onPublishToChannelFailed: Function; onPublishToChannelSucceeded: Function; onFinalizeEngagementFailed: Function; onFinalizeEngagementSucceeded: Function; onReady: Function; onSetCallState: Function; onSetWidgetUrlFailed: Function; onUpdateEngagementFailed: Function; onUpdateEngagementSucceeded: Function; onVisibilityChanged: Function; onFailed: Function; defaultEventHandler?: Function; }; export type IframeOptions = { src: string; height: string; width: string; hostElementSelector: string; }; export type Options = { iFrameOptions?: IframeOptions; debugMode: boolean; eventHandlers: EventHandlers; }; export type IframeManagerOptions = { iFrameOptions?: IframeOptions; debugMode: boolean; onMessageHandler: Function; }; export type OnResize = { width: number; height: number; }; export type SizeInfo = OnResize; export type OnInitialized = { isLoggedIn?: boolean; engagementId?: number; }; export type OnIncomingCall = { externalCallId: string; fromNumber: string; toNumber: string; callStartTime?: number; createEngagement?: boolean; }; export type OnOutgoingCall = { externalCallId: string; fromNumber?: string; toNumber?: string; callStartTime?: number; createEngagement?: boolean; }; export type OnCallAnswered = { externalCallId: string; }; export type OnCallTransferred = { externalCallId: string; }; /** * @deprecated use OnFinalizeEngagement instead */ export type OnPublishToChannel = { externalCallId: string; engagementId: number; }; export type OnFinalizeEngagement = { externalCallId: string; engagementId: number; }; export type OnSetWidgetUrl = { iFrameUrl: string; }; export type EndStatus = "COMPLETED" | "FAILED" | "CANCELED" | "BUSY" | "NO_ANSWER" | "REJECTED" | "MISSED"; export type OnCallEnded = { externalCallId: string; engagementId: number; callEndStatus?: EndStatus; }; export type RawEngagementProperties = { hs_timestamp: number | string; hs_call_body?: string; hs_call_callee_object_id?: string; hs_call_callee_object_type?: string; hs_call_direction?: string; hs_call_disposition?: string; hs_call_duration?: string; hs_call_from_number?: string; hs_call_recording_url?: string; hs_call_status?: string; hs_call_title?: string; hs_call_source?: string; hs_call_to_number?: string; hubspot_owner_id?: string; hs_activity_type?: string; hs_attachment_ids?: string; }; export type OnCallCompleted = { externalCallId: string; engagementId?: number | string; hideWidget?: boolean; engagementProperties?: RawEngagementProperties; }; export type ObjectCoordinates = { portalId: number; objectId: number; objectTypeId: "0-1" | "0-2"; }; export type OnNavigateToRecord = { engagementId?: number; objectCoordinates: ObjectCoordinates; openIn?: "CURRENT_TAB" | "NEW_TAB"; }; export type OnError = { message: string; }; export type OnMessage = { type: string; data?: Object; }; export type ContactIdMatch = { callerIdType: "CONTACT"; objectCoordinates: ObjectCoordinates; firstName: string; lastName: string; email: string; }; export type CompanyIdMatch = { callerIdType: "COMPANY"; objectCoordinates: ObjectCoordinates; name: string; };