/** @jsx jsx */ import React from 'react'; import { CustomerMetadata, Message, WidgetSettings } from '@papercups-io/browser'; import { WidgetConfig } from '../utils'; import Logger from '../logger'; export declare type SharedProps = { token: string; inbox?: string; accountId?: string; title?: string; subtitle?: string; primaryColor?: string; baseUrl?: string; greeting?: string; awayMessage?: string; customer?: CustomerMetadata | null; newMessagePlaceholder?: string; emailInputPlaceholder?: string; newMessagesNotificationText?: string; agentAvailableText?: string; agentUnavailableText?: string; showAgentAvailability?: boolean; iframeUrlOverride?: string; requireEmailUpfront?: boolean; hideOutsideWorkingHours?: boolean; popUpInitialMessage?: boolean | number; customIconUrl?: string; disableAnalyticsTracking?: boolean; debug?: boolean; onChatLoaded?: ({ open, close, identify, }: { open: () => void; close: () => void; identify: (data: any) => void; }) => void; onChatOpened?: () => void; onChatClosed?: () => void; onMessageSent?: (message: Message) => void; onMessageReceived?: (message: Message) => void; setDefaultTitle?: (settings: WidgetSettings) => string | Promise; setDefaultSubtitle?: (settings: WidgetSettings) => string | Promise; setDefaultGreeting?: (settings: WidgetSettings) => string | Promise; }; declare type Props = SharedProps & { defaultIsOpen?: boolean; isOpenByDefault?: boolean; persistOpenState?: boolean; canToggle?: boolean; children: (data: any) => any; }; declare type State = { isOpen: boolean; isLoaded: boolean; query: string; config: WidgetConfig; shouldDisplayNotifications: boolean; isTransitioning: boolean; }; declare class ChatWidgetContainer extends React.Component { iframeRef: any; storage: any; subscriptions: Array<() => void>; logger: Logger; EVENTS: string[]; constructor(props: Props); componentDidMount(): Promise; componentWillUnmount(): void; componentDidUpdate(prevProps: Props): void; shouldUpdateCustomer: (current: any, previous: any) => boolean; getDefaultTitle: (settings: WidgetSettings) => Promise; getDefaultSubtitle: (settings: WidgetSettings) => Promise; getDefaultGreeting: (settings: WidgetSettings) => Promise; setIframeRef: (el: HTMLIFrameElement) => void; getIframeUrl: () => string; handleConfigUpdated: (updates: WidgetConfig) => void; handleSetCustomerId: (id?: any) => void; handleCustomerIdUpdated: (id?: any) => void; fetchWidgetSettings: () => Promise; updateWidgetSettingsMetadata: () => Promise; hasValidPayloadIdentity: (payload: any) => boolean; customEventHandlers: (event: any) => void | null; postMessageHandlers: (msg: any) => void | null; send: (event: string, payload?: any) => void; handleMessageReceived: (message: Message) => void; handleMessageSent: (message: Message) => void; handleUnseenMessages: (payload: any) => void; handleMessagesSeen: () => void; shouldOpenByDefault: () => boolean; handleChatLoaded: () => void; formatCustomerMetadata: (customer: CustomerMetadata | null | undefined) => {}; identify: (data: CustomerMetadata) => void; updateCustomerMetadata: (customerId: string | undefined, data: CustomerMetadata | null | undefined) => void; sendCustomerUpdate: (payload: any) => void; handleCacheCustomerId: (payload: any) => void; emitToggleEvent: (isOpen: boolean) => void; handleOpenWidget: () => void; handleCloseWidget: () => void; handleToggleOpen: () => void; render(): JSX.Element | null; } export default ChatWidgetContainer;