import { Channel, Socket } from 'phoenix'; import { CustomerMetadata, Message, WidgetSettings } from './types'; import Logger from './logger'; export declare type Config = { accountId: string; customerId?: string | null; inboxId?: string; baseUrl?: string; greeting?: string; awayMessage?: string; customer?: CustomerMetadata; debug?: boolean; setInitialMessage?: (overrides?: Partial) => Array; onSetCustomerId?: (customerId: string | null) => void; onSetConversationId?: (conversationId: string) => void; onSetWidgetSettings?: (settings: WidgetSettings) => void; onPresenceSync?: (data: any) => void; onConversationCreated?: (customerId: string, data: any) => void; onMessageCreated?: (data: any) => void; onMessagesUpdated?: (messages: Array) => void; }; export declare class Papercups { socket: Socket; channel?: Channel; logger: Logger; storage: any; config: Config; customerId: string | null; conversationId: string | null; messages: Array; settings: WidgetSettings; constructor(config: Config); static init: (config: Config) => Papercups; static open: () => boolean; static close: () => boolean; static toggle: () => boolean; start: () => Promise; connect: () => void; disconnect: () => void; setWidgetSettings: (settings: WidgetSettings) => this; setCustomerId: (customerId: string | null) => this; setConversationId: (conversationId: string) => this; setMessages: (messages: Array) => this; listenForAgentAvailability: () => this; listenForNewConversations: (customerId: string) => this; joinConversationChannel: (conversationId: string, fallbackCustomerId?: string | undefined) => this; createNewConversation: (customerId: string) => Promise; initializeNewConversation: (existingCustomerId?: string | null | undefined, email?: string | undefined) => Promise; updateCustomerMetadata: (customerId: string, metadata: CustomerMetadata) => Promise; createNewCustomer: (customer: CustomerMetadata) => Promise; identify: (externalId: string, metadata?: CustomerMetadata) => Promise; createOrUpdateCustomer: (existingCustomerId?: string | null | undefined, metadata?: Partial) => Promise; fetchWidgetSettings: () => Promise; updateWidgetSettingsMetadata: (metadata: any) => Promise; findCustomerByExternalId: (externalId: string, filters?: {}) => Promise; findCustomerByMetadata: (metadata: CustomerMetadata) => Promise; checkForExistingCustomer: (metadata: CustomerMetadata, defaultCustomerId?: string | null) => Promise; updateExistingCustomer: (customerId: string, metadata?: import("./types").Customer | null | undefined) => Promise; fetchLatestCustomerConversation: (customerId: string) => Promise; getCachedCustomerId: () => any; cacheCustomerId: (customerId: string | null) => void; markMessagesAsSeen: () => void; sendNewMessage: (message: Partial, email?: string | undefined) => Promise; handleMessageCreated: (message: Message) => void; isValidCustomer: (customerId: string) => Promise; isValidCustomerId: (customerId?: string | null | undefined) => Promise; formatCustomerMetadata: () => {}; getDefaultGreeting: (overrides?: {}) => Array; fetchLatestConversation: (fallbackCustomerId?: string | null) => Promise; notify: (type: 'slack' | 'email', message: string, options?: {}) => void; }