// Type definitions for Engage Browser Widget export interface EngageUser { id: string; email?: string; name?: string; [key: string]: any; } export interface EngageConfig { key: string; no_chat?: boolean; debug?: boolean; } export interface EngageAccount { id: string; features?: { chat?: { color?: string; welcome?: string; }; }; } export interface ChatMessage { id: string; body: string; outbound: boolean; read: boolean; timestamp: string; uid: string; } export interface Chat { messages: ChatMessage[]; id: string; } export interface Tour { id: string; steps: TourStep[]; title?: string; description?: string; } export interface TourStep { id: string; selector: string; title: string; content: string; position?: 'top' | 'bottom' | 'left' | 'right'; } export interface Banner { id: string; body: string; style: 'inline' | 'float'; position: 'top' | 'bottom' | 'tr' | 'tl' | 'br' | 'bl'; bgcolor?: string; color?: string; dismiss?: boolean; } export interface EngageAPI { /** * Initialize the Engage widget */ init(config: string | EngageConfig): void; /** * Identify a user */ identify(user: EngageUser): void; /** * Open the chat widget */ openChat(): void; /** * Open a help article */ openHelp(id: string, type?: string, locale?: string): void; /** * Make an API request */ request(endpoint: string, data?: any, method?: string): Promise; } export interface EngageQueue { push(command: [string, ...any[]]): void; } declare global { interface Window { engage?: EngageAPI & { queue?: EngageQueue }; Engage?: EngageAPI; io?: (url: string) => any; } } export declare const Engage: EngageAPI;