export type ProductType = "popup" | "full"; export type LanguageCode = "en"; export type MessageSendType = "text" | "quick_reply" | "postback"; export type ApiMethod = "GET" | "POST"; export interface CreateChatBotApiRequestOptions { apiUrl: string; apiMethod?: ApiMethod; headers?: HeadersInit; } export interface ChatRequestPayload { recipientId?: string; text: string; type: MessageSendType; payload?: string; } export interface Recipient { id: string; } export interface WebUrlAction { type: "web_url"; url: string; webview_height_ratio?: "compact" | "tall" | "full"; } export interface PostbackAction { type: "postback"; title: string; payload: string; } export interface UrlButtonAction { type: "web_url"; title: string; url: string; } export type CardButton = UrlButtonAction | PostbackAction; export interface GenericElement { title: string; image_url: string; subtitle: string; default_action?: WebUrlAction; buttons?: CardButton[]; price?: string; currency?: string; } export interface GenericTemplatePayload { template_type: "generic"; elements: GenericElement[]; } export interface MessageAttachment { type: "template"; payload: GenericTemplatePayload; } export interface QuickReply { content_type: "text"; title: string; payload: string; image_url?: string; } export interface ChatResponseMessage { text?: string; attachment?: MessageAttachment; quick_replies?: QuickReply[]; } export interface ChatResponse { recipient: Recipient; message: ChatResponseMessage; } export interface LanguagePack { headerTitle: string; inputPlaceholder: string; sendLabel: string; typingLabel: string; launcherLabel: string; emptyStateLabel: string; } export interface ChatBotSDKConfig { container: string | HTMLElement; productType?: ProductType; language?: LanguageCode; title?: string; placeholder?: string; primaryColor?: string; recipientId?: string; apiUrl?: string; apiMethod?: ApiMethod; api?: { request?: (payload: ChatRequestPayload) => Promise; }; mockResponse?: ChatResponse | ((payload: ChatRequestPayload) => Promise | ChatResponse); } export interface ChatBotSDKElementConfig { productType?: ProductType; language?: LanguageCode; title?: string; placeholder?: string; primaryColor?: string; recipientId?: string; apiUrl?: string; apiMethod?: ApiMethod; }