UNPKG

@developer.notchatbot/webchat

Version:

A beautiful React chatbot widget with single-file bundle

22 lines (21 loc) 929 B
import { Message } from '../types'; /** * Fetches conversation history from the API * @param conversationId The conversation ID to fetch history for * @param apiKey The API key for authentication * @returns Promise that resolves to conversation data or null if failed */ export declare const fetchConversationHistory: (conversationId: string, apiKey: string) => Promise<any>; /** * Transforms API messages to WebChat message format * @param apiMessages Array of messages from the API * @returns Array of WebChat Message objects */ export declare const transformApiMessagesToWebChat: (apiMessages: any[]) => Message[]; /** * Transforms WebChat messages to API format * @param messages Array of WebChat Message objects * @param conversationId The conversation ID * @returns Array of messages in API format */ export declare const transformWebChatMessagesToApi: (messages: Message[], conversationId: string) => any[];