import { default as ChatWidget } from './components/ChatWidget.svelte'; import { ChatWidgetConfig, ConversationPreview, ConversationWithMessages, ChatWidgetEventType, ChatWidgetEventCallback, ConversationRepository, ChatWidgetEventEmitter } from '@classic-homes/chat-core'; export * from '@classic-homes/chat-core'; export { ChatWidget }; /** * Widget API interface returned by initChatWidget */ export interface ChatWidgetAPI { /** Clear all messages and reset the chat */ clearMessages: () => void; /** Unmount the widget */ destroy: () => void; /** * Get the repository for conversation management * @deprecated Use the conversation management methods instead (listConversations, selectConversation, etc.) */ getRepository: () => ConversationRepository; /** Refresh the widget (reload conversations from storage) */ refresh: () => void; /** Get all conversations, sorted by most recent first */ listConversations: () => Promise; /** Get a specific conversation with all its messages */ getConversation: (id: string) => Promise; /** Select/switch to a conversation */ selectConversation: (id: string) => Promise; /** Start a new conversation (clears current state) */ startNewConversation: () => Promise; /** Delete a conversation */ deleteConversation: (id: string) => Promise; /** Rename a conversation */ renameConversation: (id: string, title: string) => Promise; /** Get the current active conversation ID (null if new chat) */ getCurrentConversationId: () => Promise; /** Get the current conversation title */ getCurrentTitle: () => Promise; /** * Subscribe to widget events * @returns Unsubscribe function */ on: (event: T, callback: ChatWidgetEventCallback) => () => void; /** * Subscribe to an event, automatically unsubscribe after first call * @returns Unsubscribe function */ once: (event: T, callback: ChatWidgetEventCallback) => () => void; /** Get the event emitter instance for advanced usage */ getEventEmitter: () => ChatWidgetEventEmitter; } /** * Programmatic initialization function * Only works in browser environment * * @returns ChatWidgetAPI with methods to interact with the widget */ export declare function initChatWidget(target: HTMLElement, config: ChatWidgetConfig): ChatWidgetAPI | null; export declare const version = "0.1.0"; //# sourceMappingURL=index.d.ts.map