UNPKG

neochat-widget

Version:

Universal JavaScript SDK and Widget for NeoChat AI Assistant

35 lines (34 loc) 1.22 kB
import { NeoChatConfig, NeoChatInstance, Message } from './types'; export declare class NeoChat implements NeoChatInstance { private config; private widget; private apiClient; private messages; private onMessageCallbacks; private onErrorCallbacks; private onReadyCallbacks; private onCloseCallbacks; constructor(config: NeoChatConfig); private handleMessage; private handleError; private handleReady; private handleClose; sendMessage(content: string, options?: any): Promise<Message>; startTraining(data: any, options?: any): Promise<string>; getMessages(): Message[]; clearMessages(): void; updateConfig(config: Partial<NeoChatConfig>): void; on(event: 'message', callback: (message: Message) => void): void; on(event: 'error', callback: (error: Error) => void): void; on(event: 'ready', callback: () => void): void; on(event: 'close', callback: () => void): void; off(event: string, callback: Function): void; close(): void; destroy(): void; } export declare function init(config: NeoChatConfig): NeoChatInstance; declare const _default: { init: typeof init; NeoChat: typeof NeoChat; }; export default _default;