import type { i18n as I18nInstance } from 'i18next'; import type { ChatConfig } from './types/index.ts'; export interface CreateChatOptions extends Partial { /** CSS selector or DOM element where the chat will mount. * If omitted (or the selector does not match anything), a `
` is * automatically created, appended to ``, and the shadow root is * attached to that div. */ target?: string | HTMLElement; /** Initial UI language code (e.g. 'en', 'sk'). Applied immediately via `setLanguage()`. */ language?: string; /** Isolates this instance's persisted settings/session storage (and in-memory config/theme/ * conversation state) from any other chatui instance mounted on the same page - e.g. a * host's own floating widget alongside a page's embedded demo. Only needed when multiple * instances can be mounted simultaneously; a single instance per page can omit it. */ storageNamespace?: string; } export interface ChatInstance { /** Unmount the chat and detach React. */ unmount(): void; /** Update the config without remounting. */ setConfig(patch: Partial): void; /** Switch the active theme without remounting. */ setTheme(id: string): void; /** Switch the UI language without remounting. */ setLanguage(lang: string): void; /** This instance's i18next instance, for registering extra UI languages at runtime via * `addResourceBundle()`. The widget does not read the global i18next singleton, so a bundle * registered there will not reach it - use this. `undefined` until the instance has mounted * (only possible when createChat() was called before DOMContentLoaded). */ readonly i18n: I18nInstance | undefined; } export declare function createChat(opts: CreateChatOptions): ChatInstance;