import { CSSProperties, FC, PropsWithChildren } from 'react'; import { Components } from 'react-markdown'; import { Session } from './types'; import { ChatTheme } from './theme'; import { ChatViewType } from './ChatContext'; import { Plugin } from 'unified'; import { ComponentCatalog } from './ComponentCatalog/types'; export interface ChatProps extends PropsWithChildren { /** * The style to apply to the root element. */ style?: CSSProperties; /** * The class name to apply to the root element. */ className?: string; /** * The type of prompt to display. * * - Companion: Smaller prompt screen with session lists. * - Console: Full screen experience. * - Chat: Only chat, no sessions. * @default 'console' */ viewType?: ChatViewType; /** * The list of sessions to display. */ sessions: Session[]; /** * The ID of the currently active session. */ activeSessionId?: string; /** * Custom theme for the chat. * @default chatTheme */ theme?: ChatTheme; /** * Remark plugins to apply to the request/response. * @default undefined */ remarkPlugins?: Plugin[]; /** * Custom markdown components to override default rendering. * Use this to add support for custom elements like charts. */ markdownComponents?: Components; /** * A component catalog created via `componentCatalog()`. * Enables dynamic component rendering from LLM responses using * fenced code blocks (e.g. ```component). * * This automatically wires in the necessary remark plugin and * markdown component overrides. For advanced control, use the * catalog's `remarkPlugin` and `components` properties directly * via the `remarkPlugins` and `markdownComponents` props instead. */ components?: ComponentCatalog; /** * Whether to display a loading state. */ isLoading?: boolean; /** * Whether to disable the chat. */ disabled?: boolean; /** * Callback function to handle when a session is selected. */ onSelectSession?: (sessionId: string) => void; /** * Callback function to handle when a session is deleted. */ onDeleteSession?: (sessionId: string) => void; /** * Callback function to handle creating a new session. */ onNewSession?: () => void; /** * Callback function to handle sending a new message. */ onSendMessage?: (message: string) => void; /** * Callback function to handle stopping the current action. */ onStopMessage?: () => void; /** * Callback function to handle file upload. */ onFileUpload?: (file: File) => void; } export declare const Chat: FC;