import * as react_jsx_runtime from 'react/jsx-runtime'; import { FC, ComponentType } from 'react'; import { Components } from 'react-markdown'; type ChatEvent = { title: string; description?: string; status: 'pending' | 'success' | 'error'; data?: any; }; declare function ChatEvent({ event, className, renderData, }: { event: ChatEvent; className?: string; renderData?: (data: ChatEvent['data']) => React.ReactNode; }): react_jsx_runtime.JSX.Element; type FileData = { filename: string; mediaType: string; url: string; }; declare function ChatFile({ file, className, }: { file: FileData; className?: string; }): react_jsx_runtime.JSX.Element; type SuggestedQuestionsData = string[]; declare function SuggestedQuestions({ questions, sendMessage, requestData, className, }: { questions: SuggestedQuestionsData; sendMessage: ChatContext['sendMessage']; requestData?: any; className?: string; }): false | react_jsx_runtime.JSX.Element; type MessagePart = TextPart | DataPart | FilePart | AnyPart; declare const TextPartType: "text"; declare const FilePartType: "data-file"; type TextPart = { type: typeof TextPartType; text: string; }; type DataPart = { id?: string; type: T; data: D; }; type FilePart = DataPart; type AnyPart = { id?: string; type: T; data?: any; }; type JSONValue = null | string | number | boolean | { [value: string]: JSONValue; } | JSONValue[]; interface Message { id: string; role: 'system' | 'user' | 'assistant'; parts: MessagePart[]; } type ChatRequestOptions = { headers?: Record | Headers; body?: object; }; type ChatHandler = { messages: Message[]; status: 'submitted' | 'streaming' | 'ready' | 'error'; sendMessage: (msg: Message, opts?: ChatRequestOptions) => Promise; stop?: () => Promise; regenerate?: (opts?: { messageId?: string; } & ChatRequestOptions) => void; setMessages?: (messages: Message[]) => void; }; type ChatContext = ChatHandler & { input: string; setInput: (input: string) => void; requestData: any; setRequestData: (data: any) => void; isLoading: boolean; }; type DocumentFile = { id: string; name: string; size: number; type: string; url: string; refs?: string[]; }; type SourceNode = { id: string; metadata: Record; score?: number; text: string; url?: string; }; type Document = { url: string; sources: SourceNode[]; }; declare function DocumentInfo({ document, className, onRemove, startIndex, }: { document: Document; className?: string; onRemove?: () => void; startIndex?: number; }): react_jsx_runtime.JSX.Element; type SourceData = { nodes: SourceNode[]; }; declare function preprocessSourceNodes(nodes: SourceNode[]): SourceNode[]; declare function ChatSources({ data, className, }: { data: SourceData; className?: string; }): react_jsx_runtime.JSX.Element | null; interface CitationComponentProps { index: number; node: SourceNode; } declare function Citation({ index }: CitationComponentProps): react_jsx_runtime.JSX.Element; interface LanguageRendererProps { code: string; className?: string; } type ReactStyleMarkdownComponents = { [K in keyof Components]?: Extract>; }; interface MarkdownProps { content: string; sources?: SourceData; backend?: string; components?: ReactStyleMarkdownComponents; citationComponent?: ComponentType; className?: string; languageRenderers?: Record>; } declare function Markdown({ content, sources, backend, citationComponent: CitationComponent, className: customClassName, components, languageRenderers, }: MarkdownProps): react_jsx_runtime.JSX.Element; interface Props { language: string; value: string; className?: string; showHeader?: boolean; headerClassName?: string; codeClassName?: string; } interface languageMap { [key: string]: string | undefined; } declare const programmingLanguages: languageMap; declare const generateRandomString: (length: number, lowercase?: boolean) => string; declare const CodeBlock: FC; interface PdfDialogProps { documentId: string; url: string; trigger: React.ReactNode; } declare function PdfDialog(props: PdfDialogProps): react_jsx_runtime.JSX.Element; interface StarterQuestionsProps { questions: string[]; sendMessage: ChatContext['sendMessage']; className?: string; } declare function StarterQuestions(props: StarterQuestionsProps): react_jsx_runtime.JSX.Element; declare function ImagePreview({ url, onRemove, }: { url: string; onRemove: () => void; }): react_jsx_runtime.JSX.Element; interface FileUploaderProps { config?: { inputId?: string; fileSizeLimit?: number; allowedExtensions?: string[]; disabled: boolean; multiple?: boolean; }; onFileUpload: (file: File) => Promise; onFileError?: (errMsg: string) => void; className?: string; } declare function FileUploader({ config, onFileUpload, onFileError, className, }: FileUploaderProps): react_jsx_runtime.JSX.Element; type CodeEditorLanguage = 'javascript' | 'python' | 'html' | 'css'; declare function CodeEditor({ code, onChange, className, language, }: { code: string; onChange?: (code: string) => void; className?: string; language?: 'javascript' | 'python' | 'html' | 'css'; }): react_jsx_runtime.JSX.Element; declare function fileExtensionToEditorLang(extension: string): CodeEditorLanguage | undefined; declare function DocumentEditor({ content, onChange, className, showToolbar, }: { content: string; onChange?: (markdown: string) => void; className?: string; showToolbar?: boolean; }): react_jsx_runtime.JSX.Element; export { ChatEvent, ChatFile, ChatSources, Citation, CodeBlock, CodeEditor, DocumentEditor, DocumentInfo, FileUploader, ImagePreview, Markdown, PdfDialog, StarterQuestions, SuggestedQuestions, fileExtensionToEditorLang, generateRandomString, preprocessSourceNodes, programmingLanguages }; export type { CitationComponentProps, Document, DocumentFile, FileData, FileUploaderProps, LanguageRendererProps, MarkdownProps, PdfDialogProps, SourceData, SourceNode, SuggestedQuestionsData };