import type * as React from "react"; /** * Framework-agnostic message shape. Normalize messages from any chat SDK * (AI SDK, LangChain, Mastra, TanStack AI, etc.) into this format. */ export type ChatMessageItem = { /** Unique identifier for the message */ id: string; /** Role of the message sender */ role: "user" | "assistant" | "system"; /** Text content of the message */ content: string; }; export type ChatMessageListProps = { /** Messages to render in convenience mode. Not needed when using children. */ messages?: ChatMessageItem[]; /** Whether the assistant is currently streaming a response */ isStreaming?: boolean; /** Custom render function for individual messages. Overrides default rendering. */ renderMessage?: (message: ChatMessageItem, context: { isLast: boolean; isStreaming: boolean; }) => React.ReactNode; /** Custom loading indicator shown while waiting for assistant content */ loadingIndicator?: React.ReactNode; } & React.ComponentProps<"div">; /** * Layout container for chat messages. Supports two modes: * * **Children mode (composable):** Pass children for full control over rendering. * Use `ChatUserMessage`, `ChatAssistantMessage`, and `ChatStreamingIndicator` * sub-components for pre-styled building blocks. * * **Messages mode (convenience):** Pass a `messages` array for automatic rendering * of simple text-based conversations. Use `renderMessage` to customize. */ export declare function ChatMessageList({ messages, isStreaming, renderMessage, loadingIndicator, children, className, ...props }: ChatMessageListProps): React.JSX.Element | null; export type ChatUserMessageProps = Omit, "children"> & { children: string; }; /** * Pre-styled user message bubble. Right-aligned with primary-colored background. * Accepts only string children — use `ChatAssistantMessage` for rich content. */ export declare function ChatUserMessage({ children, className, ...props }: ChatUserMessageProps): React.JSX.Element; export type ChatAssistantMessageProps = { /** Whether the message text is being streamed (animates text) */ isAnimating?: boolean; } & React.ComponentProps<"div">; /** * Pre-styled assistant message. Pass a string for automatic markdown rendering, * or pass React elements for full control over content (tool calls, images, etc.). * * @example Simple text * ```tsx * * {message.content} * * ``` * * @example Complex content * ```tsx * * {textPart} * * * * ``` */ export declare function ChatAssistantMessage({ children, isAnimating, className, ...props }: ChatAssistantMessageProps): React.JSX.Element; export type ChatStreamingIndicatorProps = React.ComponentProps<"div">; /** * Typing / loading indicator shown while waiting for assistant content. * Renders a default typing animation, or pass children for a custom indicator. */ export declare function ChatStreamingIndicator({ children, className, ...props }: ChatStreamingIndicatorProps): React.JSX.Element; export type ChatMessageListSkeletonProps = React.ComponentProps<"div">; /** * Skeleton placeholder that mirrors the `ChatMessageList` layout. * Shows alternating user/assistant message bubbles as animated placeholders. */ export declare function ChatMessageListSkeleton({ className, ...props }: ChatMessageListSkeletonProps): React.JSX.Element; //# sourceMappingURL=chat-message-list.d.ts.map