import type { VNode } from 'vue'; import type { AppConfig } from '@nuxt/schema'; import type { UIDataTypes, UIMessage, UITools, ChatStatus } from 'ai'; import theme from '#build/b24ui/chat-messages'; import type { ButtonProps, ChatMessageProps, ChatMessageSlots, IconComponent, LinkPropsKeys } from '../types'; import type { ComponentConfig } from '../types/tv'; type ChatMessages = ComponentConfig; type MessageBase = T[number] extends UIMessage ? UIMessage : UIMessage; type PropsBase = MessageBase extends UIMessage ? ChatMessageProps : never; export interface ChatMessagesProps { messages?: T; status?: ChatStatus; /** * Whether to automatically scroll to the bottom when a message is streaming. * @defaultValue false */ shouldAutoScroll?: boolean; /** * Whether to scroll to the bottom on mounted. * @defaultValue true */ shouldScrollToBottom?: boolean; /** * Display an auto scroll button. * `{ size: 'md', color: 'air-secondary-no-accent' }`{lang="ts-type"} * @defaultValue true */ autoScroll?: boolean | Omit; /** * The icon displayed in the auto scroll button. * @defaultValue icons.arrowDown * @IconComponent */ autoScrollIcon?: IconComponent; /** * The `user` messages props. * `{ side: 'right', variant: 'message' }`{lang="ts-type"} */ user?: Pick, 'icon' | 'avatar' | 'variant' | 'side' | 'actions' | 'b24ui'>; /** * The `assistant` messages props. * `{ side: 'left', variant: 'message' }`{lang="ts-type"} */ assistant?: Pick, 'icon' | 'avatar' | 'variant' | 'side' | 'actions' | 'b24ui'>; /** * Render the messages in a compact style. * This is done automatically when used inside a `UChatPalette`{lang="ts-type"}. * @defaultValue false */ compact?: boolean; /** * The spacing offset for the last message in px. Can be useful when the prompt is sticky for example. * @defaultValue 0 */ spacingOffset?: number; class?: any; b24ui?: ChatMessages['slots']; } export type ChatMessagesSlots = { default?(props?: {}): VNode[]; indicator?(props: { b24ui: ChatMessages['b24ui']; }): VNode[]; viewport?(props: { b24ui: ChatMessages['b24ui']; onClick: () => void; }): VNode[]; } & { [K in keyof ChatMessageSlots]?: NonNullable extends (props: infer P) => VNode[] ? (props: P & { message: MessageBase; }) => VNode[] : never; }; declare const _default: typeof __VLS_export; export default _default; declare const __VLS_export: (__VLS_props: NonNullable>["props"], __VLS_ctx?: __VLS_PrettifyLocal>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable>["expose"], __VLS_setup?: Promise<{ props: import("vue").PublicProps & __VLS_PrettifyLocal> & (typeof globalThis extends { __VLS_PROPS_FALLBACK: infer P; } ? P : {}); expose: (exposed: {}) => void; attrs: any; slots: ChatMessagesSlots; emit: {}; }>) => import("vue").VNode & { __ctx?: Awaited; }; type __VLS_PrettifyLocal = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};