import type { VNode } from 'vue'; import type { AppConfig } from '@nuxt/schema'; import type { UIDataTypes, UIMessage, UITools, FileUIPart } from 'ai'; import theme from '#build/ui/chat-message'; import type { AvatarProps, ButtonProps, IconProps } from '../types'; import type { ComponentConfig } from '../types/tv'; type ChatMessage = ComponentConfig; export interface ChatMessageProps extends UIMessage { /** * The element or component this component should render as. * @defaultValue 'article' */ as?: any; /** * @IconifyIcon */ icon?: IconProps['name']; avatar?: AvatarProps & { [key: string]: any; }; /** * @defaultValue 'naked' */ variant?: ChatMessage['variants']['variant']; /** * @defaultValue 'neutral' */ color?: ChatMessage['variants']['color']; /** * @defaultValue 'left' */ side?: ChatMessage['variants']['side']; /** * Display a list of actions under the message. * The `label` will be used in a tooltip. * `{ size: 'xs', color: 'neutral', variant: 'ghost' }`{lang="ts-type"} */ actions?: (Omit & { onClick?: (e: MouseEvent, message: UIMessage) => void; })[]; /** * Render the message in a compact style. * This is done automatically when used inside a `UChatPalette`{lang="ts-type"}. * @defaultValue false */ compact?: boolean; /** * @deprecated Use `parts` instead. (https://ai-sdk.dev/docs/migration-guides/migration-guide-5-0#content--parts-array) * Use to display the content of the message. */ content?: string; class?: any; ui?: ChatMessage['slots']; } export interface ChatMessageSlots { header?(props: UIMessage): VNode[]; leading?(props: UIMessage & { avatar: ChatMessageProps['avatar']; ui: ChatMessage['ui']; }): VNode[]; files?(props: Omit, 'parts'> & { parts: FileUIPart[]; }): VNode[]; body?(props: UIMessage): VNode[]; content?(props: UIMessage & { content?: string; }): VNode[]; actions?(props: UIMessage & { actions: ChatMessageProps['actions']; }): VNode[]; } 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: ChatMessageSlots; 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]; }) & {};