import type { ReactNode, Ref } from 'react'; import type { DefaultTheme } from 'styled-components'; import type { BaseProps, Action, NoChildrenProp, OmitStrict, LinkProps, AvatarProps } from '@pega/cosmos-react-core'; export interface AttachmentItemProps extends BaseProps { /** Unique Id for this attachment */ id: string; /** Name of the attachment. */ name: string; /** * A Cosmos icon name identifier to use for a attachment. Will serve as a fallback to a broken thumbnail. * @default 'document-doc' */ icon?: string; /** A string to be used as an image src for a attachment thumbnail. Falls back to a provided icon or the default attachment icon. */ thumbnail?: string; /** Additional information about the attachment. If progress prop is passed and its value is less than 100, this region is instead used for the upload progress indicator. */ meta?: string; /** When passed, previews the attachment on click */ onPreview?: (id: string) => void; /** Actions list for the attachment */ actions?: Action[]; /** When passed, this will render a single icon button or within a MenuButton if onDelete is defined. */ onDelete?: (id: string) => void; } export type UserAvailability = 'available' | 'unavailable' | 'temporarilyUnavailable'; export interface ChatSettingsPanelProps extends NoChildrenProp { status?: UserAvailability; label: string; onClick: () => void; } export type ColorTheme = [ keyof OmitStrict, 'extra-light' | 'light' | 'medium' | 'dark' | 'extra-dark' ]; export interface MediaPageLinks { /** Unique id for this push link */ id: string; /** Title of the content */ title: string; /** Href for external links */ href?: LinkProps['href']; /** Callback provided to perform on click */ onTitleClick?: () => void; /** A string to be used as an image src for a thumbnail. */ thumbnail?: AttachmentItemProps['thumbnail']; } export type MessageHeaderProps = { /** message header content */ content?: ReactNode; /** meta data */ meta?: ReactNode; }; export interface MessageProps extends Pick { /** Message to be displayed */ message?: string; /** Attachment list */ attachments?: AttachmentItemProps[]; /** Message page push links list */ mediaPageLinks?: MediaPageLinks[]; /** timestamp of the message(Formatted) */ timestamp?: string; /** Incoming message/ outgoing message */ direction: 'in' | 'out'; /** Avatar information, can be image and name */ avatarInfo?: Pick; /** Message status */ status?: 'delivered' | 'opened' | 'undeliverable' | 'sent'; /** Indicates if this message is being currently typed */ typing?: boolean; /** Message header */ messageHeader?: MessageHeaderProps; /** Sender type */ senderType: 'customer' | 'agent' | 'bot'; /** Sender ID, will be helpful in deciding the colour */ senderId: string; /** Number used to determine the color of agent's message */ agentVariant?: number; /** ref to the message wrapper */ ref?: Ref; } export interface TypeIndicatorProps extends Pick { /** Avatar information, can be image and name */ avatarInfo: Pick; } export interface SystemMessageProps extends Pick { /** System message to be displayed */ message: string; /** variant of this system message * @default 'secondary' */ variant?: 'primary' | 'secondary'; } export interface ChatBodyHandleValue { isScrolledToLatest: () => boolean; scrollToLatestMessage: () => void; scrollToNewMessage: () => void; } export interface ChatBodyProps { /** Transcripts */ transcripts: { /** Unique id of a chat session */ id: string; /** Messages in a chat session */ messages: ChatBodyListItemProps[]; }[]; /** Live chat messages */ liveChat: ChatBodyListItemProps[]; /** Total unread messages */ unreadMessageCount?: number; /** on scroll to button */ onScrollToButtonClick?: () => void; /** Indicates if the data is being currently loading */ loading?: boolean; /** Offset of the row item that need to trigger the load more callback */ offset?: number; /** Callback to fetch more rows */ loadMore?: () => void; /** Imperative handle */ handle?: Ref; /** Renders markdown content. Note: Native emojis are used instead of custom EmojiSet when rendering markdown. */ renderMarkdownContent?: boolean; /** ref to the element */ ref?: Ref; } type MessageListItemProps = OmitStrict & { type: 'message'; id: string; }; type SystemMessageListItemProps = SystemMessageProps & { type: 'system'; id: string; }; type TypeIndicatorListItemPops = OmitStrict & { type: 'typing'; id: string; }; export type ChatBodyListItemProps = MessageListItemProps | SystemMessageListItemProps | TypeIndicatorListItemPops; export declare const isMessageListItem: (message: ChatBodyListItemProps) => message is MessageListItemProps; export declare const isSystemMessageListItem: (message: ChatBodyListItemProps) => message is SystemMessageListItemProps; export declare const isTypeIndicatorListItem: (message: ChatBodyListItemProps) => message is TypeIndicatorListItemPops; export {}; //# sourceMappingURL=Chat.types.d.ts.map