import type { LocalMessage } from 'stream-chat'; import type { MessageDeliveryStatus } from '../../ChannelListItem'; export type ChannelPreviewMessageType = 'text' | 'deleted' | 'error' | 'empty' | 'image' | 'giphy' | 'video' | 'voice' | 'file' | 'unsupported' | 'link' | 'location' | 'poll'; /** * Delivery status of the last own message, which selects the status icon: a clock for `sending`, a * checkmark for `sent`, double checkmarks for `delivered` and `read`. */ export type ChannelPreviewDeliveryStatus = 'sending' | 'sent' | 'delivered' | 'read'; export type LatestMessagePreviewData = { /** Kind of content previewed, which selects the content-type icon. */ type: ChannelPreviewMessageType; text: string; /** Set only for own messages that did not fail to send. */ deliveryStatus?: ChannelPreviewDeliveryStatus; /** * Sender prefix: "You" (translated) for own messages, the sender's name for incoming messages * when `participantCount` is above 2, otherwise undefined. */ senderName?: string; }; export type UseLatestMessagePreviewParams = { /** Number of channel participants. Incoming messages show the sender above 2. */ participantCount?: number; /** Message to preview. Without one the preview is the empty-state text. */ latestMessage?: LocalMessage; /** * Delivery status from `useMessageDeliveryStatus`. Defaults to the message's own `status` for * own messages. */ messageDeliveryStatus?: MessageDeliveryStatus; }; export declare const useLatestMessagePreview: ({ latestMessage, messageDeliveryStatus, participantCount, }: UseLatestMessagePreviewParams) => LatestMessagePreviewData; //# sourceMappingURL=useLatestMessagePreview.d.ts.map