@@ -40,6 +40,7 @@ import {
4040 isEditedMessage ,
4141 MessageStatusTypes ,
4242} from '../../utils/utils' ;
43+ import type { Thumbnail } from '../Attachment/utils/buildGallery/types' ;
4344
4445import {
4546 isMessageWithStylesReadByAndDateSeparator ,
@@ -55,35 +56,56 @@ export type TouchableEmitter =
5556 | 'messageReplies'
5657 | 'reactionList' ;
5758
59+ export type TextMentionTouchableHandlerAdditionalInfo <
60+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics ,
61+ > = { user ?: UserResponse < StreamChatGenerics > } ;
62+
5863export type TextMentionTouchableHandlerPayload <
5964 StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics ,
6065> = {
6166 emitter : 'textMention' ;
62- additionalInfo ?: { user ?: UserResponse < StreamChatGenerics > } ;
67+ additionalInfo ?: TextMentionTouchableHandlerAdditionalInfo < StreamChatGenerics > ;
6368} ;
6469
70+ export type UrlTouchableHandlerAdditionalInfo = { url ?: string } ;
71+
6572export type UrlTouchableHandlerPayload = {
6673 emitter : 'textLink' | 'card' ;
67- additionalInfo ?: { url ?: string } ;
74+ additionalInfo ?: UrlTouchableHandlerAdditionalInfo ;
6875} ;
6976
77+ export type FileAttachmentTouchableHandlerAdditionalInfo <
78+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics ,
79+ > = { attachment ?: Attachment < StreamChatGenerics > } ;
80+
7081export type FileAttachmentTouchableHandlerPayload <
7182 StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics ,
7283> = {
7384 emitter : 'fileAttachment' ;
74- additionalInfo ?: { attachment ?: Attachment < StreamChatGenerics > } ;
85+ additionalInfo ?: FileAttachmentTouchableHandlerAdditionalInfo < StreamChatGenerics > ;
86+ } ;
87+
88+ export type GalleryThumbnailTouchableHandlerAdditionalInfo = { thumbnail ?: Thumbnail } ;
89+
90+ export type GalleryThumbnailTouchableHandlerPayload = {
91+ emitter : 'gallery' ;
92+ additionalInfo ?: GalleryThumbnailTouchableHandlerAdditionalInfo ;
7593} ;
7694
7795export type PressableHandlerPayload = {
7896 defaultHandler ?: ( ) => void ;
7997 event ?: GestureResponderEvent ;
8098} & (
8199 | {
82- emitter ?: Exclude < TouchableEmitter , 'textMention' | 'textLink' | 'card' | 'fileAttachment' > ;
100+ emitter ?: Exclude <
101+ TouchableEmitter ,
102+ 'textMention' | 'textLink' | 'card' | 'fileAttachment' | 'gallery'
103+ > ;
83104 }
84105 | TextMentionTouchableHandlerPayload
85106 | UrlTouchableHandlerPayload
86107 | FileAttachmentTouchableHandlerPayload
108+ | GalleryThumbnailTouchableHandlerPayload
87109) ;
88110
89111export type MessagePressableHandlerPayload <
0 commit comments