@@ -48,6 +48,7 @@ import {
4848 isEditedMessage ,
4949 MessageStatusTypes ,
5050} from '../../utils/utils' ;
51+ import type { Thumbnail } from '../Attachment/utils/buildGallery/types' ;
5152
5253import {
5354 isMessageWithStylesReadByAndDateSeparator ,
@@ -65,35 +66,56 @@ export type TouchableEmitter =
6566 | 'messageReplies'
6667 | 'reactionList' ;
6768
69+ export type TextMentionTouchableHandlerAdditionalInfo <
70+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics ,
71+ > = { user ?: UserResponse < StreamChatGenerics > } ;
72+
6873export type TextMentionTouchableHandlerPayload <
6974 StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics ,
7075> = {
7176 emitter : 'textMention' ;
72- additionalInfo ?: { user ?: UserResponse < StreamChatGenerics > } ;
77+ additionalInfo ?: TextMentionTouchableHandlerAdditionalInfo < StreamChatGenerics > ;
7378} ;
7479
80+ export type UrlTouchableHandlerAdditionalInfo = { url ?: string } ;
81+
7582export type UrlTouchableHandlerPayload = {
7683 emitter : 'textLink' | 'card' ;
77- additionalInfo ?: { url ?: string } ;
84+ additionalInfo ?: UrlTouchableHandlerAdditionalInfo ;
7885} ;
7986
87+ export type FileAttachmentTouchableHandlerAdditionalInfo <
88+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics ,
89+ > = { attachment ?: Attachment < StreamChatGenerics > } ;
90+
8091export type FileAttachmentTouchableHandlerPayload <
8192 StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics ,
8293> = {
8394 emitter : 'fileAttachment' ;
84- additionalInfo ?: { attachment ?: Attachment < StreamChatGenerics > } ;
95+ additionalInfo ?: FileAttachmentTouchableHandlerAdditionalInfo < StreamChatGenerics > ;
96+ } ;
97+
98+ export type GalleryThumbnailTouchableHandlerAdditionalInfo = { thumbnail ?: Thumbnail } ;
99+
100+ export type GalleryThumbnailTouchableHandlerPayload = {
101+ emitter : 'gallery' ;
102+ additionalInfo ?: GalleryThumbnailTouchableHandlerAdditionalInfo ;
85103} ;
86104
87105export type TouchableHandlerPayload = {
88106 defaultHandler ?: ( ) => void ;
89107 event ?: GestureResponderEvent ;
90108} & (
91109 | {
92- emitter ?: Exclude < TouchableEmitter , 'textMention' | 'textLink' | 'card' | 'fileAttachment' > ;
110+ emitter ?: Exclude <
111+ TouchableEmitter ,
112+ 'textMention' | 'textLink' | 'card' | 'fileAttachment' | 'gallery'
113+ > ;
93114 }
94115 | TextMentionTouchableHandlerPayload
95116 | UrlTouchableHandlerPayload
96117 | FileAttachmentTouchableHandlerPayload
118+ | GalleryThumbnailTouchableHandlerPayload
97119) ;
98120
99121export type MessageTouchableHandlerPayload <
0 commit comments