@@ -95,13 +95,31 @@ export const SUPPORTED_AUDIO_EXTENSIONS = [
9595
9696export const SUPPORTED_VIDEO_EXTENSIONS = [ 'mp4' , 'mov' , 'avi' , 'mkv' , 'webm' ] as const
9797
98+ export const SUPPORTED_IMAGE_EXTENSIONS = [
99+ 'png' ,
100+ 'jpg' ,
101+ 'jpeg' ,
102+ 'gif' ,
103+ 'webp' ,
104+ 'svg' ,
105+ 'bmp' ,
106+ 'tif' ,
107+ 'tiff' ,
108+ 'heic' ,
109+ 'heif' ,
110+ 'avif' ,
111+ 'ico' ,
112+ ] as const
113+
98114export type SupportedDocumentExtension = ( typeof SUPPORTED_DOCUMENT_EXTENSIONS ) [ number ]
99115export type SupportedAudioExtension = ( typeof SUPPORTED_AUDIO_EXTENSIONS ) [ number ]
100116export type SupportedVideoExtension = ( typeof SUPPORTED_VIDEO_EXTENSIONS ) [ number ]
117+ export type SupportedImageExtension = ( typeof SUPPORTED_IMAGE_EXTENSIONS ) [ number ]
101118export type SupportedMediaExtension =
102119 | SupportedDocumentExtension
103120 | SupportedAudioExtension
104121 | SupportedVideoExtension
122+ | SupportedImageExtension
105123
106124export const SUPPORTED_MIME_TYPES : Record < SupportedDocumentExtension , string [ ] > = {
107125 pdf : [ 'application/pdf' , 'application/x-pdf' ] ,
@@ -180,14 +198,19 @@ const SUPPORTED_IMAGE_MIME_TYPES = [
180198 'image/gif' ,
181199 'image/webp' ,
182200 'image/svg+xml' ,
201+ 'image/bmp' ,
202+ 'image/tiff' ,
203+ 'image/heic' ,
204+ 'image/heif' ,
205+ 'image/avif' ,
206+ 'image/x-icon' ,
207+ 'image/vnd.microsoft.icon' ,
183208]
184209
185- const SUPPORTED_IMAGE_EXTENSIONS = [ '.jpg' , '.jpeg' , '.png' , '.gif' , '.webp' , '.svg' ]
186-
187210export const CHAT_ACCEPT_ATTRIBUTE = [
188211 ACCEPT_ATTRIBUTE ,
189212 ...SUPPORTED_IMAGE_MIME_TYPES ,
190- ...SUPPORTED_IMAGE_EXTENSIONS ,
213+ ...SUPPORTED_IMAGE_EXTENSIONS . map ( ( ext ) => `. ${ ext } ` ) ,
191214] . join ( ',' )
192215
193216export interface FileValidationError {
0 commit comments