The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/definition/IMessage/MessageAttachment/Files/FileAttachmentProps.ts

13 lines
607 B

import { MessageAttachmentBase } from '../MessageAttachmentBase';
import { AudioAttachmentProps } from './AudioAttachmentProps';
import { FileProp } from './FileProp';
import { ImageAttachmentProps } from './ImageAttachmentProps';
import { VideoAttachmentProps } from './VideoAttachmentProps';
export type FileAttachmentProps = {
type: 'file';
file?: FileProp;
} & (VideoAttachmentProps | ImageAttachmentProps | AudioAttachmentProps);
export const isFileAttachment = (attachment: MessageAttachmentBase): attachment is FileAttachmentProps =>
'type' in attachment && (attachment as any).type === 'file';