You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			73 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			TypeScript
		
	
			
		
		
	
	
			73 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			TypeScript
		
	
| import { ConversationModel } from './conversations';
 | |
| 
 | |
| type MessageModelType = 'incoming' | 'outgoing';
 | |
| type MessageDeliveryStatus =
 | |
|   | 'sending'
 | |
|   | 'sent'
 | |
|   | 'delivered'
 | |
|   | 'read'
 | |
|   | 'error';
 | |
| export type EndSessionType = 'done' | 'ongoing';
 | |
| 
 | |
| interface MessageAttributes {
 | |
|   id: number;
 | |
|   source: string;
 | |
|   endSessionType: EndSessionType;
 | |
|   quote: any;
 | |
|   expireTimer: number;
 | |
|   received_at: number;
 | |
|   sent_at: number;
 | |
|   preview: any;
 | |
|   body: string;
 | |
|   expirationStartTimestamp: any;
 | |
|   read_by: Array<string>;
 | |
|   delivered_to: Array<string>;
 | |
|   decrypted_at: number;
 | |
|   recipients: Array<string>;
 | |
|   delivered: number;
 | |
|   type: MessageModelType;
 | |
|   group_update: any;
 | |
|   groupInvitation: any;
 | |
|   attachments: any;
 | |
|   contact: any;
 | |
|   conversationId: any;
 | |
|   errors: any;
 | |
|   flags: number;
 | |
|   hasAttachments: boolean;
 | |
|   hasFileAttachments: boolean;
 | |
|   hasVisualMediaAttachments: boolean;
 | |
|   schemaVersion: number;
 | |
|   expirationTimerUpdate: any;
 | |
|   unread: boolean;
 | |
|   group: any;
 | |
|   bodyPending: boolean;
 | |
|   timestamp: number;
 | |
|   status: MessageDeliveryStatus;
 | |
| }
 | |
| 
 | |
| export interface MessageModel extends Backbone.Model<MessageAttributes> {
 | |
|   idForLogging: () => string;
 | |
|   isGroupUpdate: () => boolean;
 | |
|   isExpirationTimerUpdate: () => boolean;
 | |
|   getNotificationText: () => string;
 | |
|   isEndSession: () => boolean;
 | |
|   markRead: () => void;
 | |
|   merge: (other: MessageModel) => void;
 | |
|   saveErrors: (error: any) => void;
 | |
|   sendSyncMessageOnly: (message: any) => void;
 | |
|   isUnread: () => boolean;
 | |
|   commit: () => Promise<number>;
 | |
|   getPropsForMessageDetail: () => any;
 | |
|   getConversation: () => ConversationModel;
 | |
|   handleMessageSentSuccess: (sentMessage: any, wrappedEnvelope: any) => any;
 | |
|   handleMessageSentFailure: (sentMessage: any, error: any) => any;
 | |
| 
 | |
|   propsForMessage?: any;
 | |
|   propsForTimerNotification?: any;
 | |
|   propsForResetSessionNotification?: any;
 | |
|   propsForGroupInvitation?: any;
 | |
|   propsForGroupNotification?: any;
 | |
|   propsForVerificationNotification?: any;
 | |
|   firstMessageOfSeries: boolean;
 | |
| }
 |