Move model definition files
parent
8ca7b8cfb4
commit
eb280ec1e4
@ -1,41 +0,0 @@
|
|||||||
import { MessageModel } from './message';
|
|
||||||
|
|
||||||
interface ConversationAttributes {
|
|
||||||
members: Array<string>;
|
|
||||||
left: boolean;
|
|
||||||
expireTimer: number;
|
|
||||||
profileSharing: boolean;
|
|
||||||
mentionedUs: boolean;
|
|
||||||
unreadCount: number;
|
|
||||||
isArchived: boolean;
|
|
||||||
active_at: number;
|
|
||||||
timestamp: number; // timestamp of what?
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ConversationModel
|
|
||||||
extends Backbone.Model<ConversationAttributes> {
|
|
||||||
setFriendRequestStatus: (status: any) => Promise<void>;
|
|
||||||
idForLogging: () => string;
|
|
||||||
saveChangesToDB: () => Promise<void>;
|
|
||||||
notifyFriendRequest: (source: string, type: string) => Promise<void>;
|
|
||||||
notify: (message: MessageModel) => void;
|
|
||||||
isSessionResetReceived: () => boolean;
|
|
||||||
updateExpirationTimer: (
|
|
||||||
expireTimer: number | null,
|
|
||||||
source: string,
|
|
||||||
receivedAt: number,
|
|
||||||
options: object
|
|
||||||
) => void;
|
|
||||||
isPrivate: () => boolean;
|
|
||||||
setProfileKey: (key: string) => void;
|
|
||||||
isMe: () => boolean;
|
|
||||||
getRecipients: () => Array<string>;
|
|
||||||
onReadMessage: (message: MessageModel) => void;
|
|
||||||
updateTextInputState: () => void;
|
|
||||||
isFriend: () => boolean;
|
|
||||||
hasSentFriendRequest: () => boolean;
|
|
||||||
onFriendRequestAccepted: () => Promise<void>;
|
|
||||||
onFriendRequestReceived: () => Promise<void>;
|
|
||||||
|
|
||||||
lastMessage: string;
|
|
||||||
}
|
|
||||||
@ -1,56 +0,0 @@
|
|||||||
enum MessageModelType {
|
|
||||||
INCOMING = 'incoming',
|
|
||||||
OUTGOING = 'outgoing',
|
|
||||||
FRIEND_REQUEST = 'friend-request',
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum EndSessionType {
|
|
||||||
DONE = 'done',
|
|
||||||
ONGOING = '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;
|
|
||||||
friendStatus: any;
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MessageModel extends Backbone.Model<MessageAttributes> {
|
|
||||||
idForLogging: () => string;
|
|
||||||
isGroupUpdate: () => boolean;
|
|
||||||
isExpirationTimerUpdate: () => boolean;
|
|
||||||
isFriendRequest: () => boolean;
|
|
||||||
getNotificationText: () => string;
|
|
||||||
isEndSession: () => boolean;
|
|
||||||
markRead: () => void;
|
|
||||||
merge: (other: MessageModel) => void;
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue