ComunicWeb/assets/js/typings/Conversations.d.ts

68 lines
1.4 KiB
TypeScript
Raw Permalink Normal View History

2020-04-25 16:20:29 +00:00
/**
* Conversations typings
*
* @author Pierre Hubert
*/
declare interface ConversationSettingsFormElements {
rootElem: HTMLElement,
usersElement: HTMLElement,
conversationNameInput: HTMLElement,
allowEveryoneToAddMembers: HTMLElement,
followConversationInput: HTMLElement,
2021-03-05 13:37:22 +00:00
}
declare interface ConversationMember {
user_id: number,
last_message_seen: number,
2021-03-05 14:26:45 +00:00
last_access: number,
2021-03-05 13:37:22 +00:00
following: boolean,
is_admin: boolean,
}
declare interface Conversation {
id: number,
last_activity: number,
name: string,
color?: string,
logo?: string,
group_id?: number,
2021-04-05 13:16:37 +00:00
group_min_membership_level ?: "member"|"moderator"|"administrator",
2021-03-05 13:37:22 +00:00
members: ConversationMember[],
can_everyone_add_members: boolean,
can_have_call: boolean,
can_have_video_call: boolean,
has_call_now: boolean,
}
declare interface ConversationServerMessage {
type: "user_created_conv"|"user_added_another"|"user_left"|"user_removed_another",
user_id?: number,
user_who_added?: number,
user_added?: number,
user_who_removed?: number,
user_removed?: number,
}
declare interface ConversationMessageFile {
url: string,
size: number,
name: string,
thumbnail?: string,
type: string
}
declare interface ConversationMessage {
id: number,
conv_id: number,
user_id: number,
time_sent: number,
message?: string,
file?: ConversationMessageFile,
server_message?: ConversationServerMessage,
}
declare interface UnreadConversation {
conv: Conversation,
message: ConversationMessage
2020-04-25 16:20:29 +00:00
}