UNPKG

@wulperstudio/chat

Version:
130 lines (129 loc) 3.63 kB
export interface NoReadModel { rmid: string; notSeen: number; } export interface MemberCommunityModel { usid: string; sock: string; email: string; first_name: string; last_name: string; country: string; locale: string; active: boolean; } export interface MemberModel { active: boolean; nickname: string; sock: string; usid: string; } export declare type MembersModel = Array<MemberModel>; export interface UserModel { usid: string; nickname: string; service: string; email?: string; locale: string; active: boolean; } export interface FileModel { id: string; name: string; mime: string; url: string; ext: string; size: number; width: number; height: number; related: Array<string>; } export interface FileInboxModel extends FileModel { formats: { thumbnail: FileModel; }; } export interface MessageModel { _id: string; usid: string; space: string; parley: string; msg: string; read: Array<any>; createdAt: string; from: UserModel; files: Array<FileInboxModel>; } export declare type InboxModel = Array<MessageModel>; export interface UpgradeMessageModel { chanel: string; messages: InboxModel; } export interface LastMessageModel { usid: string; msg: string; createdAt: string; } export interface RoomModel { id: string; space: string; name?: string; nickname?: string; group: boolean; last_msg: LastMessageModel; no_read: number; visitor: string; } export interface StatusContactModel { usid: string; active: boolean; } export interface AlertMessage { space: string; usid: string; nickname: string; type: "message"; preview: string; group: boolean; } export interface ModuleChatControlModel { disconnect?: () => void; connection?: (user: UserModel) => void; register_thread_out?: (thread: { space: string; user?: {}; title?: string; }, isgroup: boolean) => void; get_list_contacts_groups_out?: (rooms: Array<RoomModel>) => void; get_inbox_out?: (inbox: InboxModel, space: string) => void; alert_new_message_out?: (alert: AlertMessage) => void; get_members_room?: (members: MembersModel) => void; set_text_msg?: (text: string, autosend: boolean) => void; search_users_bighall?: (members: MembersModel) => void; } declare class ModuleChatControl { chanelNow: string | null; roomMembers: MembersModel; private socket; private credentials; private isgroup; constructor(externals: ModuleChatControlModel, service: string, id?: string, nickname?: string, email?: string, locale?: string, avatar?: string); private start_connection; set_id_chanel(id: string): void; set_isgroup(isgroup: boolean): void; register_thread(selected: string, direct: boolean, nickname?: string | null, email?: string | null, service?: string | null, locale?: string | null, avatar?: string | null): void; get_list_contacts_groups(): void; get_inbox(space: string, isgroup: boolean): void; send_thread_message(msg: string, files?: Array<string>): void; set_mark_as_read_space(): void; get_members_room_in(): void; create_room(roomName: string, raw_members: Array<{ usid: string; nickname: string; }>): void; get_members_bighall(search?: string): void; upload_file(files: FileList | null): Promise<string | undefined>; get_out_group(): void; receive_call_event(externals: ModuleChatControlModel): void; } export default ModuleChatControl;