import Room from '../types/Room' ; import { broadcast } from '../providers/socketIoProvider' ; import Message from '../types/Message' ; import OnlineData from '../types/OnlineData' ; export default { updateRoom ( room ) { broadcast ( 'updateRoom' , room ) ; } , addMessage ( roomId , message ) { broadcast ( 'addMessage' , { roomId , message } ) ; } , deleteMessage ( messageId ) { broadcast ( 'deleteMessage' , messageId ) ; } , setOnline ( ) { broadcast ( 'setOnline' ) ; } , setOffline ( message ) { broadcast ( 'setOffline' , message ) ; } , sendOnlineData ( data ) { broadcast ( 'onlineData' , data ) ; } , setShutUp ( isShutUp ) { broadcast ( 'setShutUp' , isShutUp ) ; } , message ( msg ) { broadcast ( 'message' , msg ) ; } , messageError ( msg ) { broadcast ( 'messageError' , msg ) ; } , messageSuccess ( msg ) { broadcast ( 'messageSuccess' , msg ) ; } , setAllRooms ( rooms ) { broadcast ( 'setAllRooms' , rooms ) ; } , closeLoading ( ) { broadcast ( 'closeLoading' ) ; } , notifyError ( msg ) { broadcast ( 'notifyError' , msg ) ; } , revealMessage ( messageId ) { broadcast ( 'revealMessage' , messageId ) ; } , setMessages ( roomId , messages ) { broadcast ( 'setMessages' , { roomId , messages } ) ; } , sendAddRequest ( data ) { broadcast ( 'sendAddRequest' , data ) ; } , syncRead ( roomId ) { broadcast ( 'syncRead' , roomId ) ; } , } ;