import '../../../../core/errors/result.dart';
import '../entities/chat.dart';
import '../entities/message.dart';

abstract class ChatRepository {
  Future<Result<List<Chat>>> getChats({String? currentUserId});
  Future<Result<Chat>> getChatById(String chatId);
  Future<Result<Chat>> createPersonalChat(String userId);
  Future<Result<Chat>> createGroupChat(String name, List<String> memberIds);
  Future<Result<Chat>> getOrCreateFavorites();
  Future<Result<Message>> sendMessage(String chatId, String content, {String? type});
  Future<Result<List<Message>>> getMessages(String chatId, {String? cursor});
  Future<Result<void>> togglePin(String chatId);
  Future<Result<void>> clearChat(String chatId);
  Future<Result<void>> clearCache();
  
  Stream<Message> get messageStream;
  Stream<Map<String, dynamic>> get typingStream;
  Stream<Map<String, dynamic>> get statusStream;
  Stream<Map<String, dynamic>> get readReceiptStream;
  Future<void> sendTypingStatus(String chatId, bool isTyping);
  Future<void> markAsRead(String chatId, String lastReadMessageId, int lastReadSequenceId);
  Future<void> initSignalR();
  Future<void> disposeSignalR();
}
