import { ID } from './query-records/common-records';
import {
  DialogueDetail,
  ReactionEnum,
  MessageRecord,
  RoomDetail,
} from './query-records/room-records';

export interface ResourceBase {
  getKeyring(resourceId);
  getData(resourceId): Promise<Object>;
  getLastMessages(resourceId): Promise<MessageRecord[]>;
  getMoreMessages(resourceId, cursorMessageId): Promise<MessageRecord[]>;
  sendMessage(resourceId, content): Promise<string>;
  sendTyping(resourceId): Promise<any>;
  deleteMessage(resourceId, messageId): Promise<any>;
  editMessage(resourceId, messageId, content): Promise<any>;
  seenMessage(resourceId, messageId): Promise<any>;
  getDetail(resourceId): Promise<RoomDetail | DialogueDetail>;
  getSeenIdsByMessage(resourceId, messageId): Promise<ID[]>;
  reactMessage(resourceId, messageId, reaction: ReactionEnum | null): Promise<void>;
  getMessagesById(resourceId, messageIds: ID[]): Promise<MessageRecord[]>;
  /**
   * Call getMessagesById if you need collection
   */
  getOneMessageById(resourceId, messageId: ID): Promise<MessageRecord>;
}
