import { CbEvents } from '@openim/wasm-client-sdk';
export enum NativeEvent {
  CONNECTING,
  CONNECT_SUCCESS,
  CONNECT_FAILED,
  KICKED_OFFLINE,
  USER_TOKEN_EXPIRED,
  JOINED_GROUP_ADDED,
  JOINED_GROUP_DELETED,
  GROUP_MEMBER_ADDED,
  GROUP_MEMBER_DELETED,
  GROUP_APPLICATION_ADDED,
  GROUP_APPLICATION_DELETED,
  GROUP_INFO_CHANGED,
  GROUP_DISMISSED,
  GROUP_MEMBER_INFO_CHANGED,
  GROUP_APPLICATION_ACCEPTED,
  GROUP_APPLICATION_REJECTED,
  FRIEND_APPLICATION_ADDED,
  FRIEND_APPLICATION_DELETED,
  FRIEND_APPLICATION_ACCEPTED,
  FRIEND_APPLICATION_REJECTED,
  FRIEND_ADDED,
  FRIEND_DELETED,
  FRIEND_INFO_CHANGED,
  BLACK_ADDED,
  BLACK_DELETED,
  SYNC_SERVER_START,
  SYNC_SERVER_FINISH,
  SYNC_SERVER_PROGRESS,
  SYNC_SERVER_FAILED,
  NEW_CONVERSATION,
  CONVERSATION_CHANGED,
  TOTAL_UNREAD_MESSAGE_COUNT_CHANGED,
  RECV_NEW_MESSAGE,
  RECV_C2C_READ_RECEIPT,
  RECV_GROUP_READ_RECEIPT,
  NEW_RECV_MESSAGE_REVOKED,
  RECV_MESSAGE_EXTENSIONS_CHANGED,
  RECV_MESSAGE_EXTENSIONS_DELETED,
  RECV_MESSAGE_EXTENSIONS_ADDED,
  RECV_OFFLINE_NEW_MESSAGE,
  MSG_DELETED,
  RECV_NEW_MESSAGES,
  RECV_OFFLINE_NEW_MESSAGES,
  SELF_INFO_UPDATED,
  USER_STATUS_CHANGED,
  RECV_CUSTOM_BUSINESS_MESSAGE,
  MESSAGE_KV_INFO_CHANGED,
  OPEN,
  PART_SIZE,
  HASH_PART_PROGRESS,
  HASH_PART_COMPLETE,
  UPLOAD_ID,
  UPLOAD_PART_COMPLETE,
  UPLOAD_COMPLETE,
  COMPLETE,
  CONVERSATION_USER_INPUT_STATUS_CHANGED,
  RECV_ONLINE_ONLY_MESSAGE,
  USER_TOKEN_INVALID,
  RECV_NEW_INVITATION,
  INVITEE_ACCEPTED,
  INVITEE_ACCEPTED_BY_OTHER_DEVICE,
  INVITEE_REJECTED,
  INVITEE_REJECTED_BY_OTHER_DEVICE,
  INVITATION_CANCELLED,
  INVITATION_TIMEOUT,
  HANG_UP,
  ROOM_PARTICIPANT_CONNECTED,
  ROOM_PARTICIPANT_DISCONNECTED,
  STREAM_CHANGE,
  RECEIVE_CUSTOM_SIGNAL,
  ON_PROGRESS,
}

export const eventMapping: Record<NativeEvent, CbEvents> = {
  [NativeEvent.CONNECTING]: CbEvents.OnConnecting,
  [NativeEvent.CONNECT_SUCCESS]: CbEvents.OnConnectSuccess,
  [NativeEvent.CONNECT_FAILED]: CbEvents.OnConnectFailed,
  [NativeEvent.KICKED_OFFLINE]: CbEvents.OnKickedOffline,
  [NativeEvent.USER_TOKEN_EXPIRED]: CbEvents.OnUserTokenExpired,
  [NativeEvent.USER_TOKEN_INVALID]: CbEvents.OnUserTokenInvalid,
  [NativeEvent.JOINED_GROUP_ADDED]: CbEvents.OnJoinedGroupAdded,
  [NativeEvent.JOINED_GROUP_DELETED]: CbEvents.OnJoinedGroupDeleted,
  [NativeEvent.GROUP_MEMBER_ADDED]: CbEvents.OnGroupMemberAdded,
  [NativeEvent.GROUP_MEMBER_DELETED]: CbEvents.OnGroupMemberDeleted,
  [NativeEvent.GROUP_APPLICATION_ADDED]: CbEvents.OnGroupApplicationAdded,
  [NativeEvent.GROUP_APPLICATION_DELETED]: CbEvents.OnGroupApplicationDeleted,
  [NativeEvent.GROUP_INFO_CHANGED]: CbEvents.OnGroupInfoChanged,
  [NativeEvent.GROUP_DISMISSED]: CbEvents.OnGroupDismissed,
  [NativeEvent.GROUP_MEMBER_INFO_CHANGED]: CbEvents.OnGroupMemberInfoChanged,
  [NativeEvent.GROUP_APPLICATION_ACCEPTED]: CbEvents.OnGroupApplicationAccepted,
  [NativeEvent.GROUP_APPLICATION_REJECTED]: CbEvents.OnGroupApplicationRejected,
  [NativeEvent.FRIEND_APPLICATION_ADDED]: CbEvents.OnFriendApplicationAdded,
  [NativeEvent.FRIEND_APPLICATION_DELETED]: CbEvents.OnFriendApplicationDeleted,
  [NativeEvent.FRIEND_APPLICATION_ACCEPTED]:
    CbEvents.OnFriendApplicationAccepted,
  [NativeEvent.FRIEND_APPLICATION_REJECTED]:
    CbEvents.OnFriendApplicationRejected,
  [NativeEvent.FRIEND_ADDED]: CbEvents.OnFriendAdded,
  [NativeEvent.FRIEND_DELETED]: CbEvents.OnFriendDeleted,
  [NativeEvent.FRIEND_INFO_CHANGED]: CbEvents.OnFriendInfoChanged,
  [NativeEvent.BLACK_ADDED]: CbEvents.OnBlackAdded,
  [NativeEvent.BLACK_DELETED]: CbEvents.OnBlackDeleted,
  [NativeEvent.SYNC_SERVER_START]: CbEvents.OnSyncServerStart,
  [NativeEvent.SYNC_SERVER_FINISH]: CbEvents.OnSyncServerFinish,
  [NativeEvent.SYNC_SERVER_PROGRESS]: CbEvents.OnSyncServerProgress,
  [NativeEvent.SYNC_SERVER_FAILED]: CbEvents.OnSyncServerFailed,
  [NativeEvent.NEW_CONVERSATION]: CbEvents.OnNewConversation,
  [NativeEvent.CONVERSATION_CHANGED]: CbEvents.OnConversationChanged,
  [NativeEvent.TOTAL_UNREAD_MESSAGE_COUNT_CHANGED]:
    CbEvents.OnTotalUnreadMessageCountChanged,
  [NativeEvent.RECV_NEW_MESSAGE]: CbEvents.OnRecvNewMessage,
  [NativeEvent.RECV_C2C_READ_RECEIPT]: CbEvents.OnRecvC2CReadReceipt,
  [NativeEvent.RECV_GROUP_READ_RECEIPT]: CbEvents.OnRecvGroupReadReceipt,
  [NativeEvent.NEW_RECV_MESSAGE_REVOKED]: CbEvents.OnNewRecvMessageRevoked,
  [NativeEvent.RECV_NEW_MESSAGES]: CbEvents.OnRecvNewMessages,
  [NativeEvent.SELF_INFO_UPDATED]: CbEvents.OnSelfInfoUpdated,
  [NativeEvent.USER_STATUS_CHANGED]: CbEvents.OnUserStatusChanged,
  [NativeEvent.RECV_CUSTOM_BUSINESS_MESSAGE]:
    CbEvents.OnRecvCustomBusinessMessage,
  [NativeEvent.UPLOAD_COMPLETE]: CbEvents.UploadComplete,
  [NativeEvent.OPEN]: CbEvents.UnUsedEvent,
  [NativeEvent.PART_SIZE]: CbEvents.UnUsedEvent,
  [NativeEvent.HASH_PART_PROGRESS]: CbEvents.UnUsedEvent,
  [NativeEvent.HASH_PART_COMPLETE]: CbEvents.UnUsedEvent,
  [NativeEvent.UPLOAD_ID]: CbEvents.UnUsedEvent,
  [NativeEvent.UPLOAD_PART_COMPLETE]: CbEvents.UnUsedEvent,
  [NativeEvent.COMPLETE]: CbEvents.UnUsedEvent,
  [NativeEvent.RECV_MESSAGE_EXTENSIONS_CHANGED]: CbEvents.UnUsedEvent,
  [NativeEvent.RECV_MESSAGE_EXTENSIONS_DELETED]: CbEvents.UnUsedEvent,
  [NativeEvent.RECV_MESSAGE_EXTENSIONS_ADDED]: CbEvents.UnUsedEvent,
  [NativeEvent.RECV_OFFLINE_NEW_MESSAGE]: CbEvents.UnUsedEvent,
  [NativeEvent.MSG_DELETED]: CbEvents.UnUsedEvent,
  [NativeEvent.RECV_OFFLINE_NEW_MESSAGES]: CbEvents.UnUsedEvent,
  [NativeEvent.MESSAGE_KV_INFO_CHANGED]: CbEvents.UnUsedEvent,
  [NativeEvent.CONVERSATION_USER_INPUT_STATUS_CHANGED]: CbEvents.UnUsedEvent,
  [NativeEvent.RECV_ONLINE_ONLY_MESSAGE]: CbEvents.UnUsedEvent,
  [NativeEvent.RECV_NEW_INVITATION]: CbEvents.OnReceiveNewInvitation,
  [NativeEvent.INVITEE_ACCEPTED]: CbEvents.OnInviteeAccepted,
  [NativeEvent.INVITEE_ACCEPTED_BY_OTHER_DEVICE]:
    CbEvents.OnInviteeAcceptedByOtherDevice,
  [NativeEvent.INVITEE_REJECTED]: CbEvents.OnInviteeRejected,
  [NativeEvent.INVITEE_REJECTED_BY_OTHER_DEVICE]:
    CbEvents.OnInviteeRejectedByOtherDevice,
  [NativeEvent.INVITATION_CANCELLED]: CbEvents.OnInvitationCancelled,
  [NativeEvent.INVITATION_TIMEOUT]: CbEvents.OnInvitationTimeout,
  [NativeEvent.HANG_UP]: CbEvents.OnHangUp,
  [NativeEvent.ROOM_PARTICIPANT_CONNECTED]: CbEvents.OnRoomParticipantConnected,
  [NativeEvent.ROOM_PARTICIPANT_DISCONNECTED]:
    CbEvents.OnRoomParticipantDisconnected,
  [NativeEvent.STREAM_CHANGE]: CbEvents.OnStreamChange,
  [NativeEvent.RECEIVE_CUSTOM_SIGNAL]: CbEvents.OnReceiveCustomSignal,
  [NativeEvent.ON_PROGRESS]: CbEvents.OnUploadLogsProgress,
};
