import type { TurboModule } from 'react-native'; import { TurboModuleRegistry } from 'react-native'; export interface Spec extends TurboModule { // Events addListener: (eventName: string) => void; removeListeners: (count: number) => void; create(appKey: string, options: Object): void; destroy(): Promise; setDeviceToken(deviceToken: string): Promise; registerNativeCustomMessage(messageIdentifier: string, persistentFlag: number): Promise; registerNativeCustomMediaMessage(messageIdentifier: string, persistentFlag: number): Promise; connect(token: string, timeout: number, eventId: string): Promise; disconnect(receivePush: boolean): Promise; getConnectionStatus(): Promise; createTextMessage(type: number, targetId: string, channelId: string | null, text: string): Promise; createImageMessage(type: number, targetId: string, channelId: string | null, path: string): Promise; createFileMessage(type: number, targetId: string, channelId: string | null, path: string): Promise; createSightMessage( type: number, targetId: string, channelId: string | null, path: string, duration: number, ): Promise; createVoiceMessage( type: number, targetId: string, channelId: string | null, path: string, duration: number, ): Promise; createReferenceMessage( type: number, targetId: string, channelId: string | null, referenceMessage: Object, text: string, ): Promise; createGIFMessage(type: number, targetId: string, channelId: string | null, path: string): Promise; createCustomMessage( type: number, targetId: string, channelId: string | null, policy: number, messageIdentifier: string, fields: Object, ): Promise; createLocationMessage( type: number, targetId: string, channelId: string | null, longitude: number, latitude: number, poiName: string, thumbnailPath: string, ): Promise; createNativeCustomMessage( type: number, targetId: string, channelId: string | null, messageIdentifier: string, fields: Object, ): Promise; createNativeCustomMediaMessage( type: number, targetId: string, channelId: string | null, messageIdentifier: string, path: string, fields: Object, ): Promise; sendMessage(message: Object, eventId: string): Promise; sendMediaMessage(message: Object, eventId: string): Promise; cancelSendingMediaMessage(message: Object, eventId: string): Promise; downloadMediaMessage(message: Object, eventId: string): Promise; cancelDownloadingMediaMessage(message: Object, eventId: string): Promise; getConversation(type: number, targetId: string, channelId: string | null, eventId: string): Promise; getConversations( conversationTypes: Array, channelId: string | null, startTime: number, count: number, eventId: string, ): Promise; getConversationsWithPriority( conversationTypes: Array, channelId: string | null, startTime: number, count: number, topPriority: boolean, eventId: string, ): Promise; getUnreadConversations(conversationTypes: Array, eventId: string): Promise; getRemoteConversationList(eventId: string): Promise; removeConversationWithDeleteRemote( type: number, targetId: string, deleteRemote: boolean, eventId: string, ): Promise; removeConversation(type: number, targetId: string, channelId: string | null, eventId: string): Promise; removeConversations(conversationTypes: Array, channelId: string | null, eventId: string): Promise; getUnreadCount(type: number, targetId: string, channelId: string | null, eventId: string): Promise; getTotalUnreadCount(channelId: string | null, eventId: string): Promise; getUnreadMentionedCount(type: number, targetId: string, channelId: string | null, eventId: string): Promise; getUltraGroupAllUnreadCount(eventId: string): Promise; getUltraGroupAllUnreadMentionedCount(eventId: string): Promise; getUltraGroupUnreadCount(targetId: string, eventId: string): Promise; getUltraGroupUnreadMentionedCount(targetId: string, eventId: string): Promise; getUnreadCountByConversationTypes( conversationTypes: Array, channelId: string | null, contain: boolean, eventId: string, ): Promise; getUnreadCountByLevels(conversationTypes: Array, levels: Array, eventId: string): Promise; clearUnreadCount( type: number, targetId: string, channelId: string | null, timestamp: number, eventId: string, ): Promise; saveDraftMessage( type: number, targetId: string, channelId: string | null, draft: string, eventId: string, ): Promise; getDraftMessage(type: number, targetId: string, channelId: string | null, eventId: string): Promise; clearDraftMessage(type: number, targetId: string, channelId: string | null, eventId: string): Promise; getBlockedConversations(conversationTypes: Array, channelId: string | null, eventId: string): Promise; changeConversationTopStatus( type: number, targetId: string, channelId: string | null, top: boolean, eventId: string, ): Promise; changeConversationTopStatusWithUpdateTme( type: number, targetId: string, channelId: string | null, top: boolean, updateOperationTime: boolean, eventId: string, ): Promise; getConversationTopStatus( type: number, targetId: string, channelId: string | null, eventId: string, ): Promise; syncConversationReadStatus( type: number, targetId: string, channelId: string | null, timestamp: number, eventId: string, ): Promise; sendTypingStatus(type: number, targetId: string, channelId: string | null, currentType: string): Promise; getMessages( type: number, targetId: string, channelId: string | null, sentTime: number, order: number, policy: number, count: number, eventId: string, ): Promise; getMessageById(messageId: number, eventId: string): Promise; getMessageByUId(messageUId: string, eventId: string): Promise; getMessagesAroundTime( type: number, targetId: string, channelId: string | null, sentTime: number, beforeCount: number, afterCount: number, eventId: string, ): Promise; getLocalMessagesByMessageTypes( type: number, targetId: string, channelId: string | null, messageTypes: Array, sentTime: number, order: number, count: number, eventId: string, ): Promise; getFirstUnreadMessage(type: number, targetId: string, channelId: string | null, eventId: string): Promise; getUnreadMentionedMessages( type: number, targetId: string, channelId: string | null, eventId: string, ): Promise; insertMessage(message: Object, eventId: string): Promise; insertMessages(messages: Array, eventId: string): Promise; clearMessages( type: number, targetId: string, channelId: string | null, timestamp: number, policy: number, eventId: string, ): Promise; deleteLocalMessages(messages: Array, eventId: string): Promise; deleteLocalMessageByIds(messageIds: Array, eventId: string): Promise; deleteMessages( type: number, targetId: string, channelId: string | null, messages: Array, eventId: string, ): Promise; recallMessage(message: Object, eventId: string): Promise; sendPrivateReadReceiptMessage( targetId: string, channelId: string | null, timestamp: number, eventId: string, ): Promise; sendGroupReadReceiptRequest(message: Object, eventId: string): Promise; sendGroupReadReceiptResponse( targetId: string, channelId: string | null, messages: Array, eventId: string, ): Promise; updateMessageExpansion(messageUId: string, expansion: Object, eventId: string): Promise; removeMessageExpansionForKeys(messageUId: string, keys: Array, eventId: string): Promise; changeMessageSentStatus(messageId: number, sentStatus: number, eventId: string): Promise; changeMessageReceiveStatus(messageId: number, receivedStatus: number, eventId: string): Promise; changeMessageReceiveStatusInfo(messageId: number, receivedStatusInfo: Object, eventId: string): Promise; updateMessageLocalExtra(messageId: number, extra: string, eventId: string): Promise; joinChatRoom(targetId: string, messageCount: number, autoCreate: boolean, eventId: string): Promise; leaveChatRoom(targetId: string, eventId: string): Promise; getChatRoomMessages( targetId: string, timestamp: number, order: number, count: number, eventId: string, ): Promise; addChatRoomEntry( targetId: string, key: string, value: string, deleteWhenLeft: boolean, overwrite: boolean, eventId: string, ): Promise; addChatRoomEntries( targetId: string, entries: Object, deleteWhenLeft: boolean, overwrite: boolean, eventId: string, ): Promise; getChatRoomEntry(targetId: string, key: string, eventId: string): Promise; getChatRoomAllEntries(targetId: string, eventId: string): Promise; removeChatRoomEntry(targetId: string, key: string, force: boolean, eventId: string): Promise; removeChatRoomEntries(targetId: string, keys: Array, force: boolean, eventId: string): Promise; addToBlacklist(userId: string, eventId: string): Promise; removeFromBlacklist(userId: string, eventId: string): Promise; getBlacklistStatus(userId: string, eventId: string): Promise; getBlacklist(eventId: string): Promise; searchMessages( type: number, targetId: string, channelId: string | null, keyword: string, startTime: number, count: number, eventId: string, ): Promise; searchMessagesByTimeRange( type: number, targetId: string, channelId: string | null, keyword: string, startTime: number, endTime: number, offset: number, count: number, eventId: string, ): Promise; searchMessagesByUserId( userId: string, type: number, targetId: string, channelId: string | null, startTime: number, count: number, eventId: string, ): Promise; searchMessagesByMessageTypes( type: number, targetId: string, channelId: string | null, messageTypes: Array, keyword: string, startTime: number, count: number, eventId: string, ): Promise; searchConversations( conversationTypes: Array, channelId: string | null, messageTypes: Array, keyword: string, eventId: string, ): Promise; changeNotificationQuietHours( startTime: string, spanMinutes: number, level: number, eventId: string, ): Promise; removeNotificationQuietHours(eventId: string): Promise; getNotificationQuietHours(eventId: string): Promise; changeConversationNotificationLevel( type: number, targetId: string, channelId: string | null, level: number, eventId: string, ): Promise; getConversationNotificationLevel( type: number, targetId: string, channelId: string | null, eventId: string, ): Promise; changeConversationTypeNotificationLevel(type: number, level: number, eventId: string): Promise; getConversationTypeNotificationLevel(type: number, eventId: string): Promise; changeUltraGroupDefaultNotificationLevel(targetId: string, level: number, eventId: string): Promise; getUltraGroupDefaultNotificationLevel(targetId: string, eventId: string): Promise; changeUltraGroupChannelDefaultNotificationLevel( targetId: string, channelId: string | null, level: number, eventId: string, ): Promise; getUltraGroupChannelDefaultNotificationLevel( targetId: string, channelId: string | null, eventId: string, ): Promise; changePushContentShowStatus(showContent: boolean, eventId: string): Promise; changePushLanguage(language: string, eventId: string): Promise; changePushReceiveStatus(receive: boolean, eventId: string): Promise; sendGroupMessageToDesignatedUsers(message: Object, userIds: Array, eventId: string): Promise; getMessageCount(type: number, targetId: string, channelId: string | null, eventId: string): Promise; getTopConversations(conversationTypes: Array, channelId: string | null, eventId: string): Promise; syncUltraGroupReadStatus( targetId: string, channelId: string | null, timestamp: number, eventId: string, ): Promise; getConversationsForAllChannel(type: number, targetId: string, eventId: string): Promise; modifyUltraGroupMessage(messageUId: string, message: Object, eventId: string): Promise; recallUltraGroupMessage(message: Object, deleteRemote: boolean, eventId: string): Promise; clearUltraGroupMessages( targetId: string, channelId: string | null, timestamp: number, policy: number, eventId: string, ): Promise; sendUltraGroupTypingStatus( targetId: string, channelId: string | null, typingStatus: number, eventId: string, ): Promise; clearUltraGroupMessagesForAllChannel(targetId: string, timestamp: number, eventId: string): Promise; getBatchRemoteUltraGroupMessages(messages: Array, eventId: string): Promise; updateUltraGroupMessageExpansion(messageUId: string, expansion: Object, eventId: string): Promise; removeUltraGroupMessageExpansionForKeys(messageUId: string, keys: Array, eventId: string): Promise; changeLogLevel(level: number): Promise; getDeltaTime(): Promise; getAppSettings(): Promise; createTag(tagId: string, tagName: string, eventId: string): Promise; removeTag(tagId: string, eventId: string): Promise; updateTagNameById(tagId: string, newName: string, eventId: string): Promise; getTags(eventId: string): Promise; addConversationToTag(tagId: string, type: number, targetId: string, eventId: string): Promise; removeConversationFromTag(tagId: string, type: number, targetId: string, eventId: string): Promise; removeTagsFromConversation(type: number, targetId: string, tagIds: Array, eventId: string): Promise; getTagsFromConversation(type: number, targetId: string, eventId: string): Promise; getConversationsFromTagByPage(tagId: string, timestamp: number, count: number, eventId: string): Promise; getUnreadCountByTag(tagId: string, contain: boolean, eventId: string): Promise; changeConversationTopStatusInTag( tagId: string, type: number, targetId: string, top: boolean, eventId: string, ): Promise; getConversationTopStatusInTag(tagId: string, type: number, targetId: string, eventId: string): Promise; clearMessagesUnreadStatusByTag(tagId: string, eventId: string): Promise; clearConversationsByTag(tagId: string, deleteMessage: boolean, eventId: string): Promise; setCheckChatRoomDuplicateMessage(enableCheck: boolean): Promise; } export default TurboModuleRegistry.getEnforcing('RCReactNativeIM');