type.ts 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import TUIChatEngine from '@tencentcloud/chat-uikit-engine';
  2. export type SEARCH_TYPE = 'global' | 'conversation';
  3. // 消息搜索结果类型展示摘要
  4. // 不支持类型:
  5. // TYPES.MSG_FACE / TYPES.MSG_GRP_TIP / TYPES.MSG_GRP_SYS_NOTICE
  6. export const messageTypeAbstractMap: Record<string, string> = {
  7. [TUIChatEngine.TYPES.MSG_TEXT]: '[文本]',
  8. [TUIChatEngine.TYPES.MSG_IMAGE]: '[图片]',
  9. [TUIChatEngine.TYPES.MSG_AUDIO]: '[语音]',
  10. [TUIChatEngine.TYPES.MSG_VIDEO]: '[视频]',
  11. [TUIChatEngine.TYPES.MSG_FILE]: '[文件]',
  12. [TUIChatEngine.TYPES.MSG_CUSTOM]: '[自定义消息]',
  13. [TUIChatEngine.TYPES.MSG_SYSTEM]: '[系统消息]',
  14. [TUIChatEngine.TYPES.MSG_MERGER]: '[合并消息]',
  15. [TUIChatEngine.TYPES.MSG_LOCATION]: '[位置消息]',
  16. };
  17. export const searchResultItemDisplayType = {
  18. INFO: 'info', // 正常信息流展示
  19. BUBBLE: 'bubble', // 消息气泡展示
  20. FILE: 'file', // 文件列表类型展示
  21. IMAGE: 'image', // 图片合集形式展示
  22. };
  23. export type searchResultItemDisplayTypeKeys = keyof typeof searchResultItemDisplayType;
  24. export type searchResultItemDisplayTypeValues = typeof searchResultItemDisplayType[searchResultItemDisplayTypeKeys];
  25. export const searchMessageType = {
  26. // CONTACT: "contact", // 联系人搜索,暂不支持
  27. // GROUP: "group", // 群组搜索,暂不支持
  28. ALL_MESSAGE: 'allMessage', // 聊天记录-全部
  29. TEXT_MESSAGE: 'textMessage', // 聊天记录-文本
  30. IMAGE_MESSAGE: 'imageMessage', // 聊天记录-图片
  31. FILE_MESSAGE: 'fileMessage', // 聊天记录-文件
  32. OTHER_MESSAGE: 'otherMessage', // 聊天记录-其他
  33. };
  34. export type searchMessageTypeKeys = keyof typeof searchMessageType;
  35. export type searchMessageTypeValues = typeof searchMessageType[searchMessageTypeKeys];
  36. export interface ISearchInputValue {
  37. value: string;
  38. searchType: SEARCH_TYPE;
  39. }
  40. export interface ISearchTypeTab {
  41. key: string;
  42. label: string;
  43. value: string | string[];
  44. }
  45. export interface ISearchMessageType {
  46. value: ISearchTypeTab;
  47. searchType: SEARCH_TYPE;
  48. }
  49. export interface ISearchTimeTab {
  50. key: string;
  51. label: string;
  52. value: {
  53. timePosition: number;
  54. timePeriod: number;
  55. };
  56. }
  57. export interface ISearchMessageTime {
  58. value: ISearchTimeTab;
  59. searchType: SEARCH_TYPE;
  60. }
  61. export interface ISearchingStatus {
  62. isSearching: boolean;
  63. searchType: string;
  64. }
  65. export interface IHighlightContent {
  66. text: string;
  67. isHighlight: boolean;
  68. }