type.ts 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import TUIChatEngine from '@tencentcloud/chat-uikit-engine';
  2. export type SEARCH_TYPE = 'global' | 'conversation';
  3. // Message search result type display summary
  4. // Unsupported type:
  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', // Normal information flow display
  19. BUBBLE: 'bubble', // Message bubble display
  20. FILE: 'file', // File list type display
  21. IMAGE: 'image', // Picture collection display
  22. };
  23. export type searchResultItemDisplayTypeKeys = keyof typeof searchResultItemDisplayType;
  24. export type searchResultItemDisplayTypeValues = typeof searchResultItemDisplayType[searchResultItemDisplayTypeKeys];
  25. export const searchMessageType = {
  26. // CONTACT: "contact", // Contact search, not supported yet
  27. // GROUP: "group", // Group search, not supported yet
  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. }