interface.ts 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. /* eslint-disable @typescript-eslint/no-explicit-any */
  2. import { IConversationModel, IGroupModel, IMessageModel, Friend, FriendApplication } from '@tencentcloud/chat-uikit-engine';
  3. export interface ITUIComponents {
  4. TUIChat?: any;
  5. TUIConversation?: any;
  6. TUIContact?: any;
  7. TUISearch?: any;
  8. TUIGroup?: any;
  9. TUIProfile?: any;
  10. TUICallKit?: any;
  11. TUICallKitMini?: any;
  12. [propName: string]: any;
  13. }
  14. export interface ITUIPlugins {
  15. TUICallKit?: any;
  16. TUINotification?: any;
  17. [propName: string]: any;
  18. }
  19. export interface IEmojiListItem {
  20. type: string;
  21. index?: number;
  22. url: string;
  23. list: string[];
  24. }
  25. export type IEmojiList = any[];
  26. export interface ISendMessagePayload {
  27. text?: string;
  28. file?: any;
  29. atUserList?: string[];
  30. }
  31. export interface ISendMessageParams {
  32. to?: string;
  33. conversationType?: string;
  34. payload?: ISendMessagePayload;
  35. cloudCustomData?: any;
  36. }
  37. export interface ITransferListItem {
  38. isDisabled?: boolean;
  39. avatar?: string;
  40. nick?: string;
  41. userID?: string;
  42. [propName: string]: any;
  43. }
  44. export interface ICustomMessagePayload {
  45. businessID?: string;
  46. // 评价类自定义消息相关字段
  47. score?: number;
  48. comment?: string;
  49. // 订单类 & 超链接类 自定义消息共用字段
  50. link?: string;
  51. // 订单类自定义消息相关字段
  52. imageUrl?: string;
  53. title?: string;
  54. description?: string;
  55. price?: string;
  56. // 超链接类自定义消息相关字段
  57. text?: string;
  58. }
  59. export interface IGroupApplication {
  60. applicant: string;
  61. applicantNick: string;
  62. groupID: string;
  63. groupName: string;
  64. applicationType: 0 | 2; // 0 - group application, 2 - group invite
  65. userID: string;
  66. note: string;
  67. [propName: string]: any;
  68. }
  69. export interface IGroupApplicationUserProfile {
  70. userID: string;
  71. avatar: string;
  72. nick: string;
  73. actionStatus?: string;
  74. [propName: string]: any;
  75. }
  76. export type IGroupApplicationListItem = IGroupApplication;
  77. export interface IFriendType {
  78. userID?: string;
  79. remark?: string;
  80. groupList?: any[];
  81. source?: string;
  82. wording?: string;
  83. profile?: IFriendProfile;
  84. friendCustomFriend?: Record<string, any>[];
  85. }
  86. export interface IFriendProfile {
  87. userID?: string;
  88. avatar?: string;
  89. nick?: string;
  90. [propName: string]: unknown;
  91. }
  92. export interface IGroupMember {
  93. userID?: string;
  94. avatar?: string;
  95. nick?: string;
  96. role?: string;
  97. joinTime?: number;
  98. nameCard?: string;
  99. muteUntil?: string;
  100. memberCustomField?: Record<string, any>[];
  101. }
  102. export interface IGroupSelfInfo {
  103. role?: string;
  104. messageRemindType?: string;
  105. joinTime?: number;
  106. nameCard?: string;
  107. userID?: string;
  108. memberCustomField?: Record<string, any>[];
  109. }
  110. export interface IUserProfile {
  111. userID: string;
  112. nick: string;
  113. gender: string;
  114. birthday: number;
  115. location: string;
  116. selfSignature: string;
  117. allowType: string;
  118. language: number;
  119. avatar: string;
  120. messageSettings: number;
  121. adminForbidType: string;
  122. level: number;
  123. role: number;
  124. lastUpdatedTime: number;
  125. profileCustomField: Record<string, any>[];
  126. }
  127. export interface IContactListItem {
  128. title: string;
  129. list: any[];
  130. key: string;
  131. unreadCount?: number;
  132. }
  133. export interface IContactList {
  134. friendApplicationList: IContactListItem;
  135. blackList: IContactListItem;
  136. groupList: IContactListItem;
  137. friendList: IContactListItem;
  138. [key: string]: IContactListItem;
  139. }
  140. export interface IContactSearchResult {
  141. user: {
  142. label: string;
  143. list: any[];
  144. };
  145. group: {
  146. label: string;
  147. list: any[];
  148. };
  149. }
  150. export interface IBlackListUserItem {
  151. userID: string;
  152. nick?: string;
  153. avatar?: string;
  154. }
  155. export type IContactInfoType = Friend | FriendApplication | IGroupModel | IBlackListUserItem;
  156. export interface IContactInfoMoreItem {
  157. key: string;
  158. label: string;
  159. data: any;
  160. labelPosition?: string; // label 位置:"left"/"top"
  161. editable?: boolean; // 是否可以编辑
  162. editType?: string; // 编辑类型: "input"/"switch"/"textarea"
  163. editing?: boolean; // 当前编辑状态: true 为"正在编辑中",false 为"非编辑状态"
  164. editSubmitHandler?: () => void; // 编辑提交回调Z
  165. }
  166. export interface IContactInfoButton {
  167. key: string;
  168. label: string; // button 内容
  169. type: string; // button 类型: "cancel"/"submit"
  170. onClick: () => void; // 点击 button 回调
  171. }
  172. export interface ISearchCloudMessageResult {
  173. totalCount: number;
  174. searchResultList: ISearchResultListItem[];
  175. cursor: string;
  176. }
  177. export interface ISearchResultListItem {
  178. conversation: IConversationModel;
  179. messageCount: number;
  180. messageList: IMessageModel[];
  181. type?: string;
  182. }
  183. export interface IImageMessageContent {
  184. showName?: string;
  185. url?: string;
  186. width?: number;
  187. height?: number;
  188. }
  189. export interface IVideoMessageContent {
  190. showName: string; // - 消息发送方名称
  191. url: string; // - 视频播放链接
  192. snapshotUrl: string; // - 视频封面图链接
  193. snapshotWidth: number; // - 视频封面图宽度
  194. snapshotHeight: number; // - 视频封面图高度
  195. }
  196. export interface IFileMessageContent {
  197. name: string;
  198. url: string;
  199. size: number;
  200. }
  201. export interface IAudioMessageContent {
  202. showName: string;
  203. url: string;
  204. second: number;
  205. }
  206. export interface ICustomMessageContent {
  207. showName: string;
  208. custom: string;
  209. businessID: string;
  210. }
  211. export interface IAudioContext {
  212. src: string | undefined;
  213. startTime: number;
  214. duration: number;
  215. play: () => void;
  216. pause: () => void;
  217. stop: () => void;
  218. destroy: () => void;
  219. onPlay: (callback: (...args: any[]) => void) => void;
  220. onPause: (callback: (...args: any[]) => void) => void;
  221. onStop: (callback: (...args: any[]) => void) => void;
  222. onEnded: (callback: (...args: any[]) => void) => void;
  223. onError: (callback: (...args: any[]) => void) => void;
  224. }
  225. export interface ITipTapEditorContent {
  226. type: 'text' | 'image' | 'video' | 'file';
  227. payload: {
  228. text?: string;
  229. file?: File;
  230. atUserList?: string[];
  231. };
  232. }
  233. export interface IUserStatus {
  234. statusType: number;
  235. customStatus: string;
  236. }
  237. export interface IUserStatusMap {
  238. [userID: string]: IUserStatus;
  239. }
  240. export interface ITranslateInfo {
  241. conversationID: string;
  242. messageID: string;
  243. visible: boolean;
  244. }
  245. export interface IConvertInfo {
  246. conversationID: string;
  247. messageID: string;
  248. visible: boolean;
  249. }
  250. export interface IChatResponese<T> {
  251. code: string;
  252. data: T;
  253. }
  254. export type ToolbarDisplayType = 'emojiPicker' | 'tools' | 'none';
  255. export type InputDisplayType = 'editor' | 'audio';