interface.ts 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  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 IEmojiGroup {
  20. type: string;
  21. emojiGroupID: number;
  22. url: string;
  23. list: string[];
  24. }
  25. export type IEmojiGroupList = IEmojiGroup[];
  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. // Evaluation-related custom message fields
  47. score?: number;
  48. comment?: string;
  49. // Order & Hyperlink Class Custom Message Common Fields
  50. link?: string;
  51. // Order-related custom message fields
  52. imageUrl?: string;
  53. title?: string;
  54. description?: string;
  55. price?: string;
  56. // Hyperlink custom message related fields
  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?: Array<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?: Array<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?: Array<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: Array<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 position:"left"/"top"
  161. editable?: boolean; // indicates whether it can be edited
  162. editType?: string; // edit type: "input"/"switch"/"textarea"
  163. editing?: boolean; // Current editing status: true: "Editing" / false:"Not editing"
  164. editSubmitHandler?: () => void; // edit submit callback
  165. }
  166. export interface IContactInfoButton {
  167. key: string;
  168. label: string; // button label
  169. type: string; // button type: "cancel"/"submit"
  170. onClick: () => void; // button click callback
  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; // video message sender name
  191. url: string; // video url
  192. snapshotUrl: string; // video snapshot url
  193. snapshotWidth: number; // video snapshot width
  194. snapshotHeight: number; // video snapshot height
  195. }
  196. export interface ITextMessageContent {
  197. text: string;
  198. }
  199. export interface IMergeMessageContent {
  200. abstractList: string[];
  201. compatibleText: string;
  202. downloadKey: string;
  203. layersOverLimit: boolean;
  204. messageList: Array<{
  205. avatar: string;
  206. ID: string;
  207. cloudCustomData: string;
  208. from: string;
  209. messageBody: Array<{
  210. type: string;
  211. payload: Record<string, any>;
  212. }>;
  213. messageReceiver: string;
  214. messageRandom: number;
  215. messageSender: string;
  216. messageSequence: number;
  217. messageTime: number;
  218. nick: string;
  219. receiverUserID: string;
  220. time: number;
  221. }>;
  222. pbDownloadKey: string;
  223. showName: string;
  224. title: string;
  225. version: number;
  226. }
  227. export interface IFileMessageContent {
  228. name: string;
  229. url: string;
  230. size: number;
  231. }
  232. export interface IAudioMessageContent {
  233. showName: string;
  234. url: string;
  235. second: number;
  236. }
  237. export interface ICustomMessageContent {
  238. showName: string;
  239. custom: string;
  240. businessID: string;
  241. }
  242. export interface IAudioContext {
  243. src: string | undefined;
  244. startTime: number;
  245. duration: number;
  246. play: () => void;
  247. pause: () => void;
  248. stop: () => void;
  249. destroy: () => void;
  250. onPlay: (callback: (...args: any[]) => void) => void;
  251. onPause: (callback: (...args: any[]) => void) => void;
  252. onStop: (callback: (...args: any[]) => void) => void;
  253. onEnded: (callback: (...args: any[]) => void) => void;
  254. onError: (callback: (...args: any[]) => void) => void;
  255. }
  256. export interface ITipTapEditorContent {
  257. type: 'text' | 'image' | 'video' | 'file';
  258. payload: {
  259. text?: string;
  260. file?: File;
  261. atUserList?: string[];
  262. };
  263. }
  264. export interface IUserStatus {
  265. statusType: number;
  266. customStatus: string;
  267. }
  268. export interface IUserStatusMap {
  269. [userID: string]: IUserStatus;
  270. }
  271. export interface ITranslateInfo {
  272. conversationID: string;
  273. messageID: string;
  274. visible: boolean;
  275. }
  276. export interface IConvertInfo {
  277. conversationID: string;
  278. messageID: string;
  279. visible: boolean;
  280. }
  281. export interface IChatResponese<T> {
  282. code: string;
  283. data: T;
  284. }
  285. export type ToolbarDisplayType = 'emojiPicker' | 'tools' | 'none';
  286. export type InputDisplayType = 'editor' | 'audio';