yeim-uni-sdk.min.d.ts 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457
  1. export declare module './yeim-uni-sdk.min.js' {
  2. /**
  3. *
  4. * YeIM-Uni-SDK
  5. * 可以私有化部署的全开源即时通讯js-sdk,仅需集成 SDK 即可轻松实现聊天能力,支持Web或uni-app项目接入使用,满足通信需要。
  6. *
  7. * @author wzJun1
  8. * @link https://github.com/wzJun1/YeIM-Uni-SDK
  9. * @doc https://wzjun1.netlify.app/ye_plugins/sdk/yeimunisdk
  10. * @copyright wzJun1 2022, 2023. All rights reserved.
  11. * @license Apache-2.0
  12. *
  13. */
  14. declare class YeIMUniSDK {
  15. /**
  16. * 初始化SDK
  17. *
  18. * @param options 配置项
  19. * @param options.baseURL - YeIMServer http url (如无特殊需求,服务端启动后仅需修改ip或者域名即可)
  20. * @param options.socketURL - YeIMServer socket url(如无特殊需求,服务端启动后仅需修改ip或者域名即可)
  21. * @param options.logLevel - SDK 日志等级
  22. * @param options.reConnectInterval - socket 重连时间间隔
  23. * @param options.reConnectTotal - socket 最大重连次数,0不限制一直重连
  24. * @param options.heartInterval - socket 心跳时间间隔(默认30s)
  25. * @param options.notification - APP离线通知配置
  26. * @returns {YeIMUniSDK} YeIMUniSDK实例化对象
  27. */
  28. static init(options : {
  29. /**
  30. * YeIMServer http url (如无特殊需求,服务端启动后仅需修改ip或者域名即可)
  31. */
  32. baseURL : string;
  33. /**
  34. * YeIMServer socket url(如无特殊需求,服务端启动后仅需修改ip或者域名即可)
  35. */
  36. socketURL : string;
  37. /**
  38. * SDK 日志等级
  39. * 0 普通日志,日志量较多,接入时建议使用
  40. * 1 关键性日志,日志量较少,生产环境时建议使用
  41. * 2 无日志级别,SDK 将不打印任何日志
  42. */
  43. logLevel ?: number;
  44. /**
  45. * socket 重连时间间隔
  46. */
  47. reConnectInterval ?: number;
  48. /**
  49. * socket 最大重连次数,0不限制一直重连
  50. */
  51. reConnectTotal ?: number;
  52. /**
  53. * socket 心跳时间间隔(默认30s)
  54. */
  55. heartInterval ?: number;
  56. /**
  57. * APP离线通知配置
  58. */
  59. notification ?: object;
  60. }) : YeIMUniSDK;
  61. /**
  62. * 获取SDK实例化对象
  63. */
  64. static getInstance() : YeIMUniSDK?;
  65. /**
  66. * 连接登录YeIM
  67. *
  68. * @param options 配置项
  69. * @param options.userId 已注册的用户ID字符串
  70. * @param options.token 登录token,由请求服务端Http接口换取
  71. * @param {(result)=>void} [options.success] - 成功回调
  72. * @param {(error)=>void} [options.fail] - 失败回调
  73. * @returns {void}
  74. */
  75. connect(options : {
  76. userId : string,
  77. token : string,
  78. success ?: (result : any) => void,
  79. fail ?: (error : any) => void
  80. }) : void;
  81. /**
  82. * 创建文本消息
  83. *
  84. * @param {Options} options - 创建消息参数对象
  85. *
  86. * @param {String} options.toId - 接受者用户ID
  87. * @param {String} options.conversationType - 会话类型(私聊、群聊)定义在YeIMUniSDKDefines,YeIMUniSDKDefines.CONVERSATION_TYPE.PRIVATE = 私聊,YeIMUniSDKDefines.CONVERSATION_TYPE.GROUP = 群聊
  88. * @param {Object} options.body - 文本消息对象
  89. * @param {String} options.body.text - 文本消息内容
  90. * @param {String} options.extra - 自定义扩展数据
  91. *
  92. * @return {(Object|Message)} Message 消息对象
  93. *
  94. */
  95. createTextMessage(options : {
  96. toId : string,
  97. conversationType : YeIMUniSDKDefines.CONVERSATION_TYPE,
  98. body : {
  99. text : string
  100. },
  101. extra ?: string
  102. }) : Message | Object;
  103. /**
  104. * 创建群聊 @ 艾特消息
  105. *
  106. * @param {Options} options - 创建消息参数对象
  107. *
  108. * @param {String} options.toId - 群ID
  109. * @param {String} options.conversationType - 会话类型(私聊、群聊)定义在YeIMUniSDKDefines,YeIMUniSDKDefines.CONVERSATION_TYPE.PRIVATE = 私聊,YeIMUniSDKDefines.CONVERSATION_TYPE.GROUP = 群聊 当前消息仅支持群里
  110. * @param {Body} options.body - 文本消息对象
  111. * @param {String} options.body.text - 文本消息内容
  112. * @param {Array<String>} options.body.atUserIdList - 要艾特的用户ID列表
  113. * @param {String} options.extra - 自定义扩展数据
  114. *
  115. * @return {(Object|Message)} Message 消息对象
  116. *
  117. */
  118. createTextAtMessage(options : {
  119. toId : string,
  120. conversationType : YeIMUniSDKDefines.CONVERSATION_TYPE,
  121. body : {
  122. text : string,
  123. atUserIdList : Array<string>
  124. },
  125. extra ?: string
  126. }) : Message | Object;
  127. /**
  128. * 创建图片消息
  129. *
  130. * 仅支持单张图片
  131. *
  132. * @param {Options} options - 创建消息参数对象
  133. *
  134. * @param {String} options.toId - 接受者用户ID
  135. * @param {String} options.conversationType - 会话类型(私聊、群聊)定义在YeIMUniSDKDefines,YeIMUniSDKDefines.CONVERSATION_TYPE.PRIVATE = 私聊,YeIMUniSDKDefines.CONVERSATION_TYPE.GROUP = 群聊
  136. * @param {Body} options.body - 图片消息对象
  137. * @param {File} options.body.file - 图片消息对象
  138. * @param {String} options.body.file.tempFilePath - 本地图片文件临时路径
  139. * @param {Number} options.body.file.width - 图片宽度
  140. * @param {Number} options.body.file.height - 图片高度
  141. * @param {String} options.extra - 自定义扩展数据
  142. *
  143. * @return {(Object|Message)} Message 消息对象
  144. *
  145. */
  146. createImageMessage(options : {
  147. toId : string,
  148. conversationType : YeIMUniSDKDefines.CONVERSATION_TYPE,
  149. body : {
  150. file : {
  151. tempFilePath : string,
  152. width : number,
  153. height : number
  154. }
  155. },
  156. extra ?: string
  157. }) : Message | Object;
  158. /**
  159. * 创建图片Url直发消息
  160. *
  161. * 仅支持单张图片
  162. *
  163. * @param {Options} options - 创建消息参数对象
  164. *
  165. * @param {String} options.toId - 接受者用户ID
  166. * @param {String} options.conversationType - 会话类型(私聊、群聊)定义在YeIMUniSDKDefines,YeIMUniSDKDefines.CONVERSATION_TYPE.PRIVATE = 私聊,YeIMUniSDKDefines.CONVERSATION_TYPE.GROUP = 群聊
  167. * @param {Body} options.body - 图片消息对象
  168. * @param {String} options.body.originalUrl - 原图网络Url
  169. * @param {Number} options.body.originalWidth - 原图宽度
  170. * @param {Number} options.body.originalHeight - 原图高度
  171. * @param {String} options.body.thumbnailUrl - 缩略图网络Url
  172. * @param {Number} options.body.thumbnailWidth - 缩略图宽度
  173. * @param {Number} options.body.thumbnailHeight - 缩略图高度
  174. * @param {String} options.extra - 自定义扩展数据
  175. *
  176. * @return {(Object|Message)} Message 消息对象
  177. *
  178. */
  179. createImageMessageFromUrl(options : {
  180. toId : string,
  181. conversationType : YeIMUniSDKDefines.CONVERSATION_TYPE,
  182. body : {
  183. originalUrl : string,
  184. originalWidth : number,
  185. originalHeight : number,
  186. thumbnailUrl : string,
  187. thumbnailWidth : number,
  188. thumbnailHeight : number
  189. },
  190. extra ?: string
  191. }) : Message | Object;
  192. /**
  193. * 创建语音消息
  194. *
  195. * 仅支持AAC格式音频
  196. *
  197. * @param {Options} options - 创建消息参数对象
  198. *
  199. * @param {String} options.toId - 接受者用户ID
  200. * @param {String} options.conversationType - 会话类型(私聊、群聊)定义在YeIMUniSDKDefines,YeIMUniSDKDefines.CONVERSATION_TYPE.PRIVATE = 私聊,YeIMUniSDKDefines.CONVERSATION_TYPE.GROUP = 群聊
  201. * @param {Body} options.body - 音频消息对象
  202. * @param {File} options.body.file - 音频文件信息
  203. * @param {String} options.body.file.tempFilePath - 本地音频文件临时路径
  204. * @param {Number} options.body.file.duration - 音频时长,单位秒
  205. * @param {String} options.extra - 自定义扩展数据
  206. *
  207. * @return {(Object|Message)} Message 消息对象
  208. *
  209. */
  210. createAudioMessage(options : {
  211. toId : string,
  212. conversationType : YeIMUniSDKDefines.CONVERSATION_TYPE,
  213. body : {
  214. file : {
  215. tempFilePath : string,
  216. duration : number
  217. }
  218. },
  219. extra ?: string
  220. }) : Message | Object;
  221. /**
  222. * 创建语音Url直发消息
  223. *
  224. * @param {Options} options - 创建消息参数对象
  225. *
  226. * @param {String} options.toId - 接受者用户ID
  227. * @param {String} options.conversationType - 会话类型(私聊、群聊)定义在YeIMUniSDKDefines,YeIMUniSDKDefines.CONVERSATION_TYPE.PRIVATE = 私聊,YeIMUniSDKDefines.CONVERSATION_TYPE.GROUP = 群聊
  228. * @param {Body} options.body - 音频消息对象
  229. * @param {String} options.body.audioUrl - 音频网络Url
  230. * @param {Number} options.body.duration - 音频时长,单位秒
  231. * @param {String} options.extra - 自定义扩展数据
  232. *
  233. * @return {(Object|Message)} Message 消息对象
  234. *
  235. */
  236. createAudioMessageFromUrl(options : {
  237. toId : string,
  238. conversationType : YeIMUniSDKDefines.CONVERSATION_TYPE,
  239. body : {
  240. tempFilePath : string,
  241. duration : number
  242. },
  243. extra ?: string
  244. }) : Message | Object;
  245. /**
  246. * 创建小视频消息
  247. *
  248. * @param {Options} options - 创建消息参数对象
  249. *
  250. * @param {String} options.toId - 接受者用户ID
  251. * @param {String} options.conversationType - 会话类型(私聊、群聊)定义在YeIMUniSDKDefines,YeIMUniSDKDefines.CONVERSATION_TYPE.PRIVATE = 私聊,YeIMUniSDKDefines.CONVERSATION_TYPE.GROUP = 群聊
  252. * @param {Body} options.body - 视频消息对象
  253. * @param {File} options.body.file - 视频文件信息
  254. * @param {String} options.body.file.tempFilePath - 本地小视频文件临时路径
  255. * @param {Number} options.body.file.duration - 视频时长
  256. * @param {Number} options.body.file.width - 视频宽度
  257. * @param {Number} options.body.file.height - 视频高度
  258. * @param {String} options.extra - 自定义扩展数据
  259. *
  260. * @return {(Object|Message)} Message 消息对象
  261. *
  262. */
  263. createVideoMessage(options : {
  264. toId : string,
  265. conversationType : YeIMUniSDKDefines.CONVERSATION_TYPE,
  266. body : {
  267. file : {
  268. tempFilePath : string,
  269. duration : number,
  270. width : number,
  271. height : number
  272. }
  273. },
  274. extra ?: string
  275. }) : Message | Object;
  276. /**
  277. * 创建小视频Url直发消息
  278. *
  279. * @param {Options} options - 创建消息参数对象
  280. *
  281. * @param {String} options.toId - 接受者用户ID
  282. * @param {String} options.conversationType - 会话类型(私聊、群聊)定义在YeIMUniSDKDefines,YeIMUniSDKDefines.CONVERSATION_TYPE.PRIVATE = 私聊,YeIMUniSDKDefines.CONVERSATION_TYPE.GROUP = 群聊
  283. * @param {Body} options.body - 视频消息对象
  284. * @param {String} options.body.videoUrl - 视频网络Url
  285. * @param {String} options.body.thumbnailUrl - 视频缩略图网络Url
  286. * @param {Number} options.body.duration - 视频时长
  287. * @param {Number} options.body.width - 视频宽度
  288. * @param {Number} options.body.height - 视频高度
  289. * @param {String} options.extra - 自定义扩展数据
  290. *
  291. * @return {(Object|Message)} Message 消息对象
  292. *
  293. */
  294. createVideoMessageFromUrl(options : {
  295. toId : string,
  296. conversationType : YeIMUniSDKDefines.CONVERSATION_TYPE,
  297. body : {
  298. videoUrl : string,
  299. thumbnailUrl : string,
  300. duration : number,
  301. width : number,
  302. height : number
  303. },
  304. extra ?: string
  305. }) : Message | Object;
  306. /**
  307. * 创建位置消息
  308. *
  309. * @param {Options} options - 创建消息参数对象
  310. *
  311. * { "toId": "接受者用户ID", "conversationType": YeIMUniSDKDefines.CONVERSATION_TYPE.PRIVATE, body: { address: "地址名称", description: "地址详细描述", longitude: 105.000000, latitude: 31.000000 }}
  312. *
  313. * @param {String} options.toId - 接受者用户ID
  314. * @param {String} options.conversationType - 会话类型(私聊、群聊)定义在YeIMUniSDKDefines,YeIMUniSDKDefines.CONVERSATION_TYPE.PRIVATE = 私聊,YeIMUniSDKDefines.CONVERSATION_TYPE.GROUP = 群聊
  315. * @param {Body} options.body - 位置消息对象
  316. * @param {String} options.body.address - 地址名称
  317. * @param {String} options.body.description - 地址详细描述
  318. * @param {Number} options.body.longitude - 经度
  319. * @param {Number} options.body.latitude - 纬度
  320. * @param {String} options.extra - 自定义扩展数据
  321. *
  322. * @return {(Object|Message)} Message 消息对象
  323. *
  324. */
  325. createLocationMessage(options : {
  326. toId : string,
  327. conversationType : YeIMUniSDKDefines.CONVERSATION_TYPE,
  328. body : {
  329. address : string,
  330. description : string,
  331. longitude : number,
  332. latitude : number
  333. },
  334. extra ?: string
  335. }) : Message | Object;
  336. /**
  337. * 创建自定义消息
  338. *
  339. * 自定义消息内容放在body字段
  340. *
  341. * @param {Options} options - 创建消息参数对象
  342. *
  343. * { "toId": "接受者用户ID", "conversationType": YeIMUniSDKDefines.CONVERSATION_TYPE.PRIVATE, body: {} }
  344. *
  345. * @param {String} options.toId - 接受者用户ID
  346. * @param {String} options.conversationType - 会话类型(私聊、群聊)定义在YeIMUniSDKDefines,YeIMUniSDKDefines.CONVERSATION_TYPE.PRIVATE = 私聊,YeIMUniSDKDefines.CONVERSATION_TYPE.GROUP = 群聊
  347. * @param {Body} options.body - 自定义消息内容
  348. * @param {String|Object} options.body.custom - 消息内容
  349. * @param {String} options.extra - 自定义扩展数据
  350. *
  351. * @return {(Object|Message)} Message 消息对象
  352. *
  353. */
  354. createCustomMessage(options : {
  355. toId : string,
  356. conversationType : YeIMUniSDKDefines.CONVERSATION_TYPE,
  357. body : {
  358. custom : string | object
  359. },
  360. extra ?: string
  361. }) : Message | Object;
  362. /**
  363. * 创建合并消息
  364. *
  365. * @param {Options} options - 创建消息参数对象
  366. *
  367. * @param {String} options.toId - 接受者用户ID
  368. * @param {String} options.conversationType - 会话类型(私聊、群聊)定义在YeIMUniSDKDefines,YeIMUniSDKDefines.CONVERSATION_TYPE.PRIVATE = 私聊,YeIMUniSDKDefines.CONVERSATION_TYPE.GROUP = 群聊
  369. * @param {Body} options.body - 文本消息对象
  370. * @param {String} options.body.title - 合并消息的标题
  371. * @param {Array<Message>} options.body.messageList - 合并消息的标题
  372. * @param {Array<String>} options.body.summaryList - 合并消息的标题
  373. * @param {String} options.extra - 自定义扩展数据
  374. *
  375. * @return {(Object|Message)} Message 消息对象
  376. *
  377. */
  378. createMergerMessage(options : {
  379. toId : string,
  380. conversationType : YeIMUniSDKDefines.CONVERSATION_TYPE,
  381. body : {
  382. title : string,
  383. messageList : Array<T>,
  384. summaryList : Array<string>
  385. },
  386. extra ?: string
  387. }) : Message | Object;
  388. /**
  389. * 创建转发消息
  390. *
  391. * @param {Options} options - 创建消息参数对象
  392. *
  393. * @param {String} options.toId - 接受者用户ID
  394. * @param {String} options.conversationType - 会话类型(私聊、群聊)定义在YeIMUniSDKDefines,YeIMUniSDKDefines.CONVERSATION_TYPE.PRIVATE = 私聊,YeIMUniSDKDefines.CONVERSATION_TYPE.GROUP = 群聊
  395. * @param {Body} options.body - 文本消息对象
  396. * @param {Message} options.body.message - 要转发的消息
  397. * @param {String} options.extra - 自定义扩展数据
  398. *
  399. * @return {(Object|Message)} Message 消息对象
  400. *
  401. */
  402. createForwardMessage(options : {
  403. toId : string,
  404. conversationType : YeIMUniSDKDefines.CONVERSATION_TYPE,
  405. body : {
  406. message : Message | object,
  407. },
  408. extra ?: string
  409. }) : Message | Object;
  410. /**
  411. *
  412. * 通用上传接口
  413. *
  414. * @param {Options} options
  415. * @param {String} options.filename - 文件名称(需带后缀)
  416. * @param {String} options.filepath - 本地文件临时路径
  417. * @param {(result)=>void} [options.success] - 成功回调
  418. * @param {(error)=>void} [options.fail] - 失败回调
  419. * @param {(progress)=>void} [options.onProgress] - 上传进度回调
  420. *
  421. */
  422. upload(options : {
  423. filename : string,
  424. filepath : string,
  425. success ?: (result : any) => void,
  426. fail ?: (error : any) => void
  427. }) : void;
  428. /**
  429. *
  430. * @version 1.1.7
  431. *
  432. * 获取历史消息记录
  433. *
  434. * @param {Options} options - 参数对象
  435. *
  436. * @param {String} options.nextMessageId - 下次拉取的开始ID
  437. * @param {String} options.conversationId - 会话ID
  438. * @param {Number} options.limit - 拉取数量,默认:20
  439. * @param {(result)=>void} options.success - 成功回调
  440. * @param {(error)=>void} options.fail - 失败回调
  441. *
  442. */
  443. getHistoryMessageList(options : {
  444. nextMessageId ?: string,
  445. conversationId : string,
  446. limit ?: number,
  447. success ?: (result : any) => void,
  448. fail ?: (error : any) => void
  449. }) : void;
  450. /**
  451. *
  452. * 删除消息
  453. *
  454. * @param {Options} options - 参数对象
  455. *
  456. * @param {Message} message - 要删除的消息对象
  457. * @param {(result)=>void} options.success - 成功回调
  458. * @param {(error)=>void} options.fail - 失败回调
  459. *
  460. */
  461. deleteMessage(options : {
  462. message : Message | object,
  463. success ?: (result : any) => void,
  464. fail ?: (error : any) => void
  465. }) : void;
  466. /**
  467. *
  468. * 撤回消息
  469. *
  470. * @param {Options} options - 参数对象
  471. *
  472. * @param {Message} message - 要撤回的消息对象
  473. * @param {(result)=>void} options.success - 成功回调
  474. * @param {(error)=>void} options.fail - 失败回调
  475. *
  476. */
  477. revokeMessage(options : {
  478. message : Message | object,
  479. success ?: (result : any) => void,
  480. fail ?: (error : any) => void
  481. }) : void;
  482. /**
  483. * 根据会话ID获取本地会话详情
  484. *
  485. * @param {String} conversationId - 会话ID
  486. * @return {Conversation} conversation
  487. */
  488. getConversation(conversationId : string) : Conversation | object;
  489. /**
  490. * 获取本地会话列表
  491. *
  492. * @param {Options} options - 参数对象
  493. *
  494. * @param {String} options.page - 页码
  495. * @param {String} options.limit - 每页数量
  496. * @param {(result)=>{}} [options.success] - 成功回调
  497. * @param {(error)=>{}} [options.fail] - 失败回调
  498. */
  499. getConversationList(options : {
  500. page : number,
  501. limit : number,
  502. success ?: (result : any) => void,
  503. fail ?: (error : any) => void
  504. }) : void;
  505. /**
  506. * 根据会话ID删除会话和聊天记录(包括云端)
  507. *
  508. * @param {Object} conversationId
  509. * @return {void}
  510. */
  511. deleteConversation(conversationId : string) : void;
  512. /**
  513. * 清除指定会话未读数
  514. *
  515. * 云端同时发送给对端已读事件(私聊)
  516. *
  517. * @param {String} conversationId - 会话ID
  518. * @return {void}
  519. */
  520. clearConversationUnread(conversationId : string) : void;
  521. /**
  522. *
  523. * 发送消息统一入口
  524. *
  525. * @param {Options} options - 参数对象
  526. *
  527. * @param {Message} options.message - 消息对象
  528. * @param {(result)=>void} [options.success] - 成功回调
  529. * @param {(error)=>void} [options.fail] - 失败回调
  530. *
  531. * @example
  532. * sendMessage({
  533. message: message,
  534. success: (result) => {},
  535. fail: (error) => {}
  536. });
  537. */
  538. sendMessage(options : {
  539. message : Message | Object | undefined,
  540. success ?: (result : any) => void,
  541. fail ?: (error : any) => void
  542. }) : void;
  543. /**
  544. *
  545. * 获取用户信息
  546. *
  547. * @param {Options} options - 参数对象
  548. *
  549. * @param {String} options.userId - 用户ID
  550. * @param {(result)=>void} [options.success] - 成功回调
  551. * @param {(error)=>void} [options.fail] - 失败回调
  552. *
  553. */
  554. getUserInfo(options : {
  555. userId : string,
  556. success ?: (result : any) => void,
  557. fail ?: (error : any) => void
  558. }) : void;
  559. /**
  560. *
  561. * 更新我的用户资料
  562. *
  563. * @param {Options} options - 参数对象
  564. *
  565. * @param {String} options.nickname - 昵称
  566. * @param {String} options.avatarUrl - 头像地址
  567. * @param {Number} options.gender - 性别,0=未知,1=男性,2=女性
  568. * @param {Number} options.mobile - 电话
  569. * @param {String} options.email - 邮箱
  570. * @param {String} options.birthday - 生日
  571. * @param {String} options.motto - 个性签名
  572. * @param {String} options.extend - 用户自定义扩展字段
  573. * @param {Number} options.addFriendType - 好友添加我的方式
  574. * @param {(result)=>void} [options.success] - 成功回调
  575. * @param {(error)=>void} [options.fail] - 失败回调
  576. *
  577. */
  578. updateUserInfo(options : {
  579. nickname ?: string,
  580. avatarUrl ?: string,
  581. gender ?: number,
  582. mobile ?: number,
  583. email ?: string,
  584. birthday ?: string,
  585. motto ?: string,
  586. extend ?: string,
  587. addFriendType ?: YeIMUniSDKDefines.USER.ADDFRIEND,
  588. success ?: (result : any) => void,
  589. fail ?: (error : any) => void
  590. }) : void;
  591. /**
  592. *
  593. * 获取黑名单列表
  594. *
  595. * @param {Options} options - 参数对象
  596. *
  597. * @param {(result)=>void} [options.success] - 成功回调
  598. * @param {(error)=>void} [options.fail] - 失败回调
  599. *
  600. */
  601. getBlackUserList(options : {
  602. success ?: (result : any) => void,
  603. fail ?: (error : any) => void
  604. }) : void;
  605. /**
  606. *
  607. * 添加用户到黑名单
  608. *
  609. *
  610. * @param {Options} options - 参数对象
  611. *
  612. *
  613. * @param {Array<String>} options.members - 用户ID列表
  614. * @param {(result)=>void} [options.success] - 成功回调
  615. * @param {(error)=>void} [options.fail] - 失败回调
  616. *
  617. * @example
  618. * addToBlackUserList({
  619. members: ["user1", "user2"],
  620. success: (result) => {},
  621. fail: (error) => {}
  622. });
  623. */
  624. addToBlackUserList(options : {
  625. members : Array<string>
  626. success ?: (result : any) => void,
  627. fail ?: (error : any) => void
  628. }) : void;
  629. /**
  630. *
  631. * 把用户移出黑名单
  632. *
  633. *
  634. * @param {Options} options - 参数对象
  635. *
  636. *
  637. * @param {Array<String>} options.members - 用户ID列表
  638. * @param {(result)=>void} [options.success] - 成功回调
  639. * @param {(error)=>void} [options.fail] - 失败回调
  640. *
  641. * @example
  642. * removeFromBlacklist({
  643. members: ["user1", "user2"],
  644. success: (result) => {},
  645. fail: (error) => {}
  646. });
  647. */
  648. removeFromBlacklist(options : {
  649. members : Array<string>
  650. success ?: (result : any) => void,
  651. fail ?: (error : any) => void
  652. }) : void;
  653. /**
  654. * 添加IM事件监听器
  655. * @param {Object} event - 事件类型 YeIMUniSDKDefines.EVENT
  656. * @param {(result)=>void} callback 监听回调方法
  657. */
  658. addEventListener(event : string, callback : (result : any) => void);
  659. /**
  660. * 移除IM事件监听器
  661. * @param {Object} event - 事件类型 YeIMUniSDKDefines.EVENT
  662. * @param {(result)=>void} callback 监听回调方法
  663. */
  664. removeEventListener(event : string, callback : (result : any) => void);
  665. /**
  666. *
  667. * 创建群组
  668. *
  669. * @param {Options} options - 参数对象
  670. *
  671. * @param {String} options.name - 群名称
  672. * @param {String} options.avatarUrl - 群头像
  673. * @param {String} [options.groupId] - 群ID,未填写时系统自动生成
  674. * @param {Number} [options.joinMode] - 群申请处理方式 - YeIMUniSDKDefines.GROUP.JOINMODE
  675. * @param {String} [options.introduction] - 群简介
  676. * @param {String} [options.notification] - 群公告
  677. * @param {Array<String>} [options.members] - 创建群聊初始化成员(用户ID数组)
  678. * @param {(result)=>void} [options.success] - 成功回调
  679. * @param {(error)=>void} [options.fail] - 失败回调
  680. *
  681. * @example
  682. * createGroup({
  683. name: "",
  684. avatarUrl: "",
  685. success: (result) => {},
  686. fail: (error) => {}
  687. });
  688. */
  689. createGroup(options : {
  690. name : string,
  691. avatarUrl : string,
  692. groupId ?: string,
  693. joinMode ?: number,
  694. introduction ?: string,
  695. notification ?: string,
  696. members ?: Array<string>,
  697. success ?: (result : any) => void,
  698. fail ?: (error : any) => void
  699. }) : void;
  700. /**
  701. *
  702. * 解散群组
  703. *
  704. * 仅群主可操作
  705. *
  706. * @param {Options} options - 参数对象
  707. *
  708. * @param {String} [options.groupId] - 群ID
  709. * @param {(result)=>void} [options.success] - 成功回调
  710. * @param {(error)=>void} [options.fail] - 失败回调
  711. *
  712. * @example
  713. * dissolveGroup({
  714. groupId: "",
  715. success: (result) => {},
  716. fail: (error) => {}
  717. });
  718. */
  719. dissolveGroup(options : {
  720. groupId : string,
  721. success ?: (result : any) => void,
  722. fail ?: (error : any) => void
  723. }) : void;
  724. /**
  725. *
  726. * 更新群组资料
  727. *
  728. * @param {Options} options - 参数对象
  729. *
  730. * @param {String} [options.groupId] - 群ID
  731. * @param {String} [options.name] - 群名称
  732. * @param {String} [options.avatarUrl] - 群头像
  733. * @param {YeIMUniSDKDefines.GROUP.JOINMODE} [options.joinMode] - 群申请处理方式
  734. * @param {String} [options.introduction] - 群简介
  735. * @param {String} [options.notification] - 群公告
  736. * @param {Number} [options.isMute] - 全体禁言 0,1
  737. * @param {(result)=>void} [options.success] - 成功回调
  738. * @param {(error)=>void} [options.fail] - 失败回调
  739. *
  740. * @example
  741. * updateGroup({
  742. groupId: "",
  743. name: "",
  744. avatarUrl: "",
  745. success: (result) => {},
  746. fail: (error) => {}
  747. });
  748. */
  749. updateGroup(options : {
  750. groupId : string,
  751. name ?: string,
  752. avatarUrl ?: string,
  753. joinMode ?: number,
  754. introduction ?: string,
  755. notification ?: string,
  756. members ?: Array<string>,
  757. success ?: (result : any) => void,
  758. fail ?: (error : any) => void
  759. }) : void;
  760. /**
  761. *
  762. * 通过群ID获取群组资料
  763. *
  764. * @param {Options} options - 参数对象
  765. *
  766. * @param {String} options.groupId - 群ID
  767. * @param {(result)=>void} [options.success] - 成功回调
  768. * @param {(error)=>void} [options.fail] - 失败回调
  769. *
  770. * @example
  771. * getGroup({
  772. groupId: "",
  773. success: (result) => {},
  774. fail: (error) => {}
  775. });
  776. */
  777. getGroup(options : {
  778. groupId : string,
  779. success ?: (result : any) => void,
  780. fail ?: (error : any) => void
  781. }) : void;
  782. /**
  783. *
  784. * 转让群主
  785. *
  786. * 仅群主可操作
  787. *
  788. * @param {Options} options - 参数对象
  789. *
  790. * @param {String} [options.groupId] - 群ID
  791. * @param {String} [options.userId] - 转让用户ID
  792. * @param {(result)=>void} [options.success] - 成功回调
  793. * @param {(error)=>void} [options.fail] - 失败回调
  794. *
  795. * @example
  796. * transferLeader({
  797. groupId: "",
  798. userId: "",
  799. success: (result) => {},
  800. fail: (error) => {}
  801. });
  802. */
  803. transferLeader(options : {
  804. groupId : string,
  805. userId : string,
  806. success ?: (result : any) => void,
  807. fail ?: (error : any) => void
  808. }) : void;
  809. /**
  810. *
  811. * 获取我的群组列表
  812. *
  813. * @param {Options} options - 参数对象
  814. *
  815. * @param {(result)=>void} [options.success] - 成功回调
  816. * @param {(error)=>void} [options.fail] - 失败回调
  817. *
  818. * @example
  819. * getGroupList({
  820. success: (result) => {},
  821. fail: (error) => {}
  822. });
  823. */
  824. getGroupList(options : {
  825. success ?: (result : any) => void,
  826. fail ?: (error : any) => void
  827. }) : void;
  828. /**
  829. *
  830. * 用户申请入群
  831. *
  832. * IM内用户均可调用此接口申请进入传入的群组ID的群,根据群申请处理方式不同,可能直接进入,也可能等待审核
  833. *
  834. * @param {Options} options - 参数对象
  835. *
  836. * @param {String} options.groupId - 群ID
  837. * @param {(result)=>void} [options.success] - 成功回调
  838. * @param {(error)=>void} [options.fail] - 失败回调
  839. *
  840. * @example
  841. * joinGroup({
  842. groupId: "",
  843. success: (result) => {},
  844. fail: (error) => {}
  845. });
  846. */
  847. joinGroup(options : {
  848. groupId : string,
  849. success ?: (result : any) => void,
  850. fail ?: (error : any) => void
  851. }) : void;
  852. /**
  853. *
  854. * 退出群组
  855. *
  856. * @param {Options} options - 参数对象
  857. *
  858. * @param {String} options.groupId - 群ID
  859. * @param {(result)=>void} [options.success] - 成功回调
  860. * @param {(error)=>void} [options.fail] - 失败回调
  861. *
  862. * @example
  863. * leaveGroup({
  864. groupId: "",
  865. success: (result) => {},
  866. fail: (error) => {}
  867. });
  868. */
  869. leaveGroup(options : {
  870. groupId : string,
  871. success ?: (result : any) => void,
  872. fail ?: (error : any) => void
  873. }) : void;
  874. /**
  875. *
  876. * 添加群成员
  877. *
  878. * 不限权限,IM内用户均可调用此接口,但根据群申请处理方式不同,可能直接进入,也可能等待审核
  879. *
  880. * @param {Options} options - 参数对象
  881. *
  882. * @param {String} options.groupId - 群ID
  883. * @param {Array<String>} options.members - 用户ID列表
  884. * @param {(result)=>void} [options.success] - 成功回调
  885. * @param {(error)=>void} [options.fail] - 失败回调
  886. *
  887. * @example
  888. * addGroupUsers({
  889. groupId: "",
  890. members: ["user1", "user2"],
  891. success: (result) => {},
  892. fail: (error) => {}
  893. });
  894. */
  895. addGroupUsers(options : {
  896. groupId : string,
  897. members : Array<string>,
  898. success ?: (result : any) => void,
  899. fail ?: (error : any) => void
  900. }) : void;
  901. /**
  902. *
  903. * 移除群成员
  904. *
  905. * 仅群主可使用此接口
  906. *
  907. * @param {Object} options - 参数对象
  908. *
  909. * @param {String} options.groupId - 群ID
  910. * @param {Array<String>} options.members - 用户ID列表
  911. * @param {(result)=>void} [options.success] - 成功回调
  912. * @param {(error)=>void} [options.fail] - 失败回调
  913. *
  914. * @example
  915. * removeGroupUsers({
  916. groupId: "",
  917. members: ["user1", "user2"],
  918. success: (result) => {},
  919. fail: (error) => {}
  920. });
  921. */
  922. removeGroupUsers(options : {
  923. groupId : string,
  924. members : Array<string>,
  925. success ?: (result : any) => void,
  926. fail ?: (error : any) => void
  927. }) : void;
  928. /**
  929. *
  930. * 设置群管理员
  931. *
  932. * 仅群主可操作此接口
  933. *
  934. * @param {Options} options - 参数对象
  935. *
  936. * @param {String} options.groupId - 群ID
  937. * @param {String} options.userId - 要设置的用户ID
  938. * @param {Number} options.isAdmin - 是否设置管理员,0=取消,1=设置
  939. * @param {(result)=>void} [options.success] - 成功回调
  940. * @param {(error)=>void} [options.fail] - 失败回调
  941. *
  942. * @example
  943. * setAdminstrator({
  944. groupId: "",
  945. userId: "",
  946. isAdmin: 1,
  947. success: (result) => {},
  948. fail: (error) => {}
  949. });
  950. */
  951. setAdminstrator(options : {
  952. groupId : string,
  953. userId : string,
  954. isAdmin : number,
  955. success ?: (result : any) => void,
  956. fail ?: (error : any) => void
  957. }) : void;
  958. /**
  959. *
  960. * 禁言群成员
  961. *
  962. * 群组中群主或管理员可调用此接口禁言群成员,每次设置的分钟数均从操作时间开始算起,设置0则取消禁言
  963. *
  964. * @param {Options} options - 参数对象
  965. *
  966. * @param {String} options.groupId - 群ID
  967. * @param {String} options.userId - 禁言用户ID
  968. * @param {Number} options.time - 禁言分钟数
  969. * @param {(result)=>void} [options.success] - 成功回调
  970. * @param {(error)=>void} [options.fail] - 失败回调
  971. *
  972. * @example
  973. * setMute({
  974. groupId: "group_1",
  975. userId: "user1",
  976. time: 10,
  977. success: (result) => {},
  978. fail: (error) => {}
  979. });
  980. */
  981. setMute(options : {
  982. groupId : string,
  983. userId : string,
  984. time : number,
  985. success ?: (result : any) => void,
  986. fail ?: (error : any) => void
  987. }) : void;
  988. /**
  989. *
  990. * 获取群组用户入群申请列表
  991. *
  992. * 群主或管理员调用此接口可获取名下所有群组入群申请列表
  993. *
  994. * @param {Options} options - 参数对象
  995. *
  996. * @param {(result)=>void} [options.success] - 成功回调
  997. * @param {(error)=>void} [options.fail] - 失败回调
  998. *
  999. * @example
  1000. * getGroupApplyList({
  1001. success: (result) => {},
  1002. fail: (error) => {}
  1003. });
  1004. */
  1005. getGroupApplyList(options : {
  1006. success ?: (result : any) => void,
  1007. fail ?: (error : any) => void
  1008. }) : void;
  1009. /**
  1010. *
  1011. * 处理群组用户入群申请
  1012. *
  1013. * 申请记录所在的群组中群主或管理员可调用此接口处理申请
  1014. *
  1015. * @param {Options} options - 参数对象
  1016. *
  1017. * @param {Number} options.id - 申请记录的ID
  1018. * @param {Number} options.status - 处理结果 YeIMUniSDKDefines.GROUP.APPLYSTATU
  1019. * @param {(result)=>void} [options.success] - 成功回调
  1020. * @param {(error)=>void} [options.fail] - 失败回调
  1021. *
  1022. * @example
  1023. * handleApply({
  1024. id: 5,
  1025. status: YeIMUniSDKDefines.GROUP.APPLYSTATUS.AGREE,
  1026. success: (result) => {},
  1027. fail: (error) => {}
  1028. });
  1029. */
  1030. handleApply(options : {
  1031. id : number,
  1032. status : number
  1033. success ?: (result : any) => void,
  1034. fail ?: (error : any) => void
  1035. }) : void;
  1036. /**
  1037. *
  1038. * 获取群成员列表
  1039. *
  1040. * @param {Options} options - 参数对象
  1041. *
  1042. * @param {String} options.groupId - 群ID
  1043. * @param {(result)=>void} [options.success] - 成功回调
  1044. * @param {(error)=>void} [options.fail] - 失败回调
  1045. *
  1046. * @example
  1047. * getGroupUserList({
  1048. groupId: "group_1",
  1049. success: (result) => {},
  1050. fail: (error) => {}
  1051. });
  1052. */
  1053. getGroupUserList(options : {
  1054. groupId : string,
  1055. success ?: (result : any) => void,
  1056. fail ?: (error : any) => void
  1057. }) : void;
  1058. /**
  1059. *
  1060. * 从云端获取好友列表
  1061. *
  1062. * @param {Options} options - 参数对象
  1063. *
  1064. * @param {Boolean} options.cloud - 是否从云端拉取
  1065. * @param {Number} options.profile - 资料类型,0=简略资料,1=详细资料 (云端拉取有效)
  1066. * @param {Number} options.page - 页码
  1067. * @param {Number} options.limit - 每页数量
  1068. *
  1069. * @param {(result)=>{}} [options.success] - 成功回调
  1070. * @param {(error)=>{}} [options.fail] - 失败回调
  1071. */
  1072. getFriendList(options : {
  1073. cloud ?: boolean,
  1074. profile ?: number,
  1075. page ?: number,
  1076. limit ?: number,
  1077. success ?: (result : any) => void,
  1078. fail ?: (error : any) => void
  1079. }) : void;
  1080. /**
  1081. *
  1082. * 从云端获取好友申请列表
  1083. *
  1084. * @param {Options} options - 参数对象
  1085. *
  1086. * @param {Boolean} options.cloud - 是否从云端拉取
  1087. * @param {Number} options.type - 类型,0=发给我申请,1=我发出去的申请 (云端拉取有效)
  1088. * @param {Number} options.page - 页码
  1089. * @param {Number} options.limit - 每页数量
  1090. *
  1091. * @param {(result)=>{}} [options.success] - 成功回调
  1092. * @param {(error)=>{}} [options.fail] - 失败回调
  1093. */
  1094. getFriendApplyList(options : {
  1095. cloud ?: boolean,
  1096. type ?: number,
  1097. page ?: number,
  1098. limit ?: number,
  1099. success ?: (result : any) => void,
  1100. fail ?: (error : any) => void
  1101. }) : void;
  1102. /**
  1103. *
  1104. * 将全部好友申请设置为已读状态
  1105. *
  1106. * @param {Options} options - 参数对象
  1107. *
  1108. * @param {(result)=>{}} [options.success] - 成功回调
  1109. * @param {(error)=>{}} [options.fail] - 失败回调
  1110. */
  1111. setApplyListRead(options : {
  1112. success ?: (result : any) => void,
  1113. fail ?: (error : any) => void
  1114. }) : void;
  1115. /**
  1116. *
  1117. * 添加好友
  1118. *
  1119. * @param {Options} options - 参数对象
  1120. *
  1121. * @param {String} options.userId - 用户ID
  1122. * @param {String} options.remark - 好友备注
  1123. * @param {String} options.extraMessage - 附言
  1124. *
  1125. * @param {(result)=>{}} [options.success] - 成功回调
  1126. * @param {(error)=>{}} [options.fail] - 失败回调
  1127. */
  1128. addFriend(options : {
  1129. userId : string,
  1130. remark ?: string,
  1131. extraMessage ?: string,
  1132. success ?: (result : any) => void,
  1133. fail ?: (error : any) => void
  1134. }) : void;
  1135. /**
  1136. *
  1137. * 删除好友
  1138. *
  1139. * @param {Options} options - 参数对象
  1140. *
  1141. * @param {Array<String>} options.members - 好友ID列表
  1142. *
  1143. * @param {(result)=>{}} [options.success] - 成功回调
  1144. * @param {(error)=>{}} [options.fail] - 失败回调
  1145. */
  1146. deleteFriend(options : {
  1147. members : Array<string>,
  1148. success ?: (result : any) => void,
  1149. fail ?: (error : any) => void
  1150. }) : void;
  1151. /**
  1152. *
  1153. * 更新好友资料
  1154. *
  1155. * @param {Options} options - 参数对象
  1156. *
  1157. * @param {String} options.userId - 好友ID
  1158. * @param {String} options.remark - 好友备注
  1159. * @param {String} options.extend - 自定义扩展字段
  1160. *
  1161. * @param {(result)=>{}} [options.success] - 成功回调
  1162. * @param {(error)=>{}} [options.fail] - 失败回调
  1163. */
  1164. updateFriend(options : {
  1165. userId : string,
  1166. remark ?: string,
  1167. extend ?: string,
  1168. success ?: (result : any) => void,
  1169. fail ?: (error : any) => void
  1170. }) : void;
  1171. /**
  1172. *
  1173. * 同意好友申请
  1174. *
  1175. * @param {Options} options - 参数对象
  1176. *
  1177. * @param {Number} options.id - 申请ID
  1178. * @param {String} options.remark - 备注
  1179. *
  1180. * @param {(result)=>{}} [options.success] - 成功回调
  1181. * @param {(error)=>{}} [options.fail] - 失败回调
  1182. */
  1183. acceptApply(options : {
  1184. id : number,
  1185. remark ?: string,
  1186. success ?: (result : any) => void,
  1187. fail ?: (error : any) => void
  1188. }) : void;
  1189. /**
  1190. *
  1191. * 拒绝好友申请
  1192. *
  1193. * @param {Options} options - 参数对象
  1194. *
  1195. * @param {Number} options.id - 申请ID
  1196. *
  1197. * @param {(result)=>{}} [options.success] - 成功回调
  1198. * @param {(error)=>{}} [options.fail] - 失败回调
  1199. */
  1200. refuseApply(options : {
  1201. id : number,
  1202. success ?: (result : any) => void,
  1203. fail ?: (error : any) => void
  1204. }) : void;
  1205. /**
  1206. * 断开连接,此操作不会重连
  1207. */
  1208. disConnect() : void;
  1209. /**
  1210. * 获取当前连接状态
  1211. *
  1212. * 0:连接中 1:连接已打开 2:连接关闭中 3:连接已关闭
  1213. * @returns {number}
  1214. */
  1215. readyState() : number;
  1216. /**
  1217. * 设置APP在前台
  1218. */
  1219. intoApp() : void;
  1220. /**
  1221. * 设置APP已进入后台
  1222. */
  1223. leaveApp() : void;
  1224. }
  1225. interface Message {
  1226. }
  1227. interface Conversation {
  1228. }
  1229. /**
  1230. * YeIMUniSDK预定义常量
  1231. */
  1232. // @ts-ignore
  1233. declare const YeIMUniSDKDefines = {
  1234. /**
  1235. * 事件类型
  1236. */
  1237. EVENT: {
  1238. /**
  1239. * 网络状态变化
  1240. */
  1241. NET_CHANGED,
  1242. /**
  1243. * 会话列表变化
  1244. */
  1245. CONVERSATION_LIST_CHANGED,
  1246. /**
  1247. * 收到消息
  1248. */
  1249. MESSAGE_RECEIVED,
  1250. /**
  1251. * 撤回消息
  1252. */
  1253. MESSAGE_REVOKED,
  1254. /**
  1255. * 私聊会话已读回执
  1256. */
  1257. PRIVATE_READ_RECEIPT,
  1258. /**
  1259. * 用户被踢下线
  1260. */
  1261. KICKED_OUT
  1262. },
  1263. /**
  1264. * 会话类型
  1265. */
  1266. CONVERSATION_TYPE: {
  1267. /**
  1268. * 私聊
  1269. */
  1270. PRIVATE,
  1271. /**
  1272. * 群聊
  1273. */
  1274. GROUP
  1275. },
  1276. /**
  1277. * 消息类型
  1278. */
  1279. MESSAGE_TYPE: {
  1280. /**
  1281. * 文本消息
  1282. */
  1283. TEXT,
  1284. /**
  1285. * 文本 @ 消息
  1286. */
  1287. TEXT_AT,
  1288. /**
  1289. * 图片消息
  1290. */
  1291. IMAGE,
  1292. /**
  1293. * 语音消息
  1294. */
  1295. AUDIO,
  1296. /**
  1297. * 小视频消息
  1298. */
  1299. VIDEO,
  1300. /**
  1301. * 位置消息
  1302. */
  1303. LOCATION,
  1304. /**
  1305. * 自定义消息
  1306. */
  1307. CUSTOM,
  1308. /**
  1309. * 合并消息
  1310. */
  1311. MERGER,
  1312. /**
  1313. * 转发消息
  1314. */
  1315. FORWARD,
  1316. /**
  1317. * 群聊系统通知
  1318. */
  1319. GROUP_SYS_NOTICE
  1320. },
  1321. /**
  1322. * 用户相关常量
  1323. */
  1324. USER: {
  1325. /**
  1326. * 加好友验证方式
  1327. */
  1328. ADDFRIEND: {
  1329. /**
  1330. * 允许任何人添加自己为好友
  1331. */
  1332. ALLOW,
  1333. /**
  1334. * 需要经过自己确认才能添加自己为好友
  1335. */
  1336. CONFIRM,
  1337. /**
  1338. * 拒绝加好友
  1339. */
  1340. DENY
  1341. }
  1342. },
  1343. /**
  1344. * 群组相关常量
  1345. */
  1346. GROUP: {
  1347. /**
  1348. * 群申请处理方式
  1349. */
  1350. JOINMODE: {
  1351. /**
  1352. * 自有加入,不需要申请和审核,不需要被邀请人允许。
  1353. */
  1354. FREE,
  1355. /**
  1356. * 验证加入,需要申请,以及群主或管理员的同意才能入群
  1357. */
  1358. CHECK,
  1359. /**
  1360. * 禁止加入
  1361. */
  1362. FORBIDDEN
  1363. },
  1364. /**
  1365. * 入群申请处理结果
  1366. */
  1367. APPLYSTATUS: {
  1368. /**
  1369. * 待处理
  1370. */
  1371. PENDING,
  1372. /**
  1373. * 同意
  1374. */
  1375. AGREE,
  1376. /**
  1377. * 拒绝
  1378. */
  1379. REFUSE
  1380. }
  1381. },
  1382. }
  1383. }