@dcloudio/uni-app-x 0.7.112 → 0.7.113

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (379) hide show
  1. package/package.json +1 -1
  2. package/types/dom2-internal/UniNativeView.d.ts +1 -0
  3. package/types/dom2-internal/UniPage.d.ts +16 -0
  4. package/types/native/CSSStyleDeclaration.d.ts +172 -172
  5. package/types/native/CanvasRenderingContext2D.d.ts +4720 -4720
  6. package/types/native/DrawableContext.d.ts +1893 -1893
  7. package/types/native/IUniElement.d.ts +7468 -7468
  8. package/types/native/IUniNativeViewElement.d.ts +327 -327
  9. package/types/native/SnapshotOptions.d.ts +337 -62
  10. package/types/native/UniPage.d.ts +1305 -1305
  11. package/types/native/UniResizeObserver.d.ts +749 -749
  12. package/types/native/UniSwiperAnimationFinishEvent.d.ts +59 -59
  13. package/types/native/UniSwiperChangeEvent.d.ts +58 -58
  14. package/types/page.d.ts +3154 -3112
  15. package/types/uni/uts-plugin-api/global.d.ts +8 -0
  16. package/types/uni/uts-plugin-api/index.d.ts +8 -0
  17. package/types/uni/uts-plugin-api/lib/uni-actionSheet/utssdk/interface.d.ts +1672 -911
  18. package/types/uni/uts-plugin-api/lib/uni-addPhoneContact/utssdk/interface.d.ts +126 -126
  19. package/types/uni/uts-plugin-api/lib/uni-arrayBufferToBase64/utssdk/interface.d.ts +14 -14
  20. package/types/uni/uts-plugin-api/lib/uni-authentication/utssdk/interface.d.ts +154 -154
  21. package/types/uni/uts-plugin-api/lib/uni-base64ToArrayBuffer/utssdk/interface.d.ts +14 -14
  22. package/types/uni/uts-plugin-api/lib/uni-camera/utssdk/global.d.ts +55 -0
  23. package/types/uni/uts-plugin-api/lib/uni-camera/utssdk/index.d.ts +27 -0
  24. package/types/uni/uts-plugin-api/lib/uni-camera/utssdk/interface.d.ts +1155 -0
  25. package/types/uni/uts-plugin-api/lib/uni-canvas/utssdk/global.d.ts +9 -6
  26. package/types/uni/uts-plugin-api/lib/uni-canvas/utssdk/index.d.ts +5 -3
  27. package/types/uni/uts-plugin-api/lib/uni-canvas/utssdk/interface.d.ts +978 -972
  28. package/types/uni/uts-plugin-api/lib/uni-canvas-dom2/utssdk/global.d.ts +25 -0
  29. package/types/uni/uts-plugin-api/lib/uni-canvas-dom2/utssdk/index.d.ts +12 -0
  30. package/types/uni/uts-plugin-api/lib/uni-canvas-dom2/utssdk/interface.d.ts +978 -0
  31. package/types/uni/uts-plugin-api/lib/uni-chooseLocation/utssdk/interface.d.ts +358 -358
  32. package/types/uni/uts-plugin-api/lib/uni-chooseMedia/utssdk/interface.d.ts +8 -8
  33. package/types/uni/uts-plugin-api/lib/uni-clipboard/utssdk/interface.d.ts +78 -78
  34. package/types/uni/uts-plugin-api/lib/uni-createSelectorQuery/utssdk/interface.d.ts +490 -479
  35. package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/interface.d.ts +214 -214
  36. package/types/uni/uts-plugin-api/lib/uni-createWorker/utssdk/interface.d.ts +126 -126
  37. package/types/uni/uts-plugin-api/lib/uni-dialogPage/utssdk/interface.d.ts +30 -30
  38. package/types/uni/uts-plugin-api/lib/uni-editor/utssdk/global.d.ts +39 -0
  39. package/types/uni/uts-plugin-api/lib/uni-editor/utssdk/index.d.ts +19 -0
  40. package/types/uni/uts-plugin-api/lib/uni-editor/utssdk/interface.d.ts +856 -0
  41. package/types/uni/uts-plugin-api/lib/uni-event/utssdk/interface.d.ts +338 -338
  42. package/types/uni/uts-plugin-api/lib/uni-exit/utssdk/interface.d.ts +147 -147
  43. package/types/uni/uts-plugin-api/lib/uni-file/utssdk/interface.d.ts +397 -397
  44. package/types/uni/uts-plugin-api/lib/uni-fileSystemManager/utssdk/interface.d.ts +6363 -6359
  45. package/types/uni/uts-plugin-api/lib/uni-getAppAuthorizeSetting/utssdk/interface.d.ts +554 -554
  46. package/types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +2149 -2149
  47. package/types/uni/uts-plugin-api/lib/uni-getBackgroundAudioManager/utssdk/interface.d.ts +1340 -1340
  48. package/types/uni/uts-plugin-api/lib/uni-getDeviceInfo/utssdk/interface.d.ts +1707 -1707
  49. package/types/uni/uts-plugin-api/lib/uni-getEnterOptionsSync/utssdk/interface.d.ts +307 -307
  50. package/types/uni/uts-plugin-api/lib/uni-getLaunchOptionsSync/utssdk/interface.d.ts +310 -310
  51. package/types/uni/uts-plugin-api/lib/uni-getNetworkType/utssdk/interface.d.ts +5 -5
  52. package/types/uni/uts-plugin-api/lib/uni-getPerformance/utssdk/interface.d.ts +129 -129
  53. package/types/uni/uts-plugin-api/lib/uni-getProvider/utssdk/interface.d.ts +757 -757
  54. package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/interface.d.ts +5881 -5879
  55. package/types/uni/uts-plugin-api/lib/uni-getSystemSetting/utssdk/interface.d.ts +442 -442
  56. package/types/uni/uts-plugin-api/lib/uni-input/utssdk/global.d.ts +9 -0
  57. package/types/uni/uts-plugin-api/lib/uni-input/utssdk/index.d.ts +5 -0
  58. package/types/uni/uts-plugin-api/lib/uni-input/utssdk/interface.d.ts +0 -0
  59. package/types/uni/uts-plugin-api/lib/uni-interceptor/utssdk/interface.d.ts +171 -171
  60. package/types/uni/uts-plugin-api/lib/uni-keyboard/utssdk/interface.d.ts +1 -1
  61. package/types/uni/uts-plugin-api/lib/uni-loadFontFace/utssdk/interface.d.ts +536 -536
  62. package/types/uni/uts-plugin-api/lib/uni-location/utssdk/interface.d.ts +2914 -2910
  63. package/types/uni/uts-plugin-api/lib/uni-media/utssdk/interface.d.ts +24 -24
  64. package/types/uni/uts-plugin-api/lib/uni-modal/utssdk/interface.d.ts +208 -208
  65. package/types/uni/uts-plugin-api/lib/uni-navigationBar/utssdk/interface.d.ts +785 -785
  66. package/types/uni/uts-plugin-api/lib/uni-network/utssdk/interface.d.ts +4243 -4243
  67. package/types/uni/uts-plugin-api/lib/uni-oauth/utssdk/interface.d.ts +1979 -1963
  68. package/types/uni/uts-plugin-api/lib/uni-oauth-weixin/utssdk/interface.d.ts +5 -3
  69. package/types/uni/uts-plugin-api/lib/uni-openAppAuthorizeSetting/utssdk/interface.d.ts +229 -229
  70. package/types/uni/uts-plugin-api/lib/uni-openDocument/utssdk/interface.d.ts +753 -753
  71. package/types/uni/uts-plugin-api/lib/uni-pageScrollTo/utssdk/interface.d.ts +84 -84
  72. package/types/uni/uts-plugin-api/lib/uni-payment/utssdk/interface.d.ts +790 -788
  73. package/types/uni/uts-plugin-api/lib/uni-previewImage/utssdk/interface.d.ts +447 -447
  74. package/types/uni/uts-plugin-api/lib/uni-privacy/utssdk/interface.d.ts +498 -498
  75. package/types/uni/uts-plugin-api/lib/uni-prompt/utssdk/interface.d.ts +1552 -1548
  76. package/types/uni/uts-plugin-api/lib/uni-pullDownRefresh/utssdk/interface.d.ts +58 -58
  77. package/types/uni/uts-plugin-api/lib/uni-recorder/utssdk/interface.d.ts +30 -30
  78. package/types/uni/uts-plugin-api/lib/uni-route/utssdk/interface.d.ts +2513 -2513
  79. package/types/uni/uts-plugin-api/lib/uni-rpx2px/utssdk/interface.d.ts +81 -81
  80. package/types/uni/uts-plugin-api/lib/uni-scanCode/utssdk/interface.d.ts +351 -351
  81. package/types/uni/uts-plugin-api/lib/uni-screenBrightness/utssdk/interface.d.ts +107 -107
  82. package/types/uni/uts-plugin-api/lib/uni-share/utssdk/interface.d.ts +584 -584
  83. package/types/uni/uts-plugin-api/lib/uni-shareWithSystem/utssdk/interface.d.ts +722 -722
  84. package/types/uni/uts-plugin-api/lib/uni-showLoading/utssdk/interface.d.ts +292 -292
  85. package/types/uni/uts-plugin-api/lib/uni-storage/utssdk/interface.d.ts +358 -358
  86. package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/interface.d.ts +657 -657
  87. package/types/uni/uts-plugin-api/lib/uni-textarea/utssdk/global.d.ts +9 -0
  88. package/types/uni/uts-plugin-api/lib/uni-textarea/utssdk/index.d.ts +5 -0
  89. package/types/uni/uts-plugin-api/lib/uni-textarea/utssdk/interface.d.ts +0 -0
  90. package/types/uni/uts-plugin-api/lib/uni-theme/utssdk/interface.d.ts +1010 -1010
  91. package/types/uni/uts-plugin-api/lib/uni-video/utssdk/global.d.ts +47 -0
  92. package/types/uni/uts-plugin-api/lib/uni-video/utssdk/index.d.ts +23 -0
  93. package/types/uni/uts-plugin-api/lib/uni-video/utssdk/interface.d.ts +926 -0
  94. package/types/uni/uts-plugin-api/lib/uni-web-view/utssdk/global.d.ts +29 -0
  95. package/types/uni/uts-plugin-api/lib/uni-web-view/utssdk/index.d.ts +14 -0
  96. package/types/uni/uts-plugin-api/lib/uni-web-view/utssdk/interface.d.ts +452 -0
  97. package/types/uni/uts-plugin-api/lib/uni-websocket/utssdk/interface.d.ts +1442 -1442
  98. package/types/uni/uts-plugin-biz/lib/uni-facialVerify/utssdk/interface.d.ts +220 -220
  99. package/types/uni/uts-plugin-biz/lib/uni-map-tencent/utssdk/interface.d.ts +65 -65
  100. package/types/uni/uts-plugin-biz/lib/uni-push/utssdk/interface.d.ts +981 -981
  101. package/types/uni/uts-plugin-biz/lib/uni-verify/utssdk/interface.d.ts +26 -26
  102. package/types/uni/uts-plugin-component/.temp/uni-camera/utssdk/interface.uts +1155 -0
  103. package/types/uni/uts-plugin-component/.temp/uni-camera.d.ts +38 -0
  104. package/types/uni/uts-plugin-component/.temp/uni-camera.ts +52 -0
  105. package/types/uni/uts-plugin-component/.temp/uni-canvas/utssdk/interface.uts +976 -0
  106. package/types/uni/uts-plugin-component/.temp/uni-canvas-dom2/utssdk/interface.uts +976 -0
  107. package/types/uni/uts-plugin-component/.temp/uni-editor.d.ts +171 -0
  108. package/types/uni/uts-plugin-component/.temp/uni-editor.ts +237 -0
  109. package/types/uni/uts-plugin-component/.temp/uni-form.d.ts +2 -0
  110. package/types/uni/uts-plugin-component/.temp/uni-form.ts +1 -0
  111. package/types/uni/uts-plugin-component/.temp/uni-input/utssdk/interface.uts +0 -0
  112. package/types/uni/uts-plugin-component/.temp/uni-map-tencent.d.ts +56 -0
  113. package/types/uni/uts-plugin-component/.temp/uni-map-tencent.ts +88 -0
  114. package/types/uni/uts-plugin-component/.temp/uni-match-media.d.ts +2 -0
  115. package/types/uni/uts-plugin-component/.temp/uni-match-media.ts +2 -0
  116. package/types/uni/uts-plugin-component/.temp/uni-navigator.d.ts +2 -0
  117. package/types/uni/uts-plugin-component/.temp/uni-navigator.ts +1 -0
  118. package/types/uni/uts-plugin-component/.temp/uni-page-container.d.ts +0 -0
  119. package/types/uni/uts-plugin-component/.temp/uni-page-container.ts +2 -0
  120. package/types/uni/uts-plugin-component/.temp/uni-progress.d.ts +2 -0
  121. package/types/uni/uts-plugin-component/.temp/uni-progress.ts +1 -0
  122. package/types/uni/uts-plugin-component/.temp/uni-rich-text.d.ts +7 -0
  123. package/types/uni/uts-plugin-component/.temp/uni-rich-text.ts +12 -0
  124. package/types/uni/uts-plugin-component/.temp/uni-textarea/utssdk/interface.uts +0 -0
  125. package/types/uni/uts-plugin-component/.temp/uni-video/utssdk/interface.uts +936 -0
  126. package/types/uni/uts-plugin-component/.temp/uni-video.d.ts +134 -0
  127. package/types/uni/uts-plugin-component/.temp/uni-video.ts +180 -0
  128. package/types/uni/uts-plugin-component/.temp/uni-web-view/utssdk/interface.uts +452 -0
  129. package/types/uni/uts-plugin-component/.temp/uni-web-view.d.ts +51 -0
  130. package/types/uni/uts-plugin-component/.temp/uni-web-view.ts +86 -0
  131. package/types/uni/uts-plugin-component/global.d.ts +79 -0
  132. package/types/uni/uts-plugin-component/index.d.ts +79 -0
  133. package/types/uni/uts-plugin-component/lib/uni-actionSheet/utssdk/global.d.ts +29 -0
  134. package/types/uni/uts-plugin-component/lib/uni-actionSheet/utssdk/index.d.ts +14 -0
  135. package/types/uni/uts-plugin-component/lib/uni-actionSheet/utssdk/interface.d.ts +1673 -0
  136. package/types/uni/uts-plugin-component/lib/uni-addPhoneContact/utssdk/global.d.ts +25 -0
  137. package/types/uni/uts-plugin-component/lib/uni-addPhoneContact/utssdk/index.d.ts +12 -0
  138. package/types/uni/uts-plugin-component/lib/uni-addPhoneContact/utssdk/interface.d.ts +226 -0
  139. package/types/uni/uts-plugin-component/lib/uni-arrayBufferToBase64/utssdk/global.d.ts +11 -0
  140. package/types/uni/uts-plugin-component/lib/uni-arrayBufferToBase64/utssdk/index.d.ts +5 -0
  141. package/types/uni/uts-plugin-component/lib/uni-arrayBufferToBase64/utssdk/interface.d.ts +79 -0
  142. package/types/uni/uts-plugin-component/lib/uni-authentication/utssdk/global.d.ts +59 -0
  143. package/types/uni/uts-plugin-component/lib/uni-authentication/utssdk/index.d.ts +29 -0
  144. package/types/uni/uts-plugin-component/lib/uni-authentication/utssdk/interface.d.ts +371 -0
  145. package/types/uni/uts-plugin-component/lib/uni-barcode-scanning/utssdk/global.d.ts +9 -0
  146. package/types/uni/uts-plugin-component/lib/uni-barcode-scanning/utssdk/index.d.ts +5 -0
  147. package/types/uni/uts-plugin-component/lib/uni-barcode-scanning/utssdk/interface.d.ts +0 -0
  148. package/types/uni/uts-plugin-component/lib/uni-base64ToArrayBuffer/utssdk/global.d.ts +11 -0
  149. package/types/uni/uts-plugin-component/lib/uni-base64ToArrayBuffer/utssdk/index.d.ts +5 -0
  150. package/types/uni/uts-plugin-component/lib/uni-base64ToArrayBuffer/utssdk/interface.d.ts +79 -0
  151. package/types/uni/uts-plugin-component/lib/uni-canvas/utssdk/interface.d.ts +978 -976
  152. package/types/uni/uts-plugin-component/lib/uni-canvas-dom2/utssdk/interface.d.ts +978 -976
  153. package/types/uni/uts-plugin-component/lib/uni-chooseLocation/utssdk/global.d.ts +25 -0
  154. package/types/uni/uts-plugin-component/lib/uni-chooseLocation/utssdk/index.d.ts +12 -0
  155. package/types/uni/uts-plugin-component/lib/uni-chooseLocation/utssdk/interface.d.ts +423 -0
  156. package/types/uni/uts-plugin-component/lib/uni-chooseMedia/utssdk/global.d.ts +33 -0
  157. package/types/uni/uts-plugin-component/lib/uni-chooseMedia/utssdk/index.d.ts +16 -0
  158. package/types/uni/uts-plugin-component/lib/uni-chooseMedia/utssdk/interface.d.ts +499 -0
  159. package/types/uni/uts-plugin-component/lib/uni-clipboard/utssdk/global.d.ts +45 -0
  160. package/types/uni/uts-plugin-component/lib/uni-clipboard/utssdk/index.d.ts +22 -0
  161. package/types/uni/uts-plugin-component/lib/uni-clipboard/utssdk/interface.d.ts +217 -0
  162. package/types/uni/uts-plugin-component/lib/uni-createInnerAudioContext/utssdk/global.d.ts +33 -0
  163. package/types/uni/uts-plugin-component/lib/uni-createInnerAudioContext/utssdk/index.d.ts +16 -0
  164. package/types/uni/uts-plugin-component/lib/uni-createInnerAudioContext/utssdk/interface.d.ts +3379 -0
  165. package/types/uni/uts-plugin-component/lib/uni-createIntersectionObserver/utssdk/global.d.ts +21 -0
  166. package/types/uni/uts-plugin-component/lib/uni-createIntersectionObserver/utssdk/index.d.ts +10 -0
  167. package/types/uni/uts-plugin-component/lib/uni-createIntersectionObserver/utssdk/interface.d.ts +153 -0
  168. package/types/uni/uts-plugin-component/lib/uni-createRequestPermissionListener/utssdk/global.d.ts +19 -0
  169. package/types/uni/uts-plugin-component/lib/uni-createRequestPermissionListener/utssdk/index.d.ts +9 -0
  170. package/types/uni/uts-plugin-component/lib/uni-createRequestPermissionListener/utssdk/interface.d.ts +61 -0
  171. package/types/uni/uts-plugin-component/lib/uni-createSelectorQuery/utssdk/global.d.ts +21 -0
  172. package/types/uni/uts-plugin-component/lib/uni-createSelectorQuery/utssdk/index.d.ts +10 -0
  173. package/types/uni/uts-plugin-component/lib/uni-createSelectorQuery/utssdk/interface.d.ts +560 -0
  174. package/types/uni/uts-plugin-component/lib/uni-createWebviewContext/utssdk/global.d.ts +15 -0
  175. package/types/uni/uts-plugin-component/lib/uni-createWebviewContext/utssdk/index.d.ts +7 -0
  176. package/types/uni/uts-plugin-component/lib/uni-createWebviewContext/utssdk/interface.d.ts +214 -0
  177. package/types/uni/uts-plugin-component/lib/uni-createWorker/utssdk/global.d.ts +23 -0
  178. package/types/uni/uts-plugin-component/lib/uni-createWorker/utssdk/index.d.ts +11 -0
  179. package/types/uni/uts-plugin-component/lib/uni-createWorker/utssdk/interface.d.ts +158 -0
  180. package/types/uni/uts-plugin-component/lib/uni-dialogPage/utssdk/global.d.ts +29 -0
  181. package/types/uni/uts-plugin-component/lib/uni-dialogPage/utssdk/index.d.ts +14 -0
  182. package/types/uni/uts-plugin-component/lib/uni-dialogPage/utssdk/interface.d.ts +2304 -0
  183. package/types/uni/uts-plugin-component/lib/uni-editor/utssdk/global.d.ts +39 -0
  184. package/types/uni/uts-plugin-component/lib/uni-editor/utssdk/index.d.ts +19 -0
  185. package/types/uni/uts-plugin-component/lib/uni-editor/utssdk/interface.d.ts +856 -0
  186. package/types/uni/uts-plugin-component/lib/uni-editor-global/utssdk/global.d.ts +25 -0
  187. package/types/uni/uts-plugin-component/lib/uni-editor-global/utssdk/index.d.ts +13 -0
  188. package/types/uni/uts-plugin-component/lib/uni-editor-global/utssdk/interface.d.ts +181 -0
  189. package/types/uni/uts-plugin-component/lib/uni-event/utssdk/global.d.ts +17 -0
  190. package/types/uni/uts-plugin-component/lib/uni-event/utssdk/index.d.ts +8 -0
  191. package/types/uni/uts-plugin-component/lib/uni-event/utssdk/interface.d.ts +338 -0
  192. package/types/uni/uts-plugin-component/lib/uni-exit/utssdk/global.d.ts +27 -0
  193. package/types/uni/uts-plugin-component/lib/uni-exit/utssdk/index.d.ts +13 -0
  194. package/types/uni/uts-plugin-component/lib/uni-exit/utssdk/interface.d.ts +147 -0
  195. package/types/uni/uts-plugin-component/lib/uni-file/utssdk/global.d.ts +81 -0
  196. package/types/uni/uts-plugin-component/lib/uni-file/utssdk/index.d.ts +40 -0
  197. package/types/uni/uts-plugin-component/lib/uni-file/utssdk/interface.d.ts +397 -0
  198. package/types/uni/uts-plugin-component/lib/uni-fileSystemManager/utssdk/global.d.ts +151 -0
  199. package/types/uni/uts-plugin-component/lib/uni-fileSystemManager/utssdk/index.d.ts +75 -0
  200. package/types/uni/uts-plugin-component/lib/uni-fileSystemManager/utssdk/interface.d.ts +6428 -0
  201. package/types/uni/uts-plugin-component/lib/uni-getAccessibilityInfo/utssdk/global.d.ts +11 -0
  202. package/types/uni/uts-plugin-component/lib/uni-getAccessibilityInfo/utssdk/index.d.ts +5 -0
  203. package/types/uni/uts-plugin-component/lib/uni-getAccessibilityInfo/utssdk/interface.d.ts +37 -0
  204. package/types/uni/uts-plugin-component/lib/uni-getAppAuthorizeSetting/utssdk/global.d.ts +13 -0
  205. package/types/uni/uts-plugin-component/lib/uni-getAppAuthorizeSetting/utssdk/index.d.ts +6 -0
  206. package/types/uni/uts-plugin-component/lib/uni-getAppAuthorizeSetting/utssdk/interface.d.ts +620 -0
  207. package/types/uni/uts-plugin-component/lib/uni-getAppBaseInfo/utssdk/global.d.ts +15 -0
  208. package/types/uni/uts-plugin-component/lib/uni-getAppBaseInfo/utssdk/index.d.ts +7 -0
  209. package/types/uni/uts-plugin-component/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +2220 -0
  210. package/types/uni/uts-plugin-component/lib/uni-getBackgroundAudioManager/utssdk/global.d.ts +17 -0
  211. package/types/uni/uts-plugin-component/lib/uni-getBackgroundAudioManager/utssdk/index.d.ts +8 -0
  212. package/types/uni/uts-plugin-component/lib/uni-getBackgroundAudioManager/utssdk/interface.d.ts +1406 -0
  213. package/types/uni/uts-plugin-component/lib/uni-getDeviceInfo/utssdk/global.d.ts +15 -0
  214. package/types/uni/uts-plugin-component/lib/uni-getDeviceInfo/utssdk/index.d.ts +7 -0
  215. package/types/uni/uts-plugin-component/lib/uni-getDeviceInfo/utssdk/interface.d.ts +1774 -0
  216. package/types/uni/uts-plugin-component/lib/uni-getElementById/utssdk/global.d.ts +11 -0
  217. package/types/uni/uts-plugin-component/lib/uni-getElementById/utssdk/index.d.ts +5 -0
  218. package/types/uni/uts-plugin-component/lib/uni-getElementById/utssdk/interface.d.ts +82 -0
  219. package/types/uni/uts-plugin-component/lib/uni-getEnterOptionsSync/utssdk/global.d.ts +13 -0
  220. package/types/uni/uts-plugin-component/lib/uni-getEnterOptionsSync/utssdk/index.d.ts +6 -0
  221. package/types/uni/uts-plugin-component/lib/uni-getEnterOptionsSync/utssdk/interface.d.ts +374 -0
  222. package/types/uni/uts-plugin-component/lib/uni-getLaunchOptionsSync/utssdk/global.d.ts +13 -0
  223. package/types/uni/uts-plugin-component/lib/uni-getLaunchOptionsSync/utssdk/index.d.ts +6 -0
  224. package/types/uni/uts-plugin-component/lib/uni-getLaunchOptionsSync/utssdk/interface.d.ts +377 -0
  225. package/types/uni/uts-plugin-component/lib/uni-getLocation-tencent-uni1/utssdk/global.d.ts +21 -0
  226. package/types/uni/uts-plugin-component/lib/uni-getLocation-tencent-uni1/utssdk/index.d.ts +11 -0
  227. package/types/uni/uts-plugin-component/lib/uni-getLocation-tencent-uni1/utssdk/interface.d.ts +736 -0
  228. package/types/uni/uts-plugin-component/lib/uni-getNetworkType/utssdk/global.d.ts +33 -0
  229. package/types/uni/uts-plugin-component/lib/uni-getNetworkType/utssdk/index.d.ts +16 -0
  230. package/types/uni/uts-plugin-component/lib/uni-getNetworkType/utssdk/interface.d.ts +420 -0
  231. package/types/uni/uts-plugin-component/lib/uni-getPerformance/utssdk/global.d.ts +23 -0
  232. package/types/uni/uts-plugin-component/lib/uni-getPerformance/utssdk/index.d.ts +11 -0
  233. package/types/uni/uts-plugin-component/lib/uni-getPerformance/utssdk/interface.d.ts +199 -0
  234. package/types/uni/uts-plugin-component/lib/uni-getProvider/utssdk/global.d.ts +37 -0
  235. package/types/uni/uts-plugin-component/lib/uni-getProvider/utssdk/index.d.ts +18 -0
  236. package/types/uni/uts-plugin-component/lib/uni-getProvider/utssdk/interface.d.ts +757 -0
  237. package/types/uni/uts-plugin-component/lib/uni-getSystemInfo/utssdk/global.d.ts +33 -0
  238. package/types/uni/uts-plugin-component/lib/uni-getSystemInfo/utssdk/index.d.ts +16 -0
  239. package/types/uni/uts-plugin-component/lib/uni-getSystemInfo/utssdk/interface.d.ts +6084 -0
  240. package/types/uni/uts-plugin-component/lib/uni-getSystemSetting/utssdk/global.d.ts +13 -0
  241. package/types/uni/uts-plugin-component/lib/uni-getSystemSetting/utssdk/index.d.ts +6 -0
  242. package/types/uni/uts-plugin-component/lib/uni-getSystemSetting/utssdk/interface.d.ts +508 -0
  243. package/types/uni/uts-plugin-component/lib/uni-installApk/utssdk/global.d.ts +25 -0
  244. package/types/uni/uts-plugin-component/lib/uni-installApk/utssdk/index.d.ts +12 -0
  245. package/types/uni/uts-plugin-component/lib/uni-installApk/utssdk/interface.d.ts +125 -0
  246. package/types/uni/uts-plugin-component/lib/uni-interceptor/utssdk/global.d.ts +17 -0
  247. package/types/uni/uts-plugin-component/lib/uni-interceptor/utssdk/index.d.ts +8 -0
  248. package/types/uni/uts-plugin-component/lib/uni-interceptor/utssdk/interface.d.ts +171 -0
  249. package/types/uni/uts-plugin-component/lib/uni-keyboard/utssdk/global.d.ts +45 -0
  250. package/types/uni/uts-plugin-component/lib/uni-keyboard/utssdk/index.d.ts +22 -0
  251. package/types/uni/uts-plugin-component/lib/uni-keyboard/utssdk/interface.d.ts +234 -0
  252. package/types/uni/uts-plugin-component/lib/uni-loadFontFace/utssdk/global.d.ts +29 -0
  253. package/types/uni/uts-plugin-component/lib/uni-loadFontFace/utssdk/index.d.ts +14 -0
  254. package/types/uni/uts-plugin-component/lib/uni-loadFontFace/utssdk/interface.d.ts +603 -0
  255. package/types/uni/uts-plugin-component/lib/uni-location/utssdk/global.d.ts +61 -0
  256. package/types/uni/uts-plugin-component/lib/uni-location/utssdk/index.d.ts +30 -0
  257. package/types/uni/uts-plugin-component/lib/uni-location/utssdk/interface.d.ts +3443 -0
  258. package/types/uni/uts-plugin-component/lib/uni-location-system/utssdk/global.d.ts +9 -0
  259. package/types/uni/uts-plugin-component/lib/uni-location-system/utssdk/index.d.ts +5 -0
  260. package/types/uni/uts-plugin-component/lib/uni-location-system/utssdk/interface.d.ts +3 -0
  261. package/types/uni/uts-plugin-component/lib/uni-location-tencent/utssdk/global.d.ts +9 -0
  262. package/types/uni/uts-plugin-component/lib/uni-location-tencent/utssdk/index.d.ts +5 -0
  263. package/types/uni/uts-plugin-component/lib/uni-location-tencent/utssdk/interface.d.ts +3 -0
  264. package/types/uni/uts-plugin-component/lib/uni-makePhoneCall/utssdk/global.d.ts +29 -0
  265. package/types/uni/uts-plugin-component/lib/uni-makePhoneCall/utssdk/index.d.ts +14 -0
  266. package/types/uni/uts-plugin-component/lib/uni-makePhoneCall/utssdk/interface.d.ts +386 -0
  267. package/types/uni/uts-plugin-component/lib/uni-media/utssdk/global.d.ts +157 -0
  268. package/types/uni/uts-plugin-component/lib/uni-media/utssdk/index.d.ts +78 -0
  269. package/types/uni/uts-plugin-component/lib/uni-media/utssdk/interface.d.ts +5245 -0
  270. package/types/uni/uts-plugin-component/lib/uni-modal/utssdk/global.d.ts +43 -0
  271. package/types/uni/uts-plugin-component/lib/uni-modal/utssdk/index.d.ts +21 -0
  272. package/types/uni/uts-plugin-component/lib/uni-modal/utssdk/interface.d.ts +291 -0
  273. package/types/uni/uts-plugin-component/lib/uni-navigationBar/utssdk/global.d.ts +69 -0
  274. package/types/uni/uts-plugin-component/lib/uni-navigationBar/utssdk/index.d.ts +34 -0
  275. package/types/uni/uts-plugin-component/lib/uni-navigationBar/utssdk/interface.d.ts +1047 -0
  276. package/types/uni/uts-plugin-component/lib/uni-network/utssdk/global.d.ts +109 -0
  277. package/types/uni/uts-plugin-component/lib/uni-network/utssdk/index.d.ts +54 -0
  278. package/types/uni/uts-plugin-component/lib/uni-network/utssdk/interface.d.ts +4462 -0
  279. package/types/uni/uts-plugin-component/lib/uni-oauth/utssdk/global.d.ts +71 -0
  280. package/types/uni/uts-plugin-component/lib/uni-oauth/utssdk/index.d.ts +35 -0
  281. package/types/uni/uts-plugin-component/lib/uni-oauth/utssdk/interface.d.ts +2142 -0
  282. package/types/uni/uts-plugin-component/lib/uni-oauth-huawei/utssdk/global.d.ts +9 -0
  283. package/types/uni/uts-plugin-component/lib/uni-oauth-huawei/utssdk/index.d.ts +5 -0
  284. package/types/uni/uts-plugin-component/lib/uni-oauth-huawei/utssdk/interface.d.ts +1 -0
  285. package/types/uni/uts-plugin-component/lib/uni-oauth-weixin/utssdk/global.d.ts +17 -0
  286. package/types/uni/uts-plugin-component/lib/uni-oauth-weixin/utssdk/index.d.ts +9 -0
  287. package/types/uni/uts-plugin-component/lib/uni-oauth-weixin/utssdk/interface.d.ts +48 -0
  288. package/types/uni/uts-plugin-component/lib/uni-openAppAuthorizeSetting/utssdk/global.d.ts +25 -0
  289. package/types/uni/uts-plugin-component/lib/uni-openAppAuthorizeSetting/utssdk/index.d.ts +12 -0
  290. package/types/uni/uts-plugin-component/lib/uni-openAppAuthorizeSetting/utssdk/interface.d.ts +256 -0
  291. package/types/uni/uts-plugin-component/lib/uni-openDocument/utssdk/global.d.ts +29 -0
  292. package/types/uni/uts-plugin-component/lib/uni-openDocument/utssdk/index.d.ts +14 -0
  293. package/types/uni/uts-plugin-component/lib/uni-openDocument/utssdk/interface.d.ts +823 -0
  294. package/types/uni/uts-plugin-component/lib/uni-pageScrollTo/utssdk/global.d.ts +27 -0
  295. package/types/uni/uts-plugin-component/lib/uni-pageScrollTo/utssdk/index.d.ts +13 -0
  296. package/types/uni/uts-plugin-component/lib/uni-pageScrollTo/utssdk/interface.d.ts +155 -0
  297. package/types/uni/uts-plugin-component/lib/uni-payment/utssdk/global.d.ts +33 -0
  298. package/types/uni/uts-plugin-component/lib/uni-payment/utssdk/index.d.ts +16 -0
  299. package/types/uni/uts-plugin-component/lib/uni-payment/utssdk/interface.d.ts +856 -0
  300. package/types/uni/uts-plugin-component/lib/uni-payment-alipay/utssdk/global.d.ts +9 -0
  301. package/types/uni/uts-plugin-component/lib/uni-payment-alipay/utssdk/index.d.ts +5 -0
  302. package/types/uni/uts-plugin-component/lib/uni-payment-alipay/utssdk/interface.d.ts +3 -0
  303. package/types/uni/uts-plugin-component/lib/uni-payment-huawei/utssdk/global.d.ts +9 -0
  304. package/types/uni/uts-plugin-component/lib/uni-payment-huawei/utssdk/index.d.ts +5 -0
  305. package/types/uni/uts-plugin-component/lib/uni-payment-huawei/utssdk/interface.d.ts +1 -0
  306. package/types/uni/uts-plugin-component/lib/uni-payment-wxpay/utssdk/global.d.ts +9 -0
  307. package/types/uni/uts-plugin-component/lib/uni-payment-wxpay/utssdk/index.d.ts +5 -0
  308. package/types/uni/uts-plugin-component/lib/uni-payment-wxpay/utssdk/interface.d.ts +5 -0
  309. package/types/uni/uts-plugin-component/lib/uni-picker-global/utssdk/global.d.ts +19 -0
  310. package/types/uni/uts-plugin-component/lib/uni-picker-global/utssdk/index.d.ts +10 -0
  311. package/types/uni/uts-plugin-component/lib/uni-picker-global/utssdk/interface.d.ts +26 -0
  312. package/types/uni/uts-plugin-component/lib/uni-previewImage/utssdk/global.d.ts +47 -0
  313. package/types/uni/uts-plugin-component/lib/uni-previewImage/utssdk/index.d.ts +23 -0
  314. package/types/uni/uts-plugin-component/lib/uni-previewImage/utssdk/interface.d.ts +520 -0
  315. package/types/uni/uts-plugin-component/lib/uni-privacy/utssdk/global.d.ts +31 -0
  316. package/types/uni/uts-plugin-component/lib/uni-privacy/utssdk/index.d.ts +15 -0
  317. package/types/uni/uts-plugin-component/lib/uni-privacy/utssdk/interface.d.ts +568 -0
  318. package/types/uni/uts-plugin-component/lib/uni-prompt/utssdk/global.d.ts +33 -0
  319. package/types/uni/uts-plugin-component/lib/uni-prompt/utssdk/index.d.ts +16 -0
  320. package/types/uni/uts-plugin-component/lib/uni-prompt/utssdk/interface.d.ts +1693 -0
  321. package/types/uni/uts-plugin-component/lib/uni-pullDownRefresh/utssdk/global.d.ts +29 -0
  322. package/types/uni/uts-plugin-component/lib/uni-pullDownRefresh/utssdk/index.d.ts +14 -0
  323. package/types/uni/uts-plugin-component/lib/uni-pullDownRefresh/utssdk/interface.d.ts +191 -0
  324. package/types/uni/uts-plugin-component/lib/uni-recorder/utssdk/global.d.ts +21 -0
  325. package/types/uni/uts-plugin-component/lib/uni-recorder/utssdk/index.d.ts +10 -0
  326. package/types/uni/uts-plugin-component/lib/uni-recorder/utssdk/interface.d.ts +2999 -0
  327. package/types/uni/uts-plugin-component/lib/uni-requestMerchantTransfer/utssdk/global.d.ts +21 -0
  328. package/types/uni/uts-plugin-component/lib/uni-requestMerchantTransfer/utssdk/index.d.ts +10 -0
  329. package/types/uni/uts-plugin-component/lib/uni-requestMerchantTransfer/utssdk/interface.d.ts +713 -0
  330. package/types/uni/uts-plugin-component/lib/uni-route/utssdk/global.d.ts +59 -0
  331. package/types/uni/uts-plugin-component/lib/uni-route/utssdk/index.d.ts +29 -0
  332. package/types/uni/uts-plugin-component/lib/uni-route/utssdk/interface.d.ts +2731 -0
  333. package/types/uni/uts-plugin-component/lib/uni-rpx2px/utssdk/global.d.ts +11 -0
  334. package/types/uni/uts-plugin-component/lib/uni-rpx2px/utssdk/index.d.ts +5 -0
  335. package/types/uni/uts-plugin-component/lib/uni-rpx2px/utssdk/interface.d.ts +81 -0
  336. package/types/uni/uts-plugin-component/lib/uni-scanCode/utssdk/global.d.ts +25 -0
  337. package/types/uni/uts-plugin-component/lib/uni-scanCode/utssdk/index.d.ts +12 -0
  338. package/types/uni/uts-plugin-component/lib/uni-scanCode/utssdk/interface.d.ts +429 -0
  339. package/types/uni/uts-plugin-component/lib/uni-screenBrightness/utssdk/global.d.ts +57 -0
  340. package/types/uni/uts-plugin-component/lib/uni-screenBrightness/utssdk/index.d.ts +28 -0
  341. package/types/uni/uts-plugin-component/lib/uni-screenBrightness/utssdk/interface.d.ts +314 -0
  342. package/types/uni/uts-plugin-component/lib/uni-share/utssdk/global.d.ts +41 -0
  343. package/types/uni/uts-plugin-component/lib/uni-share/utssdk/index.d.ts +20 -0
  344. package/types/uni/uts-plugin-component/lib/uni-share/utssdk/interface.d.ts +584 -0
  345. package/types/uni/uts-plugin-component/lib/uni-share-weixin/utssdk/global.d.ts +9 -0
  346. package/types/uni/uts-plugin-component/lib/uni-share-weixin/utssdk/index.d.ts +5 -0
  347. package/types/uni/uts-plugin-component/lib/uni-share-weixin/utssdk/interface.d.ts +3 -0
  348. package/types/uni/uts-plugin-component/lib/uni-shareWithSystem/utssdk/global.d.ts +27 -0
  349. package/types/uni/uts-plugin-component/lib/uni-shareWithSystem/utssdk/index.d.ts +13 -0
  350. package/types/uni/uts-plugin-component/lib/uni-shareWithSystem/utssdk/interface.d.ts +722 -0
  351. package/types/uni/uts-plugin-component/lib/uni-showLoading/utssdk/global.d.ts +47 -0
  352. package/types/uni/uts-plugin-component/lib/uni-showLoading/utssdk/index.d.ts +23 -0
  353. package/types/uni/uts-plugin-component/lib/uni-showLoading/utssdk/interface.d.ts +446 -0
  354. package/types/uni/uts-plugin-component/lib/uni-sse/utssdk/global.d.ts +21 -0
  355. package/types/uni/uts-plugin-component/lib/uni-sse/utssdk/index.d.ts +10 -0
  356. package/types/uni/uts-plugin-component/lib/uni-sse/utssdk/interface.d.ts +330 -0
  357. package/types/uni/uts-plugin-component/lib/uni-storage/utssdk/global.d.ts +79 -0
  358. package/types/uni/uts-plugin-component/lib/uni-storage/utssdk/index.d.ts +39 -0
  359. package/types/uni/uts-plugin-component/lib/uni-storage/utssdk/interface.d.ts +1030 -0
  360. package/types/uni/uts-plugin-component/lib/uni-tabBar/utssdk/global.d.ts +149 -0
  361. package/types/uni/uts-plugin-component/lib/uni-tabBar/utssdk/index.d.ts +74 -0
  362. package/types/uni/uts-plugin-component/lib/uni-tabBar/utssdk/interface.d.ts +1221 -0
  363. package/types/uni/uts-plugin-component/lib/uni-theme/utssdk/global.d.ts +53 -0
  364. package/types/uni/uts-plugin-component/lib/uni-theme/utssdk/index.d.ts +26 -0
  365. package/types/uni/uts-plugin-component/lib/uni-theme/utssdk/interface.d.ts +1141 -0
  366. package/types/uni/uts-plugin-component/lib/uni-video/utssdk/global.d.ts +0 -22
  367. package/types/uni/uts-plugin-component/lib/uni-video/utssdk/index.d.ts +0 -11
  368. package/types/uni/uts-plugin-component/lib/uni-video/utssdk/interface.d.ts +862 -872
  369. package/types/uni/uts-plugin-component/lib/uni-video-global/utssdk/global.d.ts +4 -14
  370. package/types/uni/uts-plugin-component/lib/uni-video-global/utssdk/index.d.ts +2 -7
  371. package/types/uni/uts-plugin-component/lib/uni-video-global/utssdk/interface.d.ts +14 -51
  372. package/types/uni/uts-plugin-component/lib/uni-virtualPayment/utssdk/global.d.ts +113 -0
  373. package/types/uni/uts-plugin-component/lib/uni-virtualPayment/utssdk/index.d.ts +56 -0
  374. package/types/uni/uts-plugin-component/lib/uni-virtualPayment/utssdk/interface.d.ts +1661 -0
  375. package/types/uni/uts-plugin-component/lib/uni-web-view/utssdk/interface.d.ts +17 -17
  376. package/types/uni/uts-plugin-component/lib/uni-websocket/utssdk/global.d.ts +59 -0
  377. package/types/uni/uts-plugin-component/lib/uni-websocket/utssdk/index.d.ts +29 -0
  378. package/types/uni/uts-plugin-component/lib/uni-websocket/utssdk/interface.d.ts +1939 -0
  379. package/types/vue/LifeCycle.d.ts +865 -854
@@ -0,0 +1,1939 @@
1
+ export interface Uni {
2
+ /**
3
+ * 创建一个 WebSocket 连接。
4
+ * @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/websocket.html#connectsocket
5
+ * @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#connectsocket
6
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#connectsocket
7
+ * @uniPlatform
8
+ {
9
+ "app": {
10
+ "android": {
11
+ "osVer": "4.4",
12
+ "uniVer": "√",
13
+ "uniUtsPlugin": "3.91",
14
+ "unixVer": "3.91"
15
+ },
16
+ "ios": {
17
+ "osVer": "12.0",
18
+ "uniVer": "√",
19
+ "uniUtsPlugin": "4.11",
20
+ "unixVer": "4.11",
21
+ "unixUtsPlugin": "4.11"
22
+ },
23
+ "harmony": {
24
+ "osVer": "3.0",
25
+ "uniVer": "4.23",
26
+ "unixVer": "4.61",
27
+ "unixVaporVer": "5.0"
28
+ }
29
+ },
30
+ "mp": {
31
+ "weixin": {
32
+ "hostVer": "√",
33
+ "uniVer": "√",
34
+ "unixVer": "4.41"
35
+ },
36
+ "alipay": {
37
+ "hostVer": "√",
38
+ "uniVer": "√",
39
+ "unixVer": "x"
40
+ },
41
+ "baidu": {
42
+ "hostVer": "√",
43
+ "uniVer": "√",
44
+ "unixVer": "x"
45
+ },
46
+ "toutiao": {
47
+ "hostVer": "√",
48
+ "uniVer": "√",
49
+ "unixVer": "x"
50
+ },
51
+ "lark": {
52
+ "hostVer": "√",
53
+ "uniVer": "√",
54
+ "unixVer": "x"
55
+ },
56
+ "qq": {
57
+ "hostVer": "√",
58
+ "uniVer": "√",
59
+ "unixVer": "x"
60
+ },
61
+ "kuaishou": {
62
+ "hostVer": "√",
63
+ "uniVer": "√",
64
+ "unixVer": "x"
65
+ },
66
+ "jd": {
67
+ "hostVer": "√",
68
+ "uniVer": "√",
69
+ "unixVer": "x"
70
+ }
71
+ },
72
+ "web": {
73
+ "uniVer": "√",
74
+ "unixVer": "4.0"
75
+ }
76
+ }
77
+ * @example
78
+ ```typescript
79
+ uni.connectSocket({
80
+ url: "ws://192.168.12.106:8080/ws",
81
+ complete: (e) => {
82
+ console.log("socket :", e);
83
+ }
84
+ });
85
+ ```
86
+ */
87
+ connectSocket(options: ConnectSocketOptions): SocketTask;
88
+
89
+ /**
90
+ * @description
91
+ * 监听WebSocket连接打开事件。
92
+ * @deprecated 已废弃,使用 SocketTask 的 onOpen 替换。
93
+ * @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketopen
94
+ * @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onsocketopen
95
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onsocketopen
96
+ * @uniPlatform
97
+ {
98
+ "app": {
99
+ "android": {
100
+ "osVer": "4.4",
101
+ "uniVer": "√",
102
+ "uniUtsPlugin": "3.91",
103
+ "unixVer": "3.91"
104
+ },
105
+ "ios": {
106
+ "osVer": "12.0",
107
+ "uniVer": "√",
108
+ "uniUtsPlugin": "4.11",
109
+ "unixVer": "4.11",
110
+ "unixUtsPlugin": "4.11"
111
+ },
112
+ "harmony": {
113
+ "osVer": "3.0",
114
+ "uniVer": "4.23",
115
+ "unixVer": "4.61",
116
+ "unixVaporVer": "5.0"
117
+ }
118
+ },
119
+ "mp": {
120
+ "weixin": {
121
+ "hostVer": "√",
122
+ "uniVer": "√",
123
+ "unixVer": "4.41"
124
+ },
125
+ "alipay": {
126
+ "hostVer": "√",
127
+ "uniVer": "√",
128
+ "unixVer": "x"
129
+ },
130
+ "baidu": {
131
+ "hostVer": "√",
132
+ "uniVer": "√",
133
+ "unixVer": "x"
134
+ },
135
+ "toutiao": {
136
+ "hostVer": "√",
137
+ "uniVer": "√",
138
+ "unixVer": "x"
139
+ },
140
+ "lark": {
141
+ "hostVer": "√",
142
+ "uniVer": "√",
143
+ "unixVer": "x"
144
+ },
145
+ "qq": {
146
+ "hostVer": "√",
147
+ "uniVer": "√",
148
+ "unixVer": "x"
149
+ },
150
+ "kuaishou": {
151
+ "hostVer": "√",
152
+ "uniVer": "√",
153
+ "unixVer": "x"
154
+ },
155
+ "jd": {
156
+ "hostVer": "√",
157
+ "uniVer": "√",
158
+ "unixVer": "x"
159
+ }
160
+ },
161
+ "web": {
162
+ "uniVer": "√",
163
+ "unixVer": "4.0"
164
+ }
165
+ }
166
+ * @example
167
+ ```typescript
168
+ uni.onSocketOpen(function (res) {
169
+ console.log('WebSocket连接已打开!');
170
+ });
171
+ ```
172
+ */
173
+ onSocketOpen(options: OnSocketOpenCallback): void;
174
+
175
+ /**
176
+ * 监听WebSocket错误。
177
+ * @deprecated 已废弃,使用 SocketTask 的 onError 替换。
178
+ * @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketerror
179
+ * @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onsocketerror
180
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onsocketerror
181
+ * @uniPlatform
182
+ {
183
+ "app": {
184
+ "android": {
185
+ "osVer": "4.4",
186
+ "uniVer": "√",
187
+ "uniUtsPlugin": "3.91",
188
+ "unixVer": "3.91"
189
+ },
190
+ "ios": {
191
+ "osVer": "12.0",
192
+ "uniVer": "√",
193
+ "uniUtsPlugin": "4.11",
194
+ "unixVer": "4.11",
195
+ "unixUtsPlugin": "4.11"
196
+ },
197
+ "harmony": {
198
+ "osVer": "3.0",
199
+ "uniVer": "4.23",
200
+ "unixVer": "4.61",
201
+ "unixVaporVer": "5.0"
202
+ }
203
+ },
204
+ "mp": {
205
+ "weixin": {
206
+ "hostVer": "√",
207
+ "uniVer": "√",
208
+ "unixVer": "4.41"
209
+ },
210
+ "alipay": {
211
+ "hostVer": "√",
212
+ "uniVer": "√",
213
+ "unixVer": "x"
214
+ },
215
+ "baidu": {
216
+ "hostVer": "√",
217
+ "uniVer": "√",
218
+ "unixVer": "x"
219
+ },
220
+ "toutiao": {
221
+ "hostVer": "√",
222
+ "uniVer": "√",
223
+ "unixVer": "x"
224
+ },
225
+ "lark": {
226
+ "hostVer": "√",
227
+ "uniVer": "√",
228
+ "unixVer": "x"
229
+ },
230
+ "qq": {
231
+ "hostVer": "√",
232
+ "uniVer": "√",
233
+ "unixVer": "x"
234
+ },
235
+ "kuaishou": {
236
+ "hostVer": "√",
237
+ "uniVer": "√",
238
+ "unixVer": "x"
239
+ },
240
+ "jd": {
241
+ "hostVer": "√",
242
+ "uniVer": "√",
243
+ "unixVer": "x"
244
+ }
245
+ },
246
+ "web": {
247
+ "uniVer": "√",
248
+ "unixVer": "4.0"
249
+ }
250
+ }
251
+ * @example
252
+ ```typescript
253
+ uni.onSocketError(function (res) {
254
+ console.log('WebSocket连接打开失败,请检查!');
255
+ });
256
+ ```
257
+ */
258
+ onSocketError(callback: OnSocketErrorCallback): void;
259
+
260
+ /**
261
+ * 通过 WebSocket 连接发送数据,需要先 uni.connectSocket,并在 uni.onSocketOpen 回调之后才能发送。
262
+ * @deprecated 已废弃,使用 SocketTask 的 send 替换。
263
+ * @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/websocket.html#sendsocketmessage
264
+ * @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#sendsocketmessage
265
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#sendsocketmessage
266
+ * @uniPlatform
267
+ {
268
+ "app": {
269
+ "android": {
270
+ "osVer": "4.4",
271
+ "uniVer": "√",
272
+ "uniUtsPlugin": "3.91",
273
+ "unixVer": "3.91"
274
+ },
275
+ "ios": {
276
+ "osVer": "12.0",
277
+ "uniVer": "√",
278
+ "uniUtsPlugin": "4.11",
279
+ "unixVer": "4.11",
280
+ "unixUtsPlugin": "4.11"
281
+ },
282
+ "harmony": {
283
+ "osVer": "3.0",
284
+ "uniVer": "4.23",
285
+ "unixVer": "4.61",
286
+ "unixVaporVer": "5.0"
287
+ }
288
+ },
289
+ "mp": {
290
+ "weixin": {
291
+ "hostVer": "√",
292
+ "uniVer": "√",
293
+ "unixVer": "4.41"
294
+ },
295
+ "alipay": {
296
+ "hostVer": "√",
297
+ "uniVer": "√",
298
+ "unixVer": "x"
299
+ },
300
+ "baidu": {
301
+ "hostVer": "√",
302
+ "uniVer": "√",
303
+ "unixVer": "x"
304
+ },
305
+ "toutiao": {
306
+ "hostVer": "√",
307
+ "uniVer": "√",
308
+ "unixVer": "x"
309
+ },
310
+ "lark": {
311
+ "hostVer": "√",
312
+ "uniVer": "√",
313
+ "unixVer": "x"
314
+ },
315
+ "qq": {
316
+ "hostVer": "√",
317
+ "uniVer": "√",
318
+ "unixVer": "x"
319
+ },
320
+ "kuaishou": {
321
+ "hostVer": "√",
322
+ "uniVer": "√",
323
+ "unixVer": "x"
324
+ },
325
+ "jd": {
326
+ "hostVer": "√",
327
+ "uniVer": "√",
328
+ "unixVer": "x"
329
+ }
330
+ },
331
+ "web": {
332
+ "uniVer": "√",
333
+ "unixVer": "4.0"
334
+ }
335
+ }
336
+ * @example
337
+ ```typescript
338
+ uni.sendSocketMessage({
339
+ data: msg
340
+ });
341
+ ```
342
+ */
343
+ sendSocketMessage(options: SendSocketMessageOptions): void;
344
+
345
+ /**
346
+ * 监听WebSocket接受到服务器的消息事件。
347
+ * @deprecated 已废弃,使用 SocketTask 的 onMessage 替换。
348
+ * @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketmessage
349
+ * @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onsocketmessage
350
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onsocketmessage
351
+ * @uniPlatform
352
+ {
353
+ "app": {
354
+ "android": {
355
+ "osVer": "4.4",
356
+ "uniVer": "√",
357
+ "uniUtsPlugin": "3.91",
358
+ "unixVer": "3.91"
359
+ },
360
+ "ios": {
361
+ "osVer": "12.0",
362
+ "uniVer": "√",
363
+ "uniUtsPlugin": "4.11",
364
+ "unixVer": "4.11",
365
+ "unixUtsPlugin": "4.11"
366
+ },
367
+ "harmony": {
368
+ "osVer": "3.0",
369
+ "uniVer": "4.23",
370
+ "unixVer": "4.61",
371
+ "unixVaporVer": "5.0"
372
+ }
373
+ },
374
+ "mp": {
375
+ "weixin": {
376
+ "hostVer": "√",
377
+ "uniVer": "√",
378
+ "unixVer": "4.41"
379
+ },
380
+ "alipay": {
381
+ "hostVer": "√",
382
+ "uniVer": "√",
383
+ "unixVer": "x"
384
+ },
385
+ "baidu": {
386
+ "hostVer": "√",
387
+ "uniVer": "√",
388
+ "unixVer": "x"
389
+ },
390
+ "toutiao": {
391
+ "hostVer": "√",
392
+ "uniVer": "√",
393
+ "unixVer": "x"
394
+ },
395
+ "lark": {
396
+ "hostVer": "√",
397
+ "uniVer": "√",
398
+ "unixVer": "x"
399
+ },
400
+ "qq": {
401
+ "hostVer": "√",
402
+ "uniVer": "√",
403
+ "unixVer": "x"
404
+ },
405
+ "kuaishou": {
406
+ "hostVer": "√",
407
+ "uniVer": "√",
408
+ "unixVer": "x"
409
+ },
410
+ "jd": {
411
+ "hostVer": "√",
412
+ "uniVer": "√",
413
+ "unixVer": "x"
414
+ }
415
+ },
416
+ "web": {
417
+ "uniVer": "√",
418
+ "unixVer": "4.0"
419
+ }
420
+ }
421
+ * @example
422
+ ```typescript
423
+ uni.onSocketMessage(function (res) {
424
+ console.log('收到服务器内容:' + res.data);
425
+ });
426
+ ```
427
+ */
428
+ onSocketMessage(callback: OnSocketMessageCallback): void;
429
+
430
+ /**
431
+ * 关闭 WebSocket 连接。
432
+ * @deprecated 已废弃,使用 SocketTask 的 close 替换。
433
+ * @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/websocket.html#closesocket
434
+ * @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#closesocket
435
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#closesocket
436
+ * @uniPlatform
437
+ {
438
+ "app": {
439
+ "android": {
440
+ "osVer": "4.4",
441
+ "uniVer": "√",
442
+ "uniUtsPlugin": "3.91",
443
+ "unixVer": "3.91"
444
+ },
445
+ "ios": {
446
+ "osVer": "12.0",
447
+ "uniVer": "√",
448
+ "uniUtsPlugin": "4.11",
449
+ "unixVer": "4.11",
450
+ "unixUtsPlugin": "4.11"
451
+ },
452
+ "harmony": {
453
+ "osVer": "3.0",
454
+ "uniVer": "4.23",
455
+ "unixVer": "4.61",
456
+ "unixVaporVer": "5.0"
457
+ }
458
+ },
459
+ "mp": {
460
+ "weixin": {
461
+ "hostVer": "√",
462
+ "uniVer": "√",
463
+ "unixVer": "4.41"
464
+ },
465
+ "alipay": {
466
+ "hostVer": "√",
467
+ "uniVer": "√",
468
+ "unixVer": "x"
469
+ },
470
+ "baidu": {
471
+ "hostVer": "√",
472
+ "uniVer": "√",
473
+ "unixVer": "x"
474
+ },
475
+ "toutiao": {
476
+ "hostVer": "√",
477
+ "uniVer": "√",
478
+ "unixVer": "x"
479
+ },
480
+ "lark": {
481
+ "hostVer": "√",
482
+ "uniVer": "√",
483
+ "unixVer": "x"
484
+ },
485
+ "qq": {
486
+ "hostVer": "√",
487
+ "uniVer": "√",
488
+ "unixVer": "x"
489
+ },
490
+ "kuaishou": {
491
+ "hostVer": "√",
492
+ "uniVer": "√",
493
+ "unixVer": "x"
494
+ },
495
+ "jd": {
496
+ "hostVer": "√",
497
+ "uniVer": "√",
498
+ "unixVer": "x"
499
+ }
500
+ },
501
+ "web": {
502
+ "uniVer": "√",
503
+ "unixVer": "4.0"
504
+ }
505
+ }
506
+ * @example
507
+ ```typescript
508
+ uni.closeSocket();
509
+ ```
510
+ */
511
+ closeSocket(options: CloseSocketOptions): void;
512
+
513
+ /**
514
+ * 监听WebSocket关闭。
515
+ * @deprecated 已废弃,使用 SocketTask 的 onClose 替换。
516
+ * @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketclose
517
+ * @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onsocketclose
518
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onsocketclose
519
+ * @uniPlatform
520
+ {
521
+ "app": {
522
+ "android": {
523
+ "osVer": "4.4",
524
+ "uniVer": "√",
525
+ "uniUtsPlugin": "3.91",
526
+ "unixVer": "3.91"
527
+ },
528
+ "ios": {
529
+ "osVer": "12.0",
530
+ "uniVer": "√",
531
+ "uniUtsPlugin": "4.11",
532
+ "unixVer": "4.11",
533
+ "unixUtsPlugin": "4.11"
534
+ },
535
+ "harmony": {
536
+ "osVer": "3.0",
537
+ "uniVer": "4.23",
538
+ "unixVer": "4.61",
539
+ "unixVaporVer": "5.0"
540
+ }
541
+ },
542
+ "mp": {
543
+ "weixin": {
544
+ "hostVer": "√",
545
+ "uniVer": "√",
546
+ "unixVer": "4.41"
547
+ },
548
+ "alipay": {
549
+ "hostVer": "√",
550
+ "uniVer": "√",
551
+ "unixVer": "x"
552
+ },
553
+ "baidu": {
554
+ "hostVer": "√",
555
+ "uniVer": "√",
556
+ "unixVer": "x"
557
+ },
558
+ "toutiao": {
559
+ "hostVer": "√",
560
+ "uniVer": "√",
561
+ "unixVer": "x"
562
+ },
563
+ "lark": {
564
+ "hostVer": "√",
565
+ "uniVer": "√",
566
+ "unixVer": "x"
567
+ },
568
+ "qq": {
569
+ "hostVer": "√",
570
+ "uniVer": "√",
571
+ "unixVer": "x"
572
+ },
573
+ "kuaishou": {
574
+ "hostVer": "√",
575
+ "uniVer": "√",
576
+ "unixVer": "x"
577
+ },
578
+ "jd": {
579
+ "hostVer": "√",
580
+ "uniVer": "√",
581
+ "unixVer": "x"
582
+ }
583
+ },
584
+ "web": {
585
+ "uniVer": "√",
586
+ "unixVer": "4.0"
587
+ }
588
+ }
589
+ * @example
590
+ ```typescript
591
+ uni.onSocketClose(function (res) {
592
+ console.log('WebSocket 已关闭!');
593
+ });
594
+ ```
595
+ */
596
+ onSocketClose(callback: OnSocketCloseCallback): void;
597
+ }
598
+
599
+ export type ConnectSocket = (options: ConnectSocketOptions) => SocketTask;
600
+ export type ConnectSocketSuccess = {
601
+ errMsg: string
602
+ };
603
+ type ConnectSocketSuccessCallback = (result: ConnectSocketSuccess) => void;
604
+ /**
605
+ * 错误码
606
+ * - 600009 URL格式不合法
607
+ */
608
+ export type ConnectSocketErrorCode = 600009;
609
+
610
+ /**
611
+ * 连接调用失败的错误回调参数
612
+ */
613
+ export interface ConnectSocketFail extends IUniError {
614
+ errCode: ConnectSocketErrorCode;
615
+ };
616
+
617
+ type ConnectSocketFailCallback = (result: ConnectSocketFail) => void;
618
+ type ConnectSocketComplete = any;
619
+ type ConnectSocketCompleteCallback = (result: ConnectSocketComplete) => void;
620
+ export type ConnectSocketOptions = {
621
+ /**
622
+ * 开发者服务器接口地址
623
+ * @uniPlatform
624
+ {
625
+ "app": {
626
+ "android": {
627
+ "osVer": "4.4",
628
+ "uniVer": "√",
629
+ "uniUtsPlugin": "3.91",
630
+ "unixVer": "3.91"
631
+ },
632
+ "ios": {
633
+ "osVer": "12.0",
634
+ "uniVer": "√",
635
+ "uniUtsPlugin": "4.11",
636
+ "unixVer": "4.11",
637
+ "unixUtsPlugin": "4.11"
638
+ },
639
+ "harmony": {
640
+ "osVer": "3.0",
641
+ "uniVer": "4.23",
642
+ "unixVer": "4.61",
643
+ "unixVaporVer": "5.0"
644
+ }
645
+ },
646
+ "mp": {
647
+ "weixin": {
648
+ "hostVer": "√",
649
+ "uniVer": "√",
650
+ "unixVer": "4.41"
651
+ },
652
+ "alipay": {
653
+ "hostVer": "√",
654
+ "uniVer": "√",
655
+ "unixVer": "x"
656
+ },
657
+ "baidu": {
658
+ "hostVer": "√",
659
+ "uniVer": "√",
660
+ "unixVer": "x"
661
+ },
662
+ "toutiao": {
663
+ "hostVer": "√",
664
+ "uniVer": "√",
665
+ "unixVer": "x"
666
+ },
667
+ "lark": {
668
+ "hostVer": "√",
669
+ "uniVer": "√",
670
+ "unixVer": "x"
671
+ },
672
+ "qq": {
673
+ "hostVer": "√",
674
+ "uniVer": "√",
675
+ "unixVer": "x"
676
+ },
677
+ "kuaishou": {
678
+ "hostVer": "√",
679
+ "uniVer": "√",
680
+ "unixVer": "x"
681
+ },
682
+ "jd": {
683
+ "hostVer": "√",
684
+ "uniVer": "√",
685
+ "unixVer": "x"
686
+ }
687
+ }
688
+ }
689
+ */
690
+ url: string,
691
+
692
+ /**
693
+ * HTTP 请求 Header,header 中不能设置 Referer
694
+ * @defaultValue null
695
+ * @uniPlatform
696
+ {
697
+ "app": {
698
+ "android": {
699
+ "osVer": "4.4",
700
+ "uniVer": "√",
701
+ "uniUtsPlugin": "3.91",
702
+ "unixVer": "3.91"
703
+ },
704
+ "ios": {
705
+ "osVer": "12.0",
706
+ "uniVer": "√",
707
+ "uniUtsPlugin": "4.11",
708
+ "unixVer": "4.11",
709
+ "unixUtsPlugin": "4.11"
710
+ }
711
+ },
712
+ "mp": {
713
+ "weixin": {
714
+ "hostVer": "√",
715
+ "uniVer": "√",
716
+ "unixVer": "4.41"
717
+ },
718
+ "alipay": {
719
+ "hostVer": "√",
720
+ "uniVer": "√",
721
+ "unixVer": "x"
722
+ },
723
+ "baidu": {
724
+ "hostVer": "√",
725
+ "uniVer": "√",
726
+ "unixVer": "x"
727
+ },
728
+ "toutiao": {
729
+ "hostVer": "√",
730
+ "uniVer": "√",
731
+ "unixVer": "x"
732
+ },
733
+ "lark": {
734
+ "hostVer": "√",
735
+ "uniVer": "√",
736
+ "unixVer": "x"
737
+ },
738
+ "qq": {
739
+ "hostVer": "√",
740
+ "uniVer": "√",
741
+ "unixVer": "x"
742
+ },
743
+ "kuaishou": {
744
+ "hostVer": "√",
745
+ "uniVer": "√",
746
+ "unixVer": "x"
747
+ },
748
+ "jd": {
749
+ "hostVer": "√",
750
+ "uniVer": "√",
751
+ "unixVer": "x"
752
+ }
753
+ }
754
+ }
755
+ */
756
+ header?: UTSJSONObject | null,
757
+
758
+ /**
759
+ * 子协议数组
760
+ * @defaultValue null
761
+ * @uniPlatform
762
+ {
763
+ "app": {
764
+ "android": {
765
+ "osVer": "4.4",
766
+ "uniVer": "√",
767
+ "uniUtsPlugin": "3.91",
768
+ "unixVer": "3.91"
769
+ },
770
+ "ios": {
771
+ "osVer": "12.0",
772
+ "uniVer": "√",
773
+ "uniUtsPlugin": "4.11",
774
+ "unixVer": "4.11",
775
+ "unixUtsPlugin": "4.11"
776
+ }
777
+ },
778
+ "mp": {
779
+ "weixin": {
780
+ "hostVer": "√",
781
+ "uniVer": "√",
782
+ "unixVer": "4.41"
783
+ },
784
+ "alipay": {
785
+ "hostVer": "√",
786
+ "uniVer": "√",
787
+ "unixVer": "x"
788
+ },
789
+ "baidu": {
790
+ "hostVer": "√",
791
+ "uniVer": "√",
792
+ "unixVer": "x"
793
+ },
794
+ "toutiao": {
795
+ "hostVer": "√",
796
+ "uniVer": "√",
797
+ "unixVer": "x"
798
+ },
799
+ "lark": {
800
+ "hostVer": "√",
801
+ "uniVer": "√",
802
+ "unixVer": "x"
803
+ },
804
+ "qq": {
805
+ "hostVer": "√",
806
+ "uniVer": "√",
807
+ "unixVer": "x"
808
+ },
809
+ "kuaishou": {
810
+ "hostVer": "√",
811
+ "uniVer": "√",
812
+ "unixVer": "x"
813
+ },
814
+ "jd": {
815
+ "hostVer": "√",
816
+ "uniVer": "√",
817
+ "unixVer": "x"
818
+ }
819
+ }
820
+ }
821
+ */
822
+ protocols?: (string[]) | null,
823
+
824
+ /**
825
+ * 接口调用成功的回调函数
826
+ * @defaultValue null
827
+ */
828
+ success?: ConnectSocketSuccessCallback | null,
829
+
830
+ /**
831
+ * 接口调用失败的回调函数
832
+ * @defaultValue null
833
+ */
834
+ fail?: ConnectSocketFailCallback | null,
835
+
836
+ /**
837
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
838
+ * @defaultValue null
839
+ */
840
+ complete?: ConnectSocketCompleteCallback | null
841
+ };
842
+
843
+ export type GeneralCallbackResult = {
844
+ /**
845
+ * 错误信息
846
+ */
847
+ errMsg: string
848
+ };
849
+
850
+ /**
851
+ * 错误码
852
+ */
853
+ export type SendSocketMessageErrorCode =
854
+ /**
855
+ * 发送数据超限,发送队列不能超过16M大小。
856
+ */
857
+ 10001 |
858
+ /**
859
+ * websocket未连接
860
+ */
861
+ 10002 |
862
+ /**
863
+ * websocket系统错误
864
+ */
865
+ 602001;
866
+
867
+ /**
868
+ * 发送失败的错误回调参数
869
+ */
870
+ export interface SendSocketMessageFail extends IUniError {
871
+ errCode: SendSocketMessageErrorCode;
872
+ };
873
+ export type SendSocketMessageOptions = {
874
+ /**
875
+ * 需要发送的内容, app平台从 4.61 版本开始支持ArrayBuffer
876
+ * @type string | ArrayBuffer
877
+ * @type {SocketDataOptions}
878
+ * @uniPlatform
879
+ {
880
+ "app": {
881
+ "android": {
882
+ "osVer": "4.4",
883
+ "uniVer": "√",
884
+ "uniUtsPlugin": "3.91",
885
+ "unixVer": "3.91"
886
+ },
887
+ "ios": {
888
+ "osVer": "12.0",
889
+ "uniVer": "√",
890
+ "uniUtsPlugin": "4.11",
891
+ "unixVer": "4.11",
892
+ "unixUtsPlugin": "4.11"
893
+ },
894
+ "harmony": {
895
+ "osVer": "3.0",
896
+ "uniVer": "4.23",
897
+ "unixVer": "4.61",
898
+ "unixVaporVer": "5.0"
899
+ }
900
+ },
901
+ "mp": {
902
+ "weixin": {
903
+ "hostVer": "√",
904
+ "uniVer": "√",
905
+ "unixVer": "4.41"
906
+ },
907
+ "alipay": {
908
+ "hostVer": "√",
909
+ "uniVer": "√",
910
+ "unixVer": "x"
911
+ },
912
+ "baidu": {
913
+ "hostVer": "√",
914
+ "uniVer": "√",
915
+ "unixVer": "x"
916
+ },
917
+ "toutiao": {
918
+ "hostVer": "√",
919
+ "uniVer": "√",
920
+ "unixVer": "x"
921
+ },
922
+ "lark": {
923
+ "hostVer": "√",
924
+ "uniVer": "√",
925
+ "unixVer": "x"
926
+ },
927
+ "qq": {
928
+ "hostVer": "√",
929
+ "uniVer": "√",
930
+ "unixVer": "x"
931
+ },
932
+ "kuaishou": {
933
+ "hostVer": "√",
934
+ "uniVer": "√",
935
+ "unixVer": "x"
936
+ },
937
+ "jd": {
938
+ "hostVer": "√",
939
+ "uniVer": "√",
940
+ "unixVer": "x"
941
+ }
942
+ }
943
+ }
944
+ */
945
+ data: any,
946
+
947
+ /**
948
+ * 接口调用成功的回调函数
949
+ * @defaultValue null
950
+ */
951
+ success?: ((result: GeneralCallbackResult) => void) | null,
952
+
953
+ /**
954
+ * 接口调用失败的回调函数
955
+ * @defaultValue null
956
+ */
957
+ fail?: ((result: SendSocketMessageFail) => void) | null,
958
+
959
+ /**
960
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
961
+ * @defaultValue null
962
+ */
963
+ complete?: ((result: any) => void) | null
964
+ };
965
+
966
+ export type CloseSocketOptions = {
967
+ /**
968
+ * 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。如果这个参数没有被指定,默认的取值是1000 (表示正常连接关闭)
969
+ * @defaultValue 1000
970
+ * @uniPlatform
971
+ {
972
+ "app": {
973
+ "android": {
974
+ "osVer": "4.4",
975
+ "uniVer": "√",
976
+ "uniUtsPlugin": "3.91",
977
+ "unixVer": "3.91"
978
+ },
979
+ "ios": {
980
+ "osVer": "12.0",
981
+ "uniVer": "√",
982
+ "uniUtsPlugin": "4.11",
983
+ "unixVer": "4.11",
984
+ "unixUtsPlugin": "4.11"
985
+ },
986
+ "harmony": {
987
+ "osVer": "3.0",
988
+ "uniVer": "4.23",
989
+ "unixVer": "4.61",
990
+ "unixVaporVer": "5.0"
991
+ }
992
+ },
993
+ "mp": {
994
+ "weixin": {
995
+ "hostVer": "√",
996
+ "uniVer": "√",
997
+ "unixVer": "4.41"
998
+ },
999
+ "alipay": {
1000
+ "hostVer": "√",
1001
+ "uniVer": "√",
1002
+ "unixVer": "x"
1003
+ },
1004
+ "baidu": {
1005
+ "hostVer": "√",
1006
+ "uniVer": "√",
1007
+ "unixVer": "x"
1008
+ },
1009
+ "toutiao": {
1010
+ "hostVer": "√",
1011
+ "uniVer": "√",
1012
+ "unixVer": "x"
1013
+ },
1014
+ "lark": {
1015
+ "hostVer": "√",
1016
+ "uniVer": "√",
1017
+ "unixVer": "x"
1018
+ },
1019
+ "qq": {
1020
+ "hostVer": "√",
1021
+ "uniVer": "√",
1022
+ "unixVer": "x"
1023
+ },
1024
+ "kuaishou": {
1025
+ "hostVer": "√",
1026
+ "uniVer": "√",
1027
+ "unixVer": "x"
1028
+ },
1029
+ "jd": {
1030
+ "hostVer": "√",
1031
+ "uniVer": "√",
1032
+ "unixVer": "x"
1033
+ }
1034
+ }
1035
+ }
1036
+ */
1037
+ code?: number | null,
1038
+
1039
+ /**
1040
+ * 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于123字节的UTF-8 文本(不是字符)
1041
+ * @defaultValue ""
1042
+ * @uniPlatform
1043
+ {
1044
+ "app": {
1045
+ "android": {
1046
+ "osVer": "4.4",
1047
+ "uniVer": "√",
1048
+ "uniUtsPlugin": "3.91",
1049
+ "unixVer": "3.91"
1050
+ },
1051
+ "ios": {
1052
+ "osVer": "12.0",
1053
+ "uniVer": "√",
1054
+ "uniUtsPlugin": "4.11",
1055
+ "unixVer": "4.11",
1056
+ "unixUtsPlugin": "4.11"
1057
+ },
1058
+ "harmony": {
1059
+ "osVer": "3.0",
1060
+ "uniVer": "4.23",
1061
+ "unixVer": "4.61",
1062
+ "unixVaporVer": "5.0"
1063
+ }
1064
+ },
1065
+ "mp": {
1066
+ "weixin": {
1067
+ "hostVer": "√",
1068
+ "uniVer": "√",
1069
+ "unixVer": "4.41"
1070
+ },
1071
+ "alipay": {
1072
+ "hostVer": "√",
1073
+ "uniVer": "√",
1074
+ "unixVer": "x"
1075
+ },
1076
+ "baidu": {
1077
+ "hostVer": "√",
1078
+ "uniVer": "√",
1079
+ "unixVer": "x"
1080
+ },
1081
+ "toutiao": {
1082
+ "hostVer": "√",
1083
+ "uniVer": "√",
1084
+ "unixVer": "x"
1085
+ },
1086
+ "lark": {
1087
+ "hostVer": "√",
1088
+ "uniVer": "√",
1089
+ "unixVer": "x"
1090
+ },
1091
+ "qq": {
1092
+ "hostVer": "√",
1093
+ "uniVer": "√",
1094
+ "unixVer": "x"
1095
+ },
1096
+ "kuaishou": {
1097
+ "hostVer": "√",
1098
+ "uniVer": "√",
1099
+ "unixVer": "x"
1100
+ },
1101
+ "jd": {
1102
+ "hostVer": "√",
1103
+ "uniVer": "√",
1104
+ "unixVer": "x"
1105
+ }
1106
+ }
1107
+ }
1108
+ */
1109
+ reason?: string | null,
1110
+
1111
+ /**
1112
+ * 接口调用成功的回调函数
1113
+ * @defaultValue null
1114
+ */
1115
+ success?: ((result: GeneralCallbackResult) => void) | null,
1116
+
1117
+ /**
1118
+ * 接口调用失败的回调函数
1119
+ * @defaultValue null
1120
+ */
1121
+ fail?: ((result: GeneralCallbackResult) => void) | null,
1122
+
1123
+ /**
1124
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
1125
+ * @defaultValue null
1126
+ */
1127
+ complete?: ((result: GeneralCallbackResult) => void) | null
1128
+ };
1129
+
1130
+ export type OnSocketOpenCallbackResult = {
1131
+ /**
1132
+ * 连接成功的 HTTP 响应 Header
1133
+ * @uniPlatform
1134
+ {
1135
+ "app": {
1136
+ "android": {
1137
+ "osVer": "4.4",
1138
+ "uniVer": "√",
1139
+ "uniUtsPlugin": "3.91",
1140
+ "unixVer": "3.91"
1141
+ },
1142
+ "ios": {
1143
+ "osVer": "12.0",
1144
+ "uniVer": "√",
1145
+ "uniUtsPlugin": "4.11",
1146
+ "unixVer": "4.11",
1147
+ "unixUtsPlugin": "4.11"
1148
+ },
1149
+ "harmony": {
1150
+ "osVer": "3.0",
1151
+ "uniVer": "4.23",
1152
+ "unixVer": "4.61",
1153
+ "unixVaporVer": "5.0"
1154
+ }
1155
+ },
1156
+ "mp": {
1157
+ "weixin": {
1158
+ "hostVer": "√",
1159
+ "uniVer": "√",
1160
+ "unixVer": "4.41"
1161
+ },
1162
+ "alipay": {
1163
+ "hostVer": "√",
1164
+ "uniVer": "√",
1165
+ "unixVer": "x"
1166
+ },
1167
+ "baidu": {
1168
+ "hostVer": "√",
1169
+ "uniVer": "√",
1170
+ "unixVer": "x"
1171
+ },
1172
+ "toutiao": {
1173
+ "hostVer": "√",
1174
+ "uniVer": "√",
1175
+ "unixVer": "x"
1176
+ },
1177
+ "lark": {
1178
+ "hostVer": "√",
1179
+ "uniVer": "√",
1180
+ "unixVer": "x"
1181
+ },
1182
+ "qq": {
1183
+ "hostVer": "√",
1184
+ "uniVer": "√",
1185
+ "unixVer": "x"
1186
+ },
1187
+ "kuaishou": {
1188
+ "hostVer": "√",
1189
+ "uniVer": "√",
1190
+ "unixVer": "x"
1191
+ },
1192
+ "jd": {
1193
+ "hostVer": "√",
1194
+ "uniVer": "√",
1195
+ "unixVer": "x"
1196
+ }
1197
+ }
1198
+ }
1199
+ */
1200
+ header: any
1201
+ };
1202
+
1203
+ export type OnSocketMessageCallbackResult = {
1204
+ /**
1205
+ * 服务器返回的消息, app平台从 4.61 版本开始支持ArrayBuffer
1206
+ * @type {SocketDataOptions}
1207
+ * @uniPlatform
1208
+ {
1209
+ "app": {
1210
+ "android": {
1211
+ "osVer": "4.4",
1212
+ "uniVer": "√",
1213
+ "uniUtsPlugin": "3.91",
1214
+ "unixVer": "3.91"
1215
+ },
1216
+ "ios": {
1217
+ "osVer": "12.0",
1218
+ "uniVer": "√",
1219
+ "uniUtsPlugin": "4.11",
1220
+ "unixVer": "4.11",
1221
+ "unixUtsPlugin": "4.11"
1222
+ },
1223
+ "harmony": {
1224
+ "osVer": "3.0",
1225
+ "uniVer": "4.23",
1226
+ "unixVer": "4.61",
1227
+ "unixVaporVer": "5.0"
1228
+ }
1229
+ },
1230
+ "mp": {
1231
+ "weixin": {
1232
+ "hostVer": "√",
1233
+ "uniVer": "√",
1234
+ "unixVer": "4.41"
1235
+ },
1236
+ "alipay": {
1237
+ "hostVer": "√",
1238
+ "uniVer": "√",
1239
+ "unixVer": "x"
1240
+ },
1241
+ "baidu": {
1242
+ "hostVer": "√",
1243
+ "uniVer": "√",
1244
+ "unixVer": "x"
1245
+ },
1246
+ "toutiao": {
1247
+ "hostVer": "√",
1248
+ "uniVer": "√",
1249
+ "unixVer": "x"
1250
+ },
1251
+ "lark": {
1252
+ "hostVer": "√",
1253
+ "uniVer": "√",
1254
+ "unixVer": "x"
1255
+ },
1256
+ "qq": {
1257
+ "hostVer": "√",
1258
+ "uniVer": "√",
1259
+ "unixVer": "x"
1260
+ },
1261
+ "kuaishou": {
1262
+ "hostVer": "√",
1263
+ "uniVer": "√",
1264
+ "unixVer": "x"
1265
+ },
1266
+ "jd": {
1267
+ "hostVer": "√",
1268
+ "uniVer": "√",
1269
+ "unixVer": "x"
1270
+ }
1271
+ }
1272
+ }
1273
+ */
1274
+ data: any
1275
+ };
1276
+
1277
+ export interface SocketTask {
1278
+ /**
1279
+ * 通过 WebSocket 连接发送数据
1280
+ * @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-send
1281
+ * @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#send
1282
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#send
1283
+ * @uniPlatform
1284
+ {
1285
+ "app": {
1286
+ "android": {
1287
+ "osVer": "4.4",
1288
+ "uniVer": "√",
1289
+ "uniUtsPlugin": "3.91",
1290
+ "unixVer": "3.91"
1291
+ },
1292
+ "ios": {
1293
+ "osVer": "12.0",
1294
+ "uniVer": "√",
1295
+ "uniUtsPlugin": "4.11",
1296
+ "unixVer": "4.11",
1297
+ "unixUtsPlugin": "4.11"
1298
+ },
1299
+ "harmony": {
1300
+ "osVer": "3.0",
1301
+ "uniVer": "4.23",
1302
+ "unixVer": "4.61",
1303
+ "unixVaporVer": "5.0"
1304
+ }
1305
+ },
1306
+ "mp": {
1307
+ "weixin": {
1308
+ "hostVer": "√",
1309
+ "uniVer": "√",
1310
+ "unixVer": "4.41"
1311
+ },
1312
+ "alipay": {
1313
+ "hostVer": "√",
1314
+ "uniVer": "√",
1315
+ "unixVer": "x"
1316
+ },
1317
+ "baidu": {
1318
+ "hostVer": "√",
1319
+ "uniVer": "√",
1320
+ "unixVer": "x"
1321
+ },
1322
+ "toutiao": {
1323
+ "hostVer": "√",
1324
+ "uniVer": "√",
1325
+ "unixVer": "x"
1326
+ },
1327
+ "lark": {
1328
+ "hostVer": "√",
1329
+ "uniVer": "√",
1330
+ "unixVer": "x"
1331
+ },
1332
+ "qq": {
1333
+ "hostVer": "√",
1334
+ "uniVer": "√",
1335
+ "unixVer": "x"
1336
+ },
1337
+ "kuaishou": {
1338
+ "hostVer": "√",
1339
+ "uniVer": "√",
1340
+ "unixVer": "x"
1341
+ },
1342
+ "jd": {
1343
+ "hostVer": "√",
1344
+ "uniVer": "√",
1345
+ "unixVer": "x"
1346
+ }
1347
+ },
1348
+ "web": {
1349
+ "uniVer": "√",
1350
+ "unixVer": "4.0"
1351
+ }
1352
+ }
1353
+ * @example
1354
+ ```typescript
1355
+ task.send({data:"halo"});
1356
+ ```
1357
+ */
1358
+ send(options: SendSocketMessageOptions): void;
1359
+
1360
+ /**
1361
+ * 关闭 WebSocket 连接
1362
+ * @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-close
1363
+ * @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#close
1364
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#close
1365
+ * @uniPlatform
1366
+ {
1367
+ "app": {
1368
+ "android": {
1369
+ "osVer": "4.4",
1370
+ "uniVer": "√",
1371
+ "uniUtsPlugin": "3.91",
1372
+ "unixVer": "3.91"
1373
+ },
1374
+ "ios": {
1375
+ "osVer": "12.0",
1376
+ "uniVer": "√",
1377
+ "uniUtsPlugin": "4.11",
1378
+ "unixVer": "4.11",
1379
+ "unixUtsPlugin": "4.11"
1380
+ },
1381
+ "harmony": {
1382
+ "osVer": "3.0",
1383
+ "uniVer": "4.23",
1384
+ "unixVer": "4.61",
1385
+ "unixVaporVer": "5.0"
1386
+ }
1387
+ },
1388
+ "mp": {
1389
+ "weixin": {
1390
+ "hostVer": "√",
1391
+ "uniVer": "√",
1392
+ "unixVer": "4.41"
1393
+ },
1394
+ "alipay": {
1395
+ "hostVer": "√",
1396
+ "uniVer": "√",
1397
+ "unixVer": "x"
1398
+ },
1399
+ "baidu": {
1400
+ "hostVer": "√",
1401
+ "uniVer": "√",
1402
+ "unixVer": "x"
1403
+ },
1404
+ "toutiao": {
1405
+ "hostVer": "√",
1406
+ "uniVer": "√",
1407
+ "unixVer": "x"
1408
+ },
1409
+ "lark": {
1410
+ "hostVer": "√",
1411
+ "uniVer": "√",
1412
+ "unixVer": "x"
1413
+ },
1414
+ "qq": {
1415
+ "hostVer": "√",
1416
+ "uniVer": "√",
1417
+ "unixVer": "x"
1418
+ },
1419
+ "kuaishou": {
1420
+ "hostVer": "√",
1421
+ "uniVer": "√",
1422
+ "unixVer": "x"
1423
+ },
1424
+ "jd": {
1425
+ "hostVer": "√",
1426
+ "uniVer": "√",
1427
+ "unixVer": "x"
1428
+ }
1429
+ },
1430
+ "web": {
1431
+ "uniVer": "√",
1432
+ "unixVer": "4.0"
1433
+ }
1434
+ }
1435
+ * @example
1436
+ ```typescript
1437
+ task.close();
1438
+ ```
1439
+ */
1440
+ close(options: CloseSocketOptions): void;
1441
+
1442
+ /**
1443
+ * 监听 WebSocket 连接打开事件
1444
+ * @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onopen
1445
+ * @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onopen
1446
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onopen
1447
+ * @uniPlatform
1448
+ {
1449
+ "app": {
1450
+ "android": {
1451
+ "osVer": "4.4",
1452
+ "uniVer": "√",
1453
+ "uniUtsPlugin": "3.91",
1454
+ "unixVer": "3.91"
1455
+ },
1456
+ "ios": {
1457
+ "osVer": "12.0",
1458
+ "uniVer": "√",
1459
+ "uniUtsPlugin": "4.11",
1460
+ "unixVer": "4.11",
1461
+ "unixUtsPlugin": "4.11"
1462
+ },
1463
+ "harmony": {
1464
+ "osVer": "3.0",
1465
+ "uniVer": "4.23",
1466
+ "unixVer": "4.61",
1467
+ "unixVaporVer": "5.0"
1468
+ }
1469
+ },
1470
+ "mp": {
1471
+ "weixin": {
1472
+ "hostVer": "√",
1473
+ "uniVer": "√",
1474
+ "unixVer": "4.41"
1475
+ },
1476
+ "alipay": {
1477
+ "hostVer": "√",
1478
+ "uniVer": "√",
1479
+ "unixVer": "x"
1480
+ },
1481
+ "baidu": {
1482
+ "hostVer": "√",
1483
+ "uniVer": "√",
1484
+ "unixVer": "x"
1485
+ },
1486
+ "toutiao": {
1487
+ "hostVer": "√",
1488
+ "uniVer": "√",
1489
+ "unixVer": "x"
1490
+ },
1491
+ "lark": {
1492
+ "hostVer": "√",
1493
+ "uniVer": "√",
1494
+ "unixVer": "x"
1495
+ },
1496
+ "qq": {
1497
+ "hostVer": "√",
1498
+ "uniVer": "√",
1499
+ "unixVer": "x"
1500
+ },
1501
+ "kuaishou": {
1502
+ "hostVer": "√",
1503
+ "uniVer": "√",
1504
+ "unixVer": "x"
1505
+ },
1506
+ "jd": {
1507
+ "hostVer": "√",
1508
+ "uniVer": "√",
1509
+ "unixVer": "x"
1510
+ }
1511
+ },
1512
+ "web": {
1513
+ "uniVer": "√",
1514
+ "unixVer": "4.0"
1515
+ }
1516
+ }
1517
+ * @example
1518
+ ```typescript
1519
+ task.onOpen((res) => {})
1520
+ ```
1521
+ */
1522
+ onOpen(callback: (result: OnSocketOpenCallbackResult) => void): void;
1523
+
1524
+ /**
1525
+ * 监听 WebSocket 连接关闭事件
1526
+ * @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onclose
1527
+ * @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onclose
1528
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onclose
1529
+ * @uniPlatform
1530
+ {
1531
+ "app": {
1532
+ "android": {
1533
+ "osVer": "4.4",
1534
+ "uniVer": "√",
1535
+ "uniUtsPlugin": "3.91",
1536
+ "unixVer": "3.91"
1537
+ },
1538
+ "ios": {
1539
+ "osVer": "12.0",
1540
+ "uniVer": "√",
1541
+ "uniUtsPlugin": "4.11",
1542
+ "unixVer": "4.11",
1543
+ "unixUtsPlugin": "4.11"
1544
+ },
1545
+ "harmony": {
1546
+ "osVer": "3.0",
1547
+ "uniVer": "4.23",
1548
+ "unixVer": "4.61",
1549
+ "unixVaporVer": "5.0"
1550
+ }
1551
+ },
1552
+ "mp": {
1553
+ "weixin": {
1554
+ "hostVer": "√",
1555
+ "uniVer": "√",
1556
+ "unixVer": "4.41"
1557
+ },
1558
+ "alipay": {
1559
+ "hostVer": "√",
1560
+ "uniVer": "√",
1561
+ "unixVer": "x"
1562
+ },
1563
+ "baidu": {
1564
+ "hostVer": "√",
1565
+ "uniVer": "√",
1566
+ "unixVer": "x"
1567
+ },
1568
+ "toutiao": {
1569
+ "hostVer": "√",
1570
+ "uniVer": "√",
1571
+ "unixVer": "x"
1572
+ },
1573
+ "lark": {
1574
+ "hostVer": "√",
1575
+ "uniVer": "√",
1576
+ "unixVer": "x"
1577
+ },
1578
+ "qq": {
1579
+ "hostVer": "√",
1580
+ "uniVer": "√",
1581
+ "unixVer": "x"
1582
+ },
1583
+ "kuaishou": {
1584
+ "hostVer": "√",
1585
+ "uniVer": "√",
1586
+ "unixVer": "x"
1587
+ },
1588
+ "jd": {
1589
+ "hostVer": "√",
1590
+ "uniVer": "√",
1591
+ "unixVer": "x"
1592
+ }
1593
+ },
1594
+ "web": {
1595
+ "uniVer": "√",
1596
+ "unixVer": "4.0"
1597
+ }
1598
+ }
1599
+ * @example
1600
+ ```typescript
1601
+ task.onClose((res) => {
1602
+ })
1603
+ ```
1604
+ */
1605
+ onClose(callback: (result: any) => void): void;
1606
+
1607
+ /**
1608
+ * onError()
1609
+ * @description
1610
+ * 监听 WebSocket 错误
1611
+ * @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onerror
1612
+ * @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onerror
1613
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onerror
1614
+ * @uniPlatform
1615
+ {
1616
+ "app": {
1617
+ "android": {
1618
+ "osVer": "4.4",
1619
+ "uniVer": "√",
1620
+ "uniUtsPlugin": "3.91",
1621
+ "unixVer": "3.91"
1622
+ },
1623
+ "ios": {
1624
+ "osVer": "12.0",
1625
+ "uniVer": "√",
1626
+ "uniUtsPlugin": "4.11",
1627
+ "unixVer": "4.11",
1628
+ "unixUtsPlugin": "4.11"
1629
+ },
1630
+ "harmony": {
1631
+ "osVer": "3.0",
1632
+ "uniVer": "4.23",
1633
+ "unixVer": "4.61",
1634
+ "unixVaporVer": "5.0"
1635
+ }
1636
+ },
1637
+ "mp": {
1638
+ "weixin": {
1639
+ "hostVer": "√",
1640
+ "uniVer": "√",
1641
+ "unixVer": "4.41"
1642
+ },
1643
+ "alipay": {
1644
+ "hostVer": "√",
1645
+ "uniVer": "√",
1646
+ "unixVer": "x"
1647
+ },
1648
+ "baidu": {
1649
+ "hostVer": "√",
1650
+ "uniVer": "√",
1651
+ "unixVer": "x"
1652
+ },
1653
+ "toutiao": {
1654
+ "hostVer": "√",
1655
+ "uniVer": "√",
1656
+ "unixVer": "x"
1657
+ },
1658
+ "lark": {
1659
+ "hostVer": "√",
1660
+ "uniVer": "√",
1661
+ "unixVer": "x"
1662
+ },
1663
+ "qq": {
1664
+ "hostVer": "√",
1665
+ "uniVer": "√",
1666
+ "unixVer": "x"
1667
+ },
1668
+ "kuaishou": {
1669
+ "hostVer": "√",
1670
+ "uniVer": "√",
1671
+ "unixVer": "x"
1672
+ },
1673
+ "jd": {
1674
+ "hostVer": "√",
1675
+ "uniVer": "√",
1676
+ "unixVer": "x"
1677
+ }
1678
+ },
1679
+ "web": {
1680
+ "uniVer": "√",
1681
+ "unixVer": "4.0"
1682
+ }
1683
+ }
1684
+ * @example
1685
+ ```typescript
1686
+ task.onError((res) => {
1687
+ })
1688
+ ```
1689
+ */
1690
+ onError(callback: (result: GeneralCallbackResult) => void): void;
1691
+
1692
+ /**
1693
+ * 监听 WebSocket 接受到服务器的消息事件
1694
+ * @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onmessage
1695
+ * @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onmessage
1696
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onmessage
1697
+ * @uniPlatform
1698
+ {
1699
+ "app": {
1700
+ "android": {
1701
+ "osVer": "4.4",
1702
+ "uniVer": "√",
1703
+ "uniUtsPlugin": "3.91",
1704
+ "unixVer": "3.91"
1705
+ },
1706
+ "ios": {
1707
+ "osVer": "12.0",
1708
+ "uniVer": "√",
1709
+ "uniUtsPlugin": "4.11",
1710
+ "unixVer": "4.11",
1711
+ "unixUtsPlugin": "4.11"
1712
+ },
1713
+ "harmony": {
1714
+ "osVer": "3.0",
1715
+ "uniVer": "4.23",
1716
+ "unixVer": "4.61",
1717
+ "unixVaporVer": "5.0"
1718
+ }
1719
+ },
1720
+ "mp": {
1721
+ "weixin": {
1722
+ "hostVer": "√",
1723
+ "uniVer": "√",
1724
+ "unixVer": "4.41"
1725
+ },
1726
+ "alipay": {
1727
+ "hostVer": "√",
1728
+ "uniVer": "√",
1729
+ "unixVer": "x"
1730
+ },
1731
+ "baidu": {
1732
+ "hostVer": "√",
1733
+ "uniVer": "√",
1734
+ "unixVer": "x"
1735
+ },
1736
+ "toutiao": {
1737
+ "hostVer": "√",
1738
+ "uniVer": "√",
1739
+ "unixVer": "x"
1740
+ },
1741
+ "lark": {
1742
+ "hostVer": "√",
1743
+ "uniVer": "√",
1744
+ "unixVer": "x"
1745
+ },
1746
+ "qq": {
1747
+ "hostVer": "√",
1748
+ "uniVer": "√",
1749
+ "unixVer": "x"
1750
+ },
1751
+ "kuaishou": {
1752
+ "hostVer": "√",
1753
+ "uniVer": "√",
1754
+ "unixVer": "x"
1755
+ },
1756
+ "jd": {
1757
+ "hostVer": "√",
1758
+ "uniVer": "√",
1759
+ "unixVer": "x"
1760
+ }
1761
+ },
1762
+ "web": {
1763
+ "uniVer": "√",
1764
+ "unixVer": "4.0"
1765
+ }
1766
+ }
1767
+ * @example
1768
+ ```typescript
1769
+ task.onMessage((res) => {
1770
+ })
1771
+ ```
1772
+ */
1773
+ onMessage(callback: (result: OnSocketMessageCallbackResult) => void): void;
1774
+ };
1775
+ export type OnSocketOpenCallback = (result: OnSocketOpenCallbackResult) => void;
1776
+
1777
+ export type OnSocketOpen = (options: OnSocketOpenCallback) => void;
1778
+ export type OnSocketErrorCallbackResult = {
1779
+ /**
1780
+ * 错误信息
1781
+ */
1782
+ errMsg: string
1783
+ };
1784
+ export type OnSocketErrorCallback = (result: OnSocketErrorCallbackResult) => void;
1785
+
1786
+ export type OnSocketError = (callback: OnSocketErrorCallback) => void;
1787
+
1788
+ export type SendSocketMessage = (options: SendSocketMessageOptions) => void;
1789
+ export type OnSocketMessageCallback = (result: OnSocketMessageCallbackResult) => void;
1790
+
1791
+ export type OnSocketMessage = (callback: OnSocketMessageCallback) => void;
1792
+
1793
+ export type CloseSocket = (options: CloseSocketOptions) => void;
1794
+ export type OnSocketCloseCallbackResult = {
1795
+ /**
1796
+ * 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。
1797
+ * @uniPlatform
1798
+ {
1799
+ "app": {
1800
+ "android": {
1801
+ "osVer": "4.4",
1802
+ "uniVer": "√",
1803
+ "uniUtsPlugin": "3.91",
1804
+ "unixVer": "3.91"
1805
+ },
1806
+ "ios": {
1807
+ "osVer": "12.0",
1808
+ "uniVer": "√",
1809
+ "uniUtsPlugin": "4.11",
1810
+ "unixVer": "4.11",
1811
+ "unixUtsPlugin": "4.11"
1812
+ },
1813
+ "harmony": {
1814
+ "osVer": "3.0",
1815
+ "uniVer": "4.23",
1816
+ "unixVer": "4.61",
1817
+ "unixVaporVer": "5.0"
1818
+ }
1819
+ },
1820
+ "mp": {
1821
+ "weixin": {
1822
+ "hostVer": "√",
1823
+ "uniVer": "√",
1824
+ "unixVer": "4.41"
1825
+ },
1826
+ "alipay": {
1827
+ "hostVer": "√",
1828
+ "uniVer": "√",
1829
+ "unixVer": "x"
1830
+ },
1831
+ "baidu": {
1832
+ "hostVer": "√",
1833
+ "uniVer": "√",
1834
+ "unixVer": "x"
1835
+ },
1836
+ "toutiao": {
1837
+ "hostVer": "√",
1838
+ "uniVer": "√",
1839
+ "unixVer": "x"
1840
+ },
1841
+ "lark": {
1842
+ "hostVer": "√",
1843
+ "uniVer": "√",
1844
+ "unixVer": "x"
1845
+ },
1846
+ "qq": {
1847
+ "hostVer": "√",
1848
+ "uniVer": "√",
1849
+ "unixVer": "x"
1850
+ },
1851
+ "kuaishou": {
1852
+ "hostVer": "√",
1853
+ "uniVer": "√",
1854
+ "unixVer": "x"
1855
+ },
1856
+ "jd": {
1857
+ "hostVer": "√",
1858
+ "uniVer": "√",
1859
+ "unixVer": "x"
1860
+ }
1861
+ }
1862
+ }
1863
+ */
1864
+ code: number,
1865
+
1866
+ /**
1867
+ * 一个可读的字符串,表示连接被关闭的原因。
1868
+ * @uniPlatform
1869
+ {
1870
+ "app": {
1871
+ "android": {
1872
+ "osVer": "4.4",
1873
+ "uniVer": "√",
1874
+ "uniUtsPlugin": "3.91",
1875
+ "unixVer": "3.91"
1876
+ },
1877
+ "ios": {
1878
+ "osVer": "12.0",
1879
+ "uniVer": "√",
1880
+ "uniUtsPlugin": "4.11",
1881
+ "unixVer": "4.11",
1882
+ "unixUtsPlugin": "4.11"
1883
+ },
1884
+ "harmony": {
1885
+ "osVer": "3.0",
1886
+ "uniVer": "4.23",
1887
+ "unixVer": "4.61",
1888
+ "unixVaporVer": "5.0"
1889
+ }
1890
+ },
1891
+ "mp": {
1892
+ "weixin": {
1893
+ "hostVer": "√",
1894
+ "uniVer": "√",
1895
+ "unixVer": "4.41"
1896
+ },
1897
+ "alipay": {
1898
+ "hostVer": "√",
1899
+ "uniVer": "√",
1900
+ "unixVer": "x"
1901
+ },
1902
+ "baidu": {
1903
+ "hostVer": "√",
1904
+ "uniVer": "√",
1905
+ "unixVer": "x"
1906
+ },
1907
+ "toutiao": {
1908
+ "hostVer": "√",
1909
+ "uniVer": "√",
1910
+ "unixVer": "x"
1911
+ },
1912
+ "lark": {
1913
+ "hostVer": "√",
1914
+ "uniVer": "√",
1915
+ "unixVer": "x"
1916
+ },
1917
+ "qq": {
1918
+ "hostVer": "√",
1919
+ "uniVer": "√",
1920
+ "unixVer": "x"
1921
+ },
1922
+ "kuaishou": {
1923
+ "hostVer": "√",
1924
+ "uniVer": "√",
1925
+ "unixVer": "x"
1926
+ },
1927
+ "jd": {
1928
+ "hostVer": "√",
1929
+ "uniVer": "√",
1930
+ "unixVer": "x"
1931
+ }
1932
+ }
1933
+ }
1934
+ */
1935
+ reason: string
1936
+ };
1937
+ export type OnSocketCloseCallback = (result: OnSocketCloseCallbackResult) => void;
1938
+
1939
+ export type OnSocketClose = (callback: OnSocketCloseCallback) => void;