@dcloudio/uni-app-x 0.7.111 → 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.
- package/package.json +1 -1
- package/types/dom2-internal/UniNativeView.d.ts +1 -0
- package/types/dom2-internal/UniPage.d.ts +16 -0
- package/types/dom2-internal/sharedData.d.ts +9 -14
- package/types/native/CSSStyleDeclaration.d.ts +172 -172
- package/types/native/CanvasRenderingContext2D.d.ts +4720 -4720
- package/types/native/DrawableContext.d.ts +1893 -1893
- package/types/native/IUniElement.d.ts +7468 -7461
- package/types/native/IUniNativeViewElement.d.ts +327 -327
- package/types/native/SnapshotOptions.d.ts +337 -62
- package/types/native/UniPage.d.ts +1305 -1305
- package/types/native/UniResizeObserver.d.ts +749 -749
- package/types/native/UniSwiperAnimationFinishEvent.d.ts +59 -59
- package/types/native/UniSwiperChangeEvent.d.ts +58 -58
- package/types/page.d.ts +3154 -3112
- package/types/uni/uts-plugin-api/global.d.ts +8 -0
- package/types/uni/uts-plugin-api/index.d.ts +8 -0
- package/types/uni/uts-plugin-api/lib/uni-actionSheet/utssdk/interface.d.ts +1672 -911
- package/types/uni/uts-plugin-api/lib/uni-addPhoneContact/utssdk/interface.d.ts +126 -126
- package/types/uni/uts-plugin-api/lib/uni-arrayBufferToBase64/utssdk/interface.d.ts +14 -14
- package/types/uni/uts-plugin-api/lib/uni-authentication/utssdk/interface.d.ts +154 -154
- package/types/uni/uts-plugin-api/lib/uni-base64ToArrayBuffer/utssdk/interface.d.ts +14 -14
- package/types/uni/uts-plugin-api/lib/uni-camera/utssdk/global.d.ts +55 -0
- package/types/uni/uts-plugin-api/lib/uni-camera/utssdk/index.d.ts +27 -0
- package/types/uni/uts-plugin-api/lib/uni-camera/utssdk/interface.d.ts +1155 -0
- package/types/uni/uts-plugin-api/lib/uni-canvas/utssdk/global.d.ts +9 -6
- package/types/uni/uts-plugin-api/lib/uni-canvas/utssdk/index.d.ts +5 -3
- package/types/uni/uts-plugin-api/lib/uni-canvas/utssdk/interface.d.ts +978 -972
- package/types/uni/uts-plugin-api/lib/uni-canvas-dom2/utssdk/global.d.ts +25 -0
- package/types/uni/uts-plugin-api/lib/uni-canvas-dom2/utssdk/index.d.ts +12 -0
- package/types/uni/uts-plugin-api/lib/uni-canvas-dom2/utssdk/interface.d.ts +978 -0
- package/types/uni/uts-plugin-api/lib/uni-chooseLocation/utssdk/interface.d.ts +358 -358
- package/types/uni/uts-plugin-api/lib/uni-chooseMedia/utssdk/interface.d.ts +8 -8
- package/types/uni/uts-plugin-api/lib/uni-clipboard/utssdk/interface.d.ts +78 -78
- package/types/uni/uts-plugin-api/lib/uni-createSelectorQuery/utssdk/interface.d.ts +490 -479
- package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/interface.d.ts +214 -214
- package/types/uni/uts-plugin-api/lib/uni-createWorker/utssdk/interface.d.ts +126 -126
- package/types/uni/uts-plugin-api/lib/uni-dialogPage/utssdk/interface.d.ts +30 -30
- package/types/uni/uts-plugin-api/lib/uni-editor/utssdk/global.d.ts +39 -0
- package/types/uni/uts-plugin-api/lib/uni-editor/utssdk/index.d.ts +19 -0
- package/types/uni/uts-plugin-api/lib/uni-editor/utssdk/interface.d.ts +856 -0
- package/types/uni/uts-plugin-api/lib/uni-event/utssdk/interface.d.ts +338 -338
- package/types/uni/uts-plugin-api/lib/uni-exit/utssdk/interface.d.ts +147 -147
- package/types/uni/uts-plugin-api/lib/uni-file/utssdk/interface.d.ts +397 -397
- package/types/uni/uts-plugin-api/lib/uni-fileSystemManager/utssdk/interface.d.ts +6363 -6359
- package/types/uni/uts-plugin-api/lib/uni-getAppAuthorizeSetting/utssdk/interface.d.ts +554 -554
- package/types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +2149 -2149
- package/types/uni/uts-plugin-api/lib/uni-getBackgroundAudioManager/utssdk/interface.d.ts +1340 -1340
- package/types/uni/uts-plugin-api/lib/uni-getDeviceInfo/utssdk/interface.d.ts +1707 -1707
- package/types/uni/uts-plugin-api/lib/uni-getEnterOptionsSync/utssdk/interface.d.ts +307 -307
- package/types/uni/uts-plugin-api/lib/uni-getLaunchOptionsSync/utssdk/interface.d.ts +310 -310
- package/types/uni/uts-plugin-api/lib/uni-getNetworkType/utssdk/interface.d.ts +5 -5
- package/types/uni/uts-plugin-api/lib/uni-getPerformance/utssdk/interface.d.ts +129 -129
- package/types/uni/uts-plugin-api/lib/uni-getProvider/utssdk/interface.d.ts +757 -757
- package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/interface.d.ts +5881 -5879
- package/types/uni/uts-plugin-api/lib/uni-getSystemSetting/utssdk/interface.d.ts +442 -442
- package/types/uni/uts-plugin-api/lib/uni-input/utssdk/global.d.ts +9 -0
- package/types/uni/uts-plugin-api/lib/uni-input/utssdk/index.d.ts +5 -0
- package/types/uni/uts-plugin-api/lib/uni-input/utssdk/interface.d.ts +0 -0
- package/types/uni/uts-plugin-api/lib/uni-interceptor/utssdk/interface.d.ts +171 -171
- package/types/uni/uts-plugin-api/lib/uni-keyboard/utssdk/interface.d.ts +1 -1
- package/types/uni/uts-plugin-api/lib/uni-loadFontFace/utssdk/interface.d.ts +536 -536
- package/types/uni/uts-plugin-api/lib/uni-location/utssdk/interface.d.ts +2914 -2910
- package/types/uni/uts-plugin-api/lib/uni-media/utssdk/interface.d.ts +24 -24
- package/types/uni/uts-plugin-api/lib/uni-modal/utssdk/interface.d.ts +208 -208
- package/types/uni/uts-plugin-api/lib/uni-navigationBar/utssdk/interface.d.ts +785 -785
- package/types/uni/uts-plugin-api/lib/uni-network/utssdk/interface.d.ts +4243 -4243
- package/types/uni/uts-plugin-api/lib/uni-oauth/utssdk/interface.d.ts +1979 -1963
- package/types/uni/uts-plugin-api/lib/uni-oauth-weixin/utssdk/interface.d.ts +5 -3
- package/types/uni/uts-plugin-api/lib/uni-openAppAuthorizeSetting/utssdk/interface.d.ts +229 -229
- package/types/uni/uts-plugin-api/lib/uni-openDocument/utssdk/interface.d.ts +753 -753
- package/types/uni/uts-plugin-api/lib/uni-pageScrollTo/utssdk/interface.d.ts +84 -84
- package/types/uni/uts-plugin-api/lib/uni-payment/utssdk/interface.d.ts +790 -788
- package/types/uni/uts-plugin-api/lib/uni-previewImage/utssdk/interface.d.ts +447 -447
- package/types/uni/uts-plugin-api/lib/uni-privacy/utssdk/interface.d.ts +498 -498
- package/types/uni/uts-plugin-api/lib/uni-prompt/utssdk/interface.d.ts +1552 -1548
- package/types/uni/uts-plugin-api/lib/uni-pullDownRefresh/utssdk/interface.d.ts +58 -58
- package/types/uni/uts-plugin-api/lib/uni-recorder/utssdk/interface.d.ts +30 -30
- package/types/uni/uts-plugin-api/lib/uni-route/utssdk/interface.d.ts +2513 -2513
- package/types/uni/uts-plugin-api/lib/uni-rpx2px/utssdk/interface.d.ts +81 -81
- package/types/uni/uts-plugin-api/lib/uni-scanCode/utssdk/interface.d.ts +351 -351
- package/types/uni/uts-plugin-api/lib/uni-screenBrightness/utssdk/interface.d.ts +107 -107
- package/types/uni/uts-plugin-api/lib/uni-share/utssdk/interface.d.ts +584 -584
- package/types/uni/uts-plugin-api/lib/uni-shareWithSystem/utssdk/interface.d.ts +722 -722
- package/types/uni/uts-plugin-api/lib/uni-showLoading/utssdk/interface.d.ts +292 -292
- package/types/uni/uts-plugin-api/lib/uni-storage/utssdk/interface.d.ts +358 -358
- package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/interface.d.ts +657 -657
- package/types/uni/uts-plugin-api/lib/uni-textarea/utssdk/global.d.ts +9 -0
- package/types/uni/uts-plugin-api/lib/uni-textarea/utssdk/index.d.ts +5 -0
- package/types/uni/uts-plugin-api/lib/uni-textarea/utssdk/interface.d.ts +0 -0
- package/types/uni/uts-plugin-api/lib/uni-theme/utssdk/interface.d.ts +1010 -1010
- package/types/uni/uts-plugin-api/lib/uni-video/utssdk/global.d.ts +47 -0
- package/types/uni/uts-plugin-api/lib/uni-video/utssdk/index.d.ts +23 -0
- package/types/uni/uts-plugin-api/lib/uni-video/utssdk/interface.d.ts +926 -0
- package/types/uni/uts-plugin-api/lib/uni-web-view/utssdk/global.d.ts +29 -0
- package/types/uni/uts-plugin-api/lib/uni-web-view/utssdk/index.d.ts +14 -0
- package/types/uni/uts-plugin-api/lib/uni-web-view/utssdk/interface.d.ts +452 -0
- package/types/uni/uts-plugin-api/lib/uni-websocket/utssdk/interface.d.ts +1442 -1442
- package/types/uni/uts-plugin-biz/lib/uni-facialVerify/utssdk/interface.d.ts +220 -220
- package/types/uni/uts-plugin-biz/lib/uni-map-tencent/utssdk/interface.d.ts +65 -65
- package/types/uni/uts-plugin-biz/lib/uni-push/utssdk/interface.d.ts +981 -981
- package/types/uni/uts-plugin-biz/lib/uni-verify/utssdk/interface.d.ts +26 -26
- package/types/uni/uts-plugin-component/.temp/uni-camera/utssdk/interface.uts +1155 -0
- package/types/uni/uts-plugin-component/.temp/uni-camera.d.ts +38 -0
- package/types/uni/uts-plugin-component/.temp/uni-camera.ts +52 -0
- package/types/uni/uts-plugin-component/.temp/uni-canvas/utssdk/interface.uts +976 -0
- package/types/uni/uts-plugin-component/.temp/uni-canvas-dom2/utssdk/interface.uts +976 -0
- package/types/uni/uts-plugin-component/.temp/uni-editor.d.ts +171 -0
- package/types/uni/uts-plugin-component/.temp/uni-editor.ts +237 -0
- package/types/uni/uts-plugin-component/.temp/uni-form.d.ts +2 -0
- package/types/uni/uts-plugin-component/.temp/uni-form.ts +1 -0
- package/types/uni/uts-plugin-component/.temp/uni-input/utssdk/interface.uts +0 -0
- package/types/uni/uts-plugin-component/.temp/uni-map-tencent.d.ts +56 -0
- package/types/uni/uts-plugin-component/.temp/uni-map-tencent.ts +88 -0
- package/types/uni/uts-plugin-component/.temp/uni-match-media.d.ts +2 -0
- package/types/uni/uts-plugin-component/.temp/uni-match-media.ts +2 -0
- package/types/uni/uts-plugin-component/.temp/uni-navigator.d.ts +2 -0
- package/types/uni/uts-plugin-component/.temp/uni-navigator.ts +1 -0
- package/types/uni/uts-plugin-component/.temp/uni-page-container.d.ts +0 -0
- package/types/uni/uts-plugin-component/.temp/uni-page-container.ts +2 -0
- package/types/uni/uts-plugin-component/.temp/uni-progress.d.ts +2 -0
- package/types/uni/uts-plugin-component/.temp/uni-progress.ts +1 -0
- package/types/uni/uts-plugin-component/.temp/uni-rich-text.d.ts +7 -0
- package/types/uni/uts-plugin-component/.temp/uni-rich-text.ts +12 -0
- package/types/uni/uts-plugin-component/.temp/uni-textarea/utssdk/interface.uts +0 -0
- package/types/uni/uts-plugin-component/.temp/uni-video/utssdk/interface.uts +936 -0
- package/types/uni/uts-plugin-component/.temp/uni-video.d.ts +134 -0
- package/types/uni/uts-plugin-component/.temp/uni-video.ts +180 -0
- package/types/uni/uts-plugin-component/.temp/uni-web-view/utssdk/interface.uts +452 -0
- package/types/uni/uts-plugin-component/.temp/uni-web-view.d.ts +51 -0
- package/types/uni/uts-plugin-component/.temp/uni-web-view.ts +86 -0
- package/types/uni/uts-plugin-component/global.d.ts +79 -0
- package/types/uni/uts-plugin-component/index.d.ts +79 -0
- package/types/uni/uts-plugin-component/lib/uni-actionSheet/utssdk/global.d.ts +29 -0
- package/types/uni/uts-plugin-component/lib/uni-actionSheet/utssdk/index.d.ts +14 -0
- package/types/uni/uts-plugin-component/lib/uni-actionSheet/utssdk/interface.d.ts +1673 -0
- package/types/uni/uts-plugin-component/lib/uni-addPhoneContact/utssdk/global.d.ts +25 -0
- package/types/uni/uts-plugin-component/lib/uni-addPhoneContact/utssdk/index.d.ts +12 -0
- package/types/uni/uts-plugin-component/lib/uni-addPhoneContact/utssdk/interface.d.ts +226 -0
- package/types/uni/uts-plugin-component/lib/uni-arrayBufferToBase64/utssdk/global.d.ts +11 -0
- package/types/uni/uts-plugin-component/lib/uni-arrayBufferToBase64/utssdk/index.d.ts +5 -0
- package/types/uni/uts-plugin-component/lib/uni-arrayBufferToBase64/utssdk/interface.d.ts +79 -0
- package/types/uni/uts-plugin-component/lib/uni-authentication/utssdk/global.d.ts +59 -0
- package/types/uni/uts-plugin-component/lib/uni-authentication/utssdk/index.d.ts +29 -0
- package/types/uni/uts-plugin-component/lib/uni-authentication/utssdk/interface.d.ts +371 -0
- package/types/uni/uts-plugin-component/lib/uni-barcode-scanning/utssdk/global.d.ts +9 -0
- package/types/uni/uts-plugin-component/lib/uni-barcode-scanning/utssdk/index.d.ts +5 -0
- package/types/uni/uts-plugin-component/lib/uni-barcode-scanning/utssdk/interface.d.ts +0 -0
- package/types/uni/uts-plugin-component/lib/uni-base64ToArrayBuffer/utssdk/global.d.ts +11 -0
- package/types/uni/uts-plugin-component/lib/uni-base64ToArrayBuffer/utssdk/index.d.ts +5 -0
- package/types/uni/uts-plugin-component/lib/uni-base64ToArrayBuffer/utssdk/interface.d.ts +79 -0
- package/types/uni/uts-plugin-component/lib/uni-canvas/utssdk/interface.d.ts +978 -976
- package/types/uni/uts-plugin-component/lib/uni-canvas-dom2/utssdk/interface.d.ts +978 -976
- package/types/uni/uts-plugin-component/lib/uni-chooseLocation/utssdk/global.d.ts +25 -0
- package/types/uni/uts-plugin-component/lib/uni-chooseLocation/utssdk/index.d.ts +12 -0
- package/types/uni/uts-plugin-component/lib/uni-chooseLocation/utssdk/interface.d.ts +423 -0
- package/types/uni/uts-plugin-component/lib/uni-chooseMedia/utssdk/global.d.ts +33 -0
- package/types/uni/uts-plugin-component/lib/uni-chooseMedia/utssdk/index.d.ts +16 -0
- package/types/uni/uts-plugin-component/lib/uni-chooseMedia/utssdk/interface.d.ts +499 -0
- package/types/uni/uts-plugin-component/lib/uni-clipboard/utssdk/global.d.ts +45 -0
- package/types/uni/uts-plugin-component/lib/uni-clipboard/utssdk/index.d.ts +22 -0
- package/types/uni/uts-plugin-component/lib/uni-clipboard/utssdk/interface.d.ts +217 -0
- package/types/uni/uts-plugin-component/lib/uni-createInnerAudioContext/utssdk/global.d.ts +33 -0
- package/types/uni/uts-plugin-component/lib/uni-createInnerAudioContext/utssdk/index.d.ts +16 -0
- package/types/uni/uts-plugin-component/lib/uni-createInnerAudioContext/utssdk/interface.d.ts +3379 -0
- package/types/uni/uts-plugin-component/lib/uni-createIntersectionObserver/utssdk/global.d.ts +21 -0
- package/types/uni/uts-plugin-component/lib/uni-createIntersectionObserver/utssdk/index.d.ts +10 -0
- package/types/uni/uts-plugin-component/lib/uni-createIntersectionObserver/utssdk/interface.d.ts +153 -0
- package/types/uni/uts-plugin-component/lib/uni-createRequestPermissionListener/utssdk/global.d.ts +19 -0
- package/types/uni/uts-plugin-component/lib/uni-createRequestPermissionListener/utssdk/index.d.ts +9 -0
- package/types/uni/uts-plugin-component/lib/uni-createRequestPermissionListener/utssdk/interface.d.ts +61 -0
- package/types/uni/uts-plugin-component/lib/uni-createSelectorQuery/utssdk/global.d.ts +21 -0
- package/types/uni/uts-plugin-component/lib/uni-createSelectorQuery/utssdk/index.d.ts +10 -0
- package/types/uni/uts-plugin-component/lib/uni-createSelectorQuery/utssdk/interface.d.ts +560 -0
- package/types/uni/uts-plugin-component/lib/uni-createWebviewContext/utssdk/global.d.ts +15 -0
- package/types/uni/uts-plugin-component/lib/uni-createWebviewContext/utssdk/index.d.ts +7 -0
- package/types/uni/uts-plugin-component/lib/uni-createWebviewContext/utssdk/interface.d.ts +214 -0
- package/types/uni/uts-plugin-component/lib/uni-createWorker/utssdk/global.d.ts +23 -0
- package/types/uni/uts-plugin-component/lib/uni-createWorker/utssdk/index.d.ts +11 -0
- package/types/uni/uts-plugin-component/lib/uni-createWorker/utssdk/interface.d.ts +158 -0
- package/types/uni/uts-plugin-component/lib/uni-dialogPage/utssdk/global.d.ts +29 -0
- package/types/uni/uts-plugin-component/lib/uni-dialogPage/utssdk/index.d.ts +14 -0
- package/types/uni/uts-plugin-component/lib/uni-dialogPage/utssdk/interface.d.ts +2304 -0
- package/types/uni/uts-plugin-component/lib/uni-editor/utssdk/global.d.ts +39 -0
- package/types/uni/uts-plugin-component/lib/uni-editor/utssdk/index.d.ts +19 -0
- package/types/uni/uts-plugin-component/lib/uni-editor/utssdk/interface.d.ts +856 -0
- package/types/uni/uts-plugin-component/lib/uni-editor-global/utssdk/global.d.ts +25 -0
- package/types/uni/uts-plugin-component/lib/uni-editor-global/utssdk/index.d.ts +13 -0
- package/types/uni/uts-plugin-component/lib/uni-editor-global/utssdk/interface.d.ts +181 -0
- package/types/uni/uts-plugin-component/lib/uni-event/utssdk/global.d.ts +17 -0
- package/types/uni/uts-plugin-component/lib/uni-event/utssdk/index.d.ts +8 -0
- package/types/uni/uts-plugin-component/lib/uni-event/utssdk/interface.d.ts +338 -0
- package/types/uni/uts-plugin-component/lib/uni-exit/utssdk/global.d.ts +27 -0
- package/types/uni/uts-plugin-component/lib/uni-exit/utssdk/index.d.ts +13 -0
- package/types/uni/uts-plugin-component/lib/uni-exit/utssdk/interface.d.ts +147 -0
- package/types/uni/uts-plugin-component/lib/uni-file/utssdk/global.d.ts +81 -0
- package/types/uni/uts-plugin-component/lib/uni-file/utssdk/index.d.ts +40 -0
- package/types/uni/uts-plugin-component/lib/uni-file/utssdk/interface.d.ts +397 -0
- package/types/uni/uts-plugin-component/lib/uni-fileSystemManager/utssdk/global.d.ts +151 -0
- package/types/uni/uts-plugin-component/lib/uni-fileSystemManager/utssdk/index.d.ts +75 -0
- package/types/uni/uts-plugin-component/lib/uni-fileSystemManager/utssdk/interface.d.ts +6428 -0
- package/types/uni/uts-plugin-component/lib/uni-getAccessibilityInfo/utssdk/global.d.ts +11 -0
- package/types/uni/uts-plugin-component/lib/uni-getAccessibilityInfo/utssdk/index.d.ts +5 -0
- package/types/uni/uts-plugin-component/lib/uni-getAccessibilityInfo/utssdk/interface.d.ts +37 -0
- package/types/uni/uts-plugin-component/lib/uni-getAppAuthorizeSetting/utssdk/global.d.ts +13 -0
- package/types/uni/uts-plugin-component/lib/uni-getAppAuthorizeSetting/utssdk/index.d.ts +6 -0
- package/types/uni/uts-plugin-component/lib/uni-getAppAuthorizeSetting/utssdk/interface.d.ts +620 -0
- package/types/uni/uts-plugin-component/lib/uni-getAppBaseInfo/utssdk/global.d.ts +15 -0
- package/types/uni/uts-plugin-component/lib/uni-getAppBaseInfo/utssdk/index.d.ts +7 -0
- package/types/uni/uts-plugin-component/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +2220 -0
- package/types/uni/uts-plugin-component/lib/uni-getBackgroundAudioManager/utssdk/global.d.ts +17 -0
- package/types/uni/uts-plugin-component/lib/uni-getBackgroundAudioManager/utssdk/index.d.ts +8 -0
- package/types/uni/uts-plugin-component/lib/uni-getBackgroundAudioManager/utssdk/interface.d.ts +1406 -0
- package/types/uni/uts-plugin-component/lib/uni-getDeviceInfo/utssdk/global.d.ts +15 -0
- package/types/uni/uts-plugin-component/lib/uni-getDeviceInfo/utssdk/index.d.ts +7 -0
- package/types/uni/uts-plugin-component/lib/uni-getDeviceInfo/utssdk/interface.d.ts +1774 -0
- package/types/uni/uts-plugin-component/lib/uni-getElementById/utssdk/global.d.ts +11 -0
- package/types/uni/uts-plugin-component/lib/uni-getElementById/utssdk/index.d.ts +5 -0
- package/types/uni/uts-plugin-component/lib/uni-getElementById/utssdk/interface.d.ts +82 -0
- package/types/uni/uts-plugin-component/lib/uni-getEnterOptionsSync/utssdk/global.d.ts +13 -0
- package/types/uni/uts-plugin-component/lib/uni-getEnterOptionsSync/utssdk/index.d.ts +6 -0
- package/types/uni/uts-plugin-component/lib/uni-getEnterOptionsSync/utssdk/interface.d.ts +374 -0
- package/types/uni/uts-plugin-component/lib/uni-getLaunchOptionsSync/utssdk/global.d.ts +13 -0
- package/types/uni/uts-plugin-component/lib/uni-getLaunchOptionsSync/utssdk/index.d.ts +6 -0
- package/types/uni/uts-plugin-component/lib/uni-getLaunchOptionsSync/utssdk/interface.d.ts +377 -0
- package/types/uni/uts-plugin-component/lib/uni-getLocation-tencent-uni1/utssdk/global.d.ts +21 -0
- package/types/uni/uts-plugin-component/lib/uni-getLocation-tencent-uni1/utssdk/index.d.ts +11 -0
- package/types/uni/uts-plugin-component/lib/uni-getLocation-tencent-uni1/utssdk/interface.d.ts +736 -0
- package/types/uni/uts-plugin-component/lib/uni-getNetworkType/utssdk/global.d.ts +33 -0
- package/types/uni/uts-plugin-component/lib/uni-getNetworkType/utssdk/index.d.ts +16 -0
- package/types/uni/uts-plugin-component/lib/uni-getNetworkType/utssdk/interface.d.ts +420 -0
- package/types/uni/uts-plugin-component/lib/uni-getPerformance/utssdk/global.d.ts +23 -0
- package/types/uni/uts-plugin-component/lib/uni-getPerformance/utssdk/index.d.ts +11 -0
- package/types/uni/uts-plugin-component/lib/uni-getPerformance/utssdk/interface.d.ts +199 -0
- package/types/uni/uts-plugin-component/lib/uni-getProvider/utssdk/global.d.ts +37 -0
- package/types/uni/uts-plugin-component/lib/uni-getProvider/utssdk/index.d.ts +18 -0
- package/types/uni/uts-plugin-component/lib/uni-getProvider/utssdk/interface.d.ts +757 -0
- package/types/uni/uts-plugin-component/lib/uni-getSystemInfo/utssdk/global.d.ts +33 -0
- package/types/uni/uts-plugin-component/lib/uni-getSystemInfo/utssdk/index.d.ts +16 -0
- package/types/uni/uts-plugin-component/lib/uni-getSystemInfo/utssdk/interface.d.ts +6084 -0
- package/types/uni/uts-plugin-component/lib/uni-getSystemSetting/utssdk/global.d.ts +13 -0
- package/types/uni/uts-plugin-component/lib/uni-getSystemSetting/utssdk/index.d.ts +6 -0
- package/types/uni/uts-plugin-component/lib/uni-getSystemSetting/utssdk/interface.d.ts +508 -0
- package/types/uni/uts-plugin-component/lib/uni-installApk/utssdk/global.d.ts +25 -0
- package/types/uni/uts-plugin-component/lib/uni-installApk/utssdk/index.d.ts +12 -0
- package/types/uni/uts-plugin-component/lib/uni-installApk/utssdk/interface.d.ts +125 -0
- package/types/uni/uts-plugin-component/lib/uni-interceptor/utssdk/global.d.ts +17 -0
- package/types/uni/uts-plugin-component/lib/uni-interceptor/utssdk/index.d.ts +8 -0
- package/types/uni/uts-plugin-component/lib/uni-interceptor/utssdk/interface.d.ts +171 -0
- package/types/uni/uts-plugin-component/lib/uni-keyboard/utssdk/global.d.ts +45 -0
- package/types/uni/uts-plugin-component/lib/uni-keyboard/utssdk/index.d.ts +22 -0
- package/types/uni/uts-plugin-component/lib/uni-keyboard/utssdk/interface.d.ts +234 -0
- package/types/uni/uts-plugin-component/lib/uni-loadFontFace/utssdk/global.d.ts +29 -0
- package/types/uni/uts-plugin-component/lib/uni-loadFontFace/utssdk/index.d.ts +14 -0
- package/types/uni/uts-plugin-component/lib/uni-loadFontFace/utssdk/interface.d.ts +603 -0
- package/types/uni/uts-plugin-component/lib/uni-location/utssdk/global.d.ts +61 -0
- package/types/uni/uts-plugin-component/lib/uni-location/utssdk/index.d.ts +30 -0
- package/types/uni/uts-plugin-component/lib/uni-location/utssdk/interface.d.ts +3443 -0
- package/types/uni/uts-plugin-component/lib/uni-location-system/utssdk/global.d.ts +9 -0
- package/types/uni/uts-plugin-component/lib/uni-location-system/utssdk/index.d.ts +5 -0
- package/types/uni/uts-plugin-component/lib/uni-location-system/utssdk/interface.d.ts +3 -0
- package/types/uni/uts-plugin-component/lib/uni-location-tencent/utssdk/global.d.ts +9 -0
- package/types/uni/uts-plugin-component/lib/uni-location-tencent/utssdk/index.d.ts +5 -0
- package/types/uni/uts-plugin-component/lib/uni-location-tencent/utssdk/interface.d.ts +3 -0
- package/types/uni/uts-plugin-component/lib/uni-makePhoneCall/utssdk/global.d.ts +29 -0
- package/types/uni/uts-plugin-component/lib/uni-makePhoneCall/utssdk/index.d.ts +14 -0
- package/types/uni/uts-plugin-component/lib/uni-makePhoneCall/utssdk/interface.d.ts +386 -0
- package/types/uni/uts-plugin-component/lib/uni-media/utssdk/global.d.ts +157 -0
- package/types/uni/uts-plugin-component/lib/uni-media/utssdk/index.d.ts +78 -0
- package/types/uni/uts-plugin-component/lib/uni-media/utssdk/interface.d.ts +5245 -0
- package/types/uni/uts-plugin-component/lib/uni-modal/utssdk/global.d.ts +43 -0
- package/types/uni/uts-plugin-component/lib/uni-modal/utssdk/index.d.ts +21 -0
- package/types/uni/uts-plugin-component/lib/uni-modal/utssdk/interface.d.ts +291 -0
- package/types/uni/uts-plugin-component/lib/uni-navigationBar/utssdk/global.d.ts +69 -0
- package/types/uni/uts-plugin-component/lib/uni-navigationBar/utssdk/index.d.ts +34 -0
- package/types/uni/uts-plugin-component/lib/uni-navigationBar/utssdk/interface.d.ts +1047 -0
- package/types/uni/uts-plugin-component/lib/uni-network/utssdk/global.d.ts +109 -0
- package/types/uni/uts-plugin-component/lib/uni-network/utssdk/index.d.ts +54 -0
- package/types/uni/uts-plugin-component/lib/uni-network/utssdk/interface.d.ts +4462 -0
- package/types/uni/uts-plugin-component/lib/uni-oauth/utssdk/global.d.ts +71 -0
- package/types/uni/uts-plugin-component/lib/uni-oauth/utssdk/index.d.ts +35 -0
- package/types/uni/uts-plugin-component/lib/uni-oauth/utssdk/interface.d.ts +2142 -0
- package/types/uni/uts-plugin-component/lib/uni-oauth-huawei/utssdk/global.d.ts +9 -0
- package/types/uni/uts-plugin-component/lib/uni-oauth-huawei/utssdk/index.d.ts +5 -0
- package/types/uni/uts-plugin-component/lib/uni-oauth-huawei/utssdk/interface.d.ts +1 -0
- package/types/uni/uts-plugin-component/lib/uni-oauth-weixin/utssdk/global.d.ts +17 -0
- package/types/uni/uts-plugin-component/lib/uni-oauth-weixin/utssdk/index.d.ts +9 -0
- package/types/uni/uts-plugin-component/lib/uni-oauth-weixin/utssdk/interface.d.ts +48 -0
- package/types/uni/uts-plugin-component/lib/uni-openAppAuthorizeSetting/utssdk/global.d.ts +25 -0
- package/types/uni/uts-plugin-component/lib/uni-openAppAuthorizeSetting/utssdk/index.d.ts +12 -0
- package/types/uni/uts-plugin-component/lib/uni-openAppAuthorizeSetting/utssdk/interface.d.ts +256 -0
- package/types/uni/uts-plugin-component/lib/uni-openDocument/utssdk/global.d.ts +29 -0
- package/types/uni/uts-plugin-component/lib/uni-openDocument/utssdk/index.d.ts +14 -0
- package/types/uni/uts-plugin-component/lib/uni-openDocument/utssdk/interface.d.ts +823 -0
- package/types/uni/uts-plugin-component/lib/uni-pageScrollTo/utssdk/global.d.ts +27 -0
- package/types/uni/uts-plugin-component/lib/uni-pageScrollTo/utssdk/index.d.ts +13 -0
- package/types/uni/uts-plugin-component/lib/uni-pageScrollTo/utssdk/interface.d.ts +155 -0
- package/types/uni/uts-plugin-component/lib/uni-payment/utssdk/global.d.ts +33 -0
- package/types/uni/uts-plugin-component/lib/uni-payment/utssdk/index.d.ts +16 -0
- package/types/uni/uts-plugin-component/lib/uni-payment/utssdk/interface.d.ts +856 -0
- package/types/uni/uts-plugin-component/lib/uni-payment-alipay/utssdk/global.d.ts +9 -0
- package/types/uni/uts-plugin-component/lib/uni-payment-alipay/utssdk/index.d.ts +5 -0
- package/types/uni/uts-plugin-component/lib/uni-payment-alipay/utssdk/interface.d.ts +3 -0
- package/types/uni/uts-plugin-component/lib/uni-payment-huawei/utssdk/global.d.ts +9 -0
- package/types/uni/uts-plugin-component/lib/uni-payment-huawei/utssdk/index.d.ts +5 -0
- package/types/uni/uts-plugin-component/lib/uni-payment-huawei/utssdk/interface.d.ts +1 -0
- package/types/uni/uts-plugin-component/lib/uni-payment-wxpay/utssdk/global.d.ts +9 -0
- package/types/uni/uts-plugin-component/lib/uni-payment-wxpay/utssdk/index.d.ts +5 -0
- package/types/uni/uts-plugin-component/lib/uni-payment-wxpay/utssdk/interface.d.ts +5 -0
- package/types/uni/uts-plugin-component/lib/uni-picker-global/utssdk/global.d.ts +19 -0
- package/types/uni/uts-plugin-component/lib/uni-picker-global/utssdk/index.d.ts +10 -0
- package/types/uni/uts-plugin-component/lib/uni-picker-global/utssdk/interface.d.ts +26 -0
- package/types/uni/uts-plugin-component/lib/uni-previewImage/utssdk/global.d.ts +47 -0
- package/types/uni/uts-plugin-component/lib/uni-previewImage/utssdk/index.d.ts +23 -0
- package/types/uni/uts-plugin-component/lib/uni-previewImage/utssdk/interface.d.ts +520 -0
- package/types/uni/uts-plugin-component/lib/uni-privacy/utssdk/global.d.ts +31 -0
- package/types/uni/uts-plugin-component/lib/uni-privacy/utssdk/index.d.ts +15 -0
- package/types/uni/uts-plugin-component/lib/uni-privacy/utssdk/interface.d.ts +568 -0
- package/types/uni/uts-plugin-component/lib/uni-prompt/utssdk/global.d.ts +33 -0
- package/types/uni/uts-plugin-component/lib/uni-prompt/utssdk/index.d.ts +16 -0
- package/types/uni/uts-plugin-component/lib/uni-prompt/utssdk/interface.d.ts +1693 -0
- package/types/uni/uts-plugin-component/lib/uni-pullDownRefresh/utssdk/global.d.ts +29 -0
- package/types/uni/uts-plugin-component/lib/uni-pullDownRefresh/utssdk/index.d.ts +14 -0
- package/types/uni/uts-plugin-component/lib/uni-pullDownRefresh/utssdk/interface.d.ts +191 -0
- package/types/uni/uts-plugin-component/lib/uni-recorder/utssdk/global.d.ts +21 -0
- package/types/uni/uts-plugin-component/lib/uni-recorder/utssdk/index.d.ts +10 -0
- package/types/uni/uts-plugin-component/lib/uni-recorder/utssdk/interface.d.ts +2999 -0
- package/types/uni/uts-plugin-component/lib/uni-requestMerchantTransfer/utssdk/global.d.ts +21 -0
- package/types/uni/uts-plugin-component/lib/uni-requestMerchantTransfer/utssdk/index.d.ts +10 -0
- package/types/uni/uts-plugin-component/lib/uni-requestMerchantTransfer/utssdk/interface.d.ts +713 -0
- package/types/uni/uts-plugin-component/lib/uni-route/utssdk/global.d.ts +59 -0
- package/types/uni/uts-plugin-component/lib/uni-route/utssdk/index.d.ts +29 -0
- package/types/uni/uts-plugin-component/lib/uni-route/utssdk/interface.d.ts +2731 -0
- package/types/uni/uts-plugin-component/lib/uni-rpx2px/utssdk/global.d.ts +11 -0
- package/types/uni/uts-plugin-component/lib/uni-rpx2px/utssdk/index.d.ts +5 -0
- package/types/uni/uts-plugin-component/lib/uni-rpx2px/utssdk/interface.d.ts +81 -0
- package/types/uni/uts-plugin-component/lib/uni-scanCode/utssdk/global.d.ts +25 -0
- package/types/uni/uts-plugin-component/lib/uni-scanCode/utssdk/index.d.ts +12 -0
- package/types/uni/uts-plugin-component/lib/uni-scanCode/utssdk/interface.d.ts +429 -0
- package/types/uni/uts-plugin-component/lib/uni-screenBrightness/utssdk/global.d.ts +57 -0
- package/types/uni/uts-plugin-component/lib/uni-screenBrightness/utssdk/index.d.ts +28 -0
- package/types/uni/uts-plugin-component/lib/uni-screenBrightness/utssdk/interface.d.ts +314 -0
- package/types/uni/uts-plugin-component/lib/uni-share/utssdk/global.d.ts +41 -0
- package/types/uni/uts-plugin-component/lib/uni-share/utssdk/index.d.ts +20 -0
- package/types/uni/uts-plugin-component/lib/uni-share/utssdk/interface.d.ts +584 -0
- package/types/uni/uts-plugin-component/lib/uni-share-weixin/utssdk/global.d.ts +9 -0
- package/types/uni/uts-plugin-component/lib/uni-share-weixin/utssdk/index.d.ts +5 -0
- package/types/uni/uts-plugin-component/lib/uni-share-weixin/utssdk/interface.d.ts +3 -0
- package/types/uni/uts-plugin-component/lib/uni-shareWithSystem/utssdk/global.d.ts +27 -0
- package/types/uni/uts-plugin-component/lib/uni-shareWithSystem/utssdk/index.d.ts +13 -0
- package/types/uni/uts-plugin-component/lib/uni-shareWithSystem/utssdk/interface.d.ts +722 -0
- package/types/uni/uts-plugin-component/lib/uni-showLoading/utssdk/global.d.ts +47 -0
- package/types/uni/uts-plugin-component/lib/uni-showLoading/utssdk/index.d.ts +23 -0
- package/types/uni/uts-plugin-component/lib/uni-showLoading/utssdk/interface.d.ts +446 -0
- package/types/uni/uts-plugin-component/lib/uni-sse/utssdk/global.d.ts +21 -0
- package/types/uni/uts-plugin-component/lib/uni-sse/utssdk/index.d.ts +10 -0
- package/types/uni/uts-plugin-component/lib/uni-sse/utssdk/interface.d.ts +330 -0
- package/types/uni/uts-plugin-component/lib/uni-storage/utssdk/global.d.ts +79 -0
- package/types/uni/uts-plugin-component/lib/uni-storage/utssdk/index.d.ts +39 -0
- package/types/uni/uts-plugin-component/lib/uni-storage/utssdk/interface.d.ts +1030 -0
- package/types/uni/uts-plugin-component/lib/uni-tabBar/utssdk/global.d.ts +149 -0
- package/types/uni/uts-plugin-component/lib/uni-tabBar/utssdk/index.d.ts +74 -0
- package/types/uni/uts-plugin-component/lib/uni-tabBar/utssdk/interface.d.ts +1221 -0
- package/types/uni/uts-plugin-component/lib/uni-theme/utssdk/global.d.ts +53 -0
- package/types/uni/uts-plugin-component/lib/uni-theme/utssdk/index.d.ts +26 -0
- package/types/uni/uts-plugin-component/lib/uni-theme/utssdk/interface.d.ts +1141 -0
- package/types/uni/uts-plugin-component/lib/uni-video/utssdk/global.d.ts +0 -22
- package/types/uni/uts-plugin-component/lib/uni-video/utssdk/index.d.ts +0 -11
- package/types/uni/uts-plugin-component/lib/uni-video/utssdk/interface.d.ts +862 -872
- package/types/uni/uts-plugin-component/lib/uni-video-global/utssdk/global.d.ts +4 -14
- package/types/uni/uts-plugin-component/lib/uni-video-global/utssdk/index.d.ts +2 -7
- package/types/uni/uts-plugin-component/lib/uni-video-global/utssdk/interface.d.ts +14 -51
- package/types/uni/uts-plugin-component/lib/uni-virtualPayment/utssdk/global.d.ts +113 -0
- package/types/uni/uts-plugin-component/lib/uni-virtualPayment/utssdk/index.d.ts +56 -0
- package/types/uni/uts-plugin-component/lib/uni-virtualPayment/utssdk/interface.d.ts +1661 -0
- package/types/uni/uts-plugin-component/lib/uni-web-view/utssdk/interface.d.ts +17 -17
- package/types/uni/uts-plugin-component/lib/uni-websocket/utssdk/global.d.ts +59 -0
- package/types/uni/uts-plugin-component/lib/uni-websocket/utssdk/index.d.ts +29 -0
- package/types/uni/uts-plugin-component/lib/uni-websocket/utssdk/interface.d.ts +1939 -0
- package/types/vue/LifeCycle.d.ts +865 -854
|
@@ -1,9 +1,9 @@
|
|
|
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
|
|
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
7
|
* @uniPlatform {
|
|
8
8
|
* "app": {
|
|
9
9
|
* "android": {
|
|
@@ -23,7 +23,7 @@ export interface Uni {
|
|
|
23
23
|
* "osVer": "3.0",
|
|
24
24
|
* "uniVer": "4.23",
|
|
25
25
|
* "unixVer": "4.61",
|
|
26
|
-
* "
|
|
26
|
+
* "unixVaporVer": "5.0"
|
|
27
27
|
* }
|
|
28
28
|
* },
|
|
29
29
|
* "mp": {
|
|
@@ -72,27 +72,27 @@ export interface Uni {
|
|
|
72
72
|
* "uniVer": "√",
|
|
73
73
|
* "unixVer": "4.0"
|
|
74
74
|
* }
|
|
75
|
-
* }
|
|
76
|
-
* @example
|
|
77
|
-
```typescript
|
|
78
|
-
uni.connectSocket({
|
|
79
|
-
url: "ws://192.168.12.106:8080/ws",
|
|
80
|
-
complete: (e) => {
|
|
81
|
-
console.log("socket :", e);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
75
|
+
* }
|
|
76
|
+
* @example
|
|
77
|
+
```typescript
|
|
78
|
+
uni.connectSocket({
|
|
79
|
+
url: "ws://192.168.12.106:8080/ws",
|
|
80
|
+
complete: (e) => {
|
|
81
|
+
console.log("socket :", e);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
84
|
```
|
|
85
85
|
* @tutorial_weixin https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.html
|
|
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
|
|
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
96
|
* @uniPlatform {
|
|
97
97
|
* "app": {
|
|
98
98
|
* "android": {
|
|
@@ -112,7 +112,7 @@ export interface Uni {
|
|
|
112
112
|
* "osVer": "3.0",
|
|
113
113
|
* "uniVer": "4.23",
|
|
114
114
|
* "unixVer": "4.61",
|
|
115
|
-
* "
|
|
115
|
+
* "unixVaporVer": "5.0"
|
|
116
116
|
* }
|
|
117
117
|
* },
|
|
118
118
|
* "mp": {
|
|
@@ -161,23 +161,23 @@ export interface Uni {
|
|
|
161
161
|
* "uniVer": "√",
|
|
162
162
|
* "unixVer": "4.0"
|
|
163
163
|
* }
|
|
164
|
-
* }
|
|
165
|
-
* @example
|
|
166
|
-
```typescript
|
|
167
|
-
uni.onSocketOpen(function (res) {
|
|
168
|
-
console.log('WebSocket连接已打开!');
|
|
169
|
-
});
|
|
164
|
+
* }
|
|
165
|
+
* @example
|
|
166
|
+
```typescript
|
|
167
|
+
uni.onSocketOpen(function (res) {
|
|
168
|
+
console.log('WebSocket连接已打开!');
|
|
169
|
+
});
|
|
170
170
|
```
|
|
171
171
|
* @tutorial_weixin https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/wx.onSocketOpen.html
|
|
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
|
|
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
181
|
* @uniPlatform {
|
|
182
182
|
* "app": {
|
|
183
183
|
* "android": {
|
|
@@ -197,7 +197,7 @@ export interface Uni {
|
|
|
197
197
|
* "osVer": "3.0",
|
|
198
198
|
* "uniVer": "4.23",
|
|
199
199
|
* "unixVer": "4.61",
|
|
200
|
-
* "
|
|
200
|
+
* "unixVaporVer": "5.0"
|
|
201
201
|
* }
|
|
202
202
|
* },
|
|
203
203
|
* "mp": {
|
|
@@ -246,23 +246,23 @@ export interface Uni {
|
|
|
246
246
|
* "uniVer": "√",
|
|
247
247
|
* "unixVer": "4.0"
|
|
248
248
|
* }
|
|
249
|
-
* }
|
|
250
|
-
* @example
|
|
251
|
-
```typescript
|
|
252
|
-
uni.onSocketError(function (res) {
|
|
253
|
-
console.log('WebSocket连接打开失败,请检查!');
|
|
254
|
-
});
|
|
249
|
+
* }
|
|
250
|
+
* @example
|
|
251
|
+
```typescript
|
|
252
|
+
uni.onSocketError(function (res) {
|
|
253
|
+
console.log('WebSocket连接打开失败,请检查!');
|
|
254
|
+
});
|
|
255
255
|
```
|
|
256
256
|
* @tutorial_weixin https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/wx.onSocketError.html
|
|
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
|
|
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
266
|
* @uniPlatform {
|
|
267
267
|
* "app": {
|
|
268
268
|
* "android": {
|
|
@@ -282,7 +282,7 @@ export interface Uni {
|
|
|
282
282
|
* "osVer": "3.0",
|
|
283
283
|
* "uniVer": "4.23",
|
|
284
284
|
* "unixVer": "4.61",
|
|
285
|
-
* "
|
|
285
|
+
* "unixVaporVer": "5.0"
|
|
286
286
|
* }
|
|
287
287
|
* },
|
|
288
288
|
* "mp": {
|
|
@@ -331,23 +331,23 @@ export interface Uni {
|
|
|
331
331
|
* "uniVer": "√",
|
|
332
332
|
* "unixVer": "4.0"
|
|
333
333
|
* }
|
|
334
|
-
* }
|
|
335
|
-
* @example
|
|
336
|
-
```typescript
|
|
337
|
-
uni.sendSocketMessage({
|
|
338
|
-
data: msg
|
|
339
|
-
});
|
|
334
|
+
* }
|
|
335
|
+
* @example
|
|
336
|
+
```typescript
|
|
337
|
+
uni.sendSocketMessage({
|
|
338
|
+
data: msg
|
|
339
|
+
});
|
|
340
340
|
```
|
|
341
341
|
* @tutorial_weixin https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/wx.sendSocketMessage.html
|
|
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
|
|
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
351
|
* @uniPlatform {
|
|
352
352
|
* "app": {
|
|
353
353
|
* "android": {
|
|
@@ -367,7 +367,7 @@ export interface Uni {
|
|
|
367
367
|
* "osVer": "3.0",
|
|
368
368
|
* "uniVer": "4.23",
|
|
369
369
|
* "unixVer": "4.61",
|
|
370
|
-
* "
|
|
370
|
+
* "unixVaporVer": "5.0"
|
|
371
371
|
* }
|
|
372
372
|
* },
|
|
373
373
|
* "mp": {
|
|
@@ -416,23 +416,23 @@ export interface Uni {
|
|
|
416
416
|
* "uniVer": "√",
|
|
417
417
|
* "unixVer": "4.0"
|
|
418
418
|
* }
|
|
419
|
-
* }
|
|
420
|
-
* @example
|
|
421
|
-
```typescript
|
|
422
|
-
uni.onSocketMessage(function (res) {
|
|
423
|
-
console.log('收到服务器内容:' + res.data);
|
|
424
|
-
});
|
|
419
|
+
* }
|
|
420
|
+
* @example
|
|
421
|
+
```typescript
|
|
422
|
+
uni.onSocketMessage(function (res) {
|
|
423
|
+
console.log('收到服务器内容:' + res.data);
|
|
424
|
+
});
|
|
425
425
|
```
|
|
426
426
|
* @tutorial_weixin https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/wx.onSocketMessage.html
|
|
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
|
|
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
436
|
* @uniPlatform {
|
|
437
437
|
* "app": {
|
|
438
438
|
* "android": {
|
|
@@ -452,7 +452,7 @@ export interface Uni {
|
|
|
452
452
|
* "osVer": "3.0",
|
|
453
453
|
* "uniVer": "4.23",
|
|
454
454
|
* "unixVer": "4.61",
|
|
455
|
-
* "
|
|
455
|
+
* "unixVaporVer": "5.0"
|
|
456
456
|
* }
|
|
457
457
|
* },
|
|
458
458
|
* "mp": {
|
|
@@ -501,21 +501,21 @@ export interface Uni {
|
|
|
501
501
|
* "uniVer": "√",
|
|
502
502
|
* "unixVer": "4.0"
|
|
503
503
|
* }
|
|
504
|
-
* }
|
|
505
|
-
* @example
|
|
506
|
-
```typescript
|
|
507
|
-
uni.closeSocket();
|
|
504
|
+
* }
|
|
505
|
+
* @example
|
|
506
|
+
```typescript
|
|
507
|
+
uni.closeSocket();
|
|
508
508
|
```
|
|
509
509
|
* @tutorial_weixin https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/wx.closeSocket.html
|
|
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
|
|
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
519
|
* @uniPlatform {
|
|
520
520
|
* "app": {
|
|
521
521
|
* "android": {
|
|
@@ -535,7 +535,7 @@ export interface Uni {
|
|
|
535
535
|
* "osVer": "3.0",
|
|
536
536
|
* "uniVer": "4.23",
|
|
537
537
|
* "unixVer": "4.61",
|
|
538
|
-
* "
|
|
538
|
+
* "unixVaporVer": "5.0"
|
|
539
539
|
* }
|
|
540
540
|
* },
|
|
541
541
|
* "mp": {
|
|
@@ -584,30 +584,30 @@ export interface Uni {
|
|
|
584
584
|
* "uniVer": "√",
|
|
585
585
|
* "unixVer": "4.0"
|
|
586
586
|
* }
|
|
587
|
-
* }
|
|
588
|
-
* @example
|
|
589
|
-
```typescript
|
|
590
|
-
uni.onSocketClose(function (res) {
|
|
591
|
-
console.log('WebSocket 已关闭!');
|
|
592
|
-
});
|
|
587
|
+
* }
|
|
588
|
+
* @example
|
|
589
|
+
```typescript
|
|
590
|
+
uni.onSocketClose(function (res) {
|
|
591
|
+
console.log('WebSocket 已关闭!');
|
|
592
|
+
});
|
|
593
593
|
```
|
|
594
594
|
* @tutorial_weixin https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/wx.onSocketClose.html
|
|
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
|
-
/**
|
|
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
611
|
* 连接调用失败的错误回调参数
|
|
612
612
|
* @uniPlatform {
|
|
613
613
|
* "mp": {
|
|
@@ -653,220 +653,220 @@ export type ConnectSocketErrorCode = 600009;
|
|
|
653
653
|
* }
|
|
654
654
|
* }
|
|
655
655
|
* }
|
|
656
|
-
*/
|
|
657
|
-
export interface ConnectSocketFail extends IUniError {
|
|
658
|
-
errCode: ConnectSocketErrorCode;
|
|
659
|
-
};
|
|
660
|
-
|
|
661
|
-
type ConnectSocketFailCallback = (result: ConnectSocketFail) => void;
|
|
662
|
-
type ConnectSocketComplete = any;
|
|
663
|
-
type ConnectSocketCompleteCallback = (result: ConnectSocketComplete) => void;
|
|
664
|
-
export type ConnectSocketOptions = {
|
|
665
|
-
/**
|
|
666
|
-
* 开发者服务器接口地址
|
|
667
|
-
* @uniPlatform
|
|
668
|
-
{
|
|
669
|
-
"app": {
|
|
670
|
-
"android": {
|
|
671
|
-
"osVer": "4.4",
|
|
672
|
-
"uniVer": "√",
|
|
673
|
-
"uniUtsPlugin": "3.91",
|
|
674
|
-
"unixVer": "3.91"
|
|
675
|
-
},
|
|
676
|
-
"ios": {
|
|
677
|
-
"osVer": "12.0",
|
|
678
|
-
"uniVer": "√",
|
|
679
|
-
"uniUtsPlugin": "4.11",
|
|
680
|
-
"unixVer": "4.11",
|
|
681
|
-
"unixUtsPlugin": "4.11"
|
|
682
|
-
},
|
|
683
|
-
"harmony": {
|
|
684
|
-
"osVer": "3.0",
|
|
685
|
-
"uniVer": "4.23",
|
|
686
|
-
"unixVer": "4.61",
|
|
687
|
-
"
|
|
688
|
-
}
|
|
689
|
-
},
|
|
690
|
-
"mp": {
|
|
691
|
-
"weixin": {
|
|
692
|
-
"hostVer": "√",
|
|
693
|
-
"uniVer": "√",
|
|
694
|
-
"unixVer": "4.41"
|
|
695
|
-
},
|
|
696
|
-
"alipay": {
|
|
697
|
-
"hostVer": "√",
|
|
698
|
-
"uniVer": "√",
|
|
699
|
-
"unixVer": "x"
|
|
700
|
-
},
|
|
701
|
-
"baidu": {
|
|
702
|
-
"hostVer": "√",
|
|
703
|
-
"uniVer": "√",
|
|
704
|
-
"unixVer": "x"
|
|
705
|
-
},
|
|
706
|
-
"toutiao": {
|
|
707
|
-
"hostVer": "√",
|
|
708
|
-
"uniVer": "√",
|
|
709
|
-
"unixVer": "x"
|
|
710
|
-
},
|
|
711
|
-
"lark": {
|
|
712
|
-
"hostVer": "√",
|
|
713
|
-
"uniVer": "√",
|
|
714
|
-
"unixVer": "x"
|
|
715
|
-
},
|
|
716
|
-
"qq": {
|
|
717
|
-
"hostVer": "√",
|
|
718
|
-
"uniVer": "√",
|
|
719
|
-
"unixVer": "x"
|
|
720
|
-
},
|
|
721
|
-
"kuaishou": {
|
|
722
|
-
"hostVer": "√",
|
|
723
|
-
"uniVer": "√",
|
|
724
|
-
"unixVer": "x"
|
|
725
|
-
},
|
|
726
|
-
"jd": {
|
|
727
|
-
"hostVer": "√",
|
|
728
|
-
"uniVer": "√",
|
|
729
|
-
"unixVer": "x"
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
*/
|
|
734
|
-
url: string,
|
|
735
|
-
|
|
736
|
-
/**
|
|
737
|
-
* HTTP 请求 Header,header 中不能设置 Referer
|
|
738
|
-
* @defaultValue null
|
|
739
|
-
* @uniPlatform
|
|
740
|
-
{
|
|
741
|
-
"app": {
|
|
742
|
-
"android": {
|
|
743
|
-
"osVer": "4.4",
|
|
744
|
-
"uniVer": "√",
|
|
745
|
-
"uniUtsPlugin": "3.91",
|
|
746
|
-
"unixVer": "3.91"
|
|
747
|
-
},
|
|
748
|
-
"ios": {
|
|
749
|
-
"osVer": "12.0",
|
|
750
|
-
"uniVer": "√",
|
|
751
|
-
"uniUtsPlugin": "4.11",
|
|
752
|
-
"unixVer": "4.11",
|
|
753
|
-
"unixUtsPlugin": "4.11"
|
|
754
|
-
}
|
|
755
|
-
},
|
|
756
|
-
"mp": {
|
|
757
|
-
"weixin": {
|
|
758
|
-
"hostVer": "√",
|
|
759
|
-
"uniVer": "√",
|
|
760
|
-
"unixVer": "4.41"
|
|
761
|
-
},
|
|
762
|
-
"alipay": {
|
|
763
|
-
"hostVer": "√",
|
|
764
|
-
"uniVer": "√",
|
|
765
|
-
"unixVer": "x"
|
|
766
|
-
},
|
|
767
|
-
"baidu": {
|
|
768
|
-
"hostVer": "√",
|
|
769
|
-
"uniVer": "√",
|
|
770
|
-
"unixVer": "x"
|
|
771
|
-
},
|
|
772
|
-
"toutiao": {
|
|
773
|
-
"hostVer": "√",
|
|
774
|
-
"uniVer": "√",
|
|
775
|
-
"unixVer": "x"
|
|
776
|
-
},
|
|
777
|
-
"lark": {
|
|
778
|
-
"hostVer": "√",
|
|
779
|
-
"uniVer": "√",
|
|
780
|
-
"unixVer": "x"
|
|
781
|
-
},
|
|
782
|
-
"qq": {
|
|
783
|
-
"hostVer": "√",
|
|
784
|
-
"uniVer": "√",
|
|
785
|
-
"unixVer": "x"
|
|
786
|
-
},
|
|
787
|
-
"kuaishou": {
|
|
788
|
-
"hostVer": "√",
|
|
789
|
-
"uniVer": "√",
|
|
790
|
-
"unixVer": "x"
|
|
791
|
-
},
|
|
792
|
-
"jd": {
|
|
793
|
-
"hostVer": "√",
|
|
794
|
-
"uniVer": "√",
|
|
795
|
-
"unixVer": "x"
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
*/
|
|
800
|
-
header?: UTSJSONObject | null,
|
|
801
|
-
|
|
802
|
-
/**
|
|
803
|
-
* 子协议数组
|
|
804
|
-
* @defaultValue null
|
|
805
|
-
* @uniPlatform
|
|
806
|
-
{
|
|
807
|
-
"app": {
|
|
808
|
-
"android": {
|
|
809
|
-
"osVer": "4.4",
|
|
810
|
-
"uniVer": "√",
|
|
811
|
-
"uniUtsPlugin": "3.91",
|
|
812
|
-
"unixVer": "3.91"
|
|
813
|
-
},
|
|
814
|
-
"ios": {
|
|
815
|
-
"osVer": "12.0",
|
|
816
|
-
"uniVer": "√",
|
|
817
|
-
"uniUtsPlugin": "4.11",
|
|
818
|
-
"unixVer": "4.11",
|
|
819
|
-
"unixUtsPlugin": "4.11"
|
|
820
|
-
}
|
|
821
|
-
},
|
|
822
|
-
"mp": {
|
|
823
|
-
"weixin": {
|
|
824
|
-
"hostVer": "√",
|
|
825
|
-
"uniVer": "√",
|
|
826
|
-
"unixVer": "4.41"
|
|
827
|
-
},
|
|
828
|
-
"alipay": {
|
|
829
|
-
"hostVer": "√",
|
|
830
|
-
"uniVer": "√",
|
|
831
|
-
"unixVer": "x"
|
|
832
|
-
},
|
|
833
|
-
"baidu": {
|
|
834
|
-
"hostVer": "√",
|
|
835
|
-
"uniVer": "√",
|
|
836
|
-
"unixVer": "x"
|
|
837
|
-
},
|
|
838
|
-
"toutiao": {
|
|
839
|
-
"hostVer": "√",
|
|
840
|
-
"uniVer": "√",
|
|
841
|
-
"unixVer": "x"
|
|
842
|
-
},
|
|
843
|
-
"lark": {
|
|
844
|
-
"hostVer": "√",
|
|
845
|
-
"uniVer": "√",
|
|
846
|
-
"unixVer": "x"
|
|
847
|
-
},
|
|
848
|
-
"qq": {
|
|
849
|
-
"hostVer": "√",
|
|
850
|
-
"uniVer": "√",
|
|
851
|
-
"unixVer": "x"
|
|
852
|
-
},
|
|
853
|
-
"kuaishou": {
|
|
854
|
-
"hostVer": "√",
|
|
855
|
-
"uniVer": "√",
|
|
856
|
-
"unixVer": "x"
|
|
857
|
-
},
|
|
858
|
-
"jd": {
|
|
859
|
-
"hostVer": "√",
|
|
860
|
-
"uniVer": "√",
|
|
861
|
-
"unixVer": "x"
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
*/
|
|
866
|
-
protocols?: (string[]) | null,
|
|
867
|
-
|
|
868
|
-
/**
|
|
869
|
-
* 接口调用成功的回调函数
|
|
656
|
+
*/
|
|
657
|
+
export interface ConnectSocketFail extends IUniError {
|
|
658
|
+
errCode: ConnectSocketErrorCode;
|
|
659
|
+
};
|
|
660
|
+
|
|
661
|
+
type ConnectSocketFailCallback = (result: ConnectSocketFail) => void;
|
|
662
|
+
type ConnectSocketComplete = any;
|
|
663
|
+
type ConnectSocketCompleteCallback = (result: ConnectSocketComplete) => void;
|
|
664
|
+
export type ConnectSocketOptions = {
|
|
665
|
+
/**
|
|
666
|
+
* 开发者服务器接口地址
|
|
667
|
+
* @uniPlatform
|
|
668
|
+
{
|
|
669
|
+
"app": {
|
|
670
|
+
"android": {
|
|
671
|
+
"osVer": "4.4",
|
|
672
|
+
"uniVer": "√",
|
|
673
|
+
"uniUtsPlugin": "3.91",
|
|
674
|
+
"unixVer": "3.91"
|
|
675
|
+
},
|
|
676
|
+
"ios": {
|
|
677
|
+
"osVer": "12.0",
|
|
678
|
+
"uniVer": "√",
|
|
679
|
+
"uniUtsPlugin": "4.11",
|
|
680
|
+
"unixVer": "4.11",
|
|
681
|
+
"unixUtsPlugin": "4.11"
|
|
682
|
+
},
|
|
683
|
+
"harmony": {
|
|
684
|
+
"osVer": "3.0",
|
|
685
|
+
"uniVer": "4.23",
|
|
686
|
+
"unixVer": "4.61",
|
|
687
|
+
"unixVaporVer": "5.0"
|
|
688
|
+
}
|
|
689
|
+
},
|
|
690
|
+
"mp": {
|
|
691
|
+
"weixin": {
|
|
692
|
+
"hostVer": "√",
|
|
693
|
+
"uniVer": "√",
|
|
694
|
+
"unixVer": "4.41"
|
|
695
|
+
},
|
|
696
|
+
"alipay": {
|
|
697
|
+
"hostVer": "√",
|
|
698
|
+
"uniVer": "√",
|
|
699
|
+
"unixVer": "x"
|
|
700
|
+
},
|
|
701
|
+
"baidu": {
|
|
702
|
+
"hostVer": "√",
|
|
703
|
+
"uniVer": "√",
|
|
704
|
+
"unixVer": "x"
|
|
705
|
+
},
|
|
706
|
+
"toutiao": {
|
|
707
|
+
"hostVer": "√",
|
|
708
|
+
"uniVer": "√",
|
|
709
|
+
"unixVer": "x"
|
|
710
|
+
},
|
|
711
|
+
"lark": {
|
|
712
|
+
"hostVer": "√",
|
|
713
|
+
"uniVer": "√",
|
|
714
|
+
"unixVer": "x"
|
|
715
|
+
},
|
|
716
|
+
"qq": {
|
|
717
|
+
"hostVer": "√",
|
|
718
|
+
"uniVer": "√",
|
|
719
|
+
"unixVer": "x"
|
|
720
|
+
},
|
|
721
|
+
"kuaishou": {
|
|
722
|
+
"hostVer": "√",
|
|
723
|
+
"uniVer": "√",
|
|
724
|
+
"unixVer": "x"
|
|
725
|
+
},
|
|
726
|
+
"jd": {
|
|
727
|
+
"hostVer": "√",
|
|
728
|
+
"uniVer": "√",
|
|
729
|
+
"unixVer": "x"
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
*/
|
|
734
|
+
url: string,
|
|
735
|
+
|
|
736
|
+
/**
|
|
737
|
+
* HTTP 请求 Header,header 中不能设置 Referer
|
|
738
|
+
* @defaultValue null
|
|
739
|
+
* @uniPlatform
|
|
740
|
+
{
|
|
741
|
+
"app": {
|
|
742
|
+
"android": {
|
|
743
|
+
"osVer": "4.4",
|
|
744
|
+
"uniVer": "√",
|
|
745
|
+
"uniUtsPlugin": "3.91",
|
|
746
|
+
"unixVer": "3.91"
|
|
747
|
+
},
|
|
748
|
+
"ios": {
|
|
749
|
+
"osVer": "12.0",
|
|
750
|
+
"uniVer": "√",
|
|
751
|
+
"uniUtsPlugin": "4.11",
|
|
752
|
+
"unixVer": "4.11",
|
|
753
|
+
"unixUtsPlugin": "4.11"
|
|
754
|
+
}
|
|
755
|
+
},
|
|
756
|
+
"mp": {
|
|
757
|
+
"weixin": {
|
|
758
|
+
"hostVer": "√",
|
|
759
|
+
"uniVer": "√",
|
|
760
|
+
"unixVer": "4.41"
|
|
761
|
+
},
|
|
762
|
+
"alipay": {
|
|
763
|
+
"hostVer": "√",
|
|
764
|
+
"uniVer": "√",
|
|
765
|
+
"unixVer": "x"
|
|
766
|
+
},
|
|
767
|
+
"baidu": {
|
|
768
|
+
"hostVer": "√",
|
|
769
|
+
"uniVer": "√",
|
|
770
|
+
"unixVer": "x"
|
|
771
|
+
},
|
|
772
|
+
"toutiao": {
|
|
773
|
+
"hostVer": "√",
|
|
774
|
+
"uniVer": "√",
|
|
775
|
+
"unixVer": "x"
|
|
776
|
+
},
|
|
777
|
+
"lark": {
|
|
778
|
+
"hostVer": "√",
|
|
779
|
+
"uniVer": "√",
|
|
780
|
+
"unixVer": "x"
|
|
781
|
+
},
|
|
782
|
+
"qq": {
|
|
783
|
+
"hostVer": "√",
|
|
784
|
+
"uniVer": "√",
|
|
785
|
+
"unixVer": "x"
|
|
786
|
+
},
|
|
787
|
+
"kuaishou": {
|
|
788
|
+
"hostVer": "√",
|
|
789
|
+
"uniVer": "√",
|
|
790
|
+
"unixVer": "x"
|
|
791
|
+
},
|
|
792
|
+
"jd": {
|
|
793
|
+
"hostVer": "√",
|
|
794
|
+
"uniVer": "√",
|
|
795
|
+
"unixVer": "x"
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
*/
|
|
800
|
+
header?: UTSJSONObject | null,
|
|
801
|
+
|
|
802
|
+
/**
|
|
803
|
+
* 子协议数组
|
|
804
|
+
* @defaultValue null
|
|
805
|
+
* @uniPlatform
|
|
806
|
+
{
|
|
807
|
+
"app": {
|
|
808
|
+
"android": {
|
|
809
|
+
"osVer": "4.4",
|
|
810
|
+
"uniVer": "√",
|
|
811
|
+
"uniUtsPlugin": "3.91",
|
|
812
|
+
"unixVer": "3.91"
|
|
813
|
+
},
|
|
814
|
+
"ios": {
|
|
815
|
+
"osVer": "12.0",
|
|
816
|
+
"uniVer": "√",
|
|
817
|
+
"uniUtsPlugin": "4.11",
|
|
818
|
+
"unixVer": "4.11",
|
|
819
|
+
"unixUtsPlugin": "4.11"
|
|
820
|
+
}
|
|
821
|
+
},
|
|
822
|
+
"mp": {
|
|
823
|
+
"weixin": {
|
|
824
|
+
"hostVer": "√",
|
|
825
|
+
"uniVer": "√",
|
|
826
|
+
"unixVer": "4.41"
|
|
827
|
+
},
|
|
828
|
+
"alipay": {
|
|
829
|
+
"hostVer": "√",
|
|
830
|
+
"uniVer": "√",
|
|
831
|
+
"unixVer": "x"
|
|
832
|
+
},
|
|
833
|
+
"baidu": {
|
|
834
|
+
"hostVer": "√",
|
|
835
|
+
"uniVer": "√",
|
|
836
|
+
"unixVer": "x"
|
|
837
|
+
},
|
|
838
|
+
"toutiao": {
|
|
839
|
+
"hostVer": "√",
|
|
840
|
+
"uniVer": "√",
|
|
841
|
+
"unixVer": "x"
|
|
842
|
+
},
|
|
843
|
+
"lark": {
|
|
844
|
+
"hostVer": "√",
|
|
845
|
+
"uniVer": "√",
|
|
846
|
+
"unixVer": "x"
|
|
847
|
+
},
|
|
848
|
+
"qq": {
|
|
849
|
+
"hostVer": "√",
|
|
850
|
+
"uniVer": "√",
|
|
851
|
+
"unixVer": "x"
|
|
852
|
+
},
|
|
853
|
+
"kuaishou": {
|
|
854
|
+
"hostVer": "√",
|
|
855
|
+
"uniVer": "√",
|
|
856
|
+
"unixVer": "x"
|
|
857
|
+
},
|
|
858
|
+
"jd": {
|
|
859
|
+
"hostVer": "√",
|
|
860
|
+
"uniVer": "√",
|
|
861
|
+
"unixVer": "x"
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
*/
|
|
866
|
+
protocols?: (string[]) | null,
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* 接口调用成功的回调函数
|
|
870
870
|
* @defaultValue null
|
|
871
871
|
* @uniPlatform {
|
|
872
872
|
* "mp": {
|
|
@@ -912,11 +912,11 @@ export type ConnectSocketOptions = {
|
|
|
912
912
|
* }
|
|
913
913
|
* }
|
|
914
914
|
* }
|
|
915
|
-
*/
|
|
916
|
-
success?: ConnectSocketSuccessCallback | null,
|
|
917
|
-
|
|
918
|
-
/**
|
|
919
|
-
* 接口调用失败的回调函数
|
|
915
|
+
*/
|
|
916
|
+
success?: ConnectSocketSuccessCallback | null,
|
|
917
|
+
|
|
918
|
+
/**
|
|
919
|
+
* 接口调用失败的回调函数
|
|
920
920
|
* @defaultValue null
|
|
921
921
|
* @uniPlatform {
|
|
922
922
|
* "mp": {
|
|
@@ -962,11 +962,11 @@ export type ConnectSocketOptions = {
|
|
|
962
962
|
* }
|
|
963
963
|
* }
|
|
964
964
|
* }
|
|
965
|
-
*/
|
|
966
|
-
fail?: ConnectSocketFailCallback | null,
|
|
967
|
-
|
|
968
|
-
/**
|
|
969
|
-
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
|
965
|
+
*/
|
|
966
|
+
fail?: ConnectSocketFailCallback | null,
|
|
967
|
+
|
|
968
|
+
/**
|
|
969
|
+
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
|
970
970
|
* @defaultValue null
|
|
971
971
|
* @uniPlatform {
|
|
972
972
|
* "mp": {
|
|
@@ -1012,7 +1012,7 @@ export type ConnectSocketOptions = {
|
|
|
1012
1012
|
* }
|
|
1013
1013
|
* }
|
|
1014
1014
|
* }
|
|
1015
|
-
*/
|
|
1015
|
+
*/
|
|
1016
1016
|
complete?: ConnectSocketCompleteCallback | null
|
|
1017
1017
|
/**
|
|
1018
1018
|
* 需要基础库: `2.29.0`
|
|
@@ -1218,10 +1218,10 @@ export type ConnectSocketOptions = {
|
|
|
1218
1218
|
* }
|
|
1219
1219
|
*/
|
|
1220
1220
|
timeout?: number | null;
|
|
1221
|
-
};
|
|
1222
|
-
|
|
1223
|
-
export type GeneralCallbackResult = {
|
|
1224
|
-
/**
|
|
1221
|
+
};
|
|
1222
|
+
|
|
1223
|
+
export type GeneralCallbackResult = {
|
|
1224
|
+
/**
|
|
1225
1225
|
* 错误信息
|
|
1226
1226
|
* @uniPlatform {
|
|
1227
1227
|
* "mp": {
|
|
@@ -1267,28 +1267,28 @@ export type GeneralCallbackResult = {
|
|
|
1267
1267
|
* }
|
|
1268
1268
|
* }
|
|
1269
1269
|
* }
|
|
1270
|
-
*/
|
|
1271
|
-
errMsg: string
|
|
1272
|
-
};
|
|
1273
|
-
|
|
1274
|
-
/**
|
|
1275
|
-
* 错误码
|
|
1276
|
-
*/
|
|
1277
|
-
export type SendSocketMessageErrorCode =
|
|
1278
|
-
/**
|
|
1279
|
-
* 发送数据超限,发送队列不能超过16M大小。
|
|
1280
|
-
*/
|
|
1281
|
-
10001 |
|
|
1282
|
-
/**
|
|
1283
|
-
* websocket未连接
|
|
1284
|
-
*/
|
|
1285
|
-
10002 |
|
|
1286
|
-
/**
|
|
1287
|
-
* websocket系统错误
|
|
1288
|
-
*/
|
|
1289
|
-
602001;
|
|
1290
|
-
|
|
1291
|
-
/**
|
|
1270
|
+
*/
|
|
1271
|
+
errMsg: string
|
|
1272
|
+
};
|
|
1273
|
+
|
|
1274
|
+
/**
|
|
1275
|
+
* 错误码
|
|
1276
|
+
*/
|
|
1277
|
+
export type SendSocketMessageErrorCode =
|
|
1278
|
+
/**
|
|
1279
|
+
* 发送数据超限,发送队列不能超过16M大小。
|
|
1280
|
+
*/
|
|
1281
|
+
10001 |
|
|
1282
|
+
/**
|
|
1283
|
+
* websocket未连接
|
|
1284
|
+
*/
|
|
1285
|
+
10002 |
|
|
1286
|
+
/**
|
|
1287
|
+
* websocket系统错误
|
|
1288
|
+
*/
|
|
1289
|
+
602001;
|
|
1290
|
+
|
|
1291
|
+
/**
|
|
1292
1292
|
* 发送失败的错误回调参数
|
|
1293
1293
|
* @uniPlatform {
|
|
1294
1294
|
* "mp": {
|
|
@@ -1334,86 +1334,86 @@ export type SendSocketMessageErrorCode =
|
|
|
1334
1334
|
* }
|
|
1335
1335
|
* }
|
|
1336
1336
|
* }
|
|
1337
|
-
*/
|
|
1338
|
-
export interface SendSocketMessageFail extends IUniError {
|
|
1339
|
-
errCode: SendSocketMessageErrorCode;
|
|
1340
|
-
};
|
|
1341
|
-
export type SendSocketMessageOptions = {
|
|
1342
|
-
/**
|
|
1343
|
-
* 需要发送的内容, app平台从 4.61 版本开始支持ArrayBuffer
|
|
1344
|
-
* @type string | ArrayBuffer
|
|
1345
|
-
* @type {SocketDataOptions}
|
|
1346
|
-
* @uniPlatform
|
|
1347
|
-
{
|
|
1348
|
-
"app": {
|
|
1349
|
-
"android": {
|
|
1350
|
-
"osVer": "4.4",
|
|
1351
|
-
"uniVer": "√",
|
|
1352
|
-
"uniUtsPlugin": "3.91",
|
|
1353
|
-
"unixVer": "3.91"
|
|
1354
|
-
},
|
|
1355
|
-
"ios": {
|
|
1356
|
-
"osVer": "12.0",
|
|
1357
|
-
"uniVer": "√",
|
|
1358
|
-
"uniUtsPlugin": "4.11",
|
|
1359
|
-
"unixVer": "4.11",
|
|
1360
|
-
"unixUtsPlugin": "4.11"
|
|
1361
|
-
},
|
|
1362
|
-
"harmony": {
|
|
1363
|
-
"osVer": "3.0",
|
|
1364
|
-
"uniVer": "4.23",
|
|
1365
|
-
"unixVer": "4.61",
|
|
1366
|
-
"
|
|
1367
|
-
}
|
|
1368
|
-
},
|
|
1369
|
-
"mp": {
|
|
1370
|
-
"weixin": {
|
|
1371
|
-
"hostVer": "√",
|
|
1372
|
-
"uniVer": "√",
|
|
1373
|
-
"unixVer": "4.41"
|
|
1374
|
-
},
|
|
1375
|
-
"alipay": {
|
|
1376
|
-
"hostVer": "√",
|
|
1377
|
-
"uniVer": "√",
|
|
1378
|
-
"unixVer": "x"
|
|
1379
|
-
},
|
|
1380
|
-
"baidu": {
|
|
1381
|
-
"hostVer": "√",
|
|
1382
|
-
"uniVer": "√",
|
|
1383
|
-
"unixVer": "x"
|
|
1384
|
-
},
|
|
1385
|
-
"toutiao": {
|
|
1386
|
-
"hostVer": "√",
|
|
1387
|
-
"uniVer": "√",
|
|
1388
|
-
"unixVer": "x"
|
|
1389
|
-
},
|
|
1390
|
-
"lark": {
|
|
1391
|
-
"hostVer": "√",
|
|
1392
|
-
"uniVer": "√",
|
|
1393
|
-
"unixVer": "x"
|
|
1394
|
-
},
|
|
1395
|
-
"qq": {
|
|
1396
|
-
"hostVer": "√",
|
|
1397
|
-
"uniVer": "√",
|
|
1398
|
-
"unixVer": "x"
|
|
1399
|
-
},
|
|
1400
|
-
"kuaishou": {
|
|
1401
|
-
"hostVer": "√",
|
|
1402
|
-
"uniVer": "√",
|
|
1403
|
-
"unixVer": "x"
|
|
1404
|
-
},
|
|
1405
|
-
"jd": {
|
|
1406
|
-
"hostVer": "√",
|
|
1407
|
-
"uniVer": "√",
|
|
1408
|
-
"unixVer": "x"
|
|
1409
|
-
}
|
|
1410
|
-
}
|
|
1411
|
-
}
|
|
1412
|
-
*/
|
|
1413
|
-
data: any,
|
|
1414
|
-
|
|
1415
|
-
/**
|
|
1416
|
-
* 接口调用成功的回调函数
|
|
1337
|
+
*/
|
|
1338
|
+
export interface SendSocketMessageFail extends IUniError {
|
|
1339
|
+
errCode: SendSocketMessageErrorCode;
|
|
1340
|
+
};
|
|
1341
|
+
export type SendSocketMessageOptions = {
|
|
1342
|
+
/**
|
|
1343
|
+
* 需要发送的内容, app平台从 4.61 版本开始支持ArrayBuffer
|
|
1344
|
+
* @type string | ArrayBuffer
|
|
1345
|
+
* @type {SocketDataOptions}
|
|
1346
|
+
* @uniPlatform
|
|
1347
|
+
{
|
|
1348
|
+
"app": {
|
|
1349
|
+
"android": {
|
|
1350
|
+
"osVer": "4.4",
|
|
1351
|
+
"uniVer": "√",
|
|
1352
|
+
"uniUtsPlugin": "3.91",
|
|
1353
|
+
"unixVer": "3.91"
|
|
1354
|
+
},
|
|
1355
|
+
"ios": {
|
|
1356
|
+
"osVer": "12.0",
|
|
1357
|
+
"uniVer": "√",
|
|
1358
|
+
"uniUtsPlugin": "4.11",
|
|
1359
|
+
"unixVer": "4.11",
|
|
1360
|
+
"unixUtsPlugin": "4.11"
|
|
1361
|
+
},
|
|
1362
|
+
"harmony": {
|
|
1363
|
+
"osVer": "3.0",
|
|
1364
|
+
"uniVer": "4.23",
|
|
1365
|
+
"unixVer": "4.61",
|
|
1366
|
+
"unixVaporVer": "5.0"
|
|
1367
|
+
}
|
|
1368
|
+
},
|
|
1369
|
+
"mp": {
|
|
1370
|
+
"weixin": {
|
|
1371
|
+
"hostVer": "√",
|
|
1372
|
+
"uniVer": "√",
|
|
1373
|
+
"unixVer": "4.41"
|
|
1374
|
+
},
|
|
1375
|
+
"alipay": {
|
|
1376
|
+
"hostVer": "√",
|
|
1377
|
+
"uniVer": "√",
|
|
1378
|
+
"unixVer": "x"
|
|
1379
|
+
},
|
|
1380
|
+
"baidu": {
|
|
1381
|
+
"hostVer": "√",
|
|
1382
|
+
"uniVer": "√",
|
|
1383
|
+
"unixVer": "x"
|
|
1384
|
+
},
|
|
1385
|
+
"toutiao": {
|
|
1386
|
+
"hostVer": "√",
|
|
1387
|
+
"uniVer": "√",
|
|
1388
|
+
"unixVer": "x"
|
|
1389
|
+
},
|
|
1390
|
+
"lark": {
|
|
1391
|
+
"hostVer": "√",
|
|
1392
|
+
"uniVer": "√",
|
|
1393
|
+
"unixVer": "x"
|
|
1394
|
+
},
|
|
1395
|
+
"qq": {
|
|
1396
|
+
"hostVer": "√",
|
|
1397
|
+
"uniVer": "√",
|
|
1398
|
+
"unixVer": "x"
|
|
1399
|
+
},
|
|
1400
|
+
"kuaishou": {
|
|
1401
|
+
"hostVer": "√",
|
|
1402
|
+
"uniVer": "√",
|
|
1403
|
+
"unixVer": "x"
|
|
1404
|
+
},
|
|
1405
|
+
"jd": {
|
|
1406
|
+
"hostVer": "√",
|
|
1407
|
+
"uniVer": "√",
|
|
1408
|
+
"unixVer": "x"
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
*/
|
|
1413
|
+
data: any,
|
|
1414
|
+
|
|
1415
|
+
/**
|
|
1416
|
+
* 接口调用成功的回调函数
|
|
1417
1417
|
* @defaultValue null
|
|
1418
1418
|
* @uniPlatform {
|
|
1419
1419
|
* "mp": {
|
|
@@ -1459,11 +1459,11 @@ export type SendSocketMessageOptions = {
|
|
|
1459
1459
|
* }
|
|
1460
1460
|
* }
|
|
1461
1461
|
* }
|
|
1462
|
-
*/
|
|
1463
|
-
success?: ((result: GeneralCallbackResult) => void) | null,
|
|
1464
|
-
|
|
1465
|
-
/**
|
|
1466
|
-
* 接口调用失败的回调函数
|
|
1462
|
+
*/
|
|
1463
|
+
success?: ((result: GeneralCallbackResult) => void) | null,
|
|
1464
|
+
|
|
1465
|
+
/**
|
|
1466
|
+
* 接口调用失败的回调函数
|
|
1467
1467
|
* @defaultValue null
|
|
1468
1468
|
* @uniPlatform {
|
|
1469
1469
|
* "mp": {
|
|
@@ -1509,11 +1509,11 @@ export type SendSocketMessageOptions = {
|
|
|
1509
1509
|
* }
|
|
1510
1510
|
* }
|
|
1511
1511
|
* }
|
|
1512
|
-
*/
|
|
1513
|
-
fail?: ((result: SendSocketMessageFail) => void) | null,
|
|
1514
|
-
|
|
1515
|
-
/**
|
|
1516
|
-
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
|
1512
|
+
*/
|
|
1513
|
+
fail?: ((result: SendSocketMessageFail) => void) | null,
|
|
1514
|
+
|
|
1515
|
+
/**
|
|
1516
|
+
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
|
1517
1517
|
* @defaultValue null
|
|
1518
1518
|
* @uniPlatform {
|
|
1519
1519
|
* "mp": {
|
|
@@ -1559,157 +1559,157 @@ export type SendSocketMessageOptions = {
|
|
|
1559
1559
|
* }
|
|
1560
1560
|
* }
|
|
1561
1561
|
* }
|
|
1562
|
-
*/
|
|
1563
|
-
complete?: ((result: any) => void) | null
|
|
1564
|
-
};
|
|
1565
|
-
|
|
1566
|
-
export type CloseSocketOptions = {
|
|
1567
|
-
/**
|
|
1568
|
-
* 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。如果这个参数没有被指定,默认的取值是1000 (表示正常连接关闭)
|
|
1569
|
-
* @defaultValue 1000
|
|
1570
|
-
* @uniPlatform
|
|
1571
|
-
{
|
|
1572
|
-
"app": {
|
|
1573
|
-
"android": {
|
|
1574
|
-
"osVer": "4.4",
|
|
1575
|
-
"uniVer": "√",
|
|
1576
|
-
"uniUtsPlugin": "3.91",
|
|
1577
|
-
"unixVer": "3.91"
|
|
1578
|
-
},
|
|
1579
|
-
"ios": {
|
|
1580
|
-
"osVer": "12.0",
|
|
1581
|
-
"uniVer": "√",
|
|
1582
|
-
"uniUtsPlugin": "4.11",
|
|
1583
|
-
"unixVer": "4.11",
|
|
1584
|
-
"unixUtsPlugin": "4.11"
|
|
1585
|
-
},
|
|
1586
|
-
"harmony": {
|
|
1587
|
-
"osVer": "3.0",
|
|
1588
|
-
"uniVer": "4.23",
|
|
1589
|
-
"unixVer": "4.61",
|
|
1590
|
-
"
|
|
1591
|
-
}
|
|
1592
|
-
},
|
|
1593
|
-
"mp": {
|
|
1594
|
-
"weixin": {
|
|
1595
|
-
"hostVer": "√",
|
|
1596
|
-
"uniVer": "√",
|
|
1597
|
-
"unixVer": "4.41"
|
|
1598
|
-
},
|
|
1599
|
-
"alipay": {
|
|
1600
|
-
"hostVer": "√",
|
|
1601
|
-
"uniVer": "√",
|
|
1602
|
-
"unixVer": "x"
|
|
1603
|
-
},
|
|
1604
|
-
"baidu": {
|
|
1605
|
-
"hostVer": "√",
|
|
1606
|
-
"uniVer": "√",
|
|
1607
|
-
"unixVer": "x"
|
|
1608
|
-
},
|
|
1609
|
-
"toutiao": {
|
|
1610
|
-
"hostVer": "√",
|
|
1611
|
-
"uniVer": "√",
|
|
1612
|
-
"unixVer": "x"
|
|
1613
|
-
},
|
|
1614
|
-
"lark": {
|
|
1615
|
-
"hostVer": "√",
|
|
1616
|
-
"uniVer": "√",
|
|
1617
|
-
"unixVer": "x"
|
|
1618
|
-
},
|
|
1619
|
-
"qq": {
|
|
1620
|
-
"hostVer": "√",
|
|
1621
|
-
"uniVer": "√",
|
|
1622
|
-
"unixVer": "x"
|
|
1623
|
-
},
|
|
1624
|
-
"kuaishou": {
|
|
1625
|
-
"hostVer": "√",
|
|
1626
|
-
"uniVer": "√",
|
|
1627
|
-
"unixVer": "x"
|
|
1628
|
-
},
|
|
1629
|
-
"jd": {
|
|
1630
|
-
"hostVer": "√",
|
|
1631
|
-
"uniVer": "√",
|
|
1632
|
-
"unixVer": "x"
|
|
1633
|
-
}
|
|
1634
|
-
}
|
|
1635
|
-
}
|
|
1636
|
-
*/
|
|
1637
|
-
code?: number | null,
|
|
1638
|
-
|
|
1639
|
-
/**
|
|
1640
|
-
* 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于123字节的UTF-8 文本(不是字符)
|
|
1641
|
-
* @defaultValue ""
|
|
1642
|
-
* @uniPlatform
|
|
1643
|
-
{
|
|
1644
|
-
"app": {
|
|
1645
|
-
"android": {
|
|
1646
|
-
"osVer": "4.4",
|
|
1647
|
-
"uniVer": "√",
|
|
1648
|
-
"uniUtsPlugin": "3.91",
|
|
1649
|
-
"unixVer": "3.91"
|
|
1650
|
-
},
|
|
1651
|
-
"ios": {
|
|
1652
|
-
"osVer": "12.0",
|
|
1653
|
-
"uniVer": "√",
|
|
1654
|
-
"uniUtsPlugin": "4.11",
|
|
1655
|
-
"unixVer": "4.11",
|
|
1656
|
-
"unixUtsPlugin": "4.11"
|
|
1657
|
-
},
|
|
1658
|
-
"harmony": {
|
|
1659
|
-
"osVer": "3.0",
|
|
1660
|
-
"uniVer": "4.23",
|
|
1661
|
-
"unixVer": "4.61",
|
|
1662
|
-
"
|
|
1663
|
-
}
|
|
1664
|
-
},
|
|
1665
|
-
"mp": {
|
|
1666
|
-
"weixin": {
|
|
1667
|
-
"hostVer": "√",
|
|
1668
|
-
"uniVer": "√",
|
|
1669
|
-
"unixVer": "4.41"
|
|
1670
|
-
},
|
|
1671
|
-
"alipay": {
|
|
1672
|
-
"hostVer": "√",
|
|
1673
|
-
"uniVer": "√",
|
|
1674
|
-
"unixVer": "x"
|
|
1675
|
-
},
|
|
1676
|
-
"baidu": {
|
|
1677
|
-
"hostVer": "√",
|
|
1678
|
-
"uniVer": "√",
|
|
1679
|
-
"unixVer": "x"
|
|
1680
|
-
},
|
|
1681
|
-
"toutiao": {
|
|
1682
|
-
"hostVer": "√",
|
|
1683
|
-
"uniVer": "√",
|
|
1684
|
-
"unixVer": "x"
|
|
1685
|
-
},
|
|
1686
|
-
"lark": {
|
|
1687
|
-
"hostVer": "√",
|
|
1688
|
-
"uniVer": "√",
|
|
1689
|
-
"unixVer": "x"
|
|
1690
|
-
},
|
|
1691
|
-
"qq": {
|
|
1692
|
-
"hostVer": "√",
|
|
1693
|
-
"uniVer": "√",
|
|
1694
|
-
"unixVer": "x"
|
|
1695
|
-
},
|
|
1696
|
-
"kuaishou": {
|
|
1697
|
-
"hostVer": "√",
|
|
1698
|
-
"uniVer": "√",
|
|
1699
|
-
"unixVer": "x"
|
|
1700
|
-
},
|
|
1701
|
-
"jd": {
|
|
1702
|
-
"hostVer": "√",
|
|
1703
|
-
"uniVer": "√",
|
|
1704
|
-
"unixVer": "x"
|
|
1705
|
-
}
|
|
1706
|
-
}
|
|
1707
|
-
}
|
|
1708
|
-
*/
|
|
1709
|
-
reason?: string | null,
|
|
1710
|
-
|
|
1711
|
-
/**
|
|
1712
|
-
* 接口调用成功的回调函数
|
|
1562
|
+
*/
|
|
1563
|
+
complete?: ((result: any) => void) | null
|
|
1564
|
+
};
|
|
1565
|
+
|
|
1566
|
+
export type CloseSocketOptions = {
|
|
1567
|
+
/**
|
|
1568
|
+
* 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。如果这个参数没有被指定,默认的取值是1000 (表示正常连接关闭)
|
|
1569
|
+
* @defaultValue 1000
|
|
1570
|
+
* @uniPlatform
|
|
1571
|
+
{
|
|
1572
|
+
"app": {
|
|
1573
|
+
"android": {
|
|
1574
|
+
"osVer": "4.4",
|
|
1575
|
+
"uniVer": "√",
|
|
1576
|
+
"uniUtsPlugin": "3.91",
|
|
1577
|
+
"unixVer": "3.91"
|
|
1578
|
+
},
|
|
1579
|
+
"ios": {
|
|
1580
|
+
"osVer": "12.0",
|
|
1581
|
+
"uniVer": "√",
|
|
1582
|
+
"uniUtsPlugin": "4.11",
|
|
1583
|
+
"unixVer": "4.11",
|
|
1584
|
+
"unixUtsPlugin": "4.11"
|
|
1585
|
+
},
|
|
1586
|
+
"harmony": {
|
|
1587
|
+
"osVer": "3.0",
|
|
1588
|
+
"uniVer": "4.23",
|
|
1589
|
+
"unixVer": "4.61",
|
|
1590
|
+
"unixVaporVer": "5.0"
|
|
1591
|
+
}
|
|
1592
|
+
},
|
|
1593
|
+
"mp": {
|
|
1594
|
+
"weixin": {
|
|
1595
|
+
"hostVer": "√",
|
|
1596
|
+
"uniVer": "√",
|
|
1597
|
+
"unixVer": "4.41"
|
|
1598
|
+
},
|
|
1599
|
+
"alipay": {
|
|
1600
|
+
"hostVer": "√",
|
|
1601
|
+
"uniVer": "√",
|
|
1602
|
+
"unixVer": "x"
|
|
1603
|
+
},
|
|
1604
|
+
"baidu": {
|
|
1605
|
+
"hostVer": "√",
|
|
1606
|
+
"uniVer": "√",
|
|
1607
|
+
"unixVer": "x"
|
|
1608
|
+
},
|
|
1609
|
+
"toutiao": {
|
|
1610
|
+
"hostVer": "√",
|
|
1611
|
+
"uniVer": "√",
|
|
1612
|
+
"unixVer": "x"
|
|
1613
|
+
},
|
|
1614
|
+
"lark": {
|
|
1615
|
+
"hostVer": "√",
|
|
1616
|
+
"uniVer": "√",
|
|
1617
|
+
"unixVer": "x"
|
|
1618
|
+
},
|
|
1619
|
+
"qq": {
|
|
1620
|
+
"hostVer": "√",
|
|
1621
|
+
"uniVer": "√",
|
|
1622
|
+
"unixVer": "x"
|
|
1623
|
+
},
|
|
1624
|
+
"kuaishou": {
|
|
1625
|
+
"hostVer": "√",
|
|
1626
|
+
"uniVer": "√",
|
|
1627
|
+
"unixVer": "x"
|
|
1628
|
+
},
|
|
1629
|
+
"jd": {
|
|
1630
|
+
"hostVer": "√",
|
|
1631
|
+
"uniVer": "√",
|
|
1632
|
+
"unixVer": "x"
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
*/
|
|
1637
|
+
code?: number | null,
|
|
1638
|
+
|
|
1639
|
+
/**
|
|
1640
|
+
* 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于123字节的UTF-8 文本(不是字符)
|
|
1641
|
+
* @defaultValue ""
|
|
1642
|
+
* @uniPlatform
|
|
1643
|
+
{
|
|
1644
|
+
"app": {
|
|
1645
|
+
"android": {
|
|
1646
|
+
"osVer": "4.4",
|
|
1647
|
+
"uniVer": "√",
|
|
1648
|
+
"uniUtsPlugin": "3.91",
|
|
1649
|
+
"unixVer": "3.91"
|
|
1650
|
+
},
|
|
1651
|
+
"ios": {
|
|
1652
|
+
"osVer": "12.0",
|
|
1653
|
+
"uniVer": "√",
|
|
1654
|
+
"uniUtsPlugin": "4.11",
|
|
1655
|
+
"unixVer": "4.11",
|
|
1656
|
+
"unixUtsPlugin": "4.11"
|
|
1657
|
+
},
|
|
1658
|
+
"harmony": {
|
|
1659
|
+
"osVer": "3.0",
|
|
1660
|
+
"uniVer": "4.23",
|
|
1661
|
+
"unixVer": "4.61",
|
|
1662
|
+
"unixVaporVer": "5.0"
|
|
1663
|
+
}
|
|
1664
|
+
},
|
|
1665
|
+
"mp": {
|
|
1666
|
+
"weixin": {
|
|
1667
|
+
"hostVer": "√",
|
|
1668
|
+
"uniVer": "√",
|
|
1669
|
+
"unixVer": "4.41"
|
|
1670
|
+
},
|
|
1671
|
+
"alipay": {
|
|
1672
|
+
"hostVer": "√",
|
|
1673
|
+
"uniVer": "√",
|
|
1674
|
+
"unixVer": "x"
|
|
1675
|
+
},
|
|
1676
|
+
"baidu": {
|
|
1677
|
+
"hostVer": "√",
|
|
1678
|
+
"uniVer": "√",
|
|
1679
|
+
"unixVer": "x"
|
|
1680
|
+
},
|
|
1681
|
+
"toutiao": {
|
|
1682
|
+
"hostVer": "√",
|
|
1683
|
+
"uniVer": "√",
|
|
1684
|
+
"unixVer": "x"
|
|
1685
|
+
},
|
|
1686
|
+
"lark": {
|
|
1687
|
+
"hostVer": "√",
|
|
1688
|
+
"uniVer": "√",
|
|
1689
|
+
"unixVer": "x"
|
|
1690
|
+
},
|
|
1691
|
+
"qq": {
|
|
1692
|
+
"hostVer": "√",
|
|
1693
|
+
"uniVer": "√",
|
|
1694
|
+
"unixVer": "x"
|
|
1695
|
+
},
|
|
1696
|
+
"kuaishou": {
|
|
1697
|
+
"hostVer": "√",
|
|
1698
|
+
"uniVer": "√",
|
|
1699
|
+
"unixVer": "x"
|
|
1700
|
+
},
|
|
1701
|
+
"jd": {
|
|
1702
|
+
"hostVer": "√",
|
|
1703
|
+
"uniVer": "√",
|
|
1704
|
+
"unixVer": "x"
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
*/
|
|
1709
|
+
reason?: string | null,
|
|
1710
|
+
|
|
1711
|
+
/**
|
|
1712
|
+
* 接口调用成功的回调函数
|
|
1713
1713
|
* @defaultValue null
|
|
1714
1714
|
* @uniPlatform {
|
|
1715
1715
|
* "mp": {
|
|
@@ -1755,11 +1755,11 @@ export type CloseSocketOptions = {
|
|
|
1755
1755
|
* }
|
|
1756
1756
|
* }
|
|
1757
1757
|
* }
|
|
1758
|
-
*/
|
|
1759
|
-
success?: ((result: GeneralCallbackResult) => void) | null,
|
|
1760
|
-
|
|
1761
|
-
/**
|
|
1762
|
-
* 接口调用失败的回调函数
|
|
1758
|
+
*/
|
|
1759
|
+
success?: ((result: GeneralCallbackResult) => void) | null,
|
|
1760
|
+
|
|
1761
|
+
/**
|
|
1762
|
+
* 接口调用失败的回调函数
|
|
1763
1763
|
* @defaultValue null
|
|
1764
1764
|
* @uniPlatform {
|
|
1765
1765
|
* "mp": {
|
|
@@ -1805,11 +1805,11 @@ export type CloseSocketOptions = {
|
|
|
1805
1805
|
* }
|
|
1806
1806
|
* }
|
|
1807
1807
|
* }
|
|
1808
|
-
*/
|
|
1809
|
-
fail?: ((result: GeneralCallbackResult) => void) | null,
|
|
1810
|
-
|
|
1811
|
-
/**
|
|
1812
|
-
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
|
1808
|
+
*/
|
|
1809
|
+
fail?: ((result: GeneralCallbackResult) => void) | null,
|
|
1810
|
+
|
|
1811
|
+
/**
|
|
1812
|
+
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
|
1813
1813
|
* @defaultValue null
|
|
1814
1814
|
* @uniPlatform {
|
|
1815
1815
|
* "mp": {
|
|
@@ -1855,660 +1855,660 @@ export type CloseSocketOptions = {
|
|
|
1855
1855
|
* }
|
|
1856
1856
|
* }
|
|
1857
1857
|
* }
|
|
1858
|
-
*/
|
|
1859
|
-
complete?: ((result: GeneralCallbackResult) => void) | null
|
|
1860
|
-
};
|
|
1861
|
-
|
|
1862
|
-
export type OnSocketOpenCallbackResult = {
|
|
1863
|
-
/**
|
|
1864
|
-
* 连接成功的 HTTP 响应 Header
|
|
1865
|
-
* @uniPlatform
|
|
1866
|
-
{
|
|
1867
|
-
"app": {
|
|
1868
|
-
"android": {
|
|
1869
|
-
"osVer": "4.4",
|
|
1870
|
-
"uniVer": "√",
|
|
1871
|
-
"uniUtsPlugin": "3.91",
|
|
1872
|
-
"unixVer": "3.91"
|
|
1873
|
-
},
|
|
1874
|
-
"ios": {
|
|
1875
|
-
"osVer": "12.0",
|
|
1876
|
-
"uniVer": "√",
|
|
1877
|
-
"uniUtsPlugin": "4.11",
|
|
1878
|
-
"unixVer": "4.11",
|
|
1879
|
-
"unixUtsPlugin": "4.11"
|
|
1880
|
-
},
|
|
1881
|
-
"harmony": {
|
|
1882
|
-
"osVer": "3.0",
|
|
1883
|
-
"uniVer": "4.23",
|
|
1884
|
-
"unixVer": "4.61",
|
|
1885
|
-
"
|
|
1886
|
-
}
|
|
1887
|
-
},
|
|
1888
|
-
"mp": {
|
|
1889
|
-
"weixin": {
|
|
1890
|
-
"hostVer": "√",
|
|
1891
|
-
"uniVer": "√",
|
|
1892
|
-
"unixVer": "4.41"
|
|
1893
|
-
},
|
|
1894
|
-
"alipay": {
|
|
1895
|
-
"hostVer": "√",
|
|
1896
|
-
"uniVer": "√",
|
|
1897
|
-
"unixVer": "x"
|
|
1898
|
-
},
|
|
1899
|
-
"baidu": {
|
|
1900
|
-
"hostVer": "√",
|
|
1901
|
-
"uniVer": "√",
|
|
1902
|
-
"unixVer": "x"
|
|
1903
|
-
},
|
|
1904
|
-
"toutiao": {
|
|
1905
|
-
"hostVer": "√",
|
|
1906
|
-
"uniVer": "√",
|
|
1907
|
-
"unixVer": "x"
|
|
1908
|
-
},
|
|
1909
|
-
"lark": {
|
|
1910
|
-
"hostVer": "√",
|
|
1911
|
-
"uniVer": "√",
|
|
1912
|
-
"unixVer": "x"
|
|
1913
|
-
},
|
|
1914
|
-
"qq": {
|
|
1915
|
-
"hostVer": "√",
|
|
1916
|
-
"uniVer": "√",
|
|
1917
|
-
"unixVer": "x"
|
|
1918
|
-
},
|
|
1919
|
-
"kuaishou": {
|
|
1920
|
-
"hostVer": "√",
|
|
1921
|
-
"uniVer": "√",
|
|
1922
|
-
"unixVer": "x"
|
|
1923
|
-
},
|
|
1924
|
-
"jd": {
|
|
1925
|
-
"hostVer": "√",
|
|
1926
|
-
"uniVer": "√",
|
|
1927
|
-
"unixVer": "x"
|
|
1928
|
-
}
|
|
1929
|
-
}
|
|
1930
|
-
}
|
|
1931
|
-
*/
|
|
1932
|
-
header: any
|
|
1933
|
-
};
|
|
1934
|
-
|
|
1935
|
-
export type OnSocketMessageCallbackResult = {
|
|
1936
|
-
/**
|
|
1937
|
-
* 服务器返回的消息, app平台从 4.61 版本开始支持ArrayBuffer
|
|
1938
|
-
* @type {SocketDataOptions}
|
|
1939
|
-
* @uniPlatform
|
|
1940
|
-
{
|
|
1941
|
-
"app": {
|
|
1942
|
-
"android": {
|
|
1943
|
-
"osVer": "4.4",
|
|
1944
|
-
"uniVer": "√",
|
|
1945
|
-
"uniUtsPlugin": "3.91",
|
|
1946
|
-
"unixVer": "3.91"
|
|
1947
|
-
},
|
|
1948
|
-
"ios": {
|
|
1949
|
-
"osVer": "12.0",
|
|
1950
|
-
"uniVer": "√",
|
|
1951
|
-
"uniUtsPlugin": "4.11",
|
|
1952
|
-
"unixVer": "4.11",
|
|
1953
|
-
"unixUtsPlugin": "4.11"
|
|
1954
|
-
},
|
|
1955
|
-
"harmony": {
|
|
1956
|
-
"osVer": "3.0",
|
|
1957
|
-
"uniVer": "4.23",
|
|
1958
|
-
"unixVer": "4.61",
|
|
1959
|
-
"
|
|
1960
|
-
}
|
|
1961
|
-
},
|
|
1962
|
-
"mp": {
|
|
1963
|
-
"weixin": {
|
|
1964
|
-
"hostVer": "√",
|
|
1965
|
-
"uniVer": "√",
|
|
1966
|
-
"unixVer": "4.41"
|
|
1967
|
-
},
|
|
1968
|
-
"alipay": {
|
|
1969
|
-
"hostVer": "√",
|
|
1970
|
-
"uniVer": "√",
|
|
1971
|
-
"unixVer": "x"
|
|
1972
|
-
},
|
|
1973
|
-
"baidu": {
|
|
1974
|
-
"hostVer": "√",
|
|
1975
|
-
"uniVer": "√",
|
|
1976
|
-
"unixVer": "x"
|
|
1977
|
-
},
|
|
1978
|
-
"toutiao": {
|
|
1979
|
-
"hostVer": "√",
|
|
1980
|
-
"uniVer": "√",
|
|
1981
|
-
"unixVer": "x"
|
|
1982
|
-
},
|
|
1983
|
-
"lark": {
|
|
1984
|
-
"hostVer": "√",
|
|
1985
|
-
"uniVer": "√",
|
|
1986
|
-
"unixVer": "x"
|
|
1987
|
-
},
|
|
1988
|
-
"qq": {
|
|
1989
|
-
"hostVer": "√",
|
|
1990
|
-
"uniVer": "√",
|
|
1991
|
-
"unixVer": "x"
|
|
1992
|
-
},
|
|
1993
|
-
"kuaishou": {
|
|
1994
|
-
"hostVer": "√",
|
|
1995
|
-
"uniVer": "√",
|
|
1996
|
-
"unixVer": "x"
|
|
1997
|
-
},
|
|
1998
|
-
"jd": {
|
|
1999
|
-
"hostVer": "√",
|
|
2000
|
-
"uniVer": "√",
|
|
2001
|
-
"unixVer": "x"
|
|
2002
|
-
}
|
|
2003
|
-
}
|
|
2004
|
-
}
|
|
2005
|
-
*/
|
|
2006
|
-
data: any
|
|
2007
|
-
};
|
|
2008
|
-
|
|
2009
|
-
export interface SocketTask {
|
|
2010
|
-
/**
|
|
2011
|
-
* 通过 WebSocket 连接发送数据
|
|
2012
|
-
* @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-send
|
|
2013
|
-
* @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#send
|
|
2014
|
-
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#send
|
|
2015
|
-
* @uniPlatform
|
|
2016
|
-
{
|
|
2017
|
-
"app": {
|
|
2018
|
-
"android": {
|
|
2019
|
-
"osVer": "4.4",
|
|
2020
|
-
"uniVer": "√",
|
|
2021
|
-
"uniUtsPlugin": "3.91",
|
|
2022
|
-
"unixVer": "3.91"
|
|
2023
|
-
},
|
|
2024
|
-
"ios": {
|
|
2025
|
-
"osVer": "12.0",
|
|
2026
|
-
"uniVer": "√",
|
|
2027
|
-
"uniUtsPlugin": "4.11",
|
|
2028
|
-
"unixVer": "4.11",
|
|
2029
|
-
"unixUtsPlugin": "4.11"
|
|
2030
|
-
},
|
|
2031
|
-
"harmony": {
|
|
2032
|
-
"osVer": "3.0",
|
|
2033
|
-
"uniVer": "4.23",
|
|
2034
|
-
"unixVer": "4.61",
|
|
2035
|
-
"
|
|
2036
|
-
}
|
|
2037
|
-
},
|
|
2038
|
-
"mp": {
|
|
2039
|
-
"weixin": {
|
|
2040
|
-
"hostVer": "√",
|
|
2041
|
-
"uniVer": "√",
|
|
2042
|
-
"unixVer": "4.41"
|
|
2043
|
-
},
|
|
2044
|
-
"alipay": {
|
|
2045
|
-
"hostVer": "√",
|
|
2046
|
-
"uniVer": "√",
|
|
2047
|
-
"unixVer": "x"
|
|
2048
|
-
},
|
|
2049
|
-
"baidu": {
|
|
2050
|
-
"hostVer": "√",
|
|
2051
|
-
"uniVer": "√",
|
|
2052
|
-
"unixVer": "x"
|
|
2053
|
-
},
|
|
2054
|
-
"toutiao": {
|
|
2055
|
-
"hostVer": "√",
|
|
2056
|
-
"uniVer": "√",
|
|
2057
|
-
"unixVer": "x"
|
|
2058
|
-
},
|
|
2059
|
-
"lark": {
|
|
2060
|
-
"hostVer": "√",
|
|
2061
|
-
"uniVer": "√",
|
|
2062
|
-
"unixVer": "x"
|
|
2063
|
-
},
|
|
2064
|
-
"qq": {
|
|
2065
|
-
"hostVer": "√",
|
|
2066
|
-
"uniVer": "√",
|
|
2067
|
-
"unixVer": "x"
|
|
2068
|
-
},
|
|
2069
|
-
"kuaishou": {
|
|
2070
|
-
"hostVer": "√",
|
|
2071
|
-
"uniVer": "√",
|
|
2072
|
-
"unixVer": "x"
|
|
2073
|
-
},
|
|
2074
|
-
"jd": {
|
|
2075
|
-
"hostVer": "√",
|
|
2076
|
-
"uniVer": "√",
|
|
2077
|
-
"unixVer": "x"
|
|
2078
|
-
}
|
|
2079
|
-
},
|
|
2080
|
-
"web": {
|
|
2081
|
-
"uniVer": "√",
|
|
2082
|
-
"unixVer": "4.0"
|
|
2083
|
-
}
|
|
2084
|
-
}
|
|
2085
|
-
* @example
|
|
2086
|
-
```typescript
|
|
2087
|
-
task.send({data:"halo"});
|
|
2088
|
-
```
|
|
2089
|
-
*/
|
|
2090
|
-
send(options: SendSocketMessageOptions): void;
|
|
2091
|
-
|
|
2092
|
-
/**
|
|
2093
|
-
* 关闭 WebSocket 连接
|
|
2094
|
-
* @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-close
|
|
2095
|
-
* @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#close
|
|
2096
|
-
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#close
|
|
2097
|
-
* @uniPlatform
|
|
2098
|
-
{
|
|
2099
|
-
"app": {
|
|
2100
|
-
"android": {
|
|
2101
|
-
"osVer": "4.4",
|
|
2102
|
-
"uniVer": "√",
|
|
2103
|
-
"uniUtsPlugin": "3.91",
|
|
2104
|
-
"unixVer": "3.91"
|
|
2105
|
-
},
|
|
2106
|
-
"ios": {
|
|
2107
|
-
"osVer": "12.0",
|
|
2108
|
-
"uniVer": "√",
|
|
2109
|
-
"uniUtsPlugin": "4.11",
|
|
2110
|
-
"unixVer": "4.11",
|
|
2111
|
-
"unixUtsPlugin": "4.11"
|
|
2112
|
-
},
|
|
2113
|
-
"harmony": {
|
|
2114
|
-
"osVer": "3.0",
|
|
2115
|
-
"uniVer": "4.23",
|
|
2116
|
-
"unixVer": "4.61",
|
|
2117
|
-
"
|
|
2118
|
-
}
|
|
2119
|
-
},
|
|
2120
|
-
"mp": {
|
|
2121
|
-
"weixin": {
|
|
2122
|
-
"hostVer": "√",
|
|
2123
|
-
"uniVer": "√",
|
|
2124
|
-
"unixVer": "4.41"
|
|
2125
|
-
},
|
|
2126
|
-
"alipay": {
|
|
2127
|
-
"hostVer": "√",
|
|
2128
|
-
"uniVer": "√",
|
|
2129
|
-
"unixVer": "x"
|
|
2130
|
-
},
|
|
2131
|
-
"baidu": {
|
|
2132
|
-
"hostVer": "√",
|
|
2133
|
-
"uniVer": "√",
|
|
2134
|
-
"unixVer": "x"
|
|
2135
|
-
},
|
|
2136
|
-
"toutiao": {
|
|
2137
|
-
"hostVer": "√",
|
|
2138
|
-
"uniVer": "√",
|
|
2139
|
-
"unixVer": "x"
|
|
2140
|
-
},
|
|
2141
|
-
"lark": {
|
|
2142
|
-
"hostVer": "√",
|
|
2143
|
-
"uniVer": "√",
|
|
2144
|
-
"unixVer": "x"
|
|
2145
|
-
},
|
|
2146
|
-
"qq": {
|
|
2147
|
-
"hostVer": "√",
|
|
2148
|
-
"uniVer": "√",
|
|
2149
|
-
"unixVer": "x"
|
|
2150
|
-
},
|
|
2151
|
-
"kuaishou": {
|
|
2152
|
-
"hostVer": "√",
|
|
2153
|
-
"uniVer": "√",
|
|
2154
|
-
"unixVer": "x"
|
|
2155
|
-
},
|
|
2156
|
-
"jd": {
|
|
2157
|
-
"hostVer": "√",
|
|
2158
|
-
"uniVer": "√",
|
|
2159
|
-
"unixVer": "x"
|
|
2160
|
-
}
|
|
2161
|
-
},
|
|
2162
|
-
"web": {
|
|
2163
|
-
"uniVer": "√",
|
|
2164
|
-
"unixVer": "4.0"
|
|
2165
|
-
}
|
|
2166
|
-
}
|
|
2167
|
-
* @example
|
|
2168
|
-
```typescript
|
|
2169
|
-
task.close();
|
|
2170
|
-
```
|
|
2171
|
-
*/
|
|
2172
|
-
close(options: CloseSocketOptions): void;
|
|
2173
|
-
|
|
2174
|
-
/**
|
|
2175
|
-
* 监听 WebSocket 连接打开事件
|
|
2176
|
-
* @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onopen
|
|
2177
|
-
* @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onopen
|
|
2178
|
-
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onopen
|
|
2179
|
-
* @uniPlatform
|
|
2180
|
-
{
|
|
2181
|
-
"app": {
|
|
2182
|
-
"android": {
|
|
2183
|
-
"osVer": "4.4",
|
|
2184
|
-
"uniVer": "√",
|
|
2185
|
-
"uniUtsPlugin": "3.91",
|
|
2186
|
-
"unixVer": "3.91"
|
|
2187
|
-
},
|
|
2188
|
-
"ios": {
|
|
2189
|
-
"osVer": "12.0",
|
|
2190
|
-
"uniVer": "√",
|
|
2191
|
-
"uniUtsPlugin": "4.11",
|
|
2192
|
-
"unixVer": "4.11",
|
|
2193
|
-
"unixUtsPlugin": "4.11"
|
|
2194
|
-
},
|
|
2195
|
-
"harmony": {
|
|
2196
|
-
"osVer": "3.0",
|
|
2197
|
-
"uniVer": "4.23",
|
|
2198
|
-
"unixVer": "4.61",
|
|
2199
|
-
"
|
|
2200
|
-
}
|
|
2201
|
-
},
|
|
2202
|
-
"mp": {
|
|
2203
|
-
"weixin": {
|
|
2204
|
-
"hostVer": "√",
|
|
2205
|
-
"uniVer": "√",
|
|
2206
|
-
"unixVer": "4.41"
|
|
2207
|
-
},
|
|
2208
|
-
"alipay": {
|
|
2209
|
-
"hostVer": "√",
|
|
2210
|
-
"uniVer": "√",
|
|
2211
|
-
"unixVer": "x"
|
|
2212
|
-
},
|
|
2213
|
-
"baidu": {
|
|
2214
|
-
"hostVer": "√",
|
|
2215
|
-
"uniVer": "√",
|
|
2216
|
-
"unixVer": "x"
|
|
2217
|
-
},
|
|
2218
|
-
"toutiao": {
|
|
2219
|
-
"hostVer": "√",
|
|
2220
|
-
"uniVer": "√",
|
|
2221
|
-
"unixVer": "x"
|
|
2222
|
-
},
|
|
2223
|
-
"lark": {
|
|
2224
|
-
"hostVer": "√",
|
|
2225
|
-
"uniVer": "√",
|
|
2226
|
-
"unixVer": "x"
|
|
2227
|
-
},
|
|
2228
|
-
"qq": {
|
|
2229
|
-
"hostVer": "√",
|
|
2230
|
-
"uniVer": "√",
|
|
2231
|
-
"unixVer": "x"
|
|
2232
|
-
},
|
|
2233
|
-
"kuaishou": {
|
|
2234
|
-
"hostVer": "√",
|
|
2235
|
-
"uniVer": "√",
|
|
2236
|
-
"unixVer": "x"
|
|
2237
|
-
},
|
|
2238
|
-
"jd": {
|
|
2239
|
-
"hostVer": "√",
|
|
2240
|
-
"uniVer": "√",
|
|
2241
|
-
"unixVer": "x"
|
|
2242
|
-
}
|
|
2243
|
-
},
|
|
2244
|
-
"web": {
|
|
2245
|
-
"uniVer": "√",
|
|
2246
|
-
"unixVer": "4.0"
|
|
2247
|
-
}
|
|
2248
|
-
}
|
|
2249
|
-
* @example
|
|
2250
|
-
```typescript
|
|
2251
|
-
task.onOpen((res) => {})
|
|
2252
|
-
```
|
|
2253
|
-
*/
|
|
2254
|
-
onOpen(callback: (result: OnSocketOpenCallbackResult) => void): void;
|
|
2255
|
-
|
|
2256
|
-
/**
|
|
2257
|
-
* 监听 WebSocket 连接关闭事件
|
|
2258
|
-
* @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onclose
|
|
2259
|
-
* @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onclose
|
|
2260
|
-
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onclose
|
|
2261
|
-
* @uniPlatform
|
|
2262
|
-
{
|
|
2263
|
-
"app": {
|
|
2264
|
-
"android": {
|
|
2265
|
-
"osVer": "4.4",
|
|
2266
|
-
"uniVer": "√",
|
|
2267
|
-
"uniUtsPlugin": "3.91",
|
|
2268
|
-
"unixVer": "3.91"
|
|
2269
|
-
},
|
|
2270
|
-
"ios": {
|
|
2271
|
-
"osVer": "12.0",
|
|
2272
|
-
"uniVer": "√",
|
|
2273
|
-
"uniUtsPlugin": "4.11",
|
|
2274
|
-
"unixVer": "4.11",
|
|
2275
|
-
"unixUtsPlugin": "4.11"
|
|
2276
|
-
},
|
|
2277
|
-
"harmony": {
|
|
2278
|
-
"osVer": "3.0",
|
|
2279
|
-
"uniVer": "4.23",
|
|
2280
|
-
"unixVer": "4.61",
|
|
2281
|
-
"
|
|
2282
|
-
}
|
|
2283
|
-
},
|
|
2284
|
-
"mp": {
|
|
2285
|
-
"weixin": {
|
|
2286
|
-
"hostVer": "√",
|
|
2287
|
-
"uniVer": "√",
|
|
2288
|
-
"unixVer": "4.41"
|
|
2289
|
-
},
|
|
2290
|
-
"alipay": {
|
|
2291
|
-
"hostVer": "√",
|
|
2292
|
-
"uniVer": "√",
|
|
2293
|
-
"unixVer": "x"
|
|
2294
|
-
},
|
|
2295
|
-
"baidu": {
|
|
2296
|
-
"hostVer": "√",
|
|
2297
|
-
"uniVer": "√",
|
|
2298
|
-
"unixVer": "x"
|
|
2299
|
-
},
|
|
2300
|
-
"toutiao": {
|
|
2301
|
-
"hostVer": "√",
|
|
2302
|
-
"uniVer": "√",
|
|
2303
|
-
"unixVer": "x"
|
|
2304
|
-
},
|
|
2305
|
-
"lark": {
|
|
2306
|
-
"hostVer": "√",
|
|
2307
|
-
"uniVer": "√",
|
|
2308
|
-
"unixVer": "x"
|
|
2309
|
-
},
|
|
2310
|
-
"qq": {
|
|
2311
|
-
"hostVer": "√",
|
|
2312
|
-
"uniVer": "√",
|
|
2313
|
-
"unixVer": "x"
|
|
2314
|
-
},
|
|
2315
|
-
"kuaishou": {
|
|
2316
|
-
"hostVer": "√",
|
|
2317
|
-
"uniVer": "√",
|
|
2318
|
-
"unixVer": "x"
|
|
2319
|
-
},
|
|
2320
|
-
"jd": {
|
|
2321
|
-
"hostVer": "√",
|
|
2322
|
-
"uniVer": "√",
|
|
2323
|
-
"unixVer": "x"
|
|
2324
|
-
}
|
|
2325
|
-
},
|
|
2326
|
-
"web": {
|
|
2327
|
-
"uniVer": "√",
|
|
2328
|
-
"unixVer": "4.0"
|
|
2329
|
-
}
|
|
2330
|
-
}
|
|
2331
|
-
* @example
|
|
2332
|
-
```typescript
|
|
2333
|
-
task.onClose((res) => {
|
|
2334
|
-
})
|
|
2335
|
-
```
|
|
2336
|
-
*/
|
|
2337
|
-
onClose(callback: (result: any) => void): void;
|
|
2338
|
-
|
|
2339
|
-
/**
|
|
2340
|
-
* onError()
|
|
2341
|
-
* @description
|
|
2342
|
-
* 监听 WebSocket 错误
|
|
2343
|
-
* @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onerror
|
|
2344
|
-
* @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onerror
|
|
2345
|
-
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onerror
|
|
2346
|
-
* @uniPlatform
|
|
2347
|
-
{
|
|
2348
|
-
"app": {
|
|
2349
|
-
"android": {
|
|
2350
|
-
"osVer": "4.4",
|
|
2351
|
-
"uniVer": "√",
|
|
2352
|
-
"uniUtsPlugin": "3.91",
|
|
2353
|
-
"unixVer": "3.91"
|
|
2354
|
-
},
|
|
2355
|
-
"ios": {
|
|
2356
|
-
"osVer": "12.0",
|
|
2357
|
-
"uniVer": "√",
|
|
2358
|
-
"uniUtsPlugin": "4.11",
|
|
2359
|
-
"unixVer": "4.11",
|
|
2360
|
-
"unixUtsPlugin": "4.11"
|
|
2361
|
-
},
|
|
2362
|
-
"harmony": {
|
|
2363
|
-
"osVer": "3.0",
|
|
2364
|
-
"uniVer": "4.23",
|
|
2365
|
-
"unixVer": "4.61",
|
|
2366
|
-
"
|
|
2367
|
-
}
|
|
2368
|
-
},
|
|
2369
|
-
"mp": {
|
|
2370
|
-
"weixin": {
|
|
2371
|
-
"hostVer": "√",
|
|
2372
|
-
"uniVer": "√",
|
|
2373
|
-
"unixVer": "4.41"
|
|
2374
|
-
},
|
|
2375
|
-
"alipay": {
|
|
2376
|
-
"hostVer": "√",
|
|
2377
|
-
"uniVer": "√",
|
|
2378
|
-
"unixVer": "x"
|
|
2379
|
-
},
|
|
2380
|
-
"baidu": {
|
|
2381
|
-
"hostVer": "√",
|
|
2382
|
-
"uniVer": "√",
|
|
2383
|
-
"unixVer": "x"
|
|
2384
|
-
},
|
|
2385
|
-
"toutiao": {
|
|
2386
|
-
"hostVer": "√",
|
|
2387
|
-
"uniVer": "√",
|
|
2388
|
-
"unixVer": "x"
|
|
2389
|
-
},
|
|
2390
|
-
"lark": {
|
|
2391
|
-
"hostVer": "√",
|
|
2392
|
-
"uniVer": "√",
|
|
2393
|
-
"unixVer": "x"
|
|
2394
|
-
},
|
|
2395
|
-
"qq": {
|
|
2396
|
-
"hostVer": "√",
|
|
2397
|
-
"uniVer": "√",
|
|
2398
|
-
"unixVer": "x"
|
|
2399
|
-
},
|
|
2400
|
-
"kuaishou": {
|
|
2401
|
-
"hostVer": "√",
|
|
2402
|
-
"uniVer": "√",
|
|
2403
|
-
"unixVer": "x"
|
|
2404
|
-
},
|
|
2405
|
-
"jd": {
|
|
2406
|
-
"hostVer": "√",
|
|
2407
|
-
"uniVer": "√",
|
|
2408
|
-
"unixVer": "x"
|
|
2409
|
-
}
|
|
2410
|
-
},
|
|
2411
|
-
"web": {
|
|
2412
|
-
"uniVer": "√",
|
|
2413
|
-
"unixVer": "4.0"
|
|
2414
|
-
}
|
|
2415
|
-
}
|
|
2416
|
-
* @example
|
|
2417
|
-
```typescript
|
|
2418
|
-
task.onError((res) => {
|
|
2419
|
-
})
|
|
2420
|
-
```
|
|
2421
|
-
*/
|
|
2422
|
-
onError(callback: (result: GeneralCallbackResult) => void): void;
|
|
2423
|
-
|
|
2424
|
-
/**
|
|
2425
|
-
* 监听 WebSocket 接受到服务器的消息事件
|
|
2426
|
-
* @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onmessage
|
|
2427
|
-
* @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onmessage
|
|
2428
|
-
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onmessage
|
|
2429
|
-
* @uniPlatform
|
|
2430
|
-
{
|
|
2431
|
-
"app": {
|
|
2432
|
-
"android": {
|
|
2433
|
-
"osVer": "4.4",
|
|
2434
|
-
"uniVer": "√",
|
|
2435
|
-
"uniUtsPlugin": "3.91",
|
|
2436
|
-
"unixVer": "3.91"
|
|
2437
|
-
},
|
|
2438
|
-
"ios": {
|
|
2439
|
-
"osVer": "12.0",
|
|
2440
|
-
"uniVer": "√",
|
|
2441
|
-
"uniUtsPlugin": "4.11",
|
|
2442
|
-
"unixVer": "4.11",
|
|
2443
|
-
"unixUtsPlugin": "4.11"
|
|
2444
|
-
},
|
|
2445
|
-
"harmony": {
|
|
2446
|
-
"osVer": "3.0",
|
|
2447
|
-
"uniVer": "4.23",
|
|
2448
|
-
"unixVer": "4.61",
|
|
2449
|
-
"
|
|
2450
|
-
}
|
|
2451
|
-
},
|
|
2452
|
-
"mp": {
|
|
2453
|
-
"weixin": {
|
|
2454
|
-
"hostVer": "√",
|
|
2455
|
-
"uniVer": "√",
|
|
2456
|
-
"unixVer": "4.41"
|
|
2457
|
-
},
|
|
2458
|
-
"alipay": {
|
|
2459
|
-
"hostVer": "√",
|
|
2460
|
-
"uniVer": "√",
|
|
2461
|
-
"unixVer": "x"
|
|
2462
|
-
},
|
|
2463
|
-
"baidu": {
|
|
2464
|
-
"hostVer": "√",
|
|
2465
|
-
"uniVer": "√",
|
|
2466
|
-
"unixVer": "x"
|
|
2467
|
-
},
|
|
2468
|
-
"toutiao": {
|
|
2469
|
-
"hostVer": "√",
|
|
2470
|
-
"uniVer": "√",
|
|
2471
|
-
"unixVer": "x"
|
|
2472
|
-
},
|
|
2473
|
-
"lark": {
|
|
2474
|
-
"hostVer": "√",
|
|
2475
|
-
"uniVer": "√",
|
|
2476
|
-
"unixVer": "x"
|
|
2477
|
-
},
|
|
2478
|
-
"qq": {
|
|
2479
|
-
"hostVer": "√",
|
|
2480
|
-
"uniVer": "√",
|
|
2481
|
-
"unixVer": "x"
|
|
2482
|
-
},
|
|
2483
|
-
"kuaishou": {
|
|
2484
|
-
"hostVer": "√",
|
|
2485
|
-
"uniVer": "√",
|
|
2486
|
-
"unixVer": "x"
|
|
2487
|
-
},
|
|
2488
|
-
"jd": {
|
|
2489
|
-
"hostVer": "√",
|
|
2490
|
-
"uniVer": "√",
|
|
2491
|
-
"unixVer": "x"
|
|
2492
|
-
}
|
|
2493
|
-
},
|
|
2494
|
-
"web": {
|
|
2495
|
-
"uniVer": "√",
|
|
2496
|
-
"unixVer": "4.0"
|
|
2497
|
-
}
|
|
2498
|
-
}
|
|
2499
|
-
* @example
|
|
2500
|
-
```typescript
|
|
2501
|
-
task.onMessage((res) => {
|
|
2502
|
-
})
|
|
2503
|
-
```
|
|
2504
|
-
*/
|
|
2505
|
-
onMessage(callback: (result: OnSocketMessageCallbackResult) => void): void;
|
|
2506
|
-
};
|
|
2507
|
-
export type OnSocketOpenCallback = (result: OnSocketOpenCallbackResult) => void;
|
|
2508
|
-
|
|
2509
|
-
export type OnSocketOpen = (options: OnSocketOpenCallback) => void;
|
|
2510
|
-
export type OnSocketErrorCallbackResult = {
|
|
2511
|
-
/**
|
|
1858
|
+
*/
|
|
1859
|
+
complete?: ((result: GeneralCallbackResult) => void) | null
|
|
1860
|
+
};
|
|
1861
|
+
|
|
1862
|
+
export type OnSocketOpenCallbackResult = {
|
|
1863
|
+
/**
|
|
1864
|
+
* 连接成功的 HTTP 响应 Header
|
|
1865
|
+
* @uniPlatform
|
|
1866
|
+
{
|
|
1867
|
+
"app": {
|
|
1868
|
+
"android": {
|
|
1869
|
+
"osVer": "4.4",
|
|
1870
|
+
"uniVer": "√",
|
|
1871
|
+
"uniUtsPlugin": "3.91",
|
|
1872
|
+
"unixVer": "3.91"
|
|
1873
|
+
},
|
|
1874
|
+
"ios": {
|
|
1875
|
+
"osVer": "12.0",
|
|
1876
|
+
"uniVer": "√",
|
|
1877
|
+
"uniUtsPlugin": "4.11",
|
|
1878
|
+
"unixVer": "4.11",
|
|
1879
|
+
"unixUtsPlugin": "4.11"
|
|
1880
|
+
},
|
|
1881
|
+
"harmony": {
|
|
1882
|
+
"osVer": "3.0",
|
|
1883
|
+
"uniVer": "4.23",
|
|
1884
|
+
"unixVer": "4.61",
|
|
1885
|
+
"unixVaporVer": "5.0"
|
|
1886
|
+
}
|
|
1887
|
+
},
|
|
1888
|
+
"mp": {
|
|
1889
|
+
"weixin": {
|
|
1890
|
+
"hostVer": "√",
|
|
1891
|
+
"uniVer": "√",
|
|
1892
|
+
"unixVer": "4.41"
|
|
1893
|
+
},
|
|
1894
|
+
"alipay": {
|
|
1895
|
+
"hostVer": "√",
|
|
1896
|
+
"uniVer": "√",
|
|
1897
|
+
"unixVer": "x"
|
|
1898
|
+
},
|
|
1899
|
+
"baidu": {
|
|
1900
|
+
"hostVer": "√",
|
|
1901
|
+
"uniVer": "√",
|
|
1902
|
+
"unixVer": "x"
|
|
1903
|
+
},
|
|
1904
|
+
"toutiao": {
|
|
1905
|
+
"hostVer": "√",
|
|
1906
|
+
"uniVer": "√",
|
|
1907
|
+
"unixVer": "x"
|
|
1908
|
+
},
|
|
1909
|
+
"lark": {
|
|
1910
|
+
"hostVer": "√",
|
|
1911
|
+
"uniVer": "√",
|
|
1912
|
+
"unixVer": "x"
|
|
1913
|
+
},
|
|
1914
|
+
"qq": {
|
|
1915
|
+
"hostVer": "√",
|
|
1916
|
+
"uniVer": "√",
|
|
1917
|
+
"unixVer": "x"
|
|
1918
|
+
},
|
|
1919
|
+
"kuaishou": {
|
|
1920
|
+
"hostVer": "√",
|
|
1921
|
+
"uniVer": "√",
|
|
1922
|
+
"unixVer": "x"
|
|
1923
|
+
},
|
|
1924
|
+
"jd": {
|
|
1925
|
+
"hostVer": "√",
|
|
1926
|
+
"uniVer": "√",
|
|
1927
|
+
"unixVer": "x"
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
*/
|
|
1932
|
+
header: any
|
|
1933
|
+
};
|
|
1934
|
+
|
|
1935
|
+
export type OnSocketMessageCallbackResult = {
|
|
1936
|
+
/**
|
|
1937
|
+
* 服务器返回的消息, app平台从 4.61 版本开始支持ArrayBuffer
|
|
1938
|
+
* @type {SocketDataOptions}
|
|
1939
|
+
* @uniPlatform
|
|
1940
|
+
{
|
|
1941
|
+
"app": {
|
|
1942
|
+
"android": {
|
|
1943
|
+
"osVer": "4.4",
|
|
1944
|
+
"uniVer": "√",
|
|
1945
|
+
"uniUtsPlugin": "3.91",
|
|
1946
|
+
"unixVer": "3.91"
|
|
1947
|
+
},
|
|
1948
|
+
"ios": {
|
|
1949
|
+
"osVer": "12.0",
|
|
1950
|
+
"uniVer": "√",
|
|
1951
|
+
"uniUtsPlugin": "4.11",
|
|
1952
|
+
"unixVer": "4.11",
|
|
1953
|
+
"unixUtsPlugin": "4.11"
|
|
1954
|
+
},
|
|
1955
|
+
"harmony": {
|
|
1956
|
+
"osVer": "3.0",
|
|
1957
|
+
"uniVer": "4.23",
|
|
1958
|
+
"unixVer": "4.61",
|
|
1959
|
+
"unixVaporVer": "5.0"
|
|
1960
|
+
}
|
|
1961
|
+
},
|
|
1962
|
+
"mp": {
|
|
1963
|
+
"weixin": {
|
|
1964
|
+
"hostVer": "√",
|
|
1965
|
+
"uniVer": "√",
|
|
1966
|
+
"unixVer": "4.41"
|
|
1967
|
+
},
|
|
1968
|
+
"alipay": {
|
|
1969
|
+
"hostVer": "√",
|
|
1970
|
+
"uniVer": "√",
|
|
1971
|
+
"unixVer": "x"
|
|
1972
|
+
},
|
|
1973
|
+
"baidu": {
|
|
1974
|
+
"hostVer": "√",
|
|
1975
|
+
"uniVer": "√",
|
|
1976
|
+
"unixVer": "x"
|
|
1977
|
+
},
|
|
1978
|
+
"toutiao": {
|
|
1979
|
+
"hostVer": "√",
|
|
1980
|
+
"uniVer": "√",
|
|
1981
|
+
"unixVer": "x"
|
|
1982
|
+
},
|
|
1983
|
+
"lark": {
|
|
1984
|
+
"hostVer": "√",
|
|
1985
|
+
"uniVer": "√",
|
|
1986
|
+
"unixVer": "x"
|
|
1987
|
+
},
|
|
1988
|
+
"qq": {
|
|
1989
|
+
"hostVer": "√",
|
|
1990
|
+
"uniVer": "√",
|
|
1991
|
+
"unixVer": "x"
|
|
1992
|
+
},
|
|
1993
|
+
"kuaishou": {
|
|
1994
|
+
"hostVer": "√",
|
|
1995
|
+
"uniVer": "√",
|
|
1996
|
+
"unixVer": "x"
|
|
1997
|
+
},
|
|
1998
|
+
"jd": {
|
|
1999
|
+
"hostVer": "√",
|
|
2000
|
+
"uniVer": "√",
|
|
2001
|
+
"unixVer": "x"
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
*/
|
|
2006
|
+
data: any
|
|
2007
|
+
};
|
|
2008
|
+
|
|
2009
|
+
export interface SocketTask {
|
|
2010
|
+
/**
|
|
2011
|
+
* 通过 WebSocket 连接发送数据
|
|
2012
|
+
* @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-send
|
|
2013
|
+
* @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#send
|
|
2014
|
+
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#send
|
|
2015
|
+
* @uniPlatform
|
|
2016
|
+
{
|
|
2017
|
+
"app": {
|
|
2018
|
+
"android": {
|
|
2019
|
+
"osVer": "4.4",
|
|
2020
|
+
"uniVer": "√",
|
|
2021
|
+
"uniUtsPlugin": "3.91",
|
|
2022
|
+
"unixVer": "3.91"
|
|
2023
|
+
},
|
|
2024
|
+
"ios": {
|
|
2025
|
+
"osVer": "12.0",
|
|
2026
|
+
"uniVer": "√",
|
|
2027
|
+
"uniUtsPlugin": "4.11",
|
|
2028
|
+
"unixVer": "4.11",
|
|
2029
|
+
"unixUtsPlugin": "4.11"
|
|
2030
|
+
},
|
|
2031
|
+
"harmony": {
|
|
2032
|
+
"osVer": "3.0",
|
|
2033
|
+
"uniVer": "4.23",
|
|
2034
|
+
"unixVer": "4.61",
|
|
2035
|
+
"unixVaporVer": "5.0"
|
|
2036
|
+
}
|
|
2037
|
+
},
|
|
2038
|
+
"mp": {
|
|
2039
|
+
"weixin": {
|
|
2040
|
+
"hostVer": "√",
|
|
2041
|
+
"uniVer": "√",
|
|
2042
|
+
"unixVer": "4.41"
|
|
2043
|
+
},
|
|
2044
|
+
"alipay": {
|
|
2045
|
+
"hostVer": "√",
|
|
2046
|
+
"uniVer": "√",
|
|
2047
|
+
"unixVer": "x"
|
|
2048
|
+
},
|
|
2049
|
+
"baidu": {
|
|
2050
|
+
"hostVer": "√",
|
|
2051
|
+
"uniVer": "√",
|
|
2052
|
+
"unixVer": "x"
|
|
2053
|
+
},
|
|
2054
|
+
"toutiao": {
|
|
2055
|
+
"hostVer": "√",
|
|
2056
|
+
"uniVer": "√",
|
|
2057
|
+
"unixVer": "x"
|
|
2058
|
+
},
|
|
2059
|
+
"lark": {
|
|
2060
|
+
"hostVer": "√",
|
|
2061
|
+
"uniVer": "√",
|
|
2062
|
+
"unixVer": "x"
|
|
2063
|
+
},
|
|
2064
|
+
"qq": {
|
|
2065
|
+
"hostVer": "√",
|
|
2066
|
+
"uniVer": "√",
|
|
2067
|
+
"unixVer": "x"
|
|
2068
|
+
},
|
|
2069
|
+
"kuaishou": {
|
|
2070
|
+
"hostVer": "√",
|
|
2071
|
+
"uniVer": "√",
|
|
2072
|
+
"unixVer": "x"
|
|
2073
|
+
},
|
|
2074
|
+
"jd": {
|
|
2075
|
+
"hostVer": "√",
|
|
2076
|
+
"uniVer": "√",
|
|
2077
|
+
"unixVer": "x"
|
|
2078
|
+
}
|
|
2079
|
+
},
|
|
2080
|
+
"web": {
|
|
2081
|
+
"uniVer": "√",
|
|
2082
|
+
"unixVer": "4.0"
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2085
|
+
* @example
|
|
2086
|
+
```typescript
|
|
2087
|
+
task.send({data:"halo"});
|
|
2088
|
+
```
|
|
2089
|
+
*/
|
|
2090
|
+
send(options: SendSocketMessageOptions): void;
|
|
2091
|
+
|
|
2092
|
+
/**
|
|
2093
|
+
* 关闭 WebSocket 连接
|
|
2094
|
+
* @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-close
|
|
2095
|
+
* @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#close
|
|
2096
|
+
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#close
|
|
2097
|
+
* @uniPlatform
|
|
2098
|
+
{
|
|
2099
|
+
"app": {
|
|
2100
|
+
"android": {
|
|
2101
|
+
"osVer": "4.4",
|
|
2102
|
+
"uniVer": "√",
|
|
2103
|
+
"uniUtsPlugin": "3.91",
|
|
2104
|
+
"unixVer": "3.91"
|
|
2105
|
+
},
|
|
2106
|
+
"ios": {
|
|
2107
|
+
"osVer": "12.0",
|
|
2108
|
+
"uniVer": "√",
|
|
2109
|
+
"uniUtsPlugin": "4.11",
|
|
2110
|
+
"unixVer": "4.11",
|
|
2111
|
+
"unixUtsPlugin": "4.11"
|
|
2112
|
+
},
|
|
2113
|
+
"harmony": {
|
|
2114
|
+
"osVer": "3.0",
|
|
2115
|
+
"uniVer": "4.23",
|
|
2116
|
+
"unixVer": "4.61",
|
|
2117
|
+
"unixVaporVer": "5.0"
|
|
2118
|
+
}
|
|
2119
|
+
},
|
|
2120
|
+
"mp": {
|
|
2121
|
+
"weixin": {
|
|
2122
|
+
"hostVer": "√",
|
|
2123
|
+
"uniVer": "√",
|
|
2124
|
+
"unixVer": "4.41"
|
|
2125
|
+
},
|
|
2126
|
+
"alipay": {
|
|
2127
|
+
"hostVer": "√",
|
|
2128
|
+
"uniVer": "√",
|
|
2129
|
+
"unixVer": "x"
|
|
2130
|
+
},
|
|
2131
|
+
"baidu": {
|
|
2132
|
+
"hostVer": "√",
|
|
2133
|
+
"uniVer": "√",
|
|
2134
|
+
"unixVer": "x"
|
|
2135
|
+
},
|
|
2136
|
+
"toutiao": {
|
|
2137
|
+
"hostVer": "√",
|
|
2138
|
+
"uniVer": "√",
|
|
2139
|
+
"unixVer": "x"
|
|
2140
|
+
},
|
|
2141
|
+
"lark": {
|
|
2142
|
+
"hostVer": "√",
|
|
2143
|
+
"uniVer": "√",
|
|
2144
|
+
"unixVer": "x"
|
|
2145
|
+
},
|
|
2146
|
+
"qq": {
|
|
2147
|
+
"hostVer": "√",
|
|
2148
|
+
"uniVer": "√",
|
|
2149
|
+
"unixVer": "x"
|
|
2150
|
+
},
|
|
2151
|
+
"kuaishou": {
|
|
2152
|
+
"hostVer": "√",
|
|
2153
|
+
"uniVer": "√",
|
|
2154
|
+
"unixVer": "x"
|
|
2155
|
+
},
|
|
2156
|
+
"jd": {
|
|
2157
|
+
"hostVer": "√",
|
|
2158
|
+
"uniVer": "√",
|
|
2159
|
+
"unixVer": "x"
|
|
2160
|
+
}
|
|
2161
|
+
},
|
|
2162
|
+
"web": {
|
|
2163
|
+
"uniVer": "√",
|
|
2164
|
+
"unixVer": "4.0"
|
|
2165
|
+
}
|
|
2166
|
+
}
|
|
2167
|
+
* @example
|
|
2168
|
+
```typescript
|
|
2169
|
+
task.close();
|
|
2170
|
+
```
|
|
2171
|
+
*/
|
|
2172
|
+
close(options: CloseSocketOptions): void;
|
|
2173
|
+
|
|
2174
|
+
/**
|
|
2175
|
+
* 监听 WebSocket 连接打开事件
|
|
2176
|
+
* @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onopen
|
|
2177
|
+
* @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onopen
|
|
2178
|
+
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onopen
|
|
2179
|
+
* @uniPlatform
|
|
2180
|
+
{
|
|
2181
|
+
"app": {
|
|
2182
|
+
"android": {
|
|
2183
|
+
"osVer": "4.4",
|
|
2184
|
+
"uniVer": "√",
|
|
2185
|
+
"uniUtsPlugin": "3.91",
|
|
2186
|
+
"unixVer": "3.91"
|
|
2187
|
+
},
|
|
2188
|
+
"ios": {
|
|
2189
|
+
"osVer": "12.0",
|
|
2190
|
+
"uniVer": "√",
|
|
2191
|
+
"uniUtsPlugin": "4.11",
|
|
2192
|
+
"unixVer": "4.11",
|
|
2193
|
+
"unixUtsPlugin": "4.11"
|
|
2194
|
+
},
|
|
2195
|
+
"harmony": {
|
|
2196
|
+
"osVer": "3.0",
|
|
2197
|
+
"uniVer": "4.23",
|
|
2198
|
+
"unixVer": "4.61",
|
|
2199
|
+
"unixVaporVer": "5.0"
|
|
2200
|
+
}
|
|
2201
|
+
},
|
|
2202
|
+
"mp": {
|
|
2203
|
+
"weixin": {
|
|
2204
|
+
"hostVer": "√",
|
|
2205
|
+
"uniVer": "√",
|
|
2206
|
+
"unixVer": "4.41"
|
|
2207
|
+
},
|
|
2208
|
+
"alipay": {
|
|
2209
|
+
"hostVer": "√",
|
|
2210
|
+
"uniVer": "√",
|
|
2211
|
+
"unixVer": "x"
|
|
2212
|
+
},
|
|
2213
|
+
"baidu": {
|
|
2214
|
+
"hostVer": "√",
|
|
2215
|
+
"uniVer": "√",
|
|
2216
|
+
"unixVer": "x"
|
|
2217
|
+
},
|
|
2218
|
+
"toutiao": {
|
|
2219
|
+
"hostVer": "√",
|
|
2220
|
+
"uniVer": "√",
|
|
2221
|
+
"unixVer": "x"
|
|
2222
|
+
},
|
|
2223
|
+
"lark": {
|
|
2224
|
+
"hostVer": "√",
|
|
2225
|
+
"uniVer": "√",
|
|
2226
|
+
"unixVer": "x"
|
|
2227
|
+
},
|
|
2228
|
+
"qq": {
|
|
2229
|
+
"hostVer": "√",
|
|
2230
|
+
"uniVer": "√",
|
|
2231
|
+
"unixVer": "x"
|
|
2232
|
+
},
|
|
2233
|
+
"kuaishou": {
|
|
2234
|
+
"hostVer": "√",
|
|
2235
|
+
"uniVer": "√",
|
|
2236
|
+
"unixVer": "x"
|
|
2237
|
+
},
|
|
2238
|
+
"jd": {
|
|
2239
|
+
"hostVer": "√",
|
|
2240
|
+
"uniVer": "√",
|
|
2241
|
+
"unixVer": "x"
|
|
2242
|
+
}
|
|
2243
|
+
},
|
|
2244
|
+
"web": {
|
|
2245
|
+
"uniVer": "√",
|
|
2246
|
+
"unixVer": "4.0"
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
* @example
|
|
2250
|
+
```typescript
|
|
2251
|
+
task.onOpen((res) => {})
|
|
2252
|
+
```
|
|
2253
|
+
*/
|
|
2254
|
+
onOpen(callback: (result: OnSocketOpenCallbackResult) => void): void;
|
|
2255
|
+
|
|
2256
|
+
/**
|
|
2257
|
+
* 监听 WebSocket 连接关闭事件
|
|
2258
|
+
* @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onclose
|
|
2259
|
+
* @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onclose
|
|
2260
|
+
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onclose
|
|
2261
|
+
* @uniPlatform
|
|
2262
|
+
{
|
|
2263
|
+
"app": {
|
|
2264
|
+
"android": {
|
|
2265
|
+
"osVer": "4.4",
|
|
2266
|
+
"uniVer": "√",
|
|
2267
|
+
"uniUtsPlugin": "3.91",
|
|
2268
|
+
"unixVer": "3.91"
|
|
2269
|
+
},
|
|
2270
|
+
"ios": {
|
|
2271
|
+
"osVer": "12.0",
|
|
2272
|
+
"uniVer": "√",
|
|
2273
|
+
"uniUtsPlugin": "4.11",
|
|
2274
|
+
"unixVer": "4.11",
|
|
2275
|
+
"unixUtsPlugin": "4.11"
|
|
2276
|
+
},
|
|
2277
|
+
"harmony": {
|
|
2278
|
+
"osVer": "3.0",
|
|
2279
|
+
"uniVer": "4.23",
|
|
2280
|
+
"unixVer": "4.61",
|
|
2281
|
+
"unixVaporVer": "5.0"
|
|
2282
|
+
}
|
|
2283
|
+
},
|
|
2284
|
+
"mp": {
|
|
2285
|
+
"weixin": {
|
|
2286
|
+
"hostVer": "√",
|
|
2287
|
+
"uniVer": "√",
|
|
2288
|
+
"unixVer": "4.41"
|
|
2289
|
+
},
|
|
2290
|
+
"alipay": {
|
|
2291
|
+
"hostVer": "√",
|
|
2292
|
+
"uniVer": "√",
|
|
2293
|
+
"unixVer": "x"
|
|
2294
|
+
},
|
|
2295
|
+
"baidu": {
|
|
2296
|
+
"hostVer": "√",
|
|
2297
|
+
"uniVer": "√",
|
|
2298
|
+
"unixVer": "x"
|
|
2299
|
+
},
|
|
2300
|
+
"toutiao": {
|
|
2301
|
+
"hostVer": "√",
|
|
2302
|
+
"uniVer": "√",
|
|
2303
|
+
"unixVer": "x"
|
|
2304
|
+
},
|
|
2305
|
+
"lark": {
|
|
2306
|
+
"hostVer": "√",
|
|
2307
|
+
"uniVer": "√",
|
|
2308
|
+
"unixVer": "x"
|
|
2309
|
+
},
|
|
2310
|
+
"qq": {
|
|
2311
|
+
"hostVer": "√",
|
|
2312
|
+
"uniVer": "√",
|
|
2313
|
+
"unixVer": "x"
|
|
2314
|
+
},
|
|
2315
|
+
"kuaishou": {
|
|
2316
|
+
"hostVer": "√",
|
|
2317
|
+
"uniVer": "√",
|
|
2318
|
+
"unixVer": "x"
|
|
2319
|
+
},
|
|
2320
|
+
"jd": {
|
|
2321
|
+
"hostVer": "√",
|
|
2322
|
+
"uniVer": "√",
|
|
2323
|
+
"unixVer": "x"
|
|
2324
|
+
}
|
|
2325
|
+
},
|
|
2326
|
+
"web": {
|
|
2327
|
+
"uniVer": "√",
|
|
2328
|
+
"unixVer": "4.0"
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2331
|
+
* @example
|
|
2332
|
+
```typescript
|
|
2333
|
+
task.onClose((res) => {
|
|
2334
|
+
})
|
|
2335
|
+
```
|
|
2336
|
+
*/
|
|
2337
|
+
onClose(callback: (result: any) => void): void;
|
|
2338
|
+
|
|
2339
|
+
/**
|
|
2340
|
+
* onError()
|
|
2341
|
+
* @description
|
|
2342
|
+
* 监听 WebSocket 错误
|
|
2343
|
+
* @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onerror
|
|
2344
|
+
* @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onerror
|
|
2345
|
+
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onerror
|
|
2346
|
+
* @uniPlatform
|
|
2347
|
+
{
|
|
2348
|
+
"app": {
|
|
2349
|
+
"android": {
|
|
2350
|
+
"osVer": "4.4",
|
|
2351
|
+
"uniVer": "√",
|
|
2352
|
+
"uniUtsPlugin": "3.91",
|
|
2353
|
+
"unixVer": "3.91"
|
|
2354
|
+
},
|
|
2355
|
+
"ios": {
|
|
2356
|
+
"osVer": "12.0",
|
|
2357
|
+
"uniVer": "√",
|
|
2358
|
+
"uniUtsPlugin": "4.11",
|
|
2359
|
+
"unixVer": "4.11",
|
|
2360
|
+
"unixUtsPlugin": "4.11"
|
|
2361
|
+
},
|
|
2362
|
+
"harmony": {
|
|
2363
|
+
"osVer": "3.0",
|
|
2364
|
+
"uniVer": "4.23",
|
|
2365
|
+
"unixVer": "4.61",
|
|
2366
|
+
"unixVaporVer": "5.0"
|
|
2367
|
+
}
|
|
2368
|
+
},
|
|
2369
|
+
"mp": {
|
|
2370
|
+
"weixin": {
|
|
2371
|
+
"hostVer": "√",
|
|
2372
|
+
"uniVer": "√",
|
|
2373
|
+
"unixVer": "4.41"
|
|
2374
|
+
},
|
|
2375
|
+
"alipay": {
|
|
2376
|
+
"hostVer": "√",
|
|
2377
|
+
"uniVer": "√",
|
|
2378
|
+
"unixVer": "x"
|
|
2379
|
+
},
|
|
2380
|
+
"baidu": {
|
|
2381
|
+
"hostVer": "√",
|
|
2382
|
+
"uniVer": "√",
|
|
2383
|
+
"unixVer": "x"
|
|
2384
|
+
},
|
|
2385
|
+
"toutiao": {
|
|
2386
|
+
"hostVer": "√",
|
|
2387
|
+
"uniVer": "√",
|
|
2388
|
+
"unixVer": "x"
|
|
2389
|
+
},
|
|
2390
|
+
"lark": {
|
|
2391
|
+
"hostVer": "√",
|
|
2392
|
+
"uniVer": "√",
|
|
2393
|
+
"unixVer": "x"
|
|
2394
|
+
},
|
|
2395
|
+
"qq": {
|
|
2396
|
+
"hostVer": "√",
|
|
2397
|
+
"uniVer": "√",
|
|
2398
|
+
"unixVer": "x"
|
|
2399
|
+
},
|
|
2400
|
+
"kuaishou": {
|
|
2401
|
+
"hostVer": "√",
|
|
2402
|
+
"uniVer": "√",
|
|
2403
|
+
"unixVer": "x"
|
|
2404
|
+
},
|
|
2405
|
+
"jd": {
|
|
2406
|
+
"hostVer": "√",
|
|
2407
|
+
"uniVer": "√",
|
|
2408
|
+
"unixVer": "x"
|
|
2409
|
+
}
|
|
2410
|
+
},
|
|
2411
|
+
"web": {
|
|
2412
|
+
"uniVer": "√",
|
|
2413
|
+
"unixVer": "4.0"
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
* @example
|
|
2417
|
+
```typescript
|
|
2418
|
+
task.onError((res) => {
|
|
2419
|
+
})
|
|
2420
|
+
```
|
|
2421
|
+
*/
|
|
2422
|
+
onError(callback: (result: GeneralCallbackResult) => void): void;
|
|
2423
|
+
|
|
2424
|
+
/**
|
|
2425
|
+
* 监听 WebSocket 接受到服务器的消息事件
|
|
2426
|
+
* @tutorial_uni_app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onmessage
|
|
2427
|
+
* @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onmessage
|
|
2428
|
+
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onmessage
|
|
2429
|
+
* @uniPlatform
|
|
2430
|
+
{
|
|
2431
|
+
"app": {
|
|
2432
|
+
"android": {
|
|
2433
|
+
"osVer": "4.4",
|
|
2434
|
+
"uniVer": "√",
|
|
2435
|
+
"uniUtsPlugin": "3.91",
|
|
2436
|
+
"unixVer": "3.91"
|
|
2437
|
+
},
|
|
2438
|
+
"ios": {
|
|
2439
|
+
"osVer": "12.0",
|
|
2440
|
+
"uniVer": "√",
|
|
2441
|
+
"uniUtsPlugin": "4.11",
|
|
2442
|
+
"unixVer": "4.11",
|
|
2443
|
+
"unixUtsPlugin": "4.11"
|
|
2444
|
+
},
|
|
2445
|
+
"harmony": {
|
|
2446
|
+
"osVer": "3.0",
|
|
2447
|
+
"uniVer": "4.23",
|
|
2448
|
+
"unixVer": "4.61",
|
|
2449
|
+
"unixVaporVer": "5.0"
|
|
2450
|
+
}
|
|
2451
|
+
},
|
|
2452
|
+
"mp": {
|
|
2453
|
+
"weixin": {
|
|
2454
|
+
"hostVer": "√",
|
|
2455
|
+
"uniVer": "√",
|
|
2456
|
+
"unixVer": "4.41"
|
|
2457
|
+
},
|
|
2458
|
+
"alipay": {
|
|
2459
|
+
"hostVer": "√",
|
|
2460
|
+
"uniVer": "√",
|
|
2461
|
+
"unixVer": "x"
|
|
2462
|
+
},
|
|
2463
|
+
"baidu": {
|
|
2464
|
+
"hostVer": "√",
|
|
2465
|
+
"uniVer": "√",
|
|
2466
|
+
"unixVer": "x"
|
|
2467
|
+
},
|
|
2468
|
+
"toutiao": {
|
|
2469
|
+
"hostVer": "√",
|
|
2470
|
+
"uniVer": "√",
|
|
2471
|
+
"unixVer": "x"
|
|
2472
|
+
},
|
|
2473
|
+
"lark": {
|
|
2474
|
+
"hostVer": "√",
|
|
2475
|
+
"uniVer": "√",
|
|
2476
|
+
"unixVer": "x"
|
|
2477
|
+
},
|
|
2478
|
+
"qq": {
|
|
2479
|
+
"hostVer": "√",
|
|
2480
|
+
"uniVer": "√",
|
|
2481
|
+
"unixVer": "x"
|
|
2482
|
+
},
|
|
2483
|
+
"kuaishou": {
|
|
2484
|
+
"hostVer": "√",
|
|
2485
|
+
"uniVer": "√",
|
|
2486
|
+
"unixVer": "x"
|
|
2487
|
+
},
|
|
2488
|
+
"jd": {
|
|
2489
|
+
"hostVer": "√",
|
|
2490
|
+
"uniVer": "√",
|
|
2491
|
+
"unixVer": "x"
|
|
2492
|
+
}
|
|
2493
|
+
},
|
|
2494
|
+
"web": {
|
|
2495
|
+
"uniVer": "√",
|
|
2496
|
+
"unixVer": "4.0"
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
* @example
|
|
2500
|
+
```typescript
|
|
2501
|
+
task.onMessage((res) => {
|
|
2502
|
+
})
|
|
2503
|
+
```
|
|
2504
|
+
*/
|
|
2505
|
+
onMessage(callback: (result: OnSocketMessageCallbackResult) => void): void;
|
|
2506
|
+
};
|
|
2507
|
+
export type OnSocketOpenCallback = (result: OnSocketOpenCallbackResult) => void;
|
|
2508
|
+
|
|
2509
|
+
export type OnSocketOpen = (options: OnSocketOpenCallback) => void;
|
|
2510
|
+
export type OnSocketErrorCallbackResult = {
|
|
2511
|
+
/**
|
|
2512
2512
|
* 错误信息
|
|
2513
2513
|
* @uniPlatform {
|
|
2514
2514
|
* "mp": {
|
|
@@ -2554,162 +2554,162 @@ export type OnSocketErrorCallbackResult = {
|
|
|
2554
2554
|
* }
|
|
2555
2555
|
* }
|
|
2556
2556
|
* }
|
|
2557
|
-
*/
|
|
2558
|
-
errMsg: string
|
|
2559
|
-
};
|
|
2560
|
-
export type OnSocketErrorCallback = (result: OnSocketErrorCallbackResult) => void;
|
|
2561
|
-
|
|
2562
|
-
export type OnSocketError = (callback: OnSocketErrorCallback) => void;
|
|
2563
|
-
|
|
2564
|
-
export type SendSocketMessage = (options: SendSocketMessageOptions) => void;
|
|
2565
|
-
export type OnSocketMessageCallback = (result: OnSocketMessageCallbackResult) => void;
|
|
2566
|
-
|
|
2567
|
-
export type OnSocketMessage = (callback: OnSocketMessageCallback) => void;
|
|
2568
|
-
|
|
2569
|
-
export type CloseSocket = (options: CloseSocketOptions) => void;
|
|
2570
|
-
export type OnSocketCloseCallbackResult = {
|
|
2571
|
-
/**
|
|
2572
|
-
* 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。
|
|
2573
|
-
* @uniPlatform
|
|
2574
|
-
{
|
|
2575
|
-
"app": {
|
|
2576
|
-
"android": {
|
|
2577
|
-
"osVer": "4.4",
|
|
2578
|
-
"uniVer": "√",
|
|
2579
|
-
"uniUtsPlugin": "3.91",
|
|
2580
|
-
"unixVer": "3.91"
|
|
2581
|
-
},
|
|
2582
|
-
"ios": {
|
|
2583
|
-
"osVer": "12.0",
|
|
2584
|
-
"uniVer": "√",
|
|
2585
|
-
"uniUtsPlugin": "4.11",
|
|
2586
|
-
"unixVer": "4.11",
|
|
2587
|
-
"unixUtsPlugin": "4.11"
|
|
2588
|
-
},
|
|
2589
|
-
"harmony": {
|
|
2590
|
-
"osVer": "3.0",
|
|
2591
|
-
"uniVer": "4.23",
|
|
2592
|
-
"unixVer": "4.61",
|
|
2593
|
-
"
|
|
2594
|
-
}
|
|
2595
|
-
},
|
|
2596
|
-
"mp": {
|
|
2597
|
-
"weixin": {
|
|
2598
|
-
"hostVer": "√",
|
|
2599
|
-
"uniVer": "√",
|
|
2600
|
-
"unixVer": "4.41"
|
|
2601
|
-
},
|
|
2602
|
-
"alipay": {
|
|
2603
|
-
"hostVer": "√",
|
|
2604
|
-
"uniVer": "√",
|
|
2605
|
-
"unixVer": "x"
|
|
2606
|
-
},
|
|
2607
|
-
"baidu": {
|
|
2608
|
-
"hostVer": "√",
|
|
2609
|
-
"uniVer": "√",
|
|
2610
|
-
"unixVer": "x"
|
|
2611
|
-
},
|
|
2612
|
-
"toutiao": {
|
|
2613
|
-
"hostVer": "√",
|
|
2614
|
-
"uniVer": "√",
|
|
2615
|
-
"unixVer": "x"
|
|
2616
|
-
},
|
|
2617
|
-
"lark": {
|
|
2618
|
-
"hostVer": "√",
|
|
2619
|
-
"uniVer": "√",
|
|
2620
|
-
"unixVer": "x"
|
|
2621
|
-
},
|
|
2622
|
-
"qq": {
|
|
2623
|
-
"hostVer": "√",
|
|
2624
|
-
"uniVer": "√",
|
|
2625
|
-
"unixVer": "x"
|
|
2626
|
-
},
|
|
2627
|
-
"kuaishou": {
|
|
2628
|
-
"hostVer": "√",
|
|
2629
|
-
"uniVer": "√",
|
|
2630
|
-
"unixVer": "x"
|
|
2631
|
-
},
|
|
2632
|
-
"jd": {
|
|
2633
|
-
"hostVer": "√",
|
|
2634
|
-
"uniVer": "√",
|
|
2635
|
-
"unixVer": "x"
|
|
2636
|
-
}
|
|
2637
|
-
}
|
|
2638
|
-
}
|
|
2639
|
-
*/
|
|
2640
|
-
code: number,
|
|
2641
|
-
|
|
2642
|
-
/**
|
|
2643
|
-
* 一个可读的字符串,表示连接被关闭的原因。
|
|
2644
|
-
* @uniPlatform
|
|
2645
|
-
{
|
|
2646
|
-
"app": {
|
|
2647
|
-
"android": {
|
|
2648
|
-
"osVer": "4.4",
|
|
2649
|
-
"uniVer": "√",
|
|
2650
|
-
"uniUtsPlugin": "3.91",
|
|
2651
|
-
"unixVer": "3.91"
|
|
2652
|
-
},
|
|
2653
|
-
"ios": {
|
|
2654
|
-
"osVer": "12.0",
|
|
2655
|
-
"uniVer": "√",
|
|
2656
|
-
"uniUtsPlugin": "4.11",
|
|
2657
|
-
"unixVer": "4.11",
|
|
2658
|
-
"unixUtsPlugin": "4.11"
|
|
2659
|
-
},
|
|
2660
|
-
"harmony": {
|
|
2661
|
-
"osVer": "3.0",
|
|
2662
|
-
"uniVer": "4.23",
|
|
2663
|
-
"unixVer": "4.61",
|
|
2664
|
-
"
|
|
2665
|
-
}
|
|
2666
|
-
},
|
|
2667
|
-
"mp": {
|
|
2668
|
-
"weixin": {
|
|
2669
|
-
"hostVer": "√",
|
|
2670
|
-
"uniVer": "√",
|
|
2671
|
-
"unixVer": "4.41"
|
|
2672
|
-
},
|
|
2673
|
-
"alipay": {
|
|
2674
|
-
"hostVer": "√",
|
|
2675
|
-
"uniVer": "√",
|
|
2676
|
-
"unixVer": "x"
|
|
2677
|
-
},
|
|
2678
|
-
"baidu": {
|
|
2679
|
-
"hostVer": "√",
|
|
2680
|
-
"uniVer": "√",
|
|
2681
|
-
"unixVer": "x"
|
|
2682
|
-
},
|
|
2683
|
-
"toutiao": {
|
|
2684
|
-
"hostVer": "√",
|
|
2685
|
-
"uniVer": "√",
|
|
2686
|
-
"unixVer": "x"
|
|
2687
|
-
},
|
|
2688
|
-
"lark": {
|
|
2689
|
-
"hostVer": "√",
|
|
2690
|
-
"uniVer": "√",
|
|
2691
|
-
"unixVer": "x"
|
|
2692
|
-
},
|
|
2693
|
-
"qq": {
|
|
2694
|
-
"hostVer": "√",
|
|
2695
|
-
"uniVer": "√",
|
|
2696
|
-
"unixVer": "x"
|
|
2697
|
-
},
|
|
2698
|
-
"kuaishou": {
|
|
2699
|
-
"hostVer": "√",
|
|
2700
|
-
"uniVer": "√",
|
|
2701
|
-
"unixVer": "x"
|
|
2702
|
-
},
|
|
2703
|
-
"jd": {
|
|
2704
|
-
"hostVer": "√",
|
|
2705
|
-
"uniVer": "√",
|
|
2706
|
-
"unixVer": "x"
|
|
2707
|
-
}
|
|
2708
|
-
}
|
|
2709
|
-
}
|
|
2710
|
-
*/
|
|
2711
|
-
reason: string
|
|
2712
|
-
};
|
|
2713
|
-
export type OnSocketCloseCallback = (result: OnSocketCloseCallbackResult) => void;
|
|
2714
|
-
|
|
2715
|
-
export type OnSocketClose = (callback: OnSocketCloseCallback) => void;
|
|
2557
|
+
*/
|
|
2558
|
+
errMsg: string
|
|
2559
|
+
};
|
|
2560
|
+
export type OnSocketErrorCallback = (result: OnSocketErrorCallbackResult) => void;
|
|
2561
|
+
|
|
2562
|
+
export type OnSocketError = (callback: OnSocketErrorCallback) => void;
|
|
2563
|
+
|
|
2564
|
+
export type SendSocketMessage = (options: SendSocketMessageOptions) => void;
|
|
2565
|
+
export type OnSocketMessageCallback = (result: OnSocketMessageCallbackResult) => void;
|
|
2566
|
+
|
|
2567
|
+
export type OnSocketMessage = (callback: OnSocketMessageCallback) => void;
|
|
2568
|
+
|
|
2569
|
+
export type CloseSocket = (options: CloseSocketOptions) => void;
|
|
2570
|
+
export type OnSocketCloseCallbackResult = {
|
|
2571
|
+
/**
|
|
2572
|
+
* 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。
|
|
2573
|
+
* @uniPlatform
|
|
2574
|
+
{
|
|
2575
|
+
"app": {
|
|
2576
|
+
"android": {
|
|
2577
|
+
"osVer": "4.4",
|
|
2578
|
+
"uniVer": "√",
|
|
2579
|
+
"uniUtsPlugin": "3.91",
|
|
2580
|
+
"unixVer": "3.91"
|
|
2581
|
+
},
|
|
2582
|
+
"ios": {
|
|
2583
|
+
"osVer": "12.0",
|
|
2584
|
+
"uniVer": "√",
|
|
2585
|
+
"uniUtsPlugin": "4.11",
|
|
2586
|
+
"unixVer": "4.11",
|
|
2587
|
+
"unixUtsPlugin": "4.11"
|
|
2588
|
+
},
|
|
2589
|
+
"harmony": {
|
|
2590
|
+
"osVer": "3.0",
|
|
2591
|
+
"uniVer": "4.23",
|
|
2592
|
+
"unixVer": "4.61",
|
|
2593
|
+
"unixVaporVer": "5.0"
|
|
2594
|
+
}
|
|
2595
|
+
},
|
|
2596
|
+
"mp": {
|
|
2597
|
+
"weixin": {
|
|
2598
|
+
"hostVer": "√",
|
|
2599
|
+
"uniVer": "√",
|
|
2600
|
+
"unixVer": "4.41"
|
|
2601
|
+
},
|
|
2602
|
+
"alipay": {
|
|
2603
|
+
"hostVer": "√",
|
|
2604
|
+
"uniVer": "√",
|
|
2605
|
+
"unixVer": "x"
|
|
2606
|
+
},
|
|
2607
|
+
"baidu": {
|
|
2608
|
+
"hostVer": "√",
|
|
2609
|
+
"uniVer": "√",
|
|
2610
|
+
"unixVer": "x"
|
|
2611
|
+
},
|
|
2612
|
+
"toutiao": {
|
|
2613
|
+
"hostVer": "√",
|
|
2614
|
+
"uniVer": "√",
|
|
2615
|
+
"unixVer": "x"
|
|
2616
|
+
},
|
|
2617
|
+
"lark": {
|
|
2618
|
+
"hostVer": "√",
|
|
2619
|
+
"uniVer": "√",
|
|
2620
|
+
"unixVer": "x"
|
|
2621
|
+
},
|
|
2622
|
+
"qq": {
|
|
2623
|
+
"hostVer": "√",
|
|
2624
|
+
"uniVer": "√",
|
|
2625
|
+
"unixVer": "x"
|
|
2626
|
+
},
|
|
2627
|
+
"kuaishou": {
|
|
2628
|
+
"hostVer": "√",
|
|
2629
|
+
"uniVer": "√",
|
|
2630
|
+
"unixVer": "x"
|
|
2631
|
+
},
|
|
2632
|
+
"jd": {
|
|
2633
|
+
"hostVer": "√",
|
|
2634
|
+
"uniVer": "√",
|
|
2635
|
+
"unixVer": "x"
|
|
2636
|
+
}
|
|
2637
|
+
}
|
|
2638
|
+
}
|
|
2639
|
+
*/
|
|
2640
|
+
code: number,
|
|
2641
|
+
|
|
2642
|
+
/**
|
|
2643
|
+
* 一个可读的字符串,表示连接被关闭的原因。
|
|
2644
|
+
* @uniPlatform
|
|
2645
|
+
{
|
|
2646
|
+
"app": {
|
|
2647
|
+
"android": {
|
|
2648
|
+
"osVer": "4.4",
|
|
2649
|
+
"uniVer": "√",
|
|
2650
|
+
"uniUtsPlugin": "3.91",
|
|
2651
|
+
"unixVer": "3.91"
|
|
2652
|
+
},
|
|
2653
|
+
"ios": {
|
|
2654
|
+
"osVer": "12.0",
|
|
2655
|
+
"uniVer": "√",
|
|
2656
|
+
"uniUtsPlugin": "4.11",
|
|
2657
|
+
"unixVer": "4.11",
|
|
2658
|
+
"unixUtsPlugin": "4.11"
|
|
2659
|
+
},
|
|
2660
|
+
"harmony": {
|
|
2661
|
+
"osVer": "3.0",
|
|
2662
|
+
"uniVer": "4.23",
|
|
2663
|
+
"unixVer": "4.61",
|
|
2664
|
+
"unixVaporVer": "5.0"
|
|
2665
|
+
}
|
|
2666
|
+
},
|
|
2667
|
+
"mp": {
|
|
2668
|
+
"weixin": {
|
|
2669
|
+
"hostVer": "√",
|
|
2670
|
+
"uniVer": "√",
|
|
2671
|
+
"unixVer": "4.41"
|
|
2672
|
+
},
|
|
2673
|
+
"alipay": {
|
|
2674
|
+
"hostVer": "√",
|
|
2675
|
+
"uniVer": "√",
|
|
2676
|
+
"unixVer": "x"
|
|
2677
|
+
},
|
|
2678
|
+
"baidu": {
|
|
2679
|
+
"hostVer": "√",
|
|
2680
|
+
"uniVer": "√",
|
|
2681
|
+
"unixVer": "x"
|
|
2682
|
+
},
|
|
2683
|
+
"toutiao": {
|
|
2684
|
+
"hostVer": "√",
|
|
2685
|
+
"uniVer": "√",
|
|
2686
|
+
"unixVer": "x"
|
|
2687
|
+
},
|
|
2688
|
+
"lark": {
|
|
2689
|
+
"hostVer": "√",
|
|
2690
|
+
"uniVer": "√",
|
|
2691
|
+
"unixVer": "x"
|
|
2692
|
+
},
|
|
2693
|
+
"qq": {
|
|
2694
|
+
"hostVer": "√",
|
|
2695
|
+
"uniVer": "√",
|
|
2696
|
+
"unixVer": "x"
|
|
2697
|
+
},
|
|
2698
|
+
"kuaishou": {
|
|
2699
|
+
"hostVer": "√",
|
|
2700
|
+
"uniVer": "√",
|
|
2701
|
+
"unixVer": "x"
|
|
2702
|
+
},
|
|
2703
|
+
"jd": {
|
|
2704
|
+
"hostVer": "√",
|
|
2705
|
+
"uniVer": "√",
|
|
2706
|
+
"unixVer": "x"
|
|
2707
|
+
}
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2710
|
+
*/
|
|
2711
|
+
reason: string
|
|
2712
|
+
};
|
|
2713
|
+
export type OnSocketCloseCallback = (result: OnSocketCloseCallbackResult) => void;
|
|
2714
|
+
|
|
2715
|
+
export type OnSocketClose = (callback: OnSocketCloseCallback) => void;
|