@dcloudio/uni-app-x 0.7.13 → 0.7.15
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/options.d.ts +1 -1
- package/package.json +1 -1
- package/types/app.d.ts +5 -6
- package/types/index.d.ts +1 -1
- package/types/native/CanvasRenderingContext2D.d.ts +378 -0
- package/types/native/IUniElement.d.ts +40 -12
- package/types/native/Path2D.d.ts +74 -0
- package/types/native/UniApp.d.ts +17 -1
- package/types/native/UniCanvasElement.d.ts +9 -0
- package/types/native/UniEvent.d.ts +30 -0
- package/types/native/UniNativePage.d.ts +31 -1
- package/types/native/UniPageManager.d.ts +4 -1
- package/types/native/UniProvider.d.ts +14 -0
- package/types/native/UniResizeObserver.d.ts +10 -10
- package/types/native/UniScrollEvent.d.ts +1 -1
- package/types/native/UniSwiperAnimationFinishEvent.d.ts +24 -2
- package/types/native/UniSwiperChangeEvent.d.ts +24 -2
- package/types/native/UniSwiperTransitionEvent.d.ts +2 -2
- package/types/native/UniWebViewErrorEvent.d.ts +3 -3
- package/types/native/UniWebViewLoadEvent.d.ts +2 -2
- package/types/native/UniWebViewLoadingEvent.d.ts +2 -2
- package/types/native/UniWebViewMessageEvent.d.ts +1 -1
- package/types/native/global.d.ts +40 -9
- package/types/native/index.d.ts +4 -0
- package/types/page.d.ts +85 -0
- package/types/shim-uts-basic.d.ts +4495 -0
- package/types/uni/env/index.d.ts +21 -0
- package/types/uni/global.d.ts +1 -0
- package/types/uni/index.d.ts +2 -1
- package/types/uni/uts-plugin-api/global.d.ts +14 -2
- package/types/uni/uts-plugin-api/index.d.ts +14 -2
- package/types/uni/uts-plugin-api/lib/uni-arrayBufferToBase64/utssdk/global.d.ts +10 -0
- package/types/uni/uts-plugin-api/lib/uni-arrayBufferToBase64/utssdk/index.d.ts +4 -0
- package/types/uni/uts-plugin-api/lib/uni-arrayBufferToBase64/utssdk/interface.d.ts +77 -0
- package/types/uni/uts-plugin-api/lib/uni-base64ToArrayBuffer/utssdk/global.d.ts +10 -0
- package/types/uni/uts-plugin-api/lib/uni-base64ToArrayBuffer/utssdk/index.d.ts +4 -0
- package/types/uni/uts-plugin-api/lib/uni-base64ToArrayBuffer/utssdk/interface.d.ts +77 -0
- package/types/uni/uts-plugin-api/lib/uni-clipboard/utssdk/global.d.ts +40 -0
- package/types/uni/uts-plugin-api/lib/uni-clipboard/utssdk/index.d.ts +19 -0
- package/types/uni/uts-plugin-api/lib/uni-clipboard/utssdk/interface.d.ts +203 -0
- package/types/uni/uts-plugin-api/lib/uni-createIntersectionObserver/utssdk/global.d.ts +20 -0
- package/types/uni/uts-plugin-api/lib/uni-createIntersectionObserver/utssdk/index.d.ts +9 -0
- package/types/uni/uts-plugin-api/lib/uni-createIntersectionObserver/utssdk/interface.d.ts +152 -0
- package/types/uni/uts-plugin-api/lib/uni-createRequestPermissionListener/utssdk/interface.d.ts +20 -3
- package/types/uni/uts-plugin-api/lib/uni-createSelectorQuery/utssdk/interface.d.ts +19 -8
- package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/interface.d.ts +13 -6
- package/types/uni/uts-plugin-api/lib/uni-event/utssdk/interface.d.ts +30 -2
- package/types/uni/uts-plugin-api/lib/uni-exit/utssdk/interface.d.ts +12 -3
- package/types/uni/uts-plugin-api/lib/uni-fileSystemManager/utssdk/global.d.ts +6 -0
- package/types/uni/uts-plugin-api/lib/uni-fileSystemManager/utssdk/index.d.ts +3 -0
- package/types/uni/uts-plugin-api/lib/uni-fileSystemManager/utssdk/interface.d.ts +64 -8
- package/types/uni/uts-plugin-api/lib/uni-getAccessibilityInfo/utssdk/interface.d.ts +20 -17
- package/types/uni/uts-plugin-api/lib/uni-getAppAuthorizeSetting/utssdk/interface.d.ts +111 -27
- package/types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +465 -45
- package/types/uni/uts-plugin-api/lib/uni-getDeviceInfo/utssdk/interface.d.ts +651 -115
- package/types/uni/uts-plugin-api/lib/uni-getElementById/utssdk/interface.d.ts +7 -1
- package/types/uni/uts-plugin-api/lib/uni-getLaunchOptionsSync/utssdk/interface.d.ts +10 -1
- package/types/uni/uts-plugin-api/lib/uni-getLocation/utssdk/global.d.ts +24 -0
- package/types/uni/uts-plugin-api/lib/uni-getLocation/utssdk/index.d.ts +11 -0
- package/types/uni/uts-plugin-api/lib/uni-getLocation/utssdk/interface.d.ts +173 -0
- package/types/uni/uts-plugin-api/lib/uni-getLocation-system/utssdk/global.d.ts +2 -14
- package/types/uni/uts-plugin-api/lib/uni-getLocation-system/utssdk/index.d.ts +1 -6
- package/types/uni/uts-plugin-api/lib/uni-getLocation-system/utssdk/interface.d.ts +1 -151
- package/types/uni/uts-plugin-api/lib/uni-getLocation-tencent/utssdk/global.d.ts +8 -0
- package/types/uni/uts-plugin-api/lib/uni-getLocation-tencent/utssdk/index.d.ts +4 -0
- package/types/uni/uts-plugin-api/lib/uni-getLocation-tencent/utssdk/interface.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-getNetworkType/utssdk/interface.d.ts +12 -5
- package/types/uni/uts-plugin-api/lib/uni-getPerformance/utssdk/interface.d.ts +11 -5
- package/types/uni/uts-plugin-api/lib/uni-getProvider/utssdk/global.d.ts +8 -0
- package/types/uni/uts-plugin-api/lib/uni-getProvider/utssdk/index.d.ts +4 -0
- package/types/uni/uts-plugin-api/lib/uni-getProvider/utssdk/interface.d.ts +176 -72
- package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/interface.d.ts +1728 -59
- package/types/uni/uts-plugin-api/lib/uni-getSystemSetting/utssdk/interface.d.ts +123 -16
- package/types/uni/uts-plugin-api/lib/uni-installApk/utssdk/interface.d.ts +9 -6
- package/types/uni/uts-plugin-api/lib/uni-interceptor/utssdk/interface.d.ts +18 -2
- package/types/uni/uts-plugin-api/lib/uni-keyboard/utssdk/global.d.ts +22 -0
- package/types/uni/uts-plugin-api/lib/uni-keyboard/utssdk/index.d.ts +10 -0
- package/types/uni/uts-plugin-api/lib/uni-keyboard/utssdk/interface.d.ts +60 -0
- package/types/uni/uts-plugin-api/lib/uni-loadFontFace/utssdk/interface.d.ts +8 -1
- package/types/uni/uts-plugin-api/lib/uni-makePhoneCall/utssdk/global.d.ts +24 -0
- package/types/uni/uts-plugin-api/lib/uni-makePhoneCall/utssdk/index.d.ts +11 -0
- package/types/uni/uts-plugin-api/lib/uni-makePhoneCall/utssdk/interface.d.ts +100 -0
- package/types/uni/uts-plugin-api/lib/uni-media/utssdk/global.d.ts +2 -0
- package/types/uni/uts-plugin-api/lib/uni-media/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-media/utssdk/interface.d.ts +459 -67
- package/types/uni/uts-plugin-api/lib/uni-navigationBar/utssdk/interface.d.ts +34 -5
- package/types/uni/uts-plugin-api/lib/uni-network/utssdk/interface.d.ts +909 -101
- package/types/uni/uts-plugin-api/lib/uni-openAppAuthorizeSetting/utssdk/interface.d.ts +20 -15
- package/types/uni/uts-plugin-api/lib/uni-openDocument/utssdk/global.d.ts +24 -0
- package/types/uni/uts-plugin-api/lib/uni-openDocument/utssdk/index.d.ts +11 -0
- package/types/uni/uts-plugin-api/lib/uni-openDocument/utssdk/interface.d.ts +70 -0
- package/types/uni/uts-plugin-api/lib/uni-pageScrollTo/utssdk/global.d.ts +2 -0
- package/types/uni/uts-plugin-api/lib/uni-pageScrollTo/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-pageScrollTo/utssdk/interface.d.ts +16 -6
- package/types/uni/uts-plugin-api/lib/uni-payment/utssdk/interface.d.ts +26 -16
- package/types/uni/uts-plugin-api/lib/uni-payment-alipay/utssdk/global.d.ts +8 -0
- package/types/uni/uts-plugin-api/lib/uni-payment-alipay/utssdk/index.d.ts +4 -0
- package/types/uni/uts-plugin-api/lib/uni-payment-alipay/utssdk/interface.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-payment-wxpay/utssdk/global.d.ts +8 -0
- package/types/uni/uts-plugin-api/lib/uni-payment-wxpay/utssdk/index.d.ts +4 -0
- package/types/uni/uts-plugin-api/lib/uni-payment-wxpay/utssdk/interface.d.ts +3 -0
- package/types/uni/uts-plugin-api/lib/uni-prompt/utssdk/interface.d.ts +120 -42
- package/types/uni/uts-plugin-api/lib/uni-pullDownRefresh/utssdk/global.d.ts +2 -0
- package/types/uni/uts-plugin-api/lib/uni-pullDownRefresh/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-pullDownRefresh/utssdk/interface.d.ts +16 -1
- package/types/uni/uts-plugin-api/lib/uni-route/utssdk/interface.d.ts +251 -42
- package/types/uni/uts-plugin-api/lib/uni-rpx2px/utssdk/interface.d.ts +7 -2
- package/types/uni/uts-plugin-api/lib/uni-scanCode/utssdk/global.d.ts +24 -0
- package/types/uni/uts-plugin-api/lib/uni-scanCode/utssdk/index.d.ts +11 -0
- package/types/uni/uts-plugin-api/lib/uni-scanCode/utssdk/interface.d.ts +73 -0
- package/types/uni/uts-plugin-api/lib/uni-storage/utssdk/interface.d.ts +114 -45
- package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/global.d.ts +16 -0
- package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/index.d.ts +8 -0
- package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/interface.d.ts +167 -7
- package/types/uni/uts-plugin-api/lib/uni-theme/utssdk/global.d.ts +42 -0
- package/types/uni/uts-plugin-api/lib/uni-theme/utssdk/index.d.ts +20 -0
- package/types/uni/uts-plugin-api/lib/uni-theme/utssdk/interface.d.ts +516 -0
- package/types/uni/uts-plugin-api/lib/uni-websocket/utssdk/interface.d.ts +320 -83
- package/types/uni/uts-plugin-biz/lib/uni-ad/utssdk/global.d.ts +4 -4
- package/types/uni/uts-plugin-biz/lib/uni-ad/utssdk/index.d.ts +2 -2
- package/types/uni/uts-plugin-biz/lib/uni-ad/utssdk/interface.d.ts +48 -39
- package/types/uni/uts-plugin-biz/lib/uni-facialRecognitionVerify/utssdk/interface.d.ts +33 -15
- package/types/uni/uts-plugin-biz/lib/uni-push/utssdk/global.d.ts +4 -0
- package/types/uni/uts-plugin-biz/lib/uni-push/utssdk/index.d.ts +2 -0
- package/types/uni/uts-plugin-biz/lib/uni-push/utssdk/interface.d.ts +777 -394
- package/types/uni/uts-plugin-biz/lib/uni-verify/utssdk/interface.d.ts +19 -15
- package/types/uni/uts-plugin-component/lib/uni-video/utssdk/interface.d.ts +132 -15
- package/types/uni/uts-plugin-extend/README.md +3 -0
- package/types/uni/uts-plugin-extend/global.d.ts +13 -0
- package/types/uni/uts-plugin-extend/index.d.ts +13 -0
- package/types/uni/uts-plugin-extend/lib/uni-accelerometer/utssdk/global.d.ts +12 -0
- package/types/uni/uts-plugin-extend/lib/uni-accelerometer/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-extend/lib/uni-accelerometer/utssdk/interface.d.ts +365 -0
- package/types/uni/uts-plugin-extend/lib/uni-canvas/utssdk/global.d.ts +23 -0
- package/types/uni/uts-plugin-extend/lib/uni-canvas/utssdk/index.d.ts +10 -0
- package/types/uni/uts-plugin-extend/lib/uni-canvas/utssdk/interface.d.ts +710 -0
- package/types/uni/uts-plugin-extend/lib/uni-chooseLocation/utssdk/global.d.ts +21 -0
- package/types/uni/uts-plugin-extend/lib/uni-chooseLocation/utssdk/index.d.ts +9 -0
- package/types/uni/uts-plugin-extend/lib/uni-chooseLocation/utssdk/interface.d.ts +151 -0
- package/types/uni/uts-plugin-extend/lib/uni-compass/utssdk/global.d.ts +25 -0
- package/types/uni/uts-plugin-extend/lib/uni-compass/utssdk/index.d.ts +11 -0
- package/types/uni/uts-plugin-extend/lib/uni-compass/utssdk/interface.d.ts +363 -0
- package/types/uni/uts-plugin-extend/lib/uni-createInnerAudioContext/utssdk/global.d.ts +11 -0
- package/types/uni/uts-plugin-extend/lib/uni-createInnerAudioContext/utssdk/index.d.ts +4 -0
- package/types/uni/uts-plugin-extend/lib/uni-createInnerAudioContext/utssdk/interface.d.ts +224 -0
- package/types/uni/uts-plugin-extend/lib/uni-createMapContext/utssdk/global.d.ts +53 -0
- package/types/uni/uts-plugin-extend/lib/uni-createMapContext/utssdk/index.d.ts +25 -0
- package/types/uni/uts-plugin-extend/lib/uni-createMapContext/utssdk/interface.d.ts +486 -0
- package/types/uni/uts-plugin-extend/lib/uni-getBackgroundAudioManager/utssdk/global.d.ts +7 -0
- package/types/uni/uts-plugin-extend/lib/uni-getBackgroundAudioManager/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-extend/lib/uni-getBackgroundAudioManager/utssdk/interface.d.ts +296 -0
- package/types/uni/uts-plugin-extend/lib/uni-locale/utssdk/global.d.ts +15 -0
- package/types/uni/uts-plugin-extend/lib/uni-locale/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-extend/lib/uni-locale/utssdk/interface.d.ts +229 -0
- package/types/uni/uts-plugin-extend/lib/uni-localeChange/utssdk/global.d.ts +14 -0
- package/types/uni/uts-plugin-extend/lib/uni-localeChange/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-extend/lib/uni-localeChange/utssdk/interface.d.ts +559 -0
- package/types/uni/uts-plugin-extend/lib/uni-memory/utssdk/global.d.ts +9 -0
- package/types/uni/uts-plugin-extend/lib/uni-memory/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-extend/lib/uni-memory/utssdk/interface.d.ts +163 -0
- package/types/uni/uts-plugin-extend/lib/uni-openLocation/utssdk/global.d.ts +21 -0
- package/types/uni/uts-plugin-extend/lib/uni-openLocation/utssdk/index.d.ts +9 -0
- package/types/uni/uts-plugin-extend/lib/uni-openLocation/utssdk/interface.d.ts +143 -0
- package/types/uni/uts-plugin-extend/lib/uni-preloadPage/utssdk/global.d.ts +7 -0
- package/types/uni/uts-plugin-extend/lib/uni-preloadPage/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-extend/lib/uni-preloadPage/utssdk/interface.d.ts +106 -0
- package/types/uni/uts-plugin-extend/lib/uni-theme/utssdk/global.d.ts +9 -0
- package/types/uni/uts-plugin-extend/lib/uni-theme/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-extend/lib/uni-theme/utssdk/interface.d.ts +165 -0
- package/types/uni-cloud/index.d.ts +4 -0
- package/types/uni-cloud/interface.d.ts +163 -20
- package/types/vue/CheckboxGroupChangeEvent.d.ts +10 -13
- package/types/vue/LifeCycle.d.ts +32 -32
- package/types/vue/PickerViewChangeEvent.d.ts +10 -13
- package/types/vue/ProgressActiveendEvent.d.ts +9 -11
- package/types/vue/RadioGroupChangeEvent.d.ts +10 -13
- package/types/vue/SliderChangeEvent.d.ts +9 -10
- package/types/vue/SwitchChangeEvent.d.ts +11 -13
- package/types/vue/UniCloudDBElement.d.ts +72 -75
- package/types/vue/UniFormElement.d.ts +17 -19
- package/types/vue/UniNavigatorElement.d.ts +1 -2
- package/types/vue/global.d.ts +190 -0
- package/types/vue/index.d.ts +10 -11
- package/types/vue-global/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-network/utssdk/app-ios/global.d.ts +0 -78
- package/types/uni/uts-plugin-api/lib/uni-network/utssdk/app-ios/index.d.ts +0 -38
- package/types/uni/uts-plugin-api/lib/uni-network/utssdk/app-ios/interface.d.ts +0 -643
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export interface Uni {
|
|
2
2
|
/**
|
|
3
|
-
* ConnectSocket()
|
|
4
|
-
* @description
|
|
5
3
|
* 创建一个 WebSocket 连接。
|
|
6
|
-
* @
|
|
7
|
-
* @
|
|
8
|
-
* @tutorial https://
|
|
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
|
|
9
7
|
* @uniPlatform
|
|
10
8
|
* {
|
|
11
9
|
* "app": {
|
|
@@ -18,7 +16,12 @@ export interface Uni {
|
|
|
18
16
|
* "osVer": "12.0",
|
|
19
17
|
* "uniVer": "√",
|
|
20
18
|
* "unixVer": "4.11"
|
|
21
|
-
* }
|
|
19
|
+
* },
|
|
20
|
+
* "harmony": {
|
|
21
|
+
* "osVer": "3.0",
|
|
22
|
+
* "uniVer": "4.23",
|
|
23
|
+
* "unixVer": "x"
|
|
24
|
+
* }
|
|
22
25
|
* },
|
|
23
26
|
* "web": {
|
|
24
27
|
* "uniVer": "√",
|
|
@@ -37,12 +40,11 @@ export interface Uni {
|
|
|
37
40
|
*/
|
|
38
41
|
connectSocket(options: ConnectSocketOptions): SocketTask;
|
|
39
42
|
/**
|
|
40
|
-
*
|
|
41
|
-
* @description
|
|
43
|
+
* @description
|
|
42
44
|
* 监听WebSocket连接打开事件。
|
|
43
|
-
* @
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
* @tutorial-uni-app https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketopen
|
|
46
|
+
* @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onsocketopen
|
|
47
|
+
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onsocketopen
|
|
46
48
|
* @uniPlatform
|
|
47
49
|
* {
|
|
48
50
|
* "app": {
|
|
@@ -55,7 +57,12 @@ export interface Uni {
|
|
|
55
57
|
* "osVer": "12.0",
|
|
56
58
|
* "uniVer": "√",
|
|
57
59
|
* "unixVer": "4.11"
|
|
58
|
-
* }
|
|
60
|
+
* },
|
|
61
|
+
* "harmony": {
|
|
62
|
+
* "osVer": "3.0",
|
|
63
|
+
* "uniVer": "4.23",
|
|
64
|
+
* "unixVer": "x"
|
|
65
|
+
* }
|
|
59
66
|
* },
|
|
60
67
|
* "web": {
|
|
61
68
|
* "uniVer": "√",
|
|
@@ -72,12 +79,10 @@ export interface Uni {
|
|
|
72
79
|
onSocketOpen(options: OnSocketOpenCallback): void;
|
|
73
80
|
|
|
74
81
|
/**
|
|
75
|
-
*
|
|
76
|
-
* @
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
* @return {void}
|
|
80
|
-
* @tutorial https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketerror
|
|
82
|
+
* 监听WebSocket错误。
|
|
83
|
+
* @tutorial-uni-app https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketerror
|
|
84
|
+
* @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onsocketerror
|
|
85
|
+
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onsocketerror
|
|
81
86
|
* @uniPlatform
|
|
82
87
|
* {
|
|
83
88
|
* "app": {
|
|
@@ -90,7 +95,12 @@ export interface Uni {
|
|
|
90
95
|
* "osVer": "12.0",
|
|
91
96
|
* "uniVer": "√",
|
|
92
97
|
* "unixVer": "4.11"
|
|
93
|
-
* }
|
|
98
|
+
* },
|
|
99
|
+
* "harmony": {
|
|
100
|
+
* "osVer": "3.0",
|
|
101
|
+
* "uniVer": "4.23",
|
|
102
|
+
* "unixVer": "x"
|
|
103
|
+
* }
|
|
94
104
|
* },
|
|
95
105
|
* "web": {
|
|
96
106
|
* "uniVer": "√",
|
|
@@ -107,12 +117,10 @@ export interface Uni {
|
|
|
107
117
|
onSocketError(callback: OnSocketErrorCallback): void;
|
|
108
118
|
|
|
109
119
|
/**
|
|
110
|
-
* SendSocketMessage()
|
|
111
|
-
* @description
|
|
112
120
|
* 通过 WebSocket 连接发送数据,需要先 uni.connectSocket,并在 uni.onSocketOpen 回调之后才能发送。
|
|
113
|
-
* @
|
|
114
|
-
* @
|
|
115
|
-
* @tutorial https://
|
|
121
|
+
* @tutorial-uni-app https://uniapp.dcloud.net.cn/api/request/websocket.html#sendsocketmessage
|
|
122
|
+
* @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#sendsocketmessage
|
|
123
|
+
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#sendsocketmessage
|
|
116
124
|
* @uniPlatform
|
|
117
125
|
* {
|
|
118
126
|
* "app": {
|
|
@@ -125,7 +133,12 @@ export interface Uni {
|
|
|
125
133
|
* "osVer": "12.0",
|
|
126
134
|
* "uniVer": "√",
|
|
127
135
|
* "unixVer": "4.11"
|
|
128
|
-
* }
|
|
136
|
+
* },
|
|
137
|
+
* "harmony": {
|
|
138
|
+
* "osVer": "x",
|
|
139
|
+
* "uniVer": "x",
|
|
140
|
+
* "unixVer": "x"
|
|
141
|
+
* }
|
|
129
142
|
* },
|
|
130
143
|
* "web": {
|
|
131
144
|
* "uniVer": "√",
|
|
@@ -141,12 +154,10 @@ export interface Uni {
|
|
|
141
154
|
*/
|
|
142
155
|
sendSocketMessage(options: SendSocketMessageOptions): void;
|
|
143
156
|
/**
|
|
144
|
-
* OnSocketMessage()
|
|
145
|
-
* @description
|
|
146
157
|
* 监听WebSocket接受到服务器的消息事件。
|
|
147
|
-
* @
|
|
148
|
-
* @
|
|
149
|
-
* @tutorial https://
|
|
158
|
+
* @tutorial-uni-app https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketmessage
|
|
159
|
+
* @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onsocketmessage
|
|
160
|
+
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onsocketmessage
|
|
150
161
|
* @uniPlatform
|
|
151
162
|
* {
|
|
152
163
|
* "app": {
|
|
@@ -159,7 +170,12 @@ export interface Uni {
|
|
|
159
170
|
* "osVer": "12.0",
|
|
160
171
|
* "uniVer": "√",
|
|
161
172
|
* "unixVer": "4.11"
|
|
162
|
-
* }
|
|
173
|
+
* },
|
|
174
|
+
* "harmony": {
|
|
175
|
+
* "osVer": "3.0",
|
|
176
|
+
* "uniVer": "4.23",
|
|
177
|
+
* "unixVer": "x"
|
|
178
|
+
* }
|
|
163
179
|
* },
|
|
164
180
|
* "web": {
|
|
165
181
|
* "uniVer": "√",
|
|
@@ -175,12 +191,10 @@ export interface Uni {
|
|
|
175
191
|
*/
|
|
176
192
|
onSocketMessage(callback: OnSocketMessageCallback): void;
|
|
177
193
|
/**
|
|
178
|
-
* CloseSocket()
|
|
179
|
-
* @description
|
|
180
194
|
* 关闭 WebSocket 连接。
|
|
181
|
-
* @
|
|
182
|
-
* @
|
|
183
|
-
* @tutorial https://
|
|
195
|
+
* @tutorial-uni-app https://uniapp.dcloud.net.cn/api/request/websocket.html#closesocket
|
|
196
|
+
* @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#closesocket
|
|
197
|
+
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#closesocket
|
|
184
198
|
* @uniPlatform
|
|
185
199
|
* {
|
|
186
200
|
* "app": {
|
|
@@ -193,7 +207,12 @@ export interface Uni {
|
|
|
193
207
|
* "osVer": "12.0",
|
|
194
208
|
* "uniVer": "√",
|
|
195
209
|
* "unixVer": "4.11"
|
|
196
|
-
* }
|
|
210
|
+
* },
|
|
211
|
+
* "harmony": {
|
|
212
|
+
* "osVer": "3.0",
|
|
213
|
+
* "uniVer": "4.23",
|
|
214
|
+
* "unixVer": "x"
|
|
215
|
+
* }
|
|
197
216
|
* },
|
|
198
217
|
* "web": {
|
|
199
218
|
* "uniVer": "√",
|
|
@@ -207,12 +226,10 @@ export interface Uni {
|
|
|
207
226
|
*/
|
|
208
227
|
closeSocket(options: CloseSocketOptions): void;
|
|
209
228
|
/**
|
|
210
|
-
* OnSocketClose()
|
|
211
|
-
* @description
|
|
212
229
|
* 监听WebSocket关闭。
|
|
213
|
-
* @
|
|
214
|
-
* @
|
|
215
|
-
* @tutorial https://
|
|
230
|
+
* @tutorial-uni-app https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketclose
|
|
231
|
+
* @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onsocketclose
|
|
232
|
+
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onsocketclose
|
|
216
233
|
* @uniPlatform
|
|
217
234
|
* {
|
|
218
235
|
* "app": {
|
|
@@ -225,7 +242,12 @@ export interface Uni {
|
|
|
225
242
|
* "osVer": "12.0",
|
|
226
243
|
* "uniVer": "√",
|
|
227
244
|
* "unixVer": "4.11"
|
|
228
|
-
* }
|
|
245
|
+
* },
|
|
246
|
+
* "harmony": {
|
|
247
|
+
* "osVer": "3.0",
|
|
248
|
+
* "uniVer": "4.23",
|
|
249
|
+
* "unixVer": "x"
|
|
250
|
+
* }
|
|
229
251
|
* },
|
|
230
252
|
* "web": {
|
|
231
253
|
* "uniVer": "√",
|
|
@@ -256,7 +278,7 @@ export type ConnectSocketErrorCode = 600009;
|
|
|
256
278
|
/**
|
|
257
279
|
* 连接调用失败的错误回调参数
|
|
258
280
|
*/
|
|
259
|
-
export interface ConnectSocketFail extends IUniError {
|
|
281
|
+
export interface ConnectSocketFail extends IUniError {
|
|
260
282
|
errCode: ConnectSocketErrorCode;
|
|
261
283
|
};
|
|
262
284
|
|
|
@@ -265,17 +287,72 @@ type ConnectSocketComplete = any;
|
|
|
265
287
|
type ConnectSocketCompleteCallback = (result: ConnectSocketComplete) => void;
|
|
266
288
|
export type ConnectSocketOptions = {
|
|
267
289
|
/**
|
|
268
|
-
*
|
|
290
|
+
* 开发者服务器接口地址
|
|
291
|
+
* @uniPlatform
|
|
292
|
+
* {
|
|
293
|
+
* "app": {
|
|
294
|
+
* "android": {
|
|
295
|
+
* "osVer": "5.0",
|
|
296
|
+
* "uniVer": "√",
|
|
297
|
+
* "unixVer": "3.9+"
|
|
298
|
+
* },
|
|
299
|
+
* "ios": {
|
|
300
|
+
* "osVer": "12.0",
|
|
301
|
+
* "uniVer": "√",
|
|
302
|
+
* "unixVer": "4.11"
|
|
303
|
+
* },
|
|
304
|
+
* "harmony": {
|
|
305
|
+
* "osVer": "3.0",
|
|
306
|
+
* "uniVer": "4.23",
|
|
307
|
+
* "unixVer": "x"
|
|
308
|
+
* }
|
|
309
|
+
* }
|
|
310
|
+
* }
|
|
269
311
|
*/
|
|
270
312
|
url: string,
|
|
271
313
|
/**
|
|
272
314
|
* HTTP 请求 Header,header 中不能设置 Referer
|
|
273
315
|
* @defaultValue null
|
|
316
|
+
* @uniPlatform
|
|
317
|
+
* {
|
|
318
|
+
* "app": {
|
|
319
|
+
* "android": {
|
|
320
|
+
* "osVer": "5.0",
|
|
321
|
+
* "uniVer": "√",
|
|
322
|
+
* "unixVer": "3.9+"
|
|
323
|
+
* },
|
|
324
|
+
* "ios": {
|
|
325
|
+
* "osVer": "12.0",
|
|
326
|
+
* "uniVer": "√",
|
|
327
|
+
* "unixVer": "4.11"
|
|
328
|
+
* },
|
|
329
|
+
* "harmony": {
|
|
330
|
+
* "osVer": "3.0",
|
|
331
|
+
* "uniVer": "4.23",
|
|
332
|
+
* "unixVer": "x"
|
|
333
|
+
* }
|
|
334
|
+
* }
|
|
335
|
+
* }
|
|
274
336
|
*/
|
|
275
337
|
header?: UTSJSONObject | null,
|
|
276
338
|
/**
|
|
277
339
|
* 子协议数组
|
|
278
340
|
* @defaultValue null
|
|
341
|
+
* @uniPlatform
|
|
342
|
+
* {
|
|
343
|
+
* "app": {
|
|
344
|
+
* "android": {
|
|
345
|
+
* "osVer": "5.0",
|
|
346
|
+
* "uniVer": "√",
|
|
347
|
+
* "unixVer": "3.9+"
|
|
348
|
+
* },
|
|
349
|
+
* "ios": {
|
|
350
|
+
* "osVer": "12.0",
|
|
351
|
+
* "uniVer": "√",
|
|
352
|
+
* "unixVer": "4.11"
|
|
353
|
+
* }
|
|
354
|
+
* }
|
|
355
|
+
* }
|
|
279
356
|
*/
|
|
280
357
|
protocols?: (string[]) | null,
|
|
281
358
|
/**
|
|
@@ -310,7 +387,7 @@ export type SendSocketMessageErrorCode = 10001 | 10002 | 602001;
|
|
|
310
387
|
/**
|
|
311
388
|
* 发送失败的错误回调参数
|
|
312
389
|
*/
|
|
313
|
-
export interface SendSocketMessageFail extends IUniError {
|
|
390
|
+
export interface SendSocketMessageFail extends IUniError {
|
|
314
391
|
errCode: SendSocketMessageErrorCode;
|
|
315
392
|
};
|
|
316
393
|
export type SendSocketMessageOptions = {
|
|
@@ -318,6 +395,26 @@ export type SendSocketMessageOptions = {
|
|
|
318
395
|
* 需要发送的内容
|
|
319
396
|
* @type string | ArrayBuffer
|
|
320
397
|
* @type {SocketDataOptions}
|
|
398
|
+
* @uniPlatform
|
|
399
|
+
* {
|
|
400
|
+
* "app": {
|
|
401
|
+
* "android": {
|
|
402
|
+
* "osVer": "5.0",
|
|
403
|
+
* "uniVer": "√",
|
|
404
|
+
* "unixVer": "3.9+"
|
|
405
|
+
* },
|
|
406
|
+
* "ios": {
|
|
407
|
+
* "osVer": "12.0",
|
|
408
|
+
* "uniVer": "√",
|
|
409
|
+
* "unixVer": "4.11"
|
|
410
|
+
* },
|
|
411
|
+
* "harmony": {
|
|
412
|
+
* "osVer": "3.0",
|
|
413
|
+
* "uniVer": "4.23",
|
|
414
|
+
* "unixVer": "x"
|
|
415
|
+
* }
|
|
416
|
+
* }
|
|
417
|
+
* }
|
|
321
418
|
*/
|
|
322
419
|
data: any,
|
|
323
420
|
/**
|
|
@@ -340,11 +437,51 @@ export type CloseSocketOptions = {
|
|
|
340
437
|
/**
|
|
341
438
|
* 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。如果这个参数没有被指定,默认的取值是1000 (表示正常连接关闭)
|
|
342
439
|
* @defaultValue 1000
|
|
440
|
+
* @uniPlatform
|
|
441
|
+
* {
|
|
442
|
+
* "app": {
|
|
443
|
+
* "android": {
|
|
444
|
+
* "osVer": "5.0",
|
|
445
|
+
* "uniVer": "√",
|
|
446
|
+
* "unixVer": "3.9+"
|
|
447
|
+
* },
|
|
448
|
+
* "ios": {
|
|
449
|
+
* "osVer": "12.0",
|
|
450
|
+
* "uniVer": "√",
|
|
451
|
+
* "unixVer": "4.11"
|
|
452
|
+
* },
|
|
453
|
+
* "harmony": {
|
|
454
|
+
* "osVer": "3.0",
|
|
455
|
+
* "uniVer": "4.23",
|
|
456
|
+
* "unixVer": "x"
|
|
457
|
+
* }
|
|
458
|
+
* }
|
|
459
|
+
* }
|
|
343
460
|
*/
|
|
344
461
|
code?: number | null,
|
|
345
462
|
/**
|
|
346
463
|
* 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于123字节的UTF-8 文本(不是字符)
|
|
347
464
|
* @defaultValue ""
|
|
465
|
+
* @uniPlatform
|
|
466
|
+
* {
|
|
467
|
+
* "app": {
|
|
468
|
+
* "android": {
|
|
469
|
+
* "osVer": "5.0",
|
|
470
|
+
* "uniVer": "√",
|
|
471
|
+
* "unixVer": "3.9+"
|
|
472
|
+
* },
|
|
473
|
+
* "ios": {
|
|
474
|
+
* "osVer": "12.0",
|
|
475
|
+
* "uniVer": "√",
|
|
476
|
+
* "unixVer": "4.11"
|
|
477
|
+
* },
|
|
478
|
+
* "harmony": {
|
|
479
|
+
* "osVer": "3.0",
|
|
480
|
+
* "uniVer": "4.23",
|
|
481
|
+
* "unixVer": "x"
|
|
482
|
+
* }
|
|
483
|
+
* }
|
|
484
|
+
* }
|
|
348
485
|
*/
|
|
349
486
|
reason?: string | null,
|
|
350
487
|
/**
|
|
@@ -366,6 +503,26 @@ export type CloseSocketOptions = {
|
|
|
366
503
|
export type OnSocketOpenCallbackResult = {
|
|
367
504
|
/**
|
|
368
505
|
* 连接成功的 HTTP 响应 Header
|
|
506
|
+
* @uniPlatform
|
|
507
|
+
* {
|
|
508
|
+
* "app": {
|
|
509
|
+
* "android": {
|
|
510
|
+
* "osVer": "5.0",
|
|
511
|
+
* "uniVer": "√",
|
|
512
|
+
* "unixVer": "3.9+"
|
|
513
|
+
* },
|
|
514
|
+
* "ios": {
|
|
515
|
+
* "osVer": "12.0",
|
|
516
|
+
* "uniVer": "√",
|
|
517
|
+
* "unixVer": "4.11"
|
|
518
|
+
* },
|
|
519
|
+
* "harmony": {
|
|
520
|
+
* "osVer": "3.0",
|
|
521
|
+
* "uniVer": "4.23",
|
|
522
|
+
* "unixVer": "x"
|
|
523
|
+
* }
|
|
524
|
+
* }
|
|
525
|
+
* }
|
|
369
526
|
*/
|
|
370
527
|
header: any
|
|
371
528
|
};
|
|
@@ -373,17 +530,35 @@ export type OnSocketMessageCallbackResult = {
|
|
|
373
530
|
/**
|
|
374
531
|
* 服务器返回的消息
|
|
375
532
|
* @type {SocketDataOptions}
|
|
533
|
+
* @uniPlatform
|
|
534
|
+
* {
|
|
535
|
+
* "app": {
|
|
536
|
+
* "android": {
|
|
537
|
+
* "osVer": "5.0",
|
|
538
|
+
* "uniVer": "√",
|
|
539
|
+
* "unixVer": "3.9+"
|
|
540
|
+
* },
|
|
541
|
+
* "ios": {
|
|
542
|
+
* "osVer": "12.0",
|
|
543
|
+
* "uniVer": "√",
|
|
544
|
+
* "unixVer": "4.11"
|
|
545
|
+
* },
|
|
546
|
+
* "harmony": {
|
|
547
|
+
* "osVer": "3.0",
|
|
548
|
+
* "uniVer": "4.23",
|
|
549
|
+
* "unixVer": "x"
|
|
550
|
+
* }
|
|
551
|
+
* }
|
|
552
|
+
* }
|
|
376
553
|
*/
|
|
377
554
|
data: any
|
|
378
555
|
};
|
|
379
556
|
export interface SocketTask {
|
|
380
557
|
/**
|
|
381
|
-
* send()
|
|
382
|
-
* @description
|
|
383
558
|
* 通过 WebSocket 连接发送数据
|
|
384
|
-
* @
|
|
385
|
-
* @
|
|
386
|
-
* @tutorial https://
|
|
559
|
+
* @tutorial-uni-app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-send
|
|
560
|
+
* @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#send
|
|
561
|
+
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#send
|
|
387
562
|
* @uniPlatform
|
|
388
563
|
* {
|
|
389
564
|
* "app": {
|
|
@@ -396,7 +571,12 @@ export interface SocketTask {
|
|
|
396
571
|
* "osVer": "12.0",
|
|
397
572
|
* "uniVer": "√",
|
|
398
573
|
* "unixVer": "4.11"
|
|
399
|
-
* }
|
|
574
|
+
* },
|
|
575
|
+
* "harmony": {
|
|
576
|
+
* "osVer": "3.0",
|
|
577
|
+
* "uniVer": "4.23",
|
|
578
|
+
* "unixVer": "x"
|
|
579
|
+
* }
|
|
400
580
|
* },
|
|
401
581
|
* "web": {
|
|
402
582
|
* "uniVer": "√",
|
|
@@ -410,12 +590,10 @@ export interface SocketTask {
|
|
|
410
590
|
*/
|
|
411
591
|
send(options: SendSocketMessageOptions): void;
|
|
412
592
|
/**
|
|
413
|
-
* close()
|
|
414
|
-
* @description
|
|
415
593
|
* 关闭 WebSocket 连接
|
|
416
|
-
* @
|
|
417
|
-
* @
|
|
418
|
-
* @tutorial https://
|
|
594
|
+
* @tutorial-uni-app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-close
|
|
595
|
+
* @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#close
|
|
596
|
+
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#close
|
|
419
597
|
* @uniPlatform
|
|
420
598
|
* {
|
|
421
599
|
* "app": {
|
|
@@ -428,7 +606,12 @@ export interface SocketTask {
|
|
|
428
606
|
* "osVer": "12.0",
|
|
429
607
|
* "uniVer": "√",
|
|
430
608
|
* "unixVer": "4.11"
|
|
431
|
-
* }
|
|
609
|
+
* },
|
|
610
|
+
* "harmony": {
|
|
611
|
+
* "osVer": "3.0",
|
|
612
|
+
* "uniVer": "4.23",
|
|
613
|
+
* "unixVer": "x"
|
|
614
|
+
* }
|
|
432
615
|
* },
|
|
433
616
|
* "web": {
|
|
434
617
|
* "uniVer": "√",
|
|
@@ -442,12 +625,10 @@ export interface SocketTask {
|
|
|
442
625
|
*/
|
|
443
626
|
close(options: CloseSocketOptions): void;
|
|
444
627
|
/**
|
|
445
|
-
* onOpen()
|
|
446
|
-
* @description
|
|
447
628
|
* 监听 WebSocket 连接打开事件
|
|
448
|
-
* @
|
|
449
|
-
* @
|
|
450
|
-
* @tutorial https://
|
|
629
|
+
* @tutorial-uni-app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onopen
|
|
630
|
+
* @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onopen
|
|
631
|
+
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onopen
|
|
451
632
|
* @uniPlatform
|
|
452
633
|
* {
|
|
453
634
|
* "app": {
|
|
@@ -460,7 +641,12 @@ export interface SocketTask {
|
|
|
460
641
|
* "osVer": "12.0",
|
|
461
642
|
* "uniVer": "√",
|
|
462
643
|
* "unixVer": "4.11"
|
|
463
|
-
* }
|
|
644
|
+
* },
|
|
645
|
+
* "harmony": {
|
|
646
|
+
* "osVer": "3.0",
|
|
647
|
+
* "uniVer": "4.23",
|
|
648
|
+
* "unixVer": "x"
|
|
649
|
+
* }
|
|
464
650
|
* },
|
|
465
651
|
* "web": {
|
|
466
652
|
* "uniVer": "√",
|
|
@@ -474,12 +660,10 @@ export interface SocketTask {
|
|
|
474
660
|
*/
|
|
475
661
|
onOpen(callback: (result: OnSocketOpenCallbackResult) => void): void;
|
|
476
662
|
/**
|
|
477
|
-
* onClose()
|
|
478
|
-
* @description
|
|
479
663
|
* 监听 WebSocket 连接关闭事件
|
|
480
|
-
* @
|
|
481
|
-
* @
|
|
482
|
-
* @tutorial https://
|
|
664
|
+
* @tutorial-uni-app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onclose
|
|
665
|
+
* @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onclose
|
|
666
|
+
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onclose
|
|
483
667
|
* @uniPlatform
|
|
484
668
|
* {
|
|
485
669
|
* "app": {
|
|
@@ -492,7 +676,12 @@ export interface SocketTask {
|
|
|
492
676
|
* "osVer": "12.0",
|
|
493
677
|
* "uniVer": "√",
|
|
494
678
|
* "unixVer": "4.11"
|
|
495
|
-
* }
|
|
679
|
+
* },
|
|
680
|
+
* "harmony": {
|
|
681
|
+
* "osVer": "3.0",
|
|
682
|
+
* "uniVer": "4.23",
|
|
683
|
+
* "unixVer": "x"
|
|
684
|
+
* }
|
|
496
685
|
* },
|
|
497
686
|
* "web": {
|
|
498
687
|
* "uniVer": "√",
|
|
@@ -508,11 +697,11 @@ export interface SocketTask {
|
|
|
508
697
|
onClose(callback: (result: any) => void): void;
|
|
509
698
|
/**
|
|
510
699
|
* onError()
|
|
511
|
-
* @description
|
|
700
|
+
* @description
|
|
512
701
|
* 监听 WebSocket 错误
|
|
513
|
-
* @
|
|
514
|
-
* @
|
|
515
|
-
* @tutorial https://
|
|
702
|
+
* @tutorial-uni-app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onerror
|
|
703
|
+
* @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onerror
|
|
704
|
+
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onerror
|
|
516
705
|
* @uniPlatform
|
|
517
706
|
* {
|
|
518
707
|
* "app": {
|
|
@@ -525,7 +714,12 @@ export interface SocketTask {
|
|
|
525
714
|
* "osVer": "12.0",
|
|
526
715
|
* "uniVer": "√",
|
|
527
716
|
* "unixVer": "4.11"
|
|
528
|
-
* }
|
|
717
|
+
* },
|
|
718
|
+
* "harmony": {
|
|
719
|
+
* "osVer": "3.0",
|
|
720
|
+
* "uniVer": "4.23",
|
|
721
|
+
* "unixVer": "x"
|
|
722
|
+
* }
|
|
529
723
|
* },
|
|
530
724
|
* "web": {
|
|
531
725
|
* "uniVer": "√",
|
|
@@ -540,12 +734,10 @@ export interface SocketTask {
|
|
|
540
734
|
*/
|
|
541
735
|
onError(callback: (result: GeneralCallbackResult) => void): void;
|
|
542
736
|
/**
|
|
543
|
-
* onMessage()
|
|
544
|
-
* @description
|
|
545
737
|
* 监听 WebSocket 接受到服务器的消息事件
|
|
546
|
-
*
|
|
547
|
-
*
|
|
548
|
-
*
|
|
738
|
+
* @tutorial-uni-app https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onmessage
|
|
739
|
+
* @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onmessage
|
|
740
|
+
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/websocket-global.html#onmessage
|
|
549
741
|
* @uniPlatform
|
|
550
742
|
* {
|
|
551
743
|
* "app": {
|
|
@@ -558,7 +750,12 @@ export interface SocketTask {
|
|
|
558
750
|
* "osVer": "12.0",
|
|
559
751
|
* "uniVer": "√",
|
|
560
752
|
* "unixVer": "4.11"
|
|
561
|
-
* }
|
|
753
|
+
* },
|
|
754
|
+
* "harmony": {
|
|
755
|
+
* "osVer": "3.0",
|
|
756
|
+
* "uniVer": "4.23",
|
|
757
|
+
* "unixVer": "x"
|
|
758
|
+
* }
|
|
562
759
|
* },
|
|
563
760
|
* "web": {
|
|
564
761
|
* "uniVer": "√",
|
|
@@ -594,11 +791,51 @@ export type OnSocketMessage = (callback: OnSocketMessageCallback) => void;
|
|
|
594
791
|
export type CloseSocket = (options: CloseSocketOptions) => void;
|
|
595
792
|
export type OnSocketCloseCallbackResult = {
|
|
596
793
|
/**
|
|
597
|
-
* 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。
|
|
794
|
+
* 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。
|
|
795
|
+
* @uniPlatform
|
|
796
|
+
* {
|
|
797
|
+
* "app": {
|
|
798
|
+
* "android": {
|
|
799
|
+
* "osVer": "5.0",
|
|
800
|
+
* "uniVer": "√",
|
|
801
|
+
* "unixVer": "3.9+"
|
|
802
|
+
* },
|
|
803
|
+
* "ios": {
|
|
804
|
+
* "osVer": "12.0",
|
|
805
|
+
* "uniVer": "√",
|
|
806
|
+
* "unixVer": "4.11"
|
|
807
|
+
* },
|
|
808
|
+
* "harmony": {
|
|
809
|
+
* "osVer": "3.0",
|
|
810
|
+
* "uniVer": "4.23",
|
|
811
|
+
* "unixVer": "x"
|
|
812
|
+
* }
|
|
813
|
+
* }
|
|
814
|
+
* }
|
|
598
815
|
*/
|
|
599
816
|
code: number,
|
|
600
817
|
/**
|
|
601
|
-
* 一个可读的字符串,表示连接被关闭的原因。
|
|
818
|
+
* 一个可读的字符串,表示连接被关闭的原因。
|
|
819
|
+
* @uniPlatform
|
|
820
|
+
* {
|
|
821
|
+
* "app": {
|
|
822
|
+
* "android": {
|
|
823
|
+
* "osVer": "5.0",
|
|
824
|
+
* "uniVer": "√",
|
|
825
|
+
* "unixVer": "3.9+"
|
|
826
|
+
* },
|
|
827
|
+
* "ios": {
|
|
828
|
+
* "osVer": "12.0",
|
|
829
|
+
* "uniVer": "√",
|
|
830
|
+
* "unixVer": "4.11"
|
|
831
|
+
* },
|
|
832
|
+
* "harmony": {
|
|
833
|
+
* "osVer": "3.0",
|
|
834
|
+
* "uniVer": "4.23",
|
|
835
|
+
* "unixVer": "x"
|
|
836
|
+
* }
|
|
837
|
+
* }
|
|
838
|
+
* }
|
|
602
839
|
*/
|
|
603
840
|
reason: string
|
|
604
841
|
};
|
|
@@ -3,6 +3,8 @@ import {
|
|
|
3
3
|
UrlCallbackOptions as UrlCallbackOptionsOrigin,
|
|
4
4
|
CreateRewardedVideoAdOptions as CreateRewardedVideoAdOptionsOrigin,
|
|
5
5
|
RewardedVideoAd as RewardedVideoAdOrigin,
|
|
6
|
+
IVideoAd as IVideoAdOrigin,
|
|
7
|
+
IRewardedVideoAd as IRewardedVideoAdOrigin,
|
|
6
8
|
VideoAdClose as VideoAdCloseOrigin,
|
|
7
9
|
RewardedVideoAdClose as RewardedVideoAdCloseOrigin,
|
|
8
10
|
UniAdErrorCode as UniAdErrorCodeOrigin,
|
|
@@ -11,8 +13,6 @@ import {
|
|
|
11
13
|
AdCloseCallBackEvent as AdCloseCallBackEventOrigin,
|
|
12
14
|
AdErrorCallBackEvent as AdErrorCallBackEventOrigin,
|
|
13
15
|
AdVerifyCallBackEvent as AdVerifyCallBackEventOrigin,
|
|
14
|
-
IVideoAd as IVideoAdOrigin,
|
|
15
|
-
IRewardedVideoAd as IRewardedVideoAdOrigin,
|
|
16
16
|
CreateRewardedVideoAd as CreateRewardedVideoAdOrigin,
|
|
17
17
|
Uni as UniOrigin
|
|
18
18
|
} from './interface'
|
|
@@ -21,6 +21,8 @@ declare global {
|
|
|
21
21
|
type UrlCallbackOptions = UrlCallbackOptionsOrigin
|
|
22
22
|
type CreateRewardedVideoAdOptions = CreateRewardedVideoAdOptionsOrigin
|
|
23
23
|
type RewardedVideoAd = RewardedVideoAdOrigin
|
|
24
|
+
type IVideoAd = IVideoAdOrigin
|
|
25
|
+
type IRewardedVideoAd = IRewardedVideoAdOrigin
|
|
24
26
|
type VideoAdClose = VideoAdCloseOrigin
|
|
25
27
|
type RewardedVideoAdClose = RewardedVideoAdCloseOrigin
|
|
26
28
|
type UniAdErrorCode = UniAdErrorCodeOrigin
|
|
@@ -29,8 +31,6 @@ declare global {
|
|
|
29
31
|
type AdCloseCallBackEvent = AdCloseCallBackEventOrigin
|
|
30
32
|
type AdErrorCallBackEvent = AdErrorCallBackEventOrigin
|
|
31
33
|
type AdVerifyCallBackEvent = AdVerifyCallBackEventOrigin
|
|
32
|
-
type IVideoAd = IVideoAdOrigin
|
|
33
|
-
type IRewardedVideoAd = IRewardedVideoAdOrigin
|
|
34
34
|
type CreateRewardedVideoAd = CreateRewardedVideoAdOrigin
|
|
35
35
|
interface Uni extends UniOrigin { }
|
|
36
36
|
}
|