@dcloudio/uni-app-x 0.7.62 → 0.7.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/package.json +1 -1
  2. package/types/app.d.ts +36 -1
  3. package/types/dom2/UniCSSProperty.d.ts +446 -0
  4. package/types/dom2/UniCSSType.d.ts +72 -0
  5. package/types/dom2/UniCommon.d.ts +40 -0
  6. package/types/dom2/UniCustomViewElement.d.ts +12 -0
  7. package/types/dom2/UniElement.d.ts +354 -0
  8. package/types/dom2/UniElementType.d.ts +37 -0
  9. package/types/dom2/UniImageElement.d.ts +102 -0
  10. package/types/dom2/UniNativeBaseView.d.ts +178 -0
  11. package/types/dom2/UniNativeCustomView.d.ts +13 -0
  12. package/types/dom2/UniNativeDefines.d.ts +435 -0
  13. package/types/dom2/UniNativeImageView.d.ts +34 -0
  14. package/types/dom2/UniNativeScrollView.d.ts +42 -0
  15. package/types/dom2/UniNativeTextView.d.ts +25 -0
  16. package/types/dom2/UniNativeView.d.ts +51 -0
  17. package/types/dom2/UniNativeViewType.d.ts +22 -0
  18. package/types/dom2/UniPage.d.ts +55 -0
  19. package/types/dom2/UniScrollViewElement.d.ts +13 -0
  20. package/types/dom2/UniTextElement.d.ts +20 -0
  21. package/types/dom2/UniTextLayout.d.ts +386 -0
  22. package/types/dom2/UniViewElement.d.ts +57 -0
  23. package/types/dom2/global.d.ts +189 -0
  24. package/types/dom2/index.d.ts +40 -0
  25. package/types/dom2/sharedData.d.ts +227 -0
  26. package/types/index.d.ts +2 -1
  27. package/types/native/DOMRect.d.ts +2 -1
  28. package/types/native/DrawableContext.d.ts +1665 -1661
  29. package/types/native/IUniElement.d.ts +3514 -2877
  30. package/types/native/SnapshotOptions.d.ts +2 -2
  31. package/types/native/UniAnimation.d.ts +11 -10
  32. package/types/native/UniEvent.d.ts +108 -3
  33. package/types/native/UniPage.d.ts +891 -887
  34. package/types/native/UniTextElement.d.ts +37 -0
  35. package/types/native/UniTextLayout.d.ts +387 -0
  36. package/types/native/UniVideoElement.d.ts +20 -17
  37. package/types/native/Worker.d.ts +19 -0
  38. package/types/native/global.d.ts +28 -68
  39. package/types/native/index.d.ts +18 -1
  40. package/types/page.d.ts +1862 -599
  41. package/types/uni/uts-plugin-api/global.d.ts +2 -0
  42. package/types/uni/uts-plugin-api/index.d.ts +2 -0
  43. package/types/uni/uts-plugin-api/lib/uni-chooseMedia/utssdk/interface.d.ts +1 -1
  44. package/types/uni/uts-plugin-api/lib/uni-createInnerAudioContext/utssdk/interface.d.ts +10 -10
  45. package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/interface.d.ts +0 -1
  46. package/types/uni/uts-plugin-api/lib/uni-createWorker/utssdk/global.d.ts +22 -0
  47. package/types/uni/uts-plugin-api/lib/uni-createWorker/utssdk/index.d.ts +10 -0
  48. package/types/uni/uts-plugin-api/lib/uni-createWorker/utssdk/interface.d.ts +524 -0
  49. package/types/uni/uts-plugin-api/lib/uni-dialogPage/utssdk/interface.d.ts +985 -76
  50. package/types/uni/uts-plugin-api/lib/uni-getEnterOptionsSync/utssdk/interface.d.ts +79 -55
  51. package/types/uni/uts-plugin-api/lib/uni-getLaunchOptionsSync/utssdk/interface.d.ts +77 -53
  52. package/types/uni/uts-plugin-api/lib/uni-getNetworkType/utssdk/interface.d.ts +458 -407
  53. package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/interface.d.ts +420 -0
  54. package/types/uni/uts-plugin-api/lib/uni-location/utssdk/interface.d.ts +80 -80
  55. package/types/uni/uts-plugin-api/lib/uni-modal/utssdk/global.d.ts +12 -4
  56. package/types/uni/uts-plugin-api/lib/uni-modal/utssdk/index.d.ts +6 -2
  57. package/types/uni/uts-plugin-api/lib/uni-modal/utssdk/interface.d.ts +713 -91
  58. package/types/uni/uts-plugin-api/lib/uni-network/utssdk/interface.d.ts +4 -0
  59. package/types/uni/uts-plugin-api/lib/uni-oauth/utssdk/interface.d.ts +3 -3
  60. package/types/uni/uts-plugin-api/lib/uni-oauth-weixin/utssdk/interface.d.ts +3 -1
  61. package/types/uni/uts-plugin-api/lib/uni-recorder/utssdk/interface.d.ts +71 -1
  62. package/types/uni/uts-plugin-api/lib/uni-route/utssdk/interface.d.ts +1 -1
  63. package/types/uni/uts-plugin-api/lib/uni-screenBrightness/utssdk/global.d.ts +56 -0
  64. package/types/uni/uts-plugin-api/lib/uni-screenBrightness/utssdk/index.d.ts +27 -0
  65. package/types/uni/uts-plugin-api/lib/uni-screenBrightness/utssdk/interface.d.ts +842 -0
  66. package/types/uni/uts-plugin-api/lib/uni-share/utssdk/interface.d.ts +11 -11
  67. package/types/uni/uts-plugin-api/lib/uni-share-weixin/utssdk/interface.d.ts +1 -1
  68. package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/interface.d.ts +63 -42
  69. package/types/uni/uts-plugin-biz/lib/uni-ad/utssdk/interface.d.ts +2 -2
  70. package/types/uni/uts-plugin-biz/lib/uni-facialVerify/utssdk/interface.d.ts +2 -2
  71. package/types/uni/uts-plugin-biz/lib/uni-live-player/utssdk/global.d.ts +4 -0
  72. package/types/uni/uts-plugin-biz/lib/uni-live-player/utssdk/index.d.ts +2 -0
  73. package/types/uni/uts-plugin-biz/lib/uni-live-player/utssdk/interface.d.ts +1007 -314
  74. package/types/uni/uts-plugin-biz/lib/uni-live-pusher/utssdk/global.d.ts +4 -0
  75. package/types/uni/uts-plugin-biz/lib/uni-live-pusher/utssdk/index.d.ts +2 -0
  76. package/types/uni/uts-plugin-biz/lib/uni-live-pusher/utssdk/interface.d.ts +1727 -10
  77. package/types/uni/uts-plugin-component/lib/uni-camera/utssdk/interface.d.ts +235 -30
  78. package/types/uni/uts-plugin-component/lib/uni-canvas/utssdk/interface.d.ts +1 -1
  79. package/types/uni/uts-plugin-component/lib/uni-video/utssdk/interface.d.ts +17 -17
  80. package/uts-plugin.d.ts +11 -0
@@ -1,243 +1,245 @@
1
- export interface Uni {
2
- /**
3
- * getNetworkType()
4
- * @description
5
- * 获取网络类型
6
- * @param {GetNetworkTypeOptions} options
7
- * @return {void}
8
- * @tutorial_uni_app https://uniapp.dcloud.net.cn/api/system/network.html#getnetworktype
9
- * @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/get-network-type.html
10
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/get-network-type.html
11
- * @uniPlatform {
12
- * "app": {
13
- * "android": {
14
- * "osVer": "5.0",
15
- * "uniVer": "√",
16
- * "unixVer": "3.9+"
17
- * },
18
- * "ios": {
19
- * "osVer": "12.0",
20
- * "uniVer": "√",
21
- * "unixVer": "4.11"
22
- * },
23
- * "harmony": {
24
- * "osVer": "3.0",
25
- * "uniVer": "4.24",
26
- * "unixVer": "4.61"
27
- * }
28
- * },
29
- * "mp": {
30
- * "weixin": {
31
- * "hostVer": "1.9.6",
32
- * "uniVer": "√",
33
- * "unixVer": "4.41"
34
- * },
35
- * "alipay": {
36
- * "hostVer": "√",
37
- * "uniVer": "√",
38
- * "unixVer": "x"
39
- * },
40
- * "baidu": {
41
- * "hostVer": "√",
42
- * "uniVer": "√",
43
- * "unixVer": "x"
44
- * },
45
- * "toutiao": {
46
- * "hostVer": "√",
47
- * "uniVer": "√",
48
- * "unixVer": "x"
49
- * },
50
- * "lark": {
51
- * "hostVer": "√",
52
- * "uniVer": "√",
53
- * "unixVer": "x"
54
- * },
55
- * "qq": {
56
- * "hostVer": "√",
57
- * "uniVer": "√",
58
- * "unixVer": "x"
59
- * },
60
- * "kuaishou": {
61
- * "hostVer": "√",
62
- * "uniVer": "√",
63
- * "unixVer": "x"
64
- * },
65
- * "jd": {
66
- * "hostVer": "√",
67
- * "uniVer": "√",
68
- * "unixVer": "x"
69
- * }
70
- * },
71
- * "web": {
72
- * "uniVer": "√",
73
- * "unixVer": "4.0"
74
- * }
75
- * }
76
- * @example
77
- * ```typescript
78
- * uni.getNetworkType({
79
- * success(res){
80
- * console.log(res);
81
- * }
82
- * });
83
- * ```
1
+ export interface Uni {
2
+ /**
3
+ * getNetworkType()
4
+ * @description
5
+ * 获取网络类型
6
+ * @param {GetNetworkTypeOptions} options
7
+ * @return {void}
8
+ * @tutorial_uni_app https://uniapp.dcloud.net.cn/api/system/network.html#getnetworktype
9
+ * @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/get-network-type.html
10
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/get-network-type.html
11
+ * @uniPlatform {
12
+ * "app": {
13
+ * "android": {
14
+ * "osVer": "5.0",
15
+ * "uniVer": "√",
16
+ * "unixVer": "3.9+"
17
+ * },
18
+ * "ios": {
19
+ * "osVer": "12.0",
20
+ * "uniVer": "√",
21
+ * "unixVer": "4.11"
22
+ * },
23
+ * "harmony": {
24
+ * "osVer": "3.0",
25
+ * "uniVer": "4.24",
26
+ * "unixVer": "4.61"
27
+ * }
28
+ * },
29
+ * "mp": {
30
+ * "weixin": {
31
+ * "hostVer": "1.9.6",
32
+ * "uniVer": "√",
33
+ * "unixVer": "4.41"
34
+ * },
35
+ * "alipay": {
36
+ * "hostVer": "√",
37
+ * "uniVer": "√",
38
+ * "unixVer": "x"
39
+ * },
40
+ * "baidu": {
41
+ * "hostVer": "√",
42
+ * "uniVer": "√",
43
+ * "unixVer": "x"
44
+ * },
45
+ * "toutiao": {
46
+ * "hostVer": "√",
47
+ * "uniVer": "√",
48
+ * "unixVer": "x"
49
+ * },
50
+ * "lark": {
51
+ * "hostVer": "√",
52
+ * "uniVer": "√",
53
+ * "unixVer": "x"
54
+ * },
55
+ * "qq": {
56
+ * "hostVer": "√",
57
+ * "uniVer": "√",
58
+ * "unixVer": "x"
59
+ * },
60
+ * "kuaishou": {
61
+ * "hostVer": "√",
62
+ * "uniVer": "√",
63
+ * "unixVer": "x"
64
+ * },
65
+ * "jd": {
66
+ * "hostVer": "√",
67
+ * "uniVer": "√",
68
+ * "unixVer": "x"
69
+ * }
70
+ * },
71
+ * "web": {
72
+ * "uniVer": "√",
73
+ * "unixVer": "4.0"
74
+ * }
75
+ * }
76
+ * @example
77
+ * ```typescript
78
+ * uni.getNetworkType({
79
+ * success(res){
80
+ * console.log(res);
81
+ * }
82
+ * });
83
+ * ```
84
84
  * @tutorial_weixin https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.getNetworkType.html
85
- */
86
- getNetworkType(options: GetNetworkTypeOptions): void;
87
- /**
88
- * 监听网络状态变化
89
- *
90
- * @tutorial_uni_app https://uniapp.dcloud.net.cn/api/system/network.html#onnetworkstatuschange
91
- * @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/network-status-change.html
92
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/network-status-change.html
93
- * @uniPlatform {
94
- * "app": {
95
- * "android": {
96
- * "osVer": "5.0",
97
- * "uniVer": "√",
98
- * "unixVer": "x"
99
- * },
100
- * "ios": {
101
- * "osVer": "12.0",
102
- * "uniVer": "√",
103
- * "unixVer": "x"
104
- * },
105
- * "harmony": {
106
- * "osVer": "3.0",
107
- * "uniVer": "4.24",
108
- * "unixVer": "4.61"
109
- * }
110
- * },
111
- * "mp": {
112
- * "weixin": {
113
- * "hostVer": "1.1.0",
114
- * "uniVer": "",
115
- * "unixVer": "4.41"
116
- * },
117
- * "alipay": {
118
- * "hostVer": "√",
119
- * "uniVer": "√",
120
- * "unixVer": "x"
121
- * },
122
- * "baidu": {
123
- * "hostVer": "√",
124
- * "uniVer": "√",
125
- * "unixVer": "x"
126
- * },
127
- * "toutiao": {
128
- * "hostVer": "√",
129
- * "uniVer": "√",
130
- * "unixVer": "x"
131
- * },
132
- * "lark": {
133
- * "hostVer": "√",
134
- * "uniVer": "√",
135
- * "unixVer": "x"
136
- * },
137
- * "qq": {
138
- * "hostVer": "√",
139
- * "uniVer": "√",
140
- * "unixVer": "x"
141
- * },
142
- * "kuaishou": {
143
- * "hostVer": "√",
144
- * "uniVer": "√",
145
- * "unixVer": "x"
146
- * },
147
- * "jd": {
148
- * "hostVer": "√",
149
- * "uniVer": "√",
150
- * "unixVer": "x"
151
- * }
152
- * },
153
- * "web": {
154
- * "uniVer": "√",
155
- * "unixVer": "4.0"
156
- * }
157
- * }
85
+ */
86
+ getNetworkType(options : GetNetworkTypeOptions) : void;
87
+ /**
88
+ * 监听网络状态变化
89
+ *
90
+ * @tutorial_uni_app https://uniapp.dcloud.net.cn/api/system/network.html#onnetworkstatuschange
91
+ * @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/network-status-change.html
92
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/network-status-change.html
93
+ * @uniPlatform {
94
+ * "app": {
95
+ * "android": {
96
+ * "osVer": "5.0",
97
+ * "uniVer": "√",
98
+ * "unixVer": "4.81"
99
+ * },
100
+ * "ios": {
101
+ * "osVer": "12.0",
102
+ * "uniVer": "√",
103
+ * "unixVer": "4.81",
104
+ * "unixUtsPlugin": "4.81"
105
+ * },
106
+ * "harmony": {
107
+ * "osVer": "3.0",
108
+ * "uniVer": "4.24",
109
+ * "unixVer": "4.61"
110
+ * }
111
+ * },
112
+ * "mp": {
113
+ * "weixin": {
114
+ * "hostVer": "1.1.0",
115
+ * "uniVer": "",
116
+ * "unixVer": "4.41"
117
+ * },
118
+ * "alipay": {
119
+ * "hostVer": "√",
120
+ * "uniVer": "",
121
+ * "unixVer": "x"
122
+ * },
123
+ * "baidu": {
124
+ * "hostVer": "√",
125
+ * "uniVer": "",
126
+ * "unixVer": "x"
127
+ * },
128
+ * "toutiao": {
129
+ * "hostVer": "√",
130
+ * "uniVer": "",
131
+ * "unixVer": "x"
132
+ * },
133
+ * "lark": {
134
+ * "hostVer": "√",
135
+ * "uniVer": "",
136
+ * "unixVer": "x"
137
+ * },
138
+ * "qq": {
139
+ * "hostVer": "√",
140
+ * "uniVer": "",
141
+ * "unixVer": "x"
142
+ * },
143
+ * "kuaishou": {
144
+ * "hostVer": "√",
145
+ * "uniVer": "",
146
+ * "unixVer": "x"
147
+ * },
148
+ * "jd": {
149
+ * "hostVer": "√",
150
+ * "uniVer": "",
151
+ * "unixVer": "x"
152
+ * }
153
+ * },
154
+ * "web": {
155
+ * "uniVer": "",
156
+ * "unixVer": "4.0"
157
+ * }
158
+ * }
158
159
  * @tutorial_weixin https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.onNetworkStatusChange.html
159
- */
160
- onNetworkStatusChange(callback: OnNetworkStatusChangeCallback): void;
161
- /**
162
- * 取消监听网络状态变化
163
- *
164
- * @tutorial_uni_app https://uniapp.dcloud.net.cn/api/system/network.html#offnetworkstatuschange
165
- * @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/network-status-change.html
166
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/network-status-change.html
167
- * @uniPlatform {
168
- * "app": {
169
- * "android": {
170
- * "osVer": "5.0",
171
- * "uniVer": "√",
172
- * "unixVer": "x"
173
- * },
174
- * "ios": {
175
- * "osVer": "12.0",
176
- * "uniVer": "√",
177
- * "unixVer": "x"
178
- * },
179
- * "harmony": {
180
- * "osVer": "3.0",
181
- * "uniVer": "4.24",
182
- * "unixVer": "4.61"
183
- * }
184
- * },
185
- * "mp": {
186
- * "weixin": {
187
- * "hostVer": "2.9.3",
188
- * "uniVer": "",
189
- * "unixVer": "4.41"
190
- * },
191
- * "alipay": {
192
- * "hostVer": "√",
193
- * "uniVer": "√",
194
- * "unixVer": "x"
195
- * },
196
- * "baidu": {
197
- * "hostVer": "√",
198
- * "uniVer": "√",
199
- * "unixVer": "x"
200
- * },
201
- * "toutiao": {
202
- * "hostVer": "√",
203
- * "uniVer": "√",
204
- * "unixVer": "x"
205
- * },
206
- * "lark": {
207
- * "hostVer": "√",
208
- * "uniVer": "√",
209
- * "unixVer": "x"
210
- * },
211
- * "qq": {
212
- * "hostVer": "√",
213
- * "uniVer": "√",
214
- * "unixVer": "x"
215
- * },
216
- * "kuaishou": {
217
- * "hostVer": "√",
218
- * "uniVer": "√",
219
- * "unixVer": "x"
220
- * },
221
- * "jd": {
222
- * "hostVer": "√",
223
- * "uniVer": "√",
224
- * "unixVer": "x"
225
- * }
226
- * },
227
- * "web": {
228
- * "uniVer": "√",
229
- * "unixVer": "4.0"
230
- * }
231
- * }
160
+ */
161
+ onNetworkStatusChange(listener : OnNetworkStatusChangeCallback) : number;
162
+ /**
163
+ * 取消监听网络状态变化
164
+ *
165
+ * @tutorial_uni_app https://uniapp.dcloud.net.cn/api/system/network.html#offnetworkstatuschange
166
+ * @tutorial_uni_app_x https://doc.dcloud.net.cn/uni-app-x/api/network-status-change.html
167
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/network-status-change.html
168
+ * @uniPlatform {
169
+ * "app": {
170
+ * "android": {
171
+ * "osVer": "5.0",
172
+ * "uniVer": "√",
173
+ * "unixVer": "4.81"
174
+ * },
175
+ * "ios": {
176
+ * "osVer": "12.0",
177
+ * "uniVer": "√",
178
+ * "unixVer": "4.81",
179
+ * "unixUtsPlugin": "4.81"
180
+ * },
181
+ * "harmony": {
182
+ * "osVer": "3.0",
183
+ * "uniVer": "4.24",
184
+ * "unixVer": "4.61"
185
+ * }
186
+ * },
187
+ * "mp": {
188
+ * "weixin": {
189
+ * "hostVer": "2.9.3",
190
+ * "uniVer": "",
191
+ * "unixVer": "4.41"
192
+ * },
193
+ * "alipay": {
194
+ * "hostVer": "√",
195
+ * "uniVer": "",
196
+ * "unixVer": "x"
197
+ * },
198
+ * "baidu": {
199
+ * "hostVer": "√",
200
+ * "uniVer": "",
201
+ * "unixVer": "x"
202
+ * },
203
+ * "toutiao": {
204
+ * "hostVer": "√",
205
+ * "uniVer": "",
206
+ * "unixVer": "x"
207
+ * },
208
+ * "lark": {
209
+ * "hostVer": "√",
210
+ * "uniVer": "",
211
+ * "unixVer": "x"
212
+ * },
213
+ * "qq": {
214
+ * "hostVer": "√",
215
+ * "uniVer": "",
216
+ * "unixVer": "x"
217
+ * },
218
+ * "kuaishou": {
219
+ * "hostVer": "√",
220
+ * "uniVer": "",
221
+ * "unixVer": "x"
222
+ * },
223
+ * "jd": {
224
+ * "hostVer": "√",
225
+ * "uniVer": "",
226
+ * "unixVer": "x"
227
+ * }
228
+ * },
229
+ * "web": {
230
+ * "uniVer": "",
231
+ * "unixVer": "4.0"
232
+ * }
233
+ * }
232
234
  * @tutorial_weixin https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.offNetworkStatusChange.html
233
- */
234
- offNetworkStatusChange(callback: (result: any) => void): void;
235
- }
236
-
237
- export type GetNetworkType = (options: GetNetworkTypeOptions) => void;
238
- export type GetNetworkTypeSuccess = {
239
- /**
240
- * 网络类型
235
+ */
236
+ offNetworkStatusChange(listener ?: number | OnNetworkStatusChangeCallback | null) : void;
237
+ }
238
+
239
+ export type GetNetworkType = (options : GetNetworkTypeOptions) => void;
240
+ export type GetNetworkTypeSuccess = {
241
+ /**
242
+ * 网络类型
241
243
  * @uniPlatform {
242
244
  * "mp": {
243
245
  * "weixin": {
@@ -282,8 +284,8 @@ export type GetNetworkTypeSuccess = {
282
284
  * }
283
285
  * }
284
286
  * }
285
- */
286
- networkType: string
287
+ */
288
+ networkType : string
287
289
  /**
288
290
  * 需要基础库: `2.22.1`
289
291
  *
@@ -435,65 +437,16 @@ export type GetNetworkTypeSuccess = {
435
437
  * }
436
438
  */
437
439
  weakNet?: boolean | null;
438
- };
439
- export type GetNetworkTypeSuccessCallback = (result: GetNetworkTypeSuccess) => void;
440
- export type GetNetworkTypeFail = UniError;
441
- export type GetNetworkTypeFailCallback = (result: GetNetworkTypeFail) => void;
442
- export type GetNetworkTypeComplete = any;
443
- export type GetNetworkTypeCompleteCallback = (result: GetNetworkTypeComplete) => void;
444
- export type GetNetworkTypeOptions = {
445
- /**
446
- * 接口调用成功的回调函数
447
- * @defaultValue null
448
- * @uniPlatform {
449
- * "mp": {
450
- * "weixin": {
451
- * "hostVer": "√",
452
- * "uniVer": "√",
453
- * "unixVer": "4.41"
454
- * },
455
- * "alipay": {
456
- * "hostVer": "-",
457
- * "uniVer": "-",
458
- * "unixVer": "-"
459
- * },
460
- * "baidu": {
461
- * "hostVer": "-",
462
- * "uniVer": "-",
463
- * "unixVer": "-"
464
- * },
465
- * "toutiao": {
466
- * "hostVer": "-",
467
- * "uniVer": "-",
468
- * "unixVer": "-"
469
- * },
470
- * "lark": {
471
- * "hostVer": "-",
472
- * "uniVer": "-",
473
- * "unixVer": "-"
474
- * },
475
- * "qq": {
476
- * "hostVer": "-",
477
- * "uniVer": "-",
478
- * "unixVer": "-"
479
- * },
480
- * "kuaishou": {
481
- * "hostVer": "-",
482
- * "uniVer": "-",
483
- * "unixVer": "-"
484
- * },
485
- * "jd": {
486
- * "hostVer": "-",
487
- * "uniVer": "-",
488
- * "unixVer": "-"
489
- * }
490
- * }
491
- * }
492
- */
493
- success?: GetNetworkTypeSuccessCallback | null,
494
- /**
495
- * 接口调用失败的回调函数
496
- * @defaultValue null
440
+ };
441
+ export type GetNetworkTypeSuccessCallback = (result : GetNetworkTypeSuccess) => void;
442
+ export type GetNetworkTypeFail = UniError;
443
+ export type GetNetworkTypeFailCallback = (result : GetNetworkTypeFail) => void;
444
+ export type GetNetworkTypeComplete = any;
445
+ export type GetNetworkTypeCompleteCallback = (result : GetNetworkTypeComplete) => void;
446
+ export type GetNetworkTypeOptions = {
447
+ /**
448
+ * 接口调用成功的回调函数
449
+ * @defaultValue null
497
450
  * @uniPlatform {
498
451
  * "mp": {
499
452
  * "weixin": {
@@ -538,11 +491,11 @@ export type GetNetworkTypeOptions = {
538
491
  * }
539
492
  * }
540
493
  * }
541
- */
542
- fail?: GetNetworkTypeFailCallback | null,
543
- /**
544
- * 接口调用结束的回调函数(调用成功、失败都会执行)
545
- * @defaultValue null
494
+ */
495
+ success ?: GetNetworkTypeSuccessCallback | null,
496
+ /**
497
+ * 接口调用失败的回调函数
498
+ * @defaultValue null
546
499
  * @uniPlatform {
547
500
  * "mp": {
548
501
  * "weixin": {
@@ -587,108 +540,206 @@ export type GetNetworkTypeOptions = {
587
540
  * }
588
541
  * }
589
542
  * }
590
- */
591
- complete?: GetNetworkTypeCompleteCallback | null
592
- };
543
+ */
544
+ fail ?: GetNetworkTypeFailCallback | null,
545
+ /**
546
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
547
+ * @defaultValue null
548
+ * @uniPlatform {
549
+ * "mp": {
550
+ * "weixin": {
551
+ * "hostVer": "√",
552
+ * "uniVer": "√",
553
+ * "unixVer": "4.41"
554
+ * },
555
+ * "alipay": {
556
+ * "hostVer": "-",
557
+ * "uniVer": "-",
558
+ * "unixVer": "-"
559
+ * },
560
+ * "baidu": {
561
+ * "hostVer": "-",
562
+ * "uniVer": "-",
563
+ * "unixVer": "-"
564
+ * },
565
+ * "toutiao": {
566
+ * "hostVer": "-",
567
+ * "uniVer": "-",
568
+ * "unixVer": "-"
569
+ * },
570
+ * "lark": {
571
+ * "hostVer": "-",
572
+ * "uniVer": "-",
573
+ * "unixVer": "-"
574
+ * },
575
+ * "qq": {
576
+ * "hostVer": "-",
577
+ * "uniVer": "-",
578
+ * "unixVer": "-"
579
+ * },
580
+ * "kuaishou": {
581
+ * "hostVer": "-",
582
+ * "uniVer": "-",
583
+ * "unixVer": "-"
584
+ * },
585
+ * "jd": {
586
+ * "hostVer": "-",
587
+ * "uniVer": "-",
588
+ * "unixVer": "-"
589
+ * }
590
+ * }
591
+ * }
592
+ */
593
+ complete ?: GetNetworkTypeCompleteCallback | null
594
+ };
593
595
  export type OnNetworkStatusChangeCallbackResult = {
594
- /**
595
- * 当前是否有网络连接
596
- * @type boolean
597
- * @uniPlatform {
598
- * "mp": {
599
- * "weixin": {
600
- * "hostVer": "√",
601
- * "uniVer": "",
602
- * "unixVer": "4.41"
603
- * },
604
- * "alipay": {
605
- * "hostVer": "-",
606
- * "uniVer": "-",
607
- * "unixVer": "-"
608
- * },
609
- * "baidu": {
610
- * "hostVer": "-",
611
- * "uniVer": "-",
612
- * "unixVer": "-"
613
- * },
614
- * "toutiao": {
615
- * "hostVer": "-",
616
- * "uniVer": "-",
617
- * "unixVer": "-"
618
- * },
619
- * "lark": {
620
- * "hostVer": "-",
621
- * "uniVer": "-",
622
- * "unixVer": "-"
623
- * },
624
- * "qq": {
625
- * "hostVer": "-",
626
- * "uniVer": "-",
627
- * "unixVer": "-"
628
- * },
629
- * "kuaishou": {
630
- * "hostVer": "-",
631
- * "uniVer": "-",
632
- * "unixVer": "-"
633
- * },
634
- * "jd": {
635
- * "hostVer": "-",
636
- * "uniVer": "-",
637
- * "unixVer": "-"
638
- * }
639
- * }
640
- * }
641
- */
642
- isConnected: boolean,
643
- /**
644
- * 网络类型
645
- * @uniPlatform {
646
- * "mp": {
647
- * "weixin": {
648
- * "hostVer": "√",
649
- * "uniVer": "√",
650
- * "unixVer": "4.41"
651
- * },
652
- * "alipay": {
653
- * "hostVer": "-",
654
- * "uniVer": "-",
655
- * "unixVer": "-"
656
- * },
657
- * "baidu": {
658
- * "hostVer": "-",
659
- * "uniVer": "-",
660
- * "unixVer": "-"
661
- * },
662
- * "toutiao": {
663
- * "hostVer": "-",
664
- * "uniVer": "-",
665
- * "unixVer": "-"
666
- * },
667
- * "lark": {
668
- * "hostVer": "-",
669
- * "uniVer": "-",
670
- * "unixVer": "-"
671
- * },
672
- * "qq": {
673
- * "hostVer": "-",
674
- * "uniVer": "-",
675
- * "unixVer": "-"
676
- * },
677
- * "kuaishou": {
678
- * "hostVer": "-",
679
- * "uniVer": "-",
680
- * "unixVer": "-"
681
- * },
682
- * "jd": {
683
- * "hostVer": "-",
684
- * "uniVer": "-",
685
- * "unixVer": "-"
686
- * }
687
- * }
688
- * }
689
- */
690
- networkType: string
691
- };
692
- export type OnNetworkStatusChangeCallback = (result: OnNetworkStatusChangeCallbackResult) => void;
693
- export type OnNetworkStatusChange = (callback: OnNetworkStatusChangeCallback) => void;
694
- export type OffNetworkStatusChange = (callback: (result: any) => void) => void;
596
+ /**
597
+ * 当前是否有网络连接
598
+ *
599
+ * @type boolean
600
+ * @uniPlatform {
601
+ * "app": {
602
+ * "android": {
603
+ * "osVer": "5.0",
604
+ * "uniVer": "",
605
+ * "unixVer": "4.81"
606
+ * "unixUtsPlugin": "4.81"
607
+ * },
608
+ * "ios": {
609
+ * "osVer": "12.0",
610
+ * "uniVer": "√",
611
+ * "unixVer": "4.81",
612
+ * "unixUtsPlugin": "4.81"
613
+ * },
614
+ * "harmony": {
615
+ * "osVer": "3.0",
616
+ * "uniVer": "4.24",
617
+ * "unixVer": "4.61"
618
+ * }
619
+ * },
620
+ * "mp": {
621
+ * "weixin": {
622
+ * "hostVer": "",
623
+ * "uniVer": "",
624
+ * "unixVer": "4.41"
625
+ * },
626
+ * "alipay": {
627
+ * "hostVer": "",
628
+ * "uniVer": "",
629
+ * "unixVer": "x"
630
+ * },
631
+ * "baidu": {
632
+ * "hostVer": "",
633
+ * "uniVer": "",
634
+ * "unixVer": "x"
635
+ * },
636
+ * "toutiao": {
637
+ * "hostVer": "",
638
+ * "uniVer": "",
639
+ * "unixVer": "x"
640
+ * },
641
+ * "lark": {
642
+ * "hostVer": "√",
643
+ * "uniVer": "√",
644
+ * "unixVer": "x"
645
+ * },
646
+ * "qq": {
647
+ * "hostVer": "√",
648
+ * "uniVer": "√",
649
+ * "unixVer": "x"
650
+ * },
651
+ * "kuaishou": {
652
+ * "hostVer": "",
653
+ * "uniVer": "√",
654
+ * "unixVer": "x"
655
+ * },
656
+ * "jd": {
657
+ * "hostVer": "",
658
+ * "uniVer": "√",
659
+ * "unixVer": "x"
660
+ * }
661
+ * },
662
+ * "web": {
663
+ * "uniVer": "√",
664
+ * "unixVer": "4.0"
665
+ * }
666
+ * }
667
+ */
668
+ isConnected : boolean,
669
+ /**
670
+ * 网络类型(wifi、2g、3g、4g、5g、unknown、none)
671
+ *
672
+ * @type boolean
673
+ * @uniPlatform {
674
+ * "app": {
675
+ * "android": {
676
+ * "osVer": "5.0",
677
+ * "uniVer": "",
678
+ * "unixVer": "4.81"
679
+ * "unixUtsPlugin": "4.81"
680
+ * },
681
+ * "ios": {
682
+ * "osVer": "12.0",
683
+ * "uniVer": "√",
684
+ * "unixVer": "4.81",
685
+ * "unixUtsPlugin": "4.81"
686
+ * },
687
+ * "harmony": {
688
+ * "osVer": "3.0",
689
+ * "uniVer": "4.24",
690
+ * "unixVer": "4.61"
691
+ * }
692
+ * },
693
+ * "mp": {
694
+ * "weixin": {
695
+ * "hostVer": "√",
696
+ * "uniVer": "√",
697
+ * "unixVer": "4.41"
698
+ * },
699
+ * "alipay": {
700
+ * "hostVer": "√",
701
+ * "uniVer": "√",
702
+ * "unixVer": "x"
703
+ * },
704
+ * "baidu": {
705
+ * "hostVer": "√",
706
+ * "uniVer": "√",
707
+ * "unixVer": "x"
708
+ * },
709
+ * "toutiao": {
710
+ * "hostVer": "√",
711
+ * "uniVer": "√",
712
+ * "unixVer": "x"
713
+ * },
714
+ * "lark": {
715
+ * "hostVer": "√",
716
+ * "uniVer": "√",
717
+ * "unixVer": "x"
718
+ * },
719
+ * "qq": {
720
+ * "hostVer": "√",
721
+ * "uniVer": "√",
722
+ * "unixVer": "x"
723
+ * },
724
+ * "kuaishou": {
725
+ * "hostVer": "√",
726
+ * "uniVer": "√",
727
+ * "unixVer": "x"
728
+ * },
729
+ * "jd": {
730
+ * "hostVer": "√",
731
+ * "uniVer": "√",
732
+ * "unixVer": "x"
733
+ * }
734
+ * },
735
+ * "web": {
736
+ * "uniVer": "√",
737
+ * "unixVer": "4.0"
738
+ * }
739
+ * }
740
+ */
741
+ networkType : string
742
+ };
743
+ export type OnNetworkStatusChangeCallback = (result : OnNetworkStatusChangeCallbackResult) => void;
744
+ export type OnNetworkStatusChange = (listener : OnNetworkStatusChangeCallback) => number;
745
+ export type OffNetworkStatusChange = (listener ?: number | OnNetworkStatusChangeCallback | null) => void;