@dcloudio/uni-app-x 0.7.37 → 0.7.39
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/UniPage.d.ts +48 -9
- package/types/app.d.ts +8 -5
- package/types/native/AsyncApiResult.d.ts +1 -0
- package/types/native/CanvasRenderingContext2D.d.ts +1 -1
- package/types/native/IUniElement.d.ts +130 -35
- package/types/native/UniElement.d.ts +2 -1
- package/types/native/UniTextElement.d.ts +1 -0
- package/types/native/global.d.ts +16 -0
- package/types/page.d.ts +47 -5
- package/types/uni/env/index.d.ts +87 -73
- package/types/uni/global.d.ts +1 -0
- package/types/uni/index.d.ts +1 -0
- package/types/uni/uni-map-tencent-global.d.ts +33 -0
- package/types/uni/uni-map-tencent-map.d.ts +52 -0
- package/types/uni/uts-plugin-api/global.d.ts +2 -1
- package/types/uni/uts-plugin-api/index.d.ts +2 -1
- package/types/uni/uts-plugin-api/lib/uni-addPhoneContact/utssdk/global.d.ts +0 -2
- package/types/uni/uts-plugin-api/lib/uni-addPhoneContact/utssdk/index.d.ts +0 -1
- package/types/uni/uts-plugin-api/lib/uni-addPhoneContact/utssdk/interface.d.ts +212 -219
- package/types/uni/uts-plugin-api/lib/uni-arrayBufferToBase64/utssdk/interface.d.ts +73 -73
- package/types/uni/uts-plugin-api/lib/uni-authentication/utssdk/interface.d.ts +331 -205
- package/types/uni/uts-plugin-api/lib/uni-base64ToArrayBuffer/utssdk/interface.d.ts +73 -73
- package/types/uni/uts-plugin-api/lib/uni-canvas/utssdk/interface.d.ts +848 -208
- package/types/uni/{uts-plugin-extend → uts-plugin-api}/lib/uni-chooseLocation/utssdk/global.d.ts +5 -6
- package/types/uni/{uts-plugin-extend → uts-plugin-api}/lib/uni-chooseLocation/utssdk/index.d.ts +3 -3
- package/types/uni/uts-plugin-api/lib/uni-chooseLocation/utssdk/interface.d.ts +414 -0
- package/types/uni/uts-plugin-api/lib/uni-clipboard/utssdk/interface.d.ts +2 -2
- package/types/uni/uts-plugin-api/lib/uni-createInnerAudioContext/utssdk/global.d.ts +4 -0
- package/types/uni/uts-plugin-api/lib/uni-createInnerAudioContext/utssdk/index.d.ts +2 -0
- package/types/uni/uts-plugin-api/lib/uni-createInnerAudioContext/utssdk/interface.d.ts +1226 -1726
- package/types/uni/uts-plugin-api/lib/uni-createIntersectionObserver/utssdk/interface.d.ts +1 -1
- package/types/uni/uts-plugin-api/lib/uni-createSelectorQuery/utssdk/interface.d.ts +102 -18
- package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/interface.d.ts +2 -2
- package/types/uni/uts-plugin-api/lib/uni-dialogPage/utssdk/interface.d.ts +1199 -1045
- package/types/uni/uts-plugin-api/lib/uni-event/utssdk/interface.d.ts +294 -263
- package/types/uni/uts-plugin-api/lib/uni-exit/utssdk/interface.d.ts +33 -28
- package/types/uni/uts-plugin-api/lib/uni-file/utssdk/interface.d.ts +210 -0
- package/types/uni/uts-plugin-api/lib/uni-fileSystemManager/utssdk/interface.d.ts +4828 -1750
- package/types/uni/uts-plugin-api/lib/uni-getAppAuthorizeSetting/utssdk/interface.d.ts +490 -448
- package/types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +2138 -829
- package/types/uni/uts-plugin-api/lib/uni-getBackgroundAudioManager/utssdk/global.d.ts +4 -0
- package/types/uni/uts-plugin-api/lib/uni-getBackgroundAudioManager/utssdk/index.d.ts +2 -0
- package/types/uni/uts-plugin-api/lib/uni-getBackgroundAudioManager/utssdk/interface.d.ts +664 -114
- package/types/uni/uts-plugin-api/lib/uni-getDeviceInfo/utssdk/interface.d.ts +891 -9
- package/types/uni/uts-plugin-api/lib/uni-getElementById/utssdk/interface.d.ts +3 -3
- package/types/uni/uts-plugin-api/lib/uni-getEnterOptionsSync/utssdk/interface.d.ts +254 -114
- package/types/uni/uts-plugin-api/lib/uni-getLaunchOptionsSync/utssdk/interface.d.ts +152 -12
- package/types/uni/uts-plugin-api/lib/uni-getLocation/utssdk/interface.d.ts +813 -57
- package/types/uni/uts-plugin-api/lib/uni-getLocation-tencent-uni1/utssdk/global.d.ts +0 -2
- package/types/uni/uts-plugin-api/lib/uni-getLocation-tencent-uni1/utssdk/interface.d.ts +0 -45
- package/types/uni/uts-plugin-api/lib/uni-getNetworkType/utssdk/interface.d.ts +274 -148
- package/types/uni/uts-plugin-api/lib/uni-getPerformance/utssdk/interface.d.ts +38 -3
- package/types/uni/uts-plugin-api/lib/uni-getRecorderManager/utssdk/interface.d.ts +969 -969
- package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/interface.d.ts +3161 -43
- package/types/uni/uts-plugin-api/lib/uni-getSystemSetting/utssdk/interface.d.ts +316 -22
- package/types/uni/uts-plugin-api/lib/uni-interceptor/utssdk/interface.d.ts +2 -2
- package/types/uni/uts-plugin-api/lib/uni-keyboard/utssdk/interface.d.ts +42 -0
- package/types/uni/uts-plugin-api/lib/uni-loadFontFace/utssdk/interface.d.ts +41 -41
- package/types/uni/uts-plugin-api/lib/uni-makePhoneCall/utssdk/interface.d.ts +88 -88
- package/types/uni/uts-plugin-api/lib/uni-media/utssdk/global.d.ts +8 -0
- package/types/uni/uts-plugin-api/lib/uni-media/utssdk/index.d.ts +4 -0
- package/types/uni/uts-plugin-api/lib/uni-media/utssdk/interface.d.ts +2765 -1193
- package/types/uni/uts-plugin-api/lib/uni-navigationBar/utssdk/interface.d.ts +18 -18
- package/types/uni/uts-plugin-api/lib/uni-network/utssdk/interface.d.ts +3098 -1153
- package/types/uni/uts-plugin-api/lib/uni-oauth/utssdk/interface.d.ts +13 -13
- package/types/uni/uts-plugin-api/lib/uni-openDocument/utssdk/interface.d.ts +42 -0
- package/types/uni/uts-plugin-api/lib/uni-pageScrollTo/utssdk/interface.d.ts +10 -10
- package/types/uni/uts-plugin-api/lib/uni-payment/utssdk/interface.d.ts +621 -369
- package/types/uni/uts-plugin-api/lib/uni-payment-huawei/utssdk/global.d.ts +8 -0
- package/types/uni/uts-plugin-api/lib/uni-payment-huawei/utssdk/index.d.ts +4 -0
- package/types/uni/uts-plugin-api/lib/uni-payment-huawei/utssdk/interface.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-privacy/utssdk/interface.d.ts +540 -253
- package/types/uni/uts-plugin-api/lib/uni-prompt/utssdk/interface.d.ts +2602 -1131
- package/types/uni/uts-plugin-api/lib/uni-pullDownRefresh/utssdk/interface.d.ts +2 -2
- package/types/uni/uts-plugin-api/lib/uni-route/utssdk/interface.d.ts +58 -58
- package/types/uni/uts-plugin-api/lib/uni-rpx2px/utssdk/interface.d.ts +77 -35
- package/types/uni/uts-plugin-api/lib/uni-scanCode/utssdk/interface.d.ts +42 -0
- package/types/uni/uts-plugin-api/lib/uni-shareWithSystem/utssdk/global.d.ts +4 -0
- package/types/uni/uts-plugin-api/lib/uni-shareWithSystem/utssdk/index.d.ts +2 -0
- package/types/uni/uts-plugin-api/lib/uni-shareWithSystem/utssdk/interface.d.ts +614 -15
- package/types/uni/uts-plugin-api/lib/uni-storage/utssdk/interface.d.ts +857 -437
- package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/interface.d.ts +58 -16
- package/types/uni/uts-plugin-api/lib/uni-theme/utssdk/global.d.ts +8 -0
- package/types/uni/uts-plugin-api/lib/uni-theme/utssdk/index.d.ts +4 -0
- package/types/uni/uts-plugin-api/lib/uni-theme/utssdk/interface.d.ts +1057 -516
- package/types/uni/uts-plugin-api/lib/uni-virtualPayment/utssdk/interface.d.ts +1656 -1488
- package/types/uni/uts-plugin-api/lib/uni-websocket/utssdk/interface.d.ts +1752 -786
- package/types/uni/uts-plugin-biz/global.d.ts +1 -0
- package/types/uni/uts-plugin-biz/index.d.ts +1 -0
- package/types/uni/uts-plugin-biz/lib/uni-ad/utssdk/interface.d.ts +85 -1
- package/types/uni/{uts-plugin-api → uts-plugin-biz}/lib/uni-crash/utssdk/interface.d.ts +46 -46
- package/types/uni/uts-plugin-biz/lib/uni-map-tencent/utssdk/interface.d.ts +72 -20
- package/types/uni/uts-plugin-biz/lib/uni-push/utssdk/interface.d.ts +126 -0
- package/types/uni/uts-plugin-biz/lib/uni-verify/utssdk/global.d.ts +4 -0
- package/types/uni/uts-plugin-biz/lib/uni-verify/utssdk/index.d.ts +2 -0
- package/types/uni/uts-plugin-biz/lib/uni-verify/utssdk/interface.d.ts +98 -15
- package/types/uni/uts-plugin-component/lib/uni-video/utssdk/interface.d.ts +677 -299
- package/types/uni/uts-plugin-extend/README.md +3 -0
- package/types/uni/uts-plugin-extend/global.d.ts +1 -0
- package/types/uni/uts-plugin-extend/lib/uni-__f__/utssdk/global.d.ts +7 -0
- package/types/uni/uts-plugin-extend/lib/uni-__f__/utssdk/index.d.ts +0 -0
- package/types/uni/uts-plugin-extend/lib/uni-__f__/utssdk/interface.d.ts +3 -0
- package/types/uni/uts-plugin-extend/lib/uni-accelerometer/utssdk/interface.d.ts +4 -4
- package/types/uni/uts-plugin-extend/lib/uni-canvas/utssdk/interface.d.ts +5 -5
- package/types/uni/uts-plugin-extend/lib/uni-compass/utssdk/interface.d.ts +302 -302
- package/types/uni/uts-plugin-extend/lib/uni-createMediaQueryObserver/utssdk/interface.d.ts +77 -77
- package/types/uni/uts-plugin-extend/lib/uni-getBackgroundAudioManager/utssdk/interface.d.ts +431 -11
- package/types/uni/uts-plugin-extend/lib/uni-locale/utssdk/interface.d.ts +3 -3
- package/types/uni/uts-plugin-extend/lib/uni-localeChange/utssdk/interface.d.ts +6 -6
- package/types/uni/uts-plugin-extend/lib/uni-memory/utssdk/interface.d.ts +2 -2
- package/types/uni/uts-plugin-extend/lib/uni-openLocation/utssdk/interface.d.ts +73 -73
- package/types/uni-cloud/interface.d.ts +91 -0
- package/uts-plugin.d.ts +3 -1
- package/types/uni/uts-plugin-extend/lib/uni-chooseLocation/utssdk/interface.d.ts +0 -151
- package/types/uni/uts-plugin-extend/lib/uni-createInnerAudioContext/utssdk/global.d.ts +0 -11
- package/types/uni/uts-plugin-extend/lib/uni-createInnerAudioContext/utssdk/index.d.ts +0 -4
- package/types/uni/uts-plugin-extend/lib/uni-createInnerAudioContext/utssdk/interface.d.ts +0 -224
- package/types/uni/uts-plugin-extend/lib/uni-createMapContext/utssdk/global.d.ts +0 -53
- package/types/uni/uts-plugin-extend/lib/uni-createMapContext/utssdk/index.d.ts +0 -25
- package/types/uni/uts-plugin-extend/lib/uni-createMapContext/utssdk/interface.d.ts +0 -487
- package/types/uni/uts-plugin-extend/lib/uni-theme/utssdk/global.d.ts +0 -9
- package/types/uni/uts-plugin-extend/lib/uni-theme/utssdk/index.d.ts +0 -1
- package/types/uni/uts-plugin-extend/lib/uni-theme/utssdk/interface.d.ts +0 -165
- /package/types/uni/{uts-plugin-api → uts-plugin-biz}/lib/uni-crash/utssdk/global.d.ts +0 -0
- /package/types/uni/{uts-plugin-api → uts-plugin-biz}/lib/uni-crash/utssdk/index.d.ts +0 -0
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
GetLocation as GetLocationOrigin,
|
|
8
8
|
GetLocationSuccess as GetLocationSuccessOrigin,
|
|
9
9
|
GetLocationOptions as GetLocationOptionsOrigin,
|
|
10
|
-
Uni as UniOrigin
|
|
11
10
|
} from './interface'
|
|
12
11
|
|
|
13
12
|
declare global {
|
|
@@ -18,5 +17,4 @@ declare global {
|
|
|
18
17
|
type GetLocation = GetLocationOrigin
|
|
19
18
|
type GetLocationSuccess = GetLocationSuccessOrigin
|
|
20
19
|
type GetLocationOptions = GetLocationOptionsOrigin
|
|
21
|
-
interface Uni extends UniOrigin { }
|
|
22
20
|
}
|
|
@@ -2,51 +2,6 @@ import { GetLocationFailImpl as GetLocationFailImplement } from './unierror.uts'
|
|
|
2
2
|
|
|
3
3
|
export type GetLocationFailImpl = GetLocationFailImplement
|
|
4
4
|
|
|
5
|
-
export interface Uni {
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @description 获取当前的地理位置、速度
|
|
9
|
-
* @param {GetLocation} option
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* uni.getLocation({
|
|
13
|
-
* type: 'wgs84',
|
|
14
|
-
* success: function (res) {
|
|
15
|
-
* console.log('当前位置的经度:' + res.longitude);
|
|
16
|
-
* console.log('当前位置的纬度:' + res.latitude);
|
|
17
|
-
* }
|
|
18
|
-
* });
|
|
19
|
-
* ```
|
|
20
|
-
* @tutorial http://uniapp.dcloud.io/api/location/location?id=getlocation
|
|
21
|
-
* @uniPlatform {
|
|
22
|
-
* "app": {
|
|
23
|
-
* "android": {
|
|
24
|
-
* "osVer": "5.0",
|
|
25
|
-
* "uniVer": "√",
|
|
26
|
-
* "unixVer": "3.9.0"
|
|
27
|
-
* },
|
|
28
|
-
* "ios": {
|
|
29
|
-
* "osVer": "12.0",
|
|
30
|
-
* "uniVer": "√",
|
|
31
|
-
* "unixVer": "4.11"
|
|
32
|
-
* },
|
|
33
|
-
* "harmony": {
|
|
34
|
-
* "osVer": "x",
|
|
35
|
-
* "uniVer": "4.25",
|
|
36
|
-
* "unixVer": "x"
|
|
37
|
-
* }
|
|
38
|
-
* },
|
|
39
|
-
* "web": {
|
|
40
|
-
* "uniVer": "√",
|
|
41
|
-
* "unixVer": "4.0"
|
|
42
|
-
* }
|
|
43
|
-
* }
|
|
44
|
-
*
|
|
45
|
-
*/
|
|
46
|
-
getLocation(options : GetLocationOptions) : void;
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
5
|
/**
|
|
51
6
|
* 错误码
|
|
52
7
|
*/
|
|
@@ -1,148 +1,274 @@
|
|
|
1
|
-
export interface Uni {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
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": "x"
|
|
27
|
+
* }
|
|
28
|
+
* },
|
|
29
|
+
* "mp": {
|
|
30
|
+
* "weixin": {
|
|
31
|
+
* "hostVer": "√",
|
|
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
|
+
*/
|
|
85
|
+
getNetworkType(options: GetNetworkTypeOptions): void;
|
|
86
|
+
/**
|
|
87
|
+
* 监听网络状态变化
|
|
88
|
+
*
|
|
89
|
+
* @tutorial-uni-app https://uniapp.dcloud.net.cn/api/system/network.html#onnetworkstatuschange
|
|
90
|
+
* @tutorial https://uniapp.dcloud.net.cn/api/system/network.html#onnetworkstatuschange
|
|
91
|
+
* @uniPlatform {
|
|
92
|
+
* "app": {
|
|
93
|
+
* "android": {
|
|
94
|
+
* "osVer": "5.0",
|
|
95
|
+
* "uniVer": "√",
|
|
96
|
+
* "unixVer": "3.9+"
|
|
97
|
+
* },
|
|
98
|
+
* "ios": {
|
|
99
|
+
* "osVer": "12.0",
|
|
100
|
+
* "uniVer": "√",
|
|
101
|
+
* "unixVer": "4.11"
|
|
102
|
+
* },
|
|
103
|
+
* "harmony": {
|
|
104
|
+
* "osVer": "3.0",
|
|
105
|
+
* "uniVer": "4.24",
|
|
106
|
+
* "unixVer": "x"
|
|
107
|
+
* }
|
|
108
|
+
* },
|
|
109
|
+
* "mp": {
|
|
110
|
+
* "weixin": {
|
|
111
|
+
* "hostVer": "√",
|
|
112
|
+
* "uniVer": "√",
|
|
113
|
+
* "unixVer": "4.41"
|
|
114
|
+
* },
|
|
115
|
+
* "alipay": {
|
|
116
|
+
* "hostVer": "√",
|
|
117
|
+
* "uniVer": "√",
|
|
118
|
+
* "unixVer": "x"
|
|
119
|
+
* },
|
|
120
|
+
* "baidu": {
|
|
121
|
+
* "hostVer": "√",
|
|
122
|
+
* "uniVer": "√",
|
|
123
|
+
* "unixVer": "x"
|
|
124
|
+
* },
|
|
125
|
+
* "toutiao": {
|
|
126
|
+
* "hostVer": "√",
|
|
127
|
+
* "uniVer": "√",
|
|
128
|
+
* "unixVer": "x"
|
|
129
|
+
* },
|
|
130
|
+
* "lark": {
|
|
131
|
+
* "hostVer": "√",
|
|
132
|
+
* "uniVer": "√",
|
|
133
|
+
* "unixVer": "x"
|
|
134
|
+
* },
|
|
135
|
+
* "qq": {
|
|
136
|
+
* "hostVer": "√",
|
|
137
|
+
* "uniVer": "√",
|
|
138
|
+
* "unixVer": "x"
|
|
139
|
+
* },
|
|
140
|
+
* "kuaishou": {
|
|
141
|
+
* "hostVer": "√",
|
|
142
|
+
* "uniVer": "√",
|
|
143
|
+
* "unixVer": "x"
|
|
144
|
+
* },
|
|
145
|
+
* "jd": {
|
|
146
|
+
* "hostVer": "√",
|
|
147
|
+
* "uniVer": "√",
|
|
148
|
+
* "unixVer": "x"
|
|
149
|
+
* }
|
|
150
|
+
* },
|
|
151
|
+
* "web": {
|
|
152
|
+
* "uniVer": "√",
|
|
153
|
+
* "unixVer": "4.0"
|
|
154
|
+
* }
|
|
155
|
+
* }
|
|
156
|
+
*/
|
|
157
|
+
onNetworkStatusChange: OnNetworkStatusChange;
|
|
158
|
+
/**
|
|
159
|
+
* 取消监听网络状态变化
|
|
160
|
+
*
|
|
161
|
+
* @tutorial-uni-app https://uniapp.dcloud.net.cn/api/system/network.html#offnetworkstatuschange
|
|
162
|
+
* @tutorial https://uniapp.dcloud.net.cn/api/system/network.html#offnetworkstatuschange
|
|
163
|
+
* @uniPlatform {
|
|
164
|
+
* "app": {
|
|
165
|
+
* "android": {
|
|
166
|
+
* "osVer": "5.0",
|
|
167
|
+
* "uniVer": "√",
|
|
168
|
+
* "unixVer": "3.9+"
|
|
169
|
+
* },
|
|
170
|
+
* "ios": {
|
|
171
|
+
* "osVer": "12.0",
|
|
172
|
+
* "uniVer": "√",
|
|
173
|
+
* "unixVer": "4.11"
|
|
174
|
+
* },
|
|
175
|
+
* "harmony": {
|
|
176
|
+
* "osVer": "3.0",
|
|
177
|
+
* "uniVer": "4.24",
|
|
178
|
+
* "unixVer": "x"
|
|
179
|
+
* }
|
|
180
|
+
* },
|
|
181
|
+
* "mp": {
|
|
182
|
+
* "weixin": {
|
|
183
|
+
* "hostVer": "√",
|
|
184
|
+
* "uniVer": "√",
|
|
185
|
+
* "unixVer": "4.41"
|
|
186
|
+
* },
|
|
187
|
+
* "alipay": {
|
|
188
|
+
* "hostVer": "√",
|
|
189
|
+
* "uniVer": "√",
|
|
190
|
+
* "unixVer": "x"
|
|
191
|
+
* },
|
|
192
|
+
* "baidu": {
|
|
193
|
+
* "hostVer": "√",
|
|
194
|
+
* "uniVer": "√",
|
|
195
|
+
* "unixVer": "x"
|
|
196
|
+
* },
|
|
197
|
+
* "toutiao": {
|
|
198
|
+
* "hostVer": "√",
|
|
199
|
+
* "uniVer": "√",
|
|
200
|
+
* "unixVer": "x"
|
|
201
|
+
* },
|
|
202
|
+
* "lark": {
|
|
203
|
+
* "hostVer": "√",
|
|
204
|
+
* "uniVer": "√",
|
|
205
|
+
* "unixVer": "x"
|
|
206
|
+
* },
|
|
207
|
+
* "qq": {
|
|
208
|
+
* "hostVer": "√",
|
|
209
|
+
* "uniVer": "√",
|
|
210
|
+
* "unixVer": "x"
|
|
211
|
+
* },
|
|
212
|
+
* "kuaishou": {
|
|
213
|
+
* "hostVer": "√",
|
|
214
|
+
* "uniVer": "√",
|
|
215
|
+
* "unixVer": "x"
|
|
216
|
+
* },
|
|
217
|
+
* "jd": {
|
|
218
|
+
* "hostVer": "√",
|
|
219
|
+
* "uniVer": "√",
|
|
220
|
+
* "unixVer": "x"
|
|
221
|
+
* }
|
|
222
|
+
* },
|
|
223
|
+
* "web": {
|
|
224
|
+
* "uniVer": "√",
|
|
225
|
+
* "unixVer": "4.0"
|
|
226
|
+
* }
|
|
227
|
+
* }
|
|
228
|
+
*/
|
|
229
|
+
offNetworkStatusChange: OffNetworkStatusChange;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export type GetNetworkType = (options: GetNetworkTypeOptions) => void;
|
|
233
|
+
export type GetNetworkTypeSuccess = {
|
|
234
|
+
/**
|
|
235
|
+
* 网络类型
|
|
236
|
+
*/
|
|
237
|
+
networkType: string
|
|
238
|
+
};
|
|
239
|
+
export type GetNetworkTypeSuccessCallback = (result: GetNetworkTypeSuccess) => void;
|
|
240
|
+
export type GetNetworkTypeFail = UniError;
|
|
241
|
+
export type GetNetworkTypeFailCallback = (result: GetNetworkTypeFail) => void;
|
|
242
|
+
export type GetNetworkTypeComplete = any;
|
|
243
|
+
export type GetNetworkTypeCompleteCallback = (result: GetNetworkTypeComplete) => void;
|
|
244
|
+
export type GetNetworkTypeOptions = {
|
|
245
|
+
/**
|
|
246
|
+
* 接口调用成功的回调函数
|
|
247
|
+
* @defaultValue null
|
|
248
|
+
*/
|
|
249
|
+
success?: GetNetworkTypeSuccessCallback | null,
|
|
250
|
+
/**
|
|
251
|
+
* 接口调用失败的回调函数
|
|
252
|
+
* @defaultValue null
|
|
253
|
+
*/
|
|
254
|
+
fail?: GetNetworkTypeFailCallback | null,
|
|
255
|
+
/**
|
|
256
|
+
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
|
257
|
+
* @defaultValue null
|
|
258
|
+
*/
|
|
259
|
+
complete?: GetNetworkTypeCompleteCallback | null
|
|
260
|
+
};
|
|
261
|
+
export type OnNetworkStatusChangeCallbackResult = {
|
|
262
|
+
/**
|
|
263
|
+
* 当前是否有网络连接
|
|
264
|
+
* @type boolean
|
|
265
|
+
*/
|
|
266
|
+
isConnected: boolean,
|
|
267
|
+
/**
|
|
268
|
+
* 网络类型
|
|
269
|
+
*/
|
|
270
|
+
networkType: string
|
|
271
|
+
};
|
|
272
|
+
export type OnNetworkStatusChangeCallback = (result: OnNetworkStatusChangeCallbackResult) => void;
|
|
273
|
+
export type OnNetworkStatusChange = (callback: OnNetworkStatusChangeCallback) => void;
|
|
274
|
+
export type OffNetworkStatusChange = (callback: (result: any) => void) => void;
|
|
@@ -148,10 +148,45 @@ export interface Uni {
|
|
|
148
148
|
* },
|
|
149
149
|
* "mp": {
|
|
150
150
|
* "weixin": {
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
151
|
+
* "hostVer": "√",
|
|
152
|
+
* "uniVer": "√",
|
|
153
|
+
* "unixVer": "4.41"
|
|
154
|
+
* },
|
|
155
|
+
* "alipay": {
|
|
156
|
+
* "hostVer": "√",
|
|
157
|
+
* "uniVer": "√",
|
|
158
|
+
* "unixVer": "x"
|
|
159
|
+
* },
|
|
160
|
+
* "baidu": {
|
|
161
|
+
* "hostVer": "√",
|
|
162
|
+
* "uniVer": "√",
|
|
163
|
+
* "unixVer": "x"
|
|
164
|
+
* },
|
|
165
|
+
* "toutiao": {
|
|
166
|
+
* "hostVer": "√",
|
|
167
|
+
* "uniVer": "√",
|
|
168
|
+
* "unixVer": "x"
|
|
154
169
|
* },
|
|
170
|
+
* "lark": {
|
|
171
|
+
* "hostVer": "√",
|
|
172
|
+
* "uniVer": "√",
|
|
173
|
+
* "unixVer": "x"
|
|
174
|
+
* },
|
|
175
|
+
* "qq": {
|
|
176
|
+
* "hostVer": "√",
|
|
177
|
+
* "uniVer": "√",
|
|
178
|
+
* "unixVer": "x"
|
|
179
|
+
* },
|
|
180
|
+
* "kuaishou": {
|
|
181
|
+
* "hostVer": "√",
|
|
182
|
+
* "uniVer": "√",
|
|
183
|
+
* "unixVer": "x"
|
|
184
|
+
* },
|
|
185
|
+
* "jd": {
|
|
186
|
+
* "hostVer": "√",
|
|
187
|
+
* "uniVer": "√",
|
|
188
|
+
* "unixVer": "x"
|
|
189
|
+
* }
|
|
155
190
|
* },
|
|
156
191
|
* "web": {
|
|
157
192
|
* "uniVer": "x",
|