@tarojs/taro 3.7.0-alpha.8 → 3.7.0-beta.3
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 +11 -4
- package/types/api/ad/index.d.ts +6 -18
- package/types/api/ai/inference.d.ts +4 -8
- package/types/api/ai/visionkit.d.ts +625 -54
- package/types/api/base/performance.d.ts +5 -5
- package/types/api/canvas/index.d.ts +67 -54
- package/types/api/device/accelerometer.d.ts +8 -6
- package/types/api/device/accessibility.d.ts +1 -1
- package/types/api/device/battery.d.ts +2 -2
- package/types/api/device/bluetooth-ble.d.ts +40 -17
- package/types/api/device/bluetooth-peripheral.d.ts +26 -26
- package/types/api/device/bluetooth.d.ts +37 -13
- package/types/api/device/calendar.d.ts +11 -1
- package/types/api/device/clipboard.d.ts +2 -2
- package/types/api/device/compass.d.ts +5 -5
- package/types/api/device/gyroscope.d.ts +4 -4
- package/types/api/device/iBeacon.d.ts +10 -8
- package/types/api/device/keyboard.d.ts +7 -5
- package/types/api/device/memory.d.ts +3 -4
- package/types/api/device/motion.d.ts +8 -6
- package/types/api/device/network.d.ts +12 -6
- package/types/api/device/nfc.d.ts +13 -13
- package/types/api/device/phone.d.ts +1 -1
- package/types/api/device/scan.d.ts +5 -3
- package/types/api/device/screen.d.ts +27 -11
- package/types/api/device/sms.d.ts +1 -1
- package/types/api/device/vibrate.d.ts +5 -5
- package/types/api/device/wifi.d.ts +25 -13
- package/types/api/media/audio.d.ts +50 -30
- package/types/api/media/camera.d.ts +9 -3
- package/types/api/network/download.d.ts +2 -10
- package/types/api/network/upload.d.ts +2 -10
- package/types/api/open-api/device-voip.d.ts +2 -2
- package/types/api/open-api/login.d.ts +1 -1
- package/types/api/open-api/my-miniprogram.d.ts +2 -2
- package/types/api/open-api/privacy.d.ts +99 -0
- package/types/api/route/index.d.ts +3 -0
- package/types/api/skyline/index.d.ts +59 -0
- package/types/api/storage/cache-manager.d.ts +10 -10
- package/types/api/taro.extend.d.ts +1 -1
- package/types/api/ui/fonts.d.ts +4 -3
- package/types/compile/compiler.d.ts +7 -5
- package/types/compile/config/h5.d.ts +20 -10
- package/types/compile/config/index.d.ts +0 -1
- package/types/compile/config/mini.d.ts +36 -24
- package/types/compile/config/project.d.ts +8 -8
- package/types/compile/config/util.d.ts +18 -8
- package/types/compile/viteCompilerContext.d.ts +130 -0
- package/types/global.d.ts +1 -0
- package/types/index.d.ts +2 -0
- package/types/taro.api.d.ts +3 -0
- package/types/taro.component.d.ts +1 -1
- package/types/taro.config.d.ts +35 -4
- package/types/compile/config/harmony.d.ts +0 -23
|
@@ -20,7 +20,9 @@ declare module '../../index' {
|
|
|
20
20
|
complete?: (res: TaroGeneral.IBeaconError) => void
|
|
21
21
|
/** 接口调用失败的回调函数 */
|
|
22
22
|
fail?: (res: TaroGeneral.IBeaconError) => void
|
|
23
|
-
/** 是否校验蓝牙开关,仅在 iOS 下有效
|
|
23
|
+
/** 是否校验蓝牙开关,仅在 iOS 下有效
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
24
26
|
ignoreBluetoothAvailable?: boolean
|
|
25
27
|
/** 接口调用成功的回调函数 */
|
|
26
28
|
success?: (res: TaroGeneral.IBeaconError) => void
|
|
@@ -100,7 +102,7 @@ declare module '../../index' {
|
|
|
100
102
|
|
|
101
103
|
interface TaroStatic {
|
|
102
104
|
/** 停止搜索附近的 iBeacon 设备
|
|
103
|
-
* @supported weapp
|
|
105
|
+
* @supported weapp, alipay
|
|
104
106
|
* @example
|
|
105
107
|
* ```tsx
|
|
106
108
|
* Taro.stopBeaconDiscovery(params).then(...)
|
|
@@ -110,7 +112,7 @@ declare module '../../index' {
|
|
|
110
112
|
stopBeaconDiscovery(option?: stopBeaconDiscovery.Option): Promise<TaroGeneral.IBeaconError>
|
|
111
113
|
|
|
112
114
|
/** 开始搜索附近的 iBeacon 设备
|
|
113
|
-
* @supported weapp
|
|
115
|
+
* @supported weapp, alipay
|
|
114
116
|
* @example
|
|
115
117
|
* ```tsx
|
|
116
118
|
* Taro.startBeaconDiscovery({
|
|
@@ -122,7 +124,7 @@ declare module '../../index' {
|
|
|
122
124
|
startBeaconDiscovery(option: startBeaconDiscovery.Option): Promise<TaroGeneral.IBeaconError>
|
|
123
125
|
|
|
124
126
|
/** 监听 iBeacon 设备更新事件,仅能注册一个监听
|
|
125
|
-
* @supported weapp
|
|
127
|
+
* @supported weapp, alipay
|
|
126
128
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/ibeacon/wx.onBeaconUpdate.html
|
|
127
129
|
*/
|
|
128
130
|
onBeaconUpdate(
|
|
@@ -131,7 +133,7 @@ declare module '../../index' {
|
|
|
131
133
|
): void
|
|
132
134
|
|
|
133
135
|
/** 监听 iBeacon 服务状态变化事件,仅能注册一个监听
|
|
134
|
-
* @supported weapp
|
|
136
|
+
* @supported weapp, alipay
|
|
135
137
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/ibeacon/wx.onBeaconServiceChange.html
|
|
136
138
|
*/
|
|
137
139
|
onBeaconServiceChange(
|
|
@@ -140,7 +142,7 @@ declare module '../../index' {
|
|
|
140
142
|
): void
|
|
141
143
|
|
|
142
144
|
/** 取消监听 iBeacon 设备更新事件
|
|
143
|
-
* @supported weapp
|
|
145
|
+
* @supported weapp, alipay
|
|
144
146
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/ibeacon/wx.offBeaconUpdate.html
|
|
145
147
|
*/
|
|
146
148
|
offBeaconUpdate(
|
|
@@ -149,7 +151,7 @@ declare module '../../index' {
|
|
|
149
151
|
): void
|
|
150
152
|
|
|
151
153
|
/** 取消监听 iBeacon 服务状态变化事件
|
|
152
|
-
* @supported weapp
|
|
154
|
+
* @supported weapp, alipay
|
|
153
155
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/ibeacon/wx.offBeaconServiceChange.html
|
|
154
156
|
*/
|
|
155
157
|
offBeaconServiceChange(
|
|
@@ -158,7 +160,7 @@ declare module '../../index' {
|
|
|
158
160
|
): void
|
|
159
161
|
|
|
160
162
|
/** 获取所有已搜索到的 iBeacon 设备
|
|
161
|
-
* @supported weapp
|
|
163
|
+
* @supported weapp, alipay
|
|
162
164
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/ibeacon/wx.getBeacons.html
|
|
163
165
|
*/
|
|
164
166
|
getBeacons(option?: getBeacons.Option): Promise<getBeacons.CallbackResult>
|
|
@@ -43,7 +43,7 @@ declare module '../../index' {
|
|
|
43
43
|
|
|
44
44
|
interface TaroStatic {
|
|
45
45
|
/** 在input、textarea等focus拉起键盘之后,手动调用此接口收起键盘
|
|
46
|
-
* @supported weapp,
|
|
46
|
+
* @supported weapp, alipay, swan, jd, tt, rn
|
|
47
47
|
* @example
|
|
48
48
|
* ```tsx
|
|
49
49
|
* Taro.hideKeyboard({
|
|
@@ -71,7 +71,7 @@ declare module '../../index' {
|
|
|
71
71
|
getSelectedTextRange(option?: getSelectedTextRange.Option): Promise<getSelectedTextRange.SuccessCallbackResult>
|
|
72
72
|
|
|
73
73
|
/** 监听键盘高度变化
|
|
74
|
-
* @supported weapp, rn
|
|
74
|
+
* @supported weapp, swan, jd, qq, rn
|
|
75
75
|
* @example
|
|
76
76
|
* ```tsx
|
|
77
77
|
* Taro.onKeyboardHeightChange(res => {
|
|
@@ -80,16 +80,18 @@ declare module '../../index' {
|
|
|
80
80
|
* ```
|
|
81
81
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/keyboard/wx.onKeyboardHeightChange.html
|
|
82
82
|
*/
|
|
83
|
-
onKeyboardHeightChange(
|
|
83
|
+
onKeyboardHeightChange(
|
|
84
|
+
callback: onKeyboardHeightChange.Callback
|
|
85
|
+
): void
|
|
84
86
|
|
|
85
87
|
/**
|
|
86
88
|
* 取消监听键盘高度变化事件。
|
|
87
|
-
* @supported weapp, rn
|
|
89
|
+
* @supported weapp, swan, jd, rn
|
|
88
90
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/keyboard/wx.offKeyboardHeightChange.html
|
|
89
91
|
*/
|
|
90
92
|
offKeyboardHeightChange(
|
|
91
93
|
/** 键盘高度变化事件的回调函数 */
|
|
92
|
-
callback?:
|
|
94
|
+
callback?: onKeyboardHeightChange.Callback
|
|
93
95
|
): void
|
|
94
96
|
}
|
|
95
97
|
}
|
|
@@ -26,7 +26,7 @@ declare module '../../index' {
|
|
|
26
26
|
/** 监听内存不足告警事件。
|
|
27
27
|
*
|
|
28
28
|
* 当 iOS/Android 向小程序进程发出内存警告时,触发该事件。触发该事件不意味小程序被杀,大部分情况下仅仅是告警,开发者可在收到通知后回收一些不必要资源避免进一步加剧内存紧张。
|
|
29
|
-
* @supported weapp, tt
|
|
29
|
+
* @supported weapp, alipay, swan, jd, tt
|
|
30
30
|
* @example
|
|
31
31
|
* ```tsx
|
|
32
32
|
* Taro.onMemoryWarning(function () {
|
|
@@ -41,13 +41,12 @@ declare module '../../index' {
|
|
|
41
41
|
): void
|
|
42
42
|
|
|
43
43
|
/** 取消监听内存不足告警事件。
|
|
44
|
-
* @supported weapp
|
|
44
|
+
* @supported weapp, alipay, swan
|
|
45
45
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/memory/wx.offMemoryWarning.html
|
|
46
46
|
*/
|
|
47
47
|
offMemoryWarning(
|
|
48
48
|
/** 取消监听内存不足告警事件 */
|
|
49
|
-
callback
|
|
49
|
+
callback?: onMemoryWarning.Callback,
|
|
50
50
|
): void
|
|
51
|
-
|
|
52
51
|
}
|
|
53
52
|
}
|
|
@@ -51,7 +51,7 @@ declare module '../../index' {
|
|
|
51
51
|
|
|
52
52
|
interface TaroStatic {
|
|
53
53
|
/** 开始监听设备方向的变化。
|
|
54
|
-
* @supported weapp, h5, rn
|
|
54
|
+
* @supported weapp, swan, jd, h5, rn
|
|
55
55
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/motion/wx.startDeviceMotionListening.html
|
|
56
56
|
*/
|
|
57
57
|
startDeviceMotionListening(
|
|
@@ -60,7 +60,7 @@ declare module '../../index' {
|
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* 停止监听设备方向的变化。
|
|
63
|
-
* @supported weapp, h5, rn
|
|
63
|
+
* @supported weapp, swan, jd, h5, rn
|
|
64
64
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/motion/wx.stopDeviceMotionListening.html
|
|
65
65
|
*/
|
|
66
66
|
stopDeviceMotionListening(
|
|
@@ -69,18 +69,20 @@ declare module '../../index' {
|
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
71
|
* 监听设备方向变化事件。频率根据 Taro.startDeviceMotionListening() 的 interval 参数。可以使用 Taro.stopDeviceMotionListening() 停止监听。
|
|
72
|
-
* @supported weapp, h5, rn
|
|
72
|
+
* @supported weapp, alipay, swan, jd, h5, rn
|
|
73
73
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/motion/wx.onDeviceMotionChange.html
|
|
74
74
|
*/
|
|
75
|
-
onDeviceMotionChange
|
|
75
|
+
onDeviceMotionChange(
|
|
76
|
+
callback: onDeviceMotionChange.Callback
|
|
77
|
+
): void
|
|
76
78
|
|
|
77
79
|
/** 取消监听设备方向变化事件,参数为空,则取消所有的事件监听。
|
|
78
|
-
* @supported weapp, h5, rn
|
|
80
|
+
* @supported weapp, alipay, swan, jd, h5, rn
|
|
79
81
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/motion/wx.offDeviceMotionChange.html
|
|
80
82
|
*/
|
|
81
83
|
offDeviceMotionChange(
|
|
82
84
|
/** 设备方向变化事件的回调函数 */
|
|
83
|
-
callback?:
|
|
85
|
+
callback?: onDeviceMotionChange.Callback
|
|
84
86
|
): void
|
|
85
87
|
}
|
|
86
88
|
}
|
|
@@ -41,6 +41,10 @@ declare module '../../index' {
|
|
|
41
41
|
interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
|
|
42
42
|
/** 网络类型 */
|
|
43
43
|
networkType: keyof NetworkType
|
|
44
|
+
/** 信号强弱,单位 dbm */
|
|
45
|
+
signalStrength?: number
|
|
46
|
+
/** 设备是否使用了网络代理 */
|
|
47
|
+
hasSystemProxy?: boolean
|
|
44
48
|
/** 调用结果 */
|
|
45
49
|
errMsg: string
|
|
46
50
|
}
|
|
@@ -76,6 +80,8 @@ declare module '../../index' {
|
|
|
76
80
|
interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
|
|
77
81
|
/** 本机局域网IP地址 */
|
|
78
82
|
localip: string
|
|
83
|
+
/** ,基础库 2.24.0 开始支持 */
|
|
84
|
+
netmask?: string
|
|
79
85
|
/** 调用结果 */
|
|
80
86
|
errMsg: string
|
|
81
87
|
}
|
|
@@ -83,7 +89,7 @@ declare module '../../index' {
|
|
|
83
89
|
|
|
84
90
|
interface TaroStatic {
|
|
85
91
|
/** 监听弱网状态变化事件
|
|
86
|
-
* @supported weapp
|
|
92
|
+
* @supported weapp, swan, qq, tt
|
|
87
93
|
* @example
|
|
88
94
|
* ```tsx
|
|
89
95
|
* Taro.onNetworkWeakChange(function (res) {
|
|
@@ -101,7 +107,7 @@ declare module '../../index' {
|
|
|
101
107
|
): void
|
|
102
108
|
|
|
103
109
|
/** 监听网络状态变化。
|
|
104
|
-
* @supported weapp, h5, rn, tt
|
|
110
|
+
* @supported weapp, swan, h5, rn, tt
|
|
105
111
|
* @example
|
|
106
112
|
* ```tsx
|
|
107
113
|
* Taro.onNetworkStatusChange(function (res) {
|
|
@@ -117,16 +123,16 @@ declare module '../../index' {
|
|
|
117
123
|
): void
|
|
118
124
|
|
|
119
125
|
/** 取消监听弱网状态变化事件
|
|
120
|
-
* @supported weapp
|
|
126
|
+
* @supported weapp, swan
|
|
121
127
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.offNetworkWeakChange.html
|
|
122
128
|
*/
|
|
123
129
|
offNetworkWeakChange(
|
|
124
130
|
/** 弱网状态变化事件的回调函数 */
|
|
125
|
-
callback
|
|
131
|
+
callback?: onNetworkWeakChange.Callback,
|
|
126
132
|
): void
|
|
127
133
|
|
|
128
134
|
/** 取消监听网络状态变化事件,参数为空,则取消所有的事件监听。
|
|
129
|
-
* @supported weapp, h5, rn
|
|
135
|
+
* @supported weapp, swan, h5, rn
|
|
130
136
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.offNetworkStatusChange.html
|
|
131
137
|
*/
|
|
132
138
|
offNetworkStatusChange(
|
|
@@ -135,7 +141,7 @@ declare module '../../index' {
|
|
|
135
141
|
): void
|
|
136
142
|
|
|
137
143
|
/** 获取网络类型。
|
|
138
|
-
* @supported weapp, h5, rn, tt
|
|
144
|
+
* @supported weapp, swan, qq, h5, rn, tt
|
|
139
145
|
* @example
|
|
140
146
|
* ```tsx
|
|
141
147
|
* Taro.getNetworkType({
|
|
@@ -187,7 +187,7 @@ declare module '../../index' {
|
|
|
187
187
|
namespace transceive {
|
|
188
188
|
interface Option {
|
|
189
189
|
/** 需要传递的二进制数据 */
|
|
190
|
-
|
|
190
|
+
data: ArrayBuffer
|
|
191
191
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
192
192
|
complete?: (res: TaroGeneral.NFCError) => void
|
|
193
193
|
/** 接口调用失败的回调函数 */
|
|
@@ -298,7 +298,7 @@ declare module '../../index' {
|
|
|
298
298
|
namespace transceive {
|
|
299
299
|
interface Option {
|
|
300
300
|
/** 需要传递的二进制数据 */
|
|
301
|
-
|
|
301
|
+
data: ArrayBuffer
|
|
302
302
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
303
303
|
complete?: (res: TaroGeneral.NFCError) => void
|
|
304
304
|
/** 接口调用失败的回调函数 */
|
|
@@ -409,7 +409,7 @@ declare module '../../index' {
|
|
|
409
409
|
namespace transceive {
|
|
410
410
|
interface Option {
|
|
411
411
|
/** 需要传递的二进制数据 */
|
|
412
|
-
|
|
412
|
+
data: ArrayBuffer
|
|
413
413
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
414
414
|
complete?: (res: TaroGeneral.NFCError) => void
|
|
415
415
|
/** 接口调用失败的回调函数 */
|
|
@@ -521,11 +521,11 @@ declare module '../../index' {
|
|
|
521
521
|
namespace writeNdefMessage {
|
|
522
522
|
interface Option {
|
|
523
523
|
/** uri 数组 */
|
|
524
|
-
uris
|
|
524
|
+
uris?: string[]
|
|
525
525
|
/** text 数组 */
|
|
526
|
-
texts
|
|
526
|
+
texts?: string[]
|
|
527
527
|
/** 二进制对象数组, 需要指明 id, type 以及 payload (均为 ArrayBuffer 类型) */
|
|
528
|
-
records
|
|
528
|
+
records?: record[]
|
|
529
529
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
530
530
|
complete?: (res: TaroGeneral.NFCError) => void
|
|
531
531
|
/** 接口调用失败的回调函数 */
|
|
@@ -676,7 +676,7 @@ declare module '../../index' {
|
|
|
676
676
|
namespace transceive {
|
|
677
677
|
interface Option {
|
|
678
678
|
/** 需要传递的二进制数据 */
|
|
679
|
-
|
|
679
|
+
data: ArrayBuffer
|
|
680
680
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
681
681
|
complete?: (res: TaroGeneral.NFCError) => void
|
|
682
682
|
/** 接口调用失败的回调函数 */
|
|
@@ -741,7 +741,7 @@ declare module '../../index' {
|
|
|
741
741
|
*/
|
|
742
742
|
offDiscovered(
|
|
743
743
|
/** 监听 NFC Tag的回调函数 */
|
|
744
|
-
callback
|
|
744
|
+
callback?: NFCAdapter.onDiscovered.Callback,
|
|
745
745
|
): void
|
|
746
746
|
/** 监听 NFC Tag
|
|
747
747
|
* @supported weapp, tt
|
|
@@ -778,7 +778,7 @@ declare module '../../index' {
|
|
|
778
778
|
/** NFC标签的UID
|
|
779
779
|
* @supported tt
|
|
780
780
|
*/
|
|
781
|
-
|
|
781
|
+
id?: ArrayBuffer
|
|
782
782
|
}
|
|
783
783
|
|
|
784
784
|
interface NdefMessage {
|
|
@@ -906,7 +906,7 @@ declare module '../../index' {
|
|
|
906
906
|
namespace transceive {
|
|
907
907
|
interface Option {
|
|
908
908
|
/** 需要传递的二进制数据 */
|
|
909
|
-
|
|
909
|
+
data: ArrayBuffer
|
|
910
910
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
911
911
|
complete?: (res: TaroGeneral.NFCError) => void
|
|
912
912
|
/** 接口调用失败的回调函数 */
|
|
@@ -1017,7 +1017,7 @@ declare module '../../index' {
|
|
|
1017
1017
|
namespace transceive {
|
|
1018
1018
|
interface Option {
|
|
1019
1019
|
/** 需要传递的二进制数据 */
|
|
1020
|
-
|
|
1020
|
+
data: ArrayBuffer
|
|
1021
1021
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
1022
1022
|
complete?: (res: TaroGeneral.NFCError) => void
|
|
1023
1023
|
/** 接口调用失败的回调函数 */
|
|
@@ -1128,7 +1128,7 @@ declare module '../../index' {
|
|
|
1128
1128
|
namespace transceive {
|
|
1129
1129
|
interface Option {
|
|
1130
1130
|
/** 需要传递的二进制数据 */
|
|
1131
|
-
|
|
1131
|
+
data: ArrayBuffer
|
|
1132
1132
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
1133
1133
|
complete?: (res: TaroGeneral.NFCError) => void
|
|
1134
1134
|
/** 接口调用失败的回调函数 */
|
|
@@ -1212,7 +1212,7 @@ declare module '../../index' {
|
|
|
1212
1212
|
*/
|
|
1213
1213
|
offHCEMessage(
|
|
1214
1214
|
/** 接收 NFC 设备消息事件的回调函数 */
|
|
1215
|
-
callback:
|
|
1215
|
+
callback: onHCEMessage.Callback,
|
|
1216
1216
|
): void
|
|
1217
1217
|
|
|
1218
1218
|
/** 获取 NFC 实例
|
|
@@ -7,7 +7,9 @@ declare module '../../index' {
|
|
|
7
7
|
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
8
8
|
/** 接口调用失败的回调函数 */
|
|
9
9
|
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
10
|
-
/** 是否只能从相机扫码,不允许从相册选择图片
|
|
10
|
+
/** 是否只能从相机扫码,不允许从相册选择图片
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
11
13
|
onlyFromCamera?: boolean
|
|
12
14
|
/** 扫码类型 */
|
|
13
15
|
scanType?: (keyof ScanType)[]
|
|
@@ -85,7 +87,7 @@ declare module '../../index' {
|
|
|
85
87
|
interface TaroStatic {
|
|
86
88
|
/**
|
|
87
89
|
* 调起客户端扫码界面,扫码成功后返回对应的结果
|
|
88
|
-
* @supported weapp,
|
|
90
|
+
* @supported weapp, swan, jd, qq, tt, h5, rn
|
|
89
91
|
* @example
|
|
90
92
|
* ```tsx
|
|
91
93
|
* // 允许从相机和相册扫码
|
|
@@ -94,7 +96,7 @@ declare module '../../index' {
|
|
|
94
96
|
* console.log(res)
|
|
95
97
|
* }
|
|
96
98
|
* })
|
|
97
|
-
*
|
|
99
|
+
* // 只允许从相机扫码
|
|
98
100
|
* Taro.scanCode({
|
|
99
101
|
* onlyFromCamera: true,
|
|
100
102
|
* success: (res) => {
|
|
@@ -77,10 +77,10 @@ declare module '../../index' {
|
|
|
77
77
|
success?: (option: SuccessCallbackResult) => void
|
|
78
78
|
}
|
|
79
79
|
interface ScreenRecordingState {
|
|
80
|
-
/**
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
|
|
80
|
+
/** 开启 */
|
|
81
|
+
on
|
|
82
|
+
/** 关闭 */
|
|
83
|
+
off
|
|
84
84
|
}
|
|
85
85
|
interface SuccessCallbackResult {
|
|
86
86
|
/** 录屏状态 */
|
|
@@ -106,13 +106,13 @@ declare module '../../index' {
|
|
|
106
106
|
|
|
107
107
|
interface TaroStatic {
|
|
108
108
|
/** 设置截屏/录屏时屏幕表现,仅支持在 Android 端调用
|
|
109
|
-
* @supported weapp
|
|
109
|
+
* @supported weapp, alipay
|
|
110
110
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.setVisualEffectOnCapture.html
|
|
111
111
|
*/
|
|
112
112
|
setVisualEffectOnCapture(option: setVisualEffectOnCapture.Option): Promise<TaroGeneral.CallbackResult>
|
|
113
113
|
|
|
114
114
|
/** 设置屏幕亮度。
|
|
115
|
-
* @supported weapp,
|
|
115
|
+
* @supported weapp, swan, jd, qq, tt, rn
|
|
116
116
|
* @example
|
|
117
117
|
* ```tsx
|
|
118
118
|
* Taro.setScreenBrightness(params).then(...)
|
|
@@ -123,7 +123,7 @@ declare module '../../index' {
|
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* 设置是否保持常亮状态。仅在当前小程序生效,离开小程序后设置失效。
|
|
126
|
-
* @supported weapp,
|
|
126
|
+
* @supported weapp, alipay, swan, jd, qq, tt, rn
|
|
127
127
|
* @example
|
|
128
128
|
* ```tsx
|
|
129
129
|
* // 保持屏幕常亮
|
|
@@ -137,7 +137,7 @@ declare module '../../index' {
|
|
|
137
137
|
|
|
138
138
|
/**
|
|
139
139
|
* 监听用户主动截屏事件,用户使用系统截屏按键截屏时触发此事件
|
|
140
|
-
* @supported weapp, tt
|
|
140
|
+
* @supported weapp, alipay, swan, jd, tt
|
|
141
141
|
* @example
|
|
142
142
|
* ```tsx
|
|
143
143
|
* Taro.onUserCaptureScreen(function (res) {
|
|
@@ -154,6 +154,14 @@ declare module '../../index' {
|
|
|
154
154
|
/** 监听用户录屏事件
|
|
155
155
|
* @supported weapp
|
|
156
156
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.onScreenRecordingStateChanged.html
|
|
157
|
+
* @example
|
|
158
|
+
* ```tsx
|
|
159
|
+
* // 监听用户录屏事件
|
|
160
|
+
* const handler = function (res) {
|
|
161
|
+
* console.log(res.state)
|
|
162
|
+
* }
|
|
163
|
+
* Taro.onScreenRecordingStateChanged(handler)
|
|
164
|
+
* ```
|
|
157
165
|
*/
|
|
158
166
|
onScreenRecordingStateChanged(
|
|
159
167
|
/** 用户录屏事件的监听函数 */
|
|
@@ -161,7 +169,7 @@ declare module '../../index' {
|
|
|
161
169
|
): void
|
|
162
170
|
|
|
163
171
|
/** 用户主动截屏事件。取消事件监听。
|
|
164
|
-
* @supported weapp, tt
|
|
172
|
+
* @supported weapp, alipay, swan, jd, tt
|
|
165
173
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.offUserCaptureScreen.html
|
|
166
174
|
*/
|
|
167
175
|
offUserCaptureScreen(
|
|
@@ -175,12 +183,20 @@ declare module '../../index' {
|
|
|
175
183
|
*/
|
|
176
184
|
offScreenRecordingStateChanged(
|
|
177
185
|
/** 用户录屏事件的监听函数 */
|
|
178
|
-
callback
|
|
186
|
+
callback?: onScreenRecordingStateChanged.Callback
|
|
179
187
|
): void
|
|
180
188
|
|
|
181
189
|
/** 查询用户是否在录屏
|
|
182
190
|
* @supported weapp
|
|
183
191
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.getScreenRecordingState.html
|
|
192
|
+
* @example
|
|
193
|
+
* ```tsx
|
|
194
|
+
* Taro.getScreenRecordingState({
|
|
195
|
+
* success: function (res) {
|
|
196
|
+
* console.log(res.state)
|
|
197
|
+
* },
|
|
198
|
+
* })
|
|
199
|
+
* ```
|
|
184
200
|
*/
|
|
185
201
|
getScreenRecordingState(
|
|
186
202
|
option?: getScreenRecordingState.Option
|
|
@@ -191,7 +207,7 @@ declare module '../../index' {
|
|
|
191
207
|
*
|
|
192
208
|
* **说明**
|
|
193
209
|
* - 若安卓系统设置中开启了自动调节亮度功能,则屏幕亮度会根据光线自动调整,该接口仅能获取自动调节亮度之前的值,而非实时的亮度值。
|
|
194
|
-
* @supported weapp,
|
|
210
|
+
* @supported weapp, alipay, swan, jd, qq, rn
|
|
195
211
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.getScreenBrightness.html
|
|
196
212
|
*/
|
|
197
213
|
getScreenBrightness(
|
|
@@ -4,7 +4,7 @@ declare module '../../index' {
|
|
|
4
4
|
namespace vibrateShort {
|
|
5
5
|
interface Option {
|
|
6
6
|
/** 震动强度类型,有效值为:heavy、medium、light */
|
|
7
|
-
type
|
|
7
|
+
type?: 'heavy' | 'medium' | 'light'
|
|
8
8
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
9
9
|
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
10
10
|
/** 接口调用失败的回调函数 */
|
|
@@ -27,9 +27,9 @@ declare module '../../index' {
|
|
|
27
27
|
|
|
28
28
|
interface TaroStatic {
|
|
29
29
|
/** 使手机发生较短时间的振动(15 ms)。仅在 iPhone `7 / 7 Plus` 以上及 Android 机型生效
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @supported weapp,
|
|
30
|
+
*
|
|
31
|
+
* 仅微信小程序平台支持 type 参数
|
|
32
|
+
* @supported weapp, alipay, swan, jd, qq, tt, h5, rn
|
|
33
33
|
* @example
|
|
34
34
|
* ```tsx
|
|
35
35
|
* Taro.vibrateShort(params).then(...)
|
|
@@ -39,7 +39,7 @@ declare module '../../index' {
|
|
|
39
39
|
vibrateShort(option?: vibrateShort.Option): Promise<TaroGeneral.CallbackResult>
|
|
40
40
|
|
|
41
41
|
/** 使手机发生较长时间的振动(400ms)
|
|
42
|
-
* @supported weapp,
|
|
42
|
+
* @supported weapp, alipay, swan, jd, qq, tt, h5, rn
|
|
43
43
|
* @example
|
|
44
44
|
* ```tsx
|
|
45
45
|
* Taro.vibrateLong(params).then(...)
|
|
@@ -90,6 +90,10 @@ declare module '../../index' {
|
|
|
90
90
|
|
|
91
91
|
namespace getConnectedWifi {
|
|
92
92
|
interface Option {
|
|
93
|
+
/** 是否需要返回部分 Wi-Fi 信息
|
|
94
|
+
* @default false
|
|
95
|
+
*/
|
|
96
|
+
partialInfo?: boolean
|
|
93
97
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
94
98
|
complete?: (res: TaroGeneral.WifiError) => void
|
|
95
99
|
/** 接口调用失败的回调函数 */
|
|
@@ -113,6 +117,14 @@ declare module '../../index' {
|
|
|
113
117
|
password: string
|
|
114
118
|
/** Wi-Fi 设备 BSSID */
|
|
115
119
|
BSSID?: string
|
|
120
|
+
/** 跳转到系统设置页进行连接
|
|
121
|
+
* @default false
|
|
122
|
+
*/
|
|
123
|
+
maunal?: boolean
|
|
124
|
+
/** 是否需要返回部分 Wi-Fi 信息,仅安卓生效
|
|
125
|
+
* @default false
|
|
126
|
+
*/
|
|
127
|
+
partialInfo?: boolean
|
|
116
128
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
117
129
|
complete?: (res: TaroGeneral.WifiError) => void
|
|
118
130
|
/** 接口调用失败的回调函数 */
|
|
@@ -142,7 +154,7 @@ declare module '../../index' {
|
|
|
142
154
|
|
|
143
155
|
interface TaroStatic {
|
|
144
156
|
/** 关闭 Wi-Fi 模块。
|
|
145
|
-
* @supported weapp
|
|
157
|
+
* @supported weapp, alipay, swan, jd
|
|
146
158
|
* @example
|
|
147
159
|
* ```tsx
|
|
148
160
|
* Taro.stopWifi({
|
|
@@ -156,7 +168,7 @@ declare module '../../index' {
|
|
|
156
168
|
stopWifi(option?: stopWifi.Option): Promise<TaroGeneral.WifiError>
|
|
157
169
|
|
|
158
170
|
/** 初始化 Wi-Fi 模块。
|
|
159
|
-
* @supported weapp
|
|
171
|
+
* @supported weapp, alipay, swan, jd
|
|
160
172
|
* @example
|
|
161
173
|
* ```tsx
|
|
162
174
|
* Taro.startWifi({
|
|
@@ -175,7 +187,7 @@ declare module '../../index' {
|
|
|
175
187
|
* - 该接口只能在 `onGetWifiList` 回调之后才能调用。
|
|
176
188
|
* - 此时客户端会挂起,等待小程序设置 Wi-Fi 信息,请务必尽快调用该接口,若无数据请传入一个空数组。
|
|
177
189
|
* - 有可能随着周边 Wi-Fi 列表的刷新,单个流程内收到多次带有存在重复的 Wi-Fi 列表的回调。
|
|
178
|
-
* @supported weapp
|
|
190
|
+
* @supported weapp, swan, jd
|
|
179
191
|
* @example
|
|
180
192
|
* ```tsx
|
|
181
193
|
* Taro.onGetWifiList(function (res) {
|
|
@@ -209,7 +221,7 @@ declare module '../../index' {
|
|
|
209
221
|
): void
|
|
210
222
|
|
|
211
223
|
/** 监听连接上 Wi-Fi 的事件。
|
|
212
|
-
* @supported weapp
|
|
224
|
+
* @supported weapp, alipay, swan, jd
|
|
213
225
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.onWifiConnected.html
|
|
214
226
|
*/
|
|
215
227
|
onWifiConnected(
|
|
@@ -218,7 +230,7 @@ declare module '../../index' {
|
|
|
218
230
|
): void
|
|
219
231
|
|
|
220
232
|
/** 监听获取到 Wi-Fi 列表数据事件
|
|
221
|
-
* @supported weapp, tt
|
|
233
|
+
* @supported weapp, alipay, swan, jd, tt
|
|
222
234
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.onGetWifiList.html
|
|
223
235
|
*/
|
|
224
236
|
onGetWifiList(
|
|
@@ -232,39 +244,39 @@ declare module '../../index' {
|
|
|
232
244
|
*/
|
|
233
245
|
offWifiConnectedWithPartialInfo(
|
|
234
246
|
/** 连接上 Wi-Fi 的事件的回调函数 */
|
|
235
|
-
callback
|
|
247
|
+
callback?: onWifiConnectedWithPartialInfo.Callback,
|
|
236
248
|
): void
|
|
237
249
|
|
|
238
250
|
/**
|
|
239
251
|
* 取消监听连接上 Wi-Fi 的事件。
|
|
240
|
-
* @supported weapp
|
|
252
|
+
* @supported weapp, alipay, swan, jd
|
|
241
253
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.offWifiConnected.html
|
|
242
254
|
*/
|
|
243
255
|
offWifiConnected(
|
|
244
256
|
/** 连接上 Wi-Fi 的事件的回调函数 */
|
|
245
|
-
callback
|
|
257
|
+
callback?: onWifiConnected.Callback,
|
|
246
258
|
): void
|
|
247
259
|
|
|
248
260
|
/**
|
|
249
261
|
* 取消监听获取到 Wi-Fi 列表数据事件。
|
|
250
|
-
* @supported weapp, tt
|
|
262
|
+
* @supported weapp, alipay, swan, jd, tt
|
|
251
263
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.offGetWifiList.html
|
|
252
264
|
*/
|
|
253
265
|
offGetWifiList(
|
|
254
266
|
/** 获取到 Wi-Fi 列表数据事件的回调函数 */
|
|
255
|
-
callback
|
|
267
|
+
callback?: onGetWifiList.Callback,
|
|
256
268
|
): void
|
|
257
269
|
|
|
258
270
|
/** 请求获取 Wi-Fi 列表。在 `onGetWifiList` 注册的回调中返回 `wifiList` 数据。 **Android 调用前需要 [用户授权](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html) scope.userLocation。**
|
|
259
271
|
*
|
|
260
272
|
* iOS 将跳转到系统的 Wi-Fi 界面,Android 不会跳转。 iOS 11.0 及 iOS 11.1 两个版本因系统问题,该方法失效。但在 iOS 11.2 中已修复。
|
|
261
|
-
* @supported weapp, tt
|
|
273
|
+
* @supported weapp, alipay, swan, jd, tt
|
|
262
274
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.getWifiList.html
|
|
263
275
|
*/
|
|
264
276
|
getWifiList(option?: getWifiList.Option): Promise<TaroGeneral.WifiError>
|
|
265
277
|
|
|
266
278
|
/** 获取已连接中的 Wi-Fi 信息。
|
|
267
|
-
* @supported weapp
|
|
279
|
+
* @supported weapp, alipay, swan, tt
|
|
268
280
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.getConnectedWifi.html
|
|
269
281
|
*/
|
|
270
282
|
getConnectedWifi(option?: getConnectedWifi.Option): Promise<TaroGeneral.WifiError>
|
|
@@ -281,7 +293,7 @@ declare module '../../index' {
|
|
|
281
293
|
* }
|
|
282
294
|
* })
|
|
283
295
|
* ```
|
|
284
|
-
* @supported weapp
|
|
296
|
+
* @supported weapp, alipay, swan, jd
|
|
285
297
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.connectWifi.html
|
|
286
298
|
*/
|
|
287
299
|
connectWifi(option: connectWifi.Option): Promise<TaroGeneral.WifiError>
|