@tarojs/taro 3.8.0-canary.0 → 4.0.0-beta.0
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/html.css +9 -0
- 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/base/system.d.ts +2 -2
- package/types/api/base/weapp/app-event.d.ts +4 -4
- package/types/api/canvas/index.d.ts +67 -54
- package/types/api/data-analysis/index.d.ts +51 -1
- 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 +3 -3
- 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 +17 -17
- 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 +28 -12
- 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/files/index.d.ts +71 -41
- package/types/api/location/index.d.ts +166 -18
- package/types/api/media/audio.d.ts +50 -30
- package/types/api/media/camera.d.ts +6 -3
- package/types/api/media/image.d.ts +1 -1
- package/types/api/navigate/index.d.ts +2 -0
- package/types/api/network/download.d.ts +2 -10
- package/types/api/network/request.d.ts +1 -1
- 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 +8 -5
- package/types/api/skyline/index.d.ts +59 -0
- package/types/api/storage/background-fetch.d.ts +63 -11
- package/types/api/storage/cache-manager.d.ts +61 -10
- package/types/api/storage/index.d.ts +125 -10
- package/types/api/taro.extend.d.ts +9 -3
- package/types/api/ui/animation.d.ts +1 -1
- package/types/api/ui/fonts.d.ts +4 -3
- package/types/api/ui/interaction.d.ts +4 -4
- package/types/api/ui/navigation-bar.d.ts +5 -5
- package/types/api/ui/pull-down-refresh.d.ts +2 -2
- package/types/api/ui/scroll.d.ts +1 -1
- package/types/api/ui/tab-bar.d.ts +7 -7
- package/types/api/wxml/index.d.ts +4 -4
- package/types/compile/compiler.d.ts +7 -4
- package/types/compile/config/h5.d.ts +23 -10
- package/types/compile/config/harmony.d.ts +77 -0
- package/types/compile/config/index.d.ts +1 -0
- package/types/compile/config/mini.d.ts +58 -30
- package/types/compile/config/plugin.d.ts +34 -0
- package/types/compile/config/project.d.ts +26 -13
- package/types/compile/config/util.d.ts +22 -8
- package/types/compile/viteCompilerContext.d.ts +149 -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 +2 -1
- package/types/taro.config.d.ts +41 -4
|
@@ -59,7 +59,7 @@ declare module '../../index' {
|
|
|
59
59
|
|
|
60
60
|
interface TaroStatic {
|
|
61
61
|
/** 停止监听罗盘数据
|
|
62
|
-
* @supported weapp, h5, tt
|
|
62
|
+
* @supported weapp, swan, qq, h5, tt
|
|
63
63
|
* @example
|
|
64
64
|
* ```tsx
|
|
65
65
|
* Taro.stopCompass()
|
|
@@ -69,7 +69,7 @@ declare module '../../index' {
|
|
|
69
69
|
stopCompass(option?: stopCompass.Option): Promise<TaroGeneral.CallbackResult>
|
|
70
70
|
|
|
71
71
|
/** 开始监听罗盘数据
|
|
72
|
-
* @supported weapp, h5, tt
|
|
72
|
+
* @supported weapp, swan, qq, h5, tt
|
|
73
73
|
* @example
|
|
74
74
|
* ```js
|
|
75
75
|
* Taro.startCompass()
|
|
@@ -79,7 +79,7 @@ declare module '../../index' {
|
|
|
79
79
|
startCompass(option?: startCompass.Option): Promise<TaroGeneral.CallbackResult>
|
|
80
80
|
|
|
81
81
|
/** 监听罗盘数据变化事件。频率:5 次/秒,接口调用后会自动开始监听,可使用 Taro.stopCompass 停止监听。
|
|
82
|
-
* @supported weapp, h5, tt
|
|
82
|
+
* @supported weapp, swan, qq, h5, tt
|
|
83
83
|
* @example
|
|
84
84
|
* ```tsx
|
|
85
85
|
* Taro.onCompassChange(function (res) {
|
|
@@ -94,12 +94,12 @@ declare module '../../index' {
|
|
|
94
94
|
): void
|
|
95
95
|
|
|
96
96
|
/** 取消监听罗盘数据变化事件,参数为空,则取消所有的事件监听。
|
|
97
|
-
* @supported weapp, h5
|
|
97
|
+
* @supported weapp, swan, qq, h5
|
|
98
98
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/compass/wx.offCompassChange.html
|
|
99
99
|
*/
|
|
100
100
|
offCompassChange(
|
|
101
101
|
/** 罗盘数据变化事件的回调函数 */
|
|
102
|
-
callback
|
|
102
|
+
callback?: onCompassChange.Callback,
|
|
103
103
|
): void
|
|
104
104
|
}
|
|
105
105
|
}
|
|
@@ -53,7 +53,7 @@ declare module '../../index' {
|
|
|
53
53
|
|
|
54
54
|
interface TaroStatic {
|
|
55
55
|
/** 停止监听陀螺仪数据。
|
|
56
|
-
* @supported weapp,
|
|
56
|
+
* @supported weapp, alipay, swan, jd, qq, tt, rn
|
|
57
57
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/gyroscope/wx.stopGyroscope.html
|
|
58
58
|
*/
|
|
59
59
|
stopGyroscope(option?: stopGyroscope.Option): Promise<TaroGeneral.CallbackResult>
|
|
@@ -65,7 +65,7 @@ declare module '../../index' {
|
|
|
65
65
|
startGyroscope(option: startGyroscope.Option): Promise<TaroGeneral.CallbackResult>
|
|
66
66
|
|
|
67
67
|
/** 监听陀螺仪数据变化事件。频率根据 Taro.startGyroscope() 的 interval 参数。可以使用 Taro.stopGyroscope() 停止监听。
|
|
68
|
-
* @supported weapp,
|
|
68
|
+
* @supported weapp, alipay, swan, jd, qq, tt, rn
|
|
69
69
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/gyroscope/wx.onGyroscopeChange.html
|
|
70
70
|
*/
|
|
71
71
|
onGyroscopeChange(
|
|
@@ -74,12 +74,12 @@ declare module '../../index' {
|
|
|
74
74
|
): void
|
|
75
75
|
|
|
76
76
|
/** 取消监听陀螺仪数据变化事件。
|
|
77
|
-
* @supported weapp,
|
|
77
|
+
* @supported weapp, alipay, swan, jd, tt, rn
|
|
78
78
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/gyroscope/wx.offGyroscopeChange.html
|
|
79
79
|
*/
|
|
80
80
|
offGyroscopeChange(
|
|
81
81
|
/** 陀螺仪数据变化事件的回调函数 */
|
|
82
|
-
callback?:
|
|
82
|
+
callback?: onGyroscopeChange.Callback,
|
|
83
83
|
): void
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -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, harmony
|
|
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, harmony
|
|
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, harmony
|
|
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, harmony
|
|
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, harmony
|
|
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(
|
|
@@ -171,16 +179,24 @@ declare module '../../index' {
|
|
|
171
179
|
|
|
172
180
|
/** 取消用户录屏事件的监听函数
|
|
173
181
|
* @supported weapp
|
|
174
|
-
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.offScreenRecordingStateChanged.html
|
|
182
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.offScreenRecordingStateChanged.html
|
|
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, rn,
|
|
210
|
+
* @supported weapp, alipay, swan, jd, qq, rn, harmony
|
|
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, h5, rn,
|
|
30
|
+
*
|
|
31
|
+
* 仅微信小程序平台支持 type 参数
|
|
32
|
+
* @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony
|
|
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, h5, rn,
|
|
42
|
+
* @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony
|
|
43
43
|
* @example
|
|
44
44
|
* ```tsx
|
|
45
45
|
* Taro.vibrateLong(params).then(...)
|