@tarojs/taro 3.4.1 → 3.4.2

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 (88) hide show
  1. package/package.json +5 -5
  2. package/types/api/ai/face.d.ts +133 -0
  3. package/types/api/ai/visionkit.d.ts +303 -0
  4. package/types/api/base/crypto.d.ts +90 -0
  5. package/types/api/base/debug.d.ts +152 -13
  6. package/types/api/base/env.d.ts +2 -1
  7. package/types/api/base/index.d.ts +10 -2
  8. package/types/api/base/performance.d.ts +195 -0
  9. package/types/api/base/system.d.ts +539 -101
  10. package/types/api/base/update.d.ts +59 -7
  11. package/types/api/base/weapp/app-event.d.ts +46 -23
  12. package/types/api/base/weapp/life-cycle.d.ts +141 -1
  13. package/types/api/canvas/index.d.ts +150 -136
  14. package/types/api/cloud/index.d.ts +2 -2
  15. package/types/api/device/accelerometer.d.ts +3 -3
  16. package/types/api/device/accessibility.d.ts +26 -0
  17. package/types/api/device/battery.d.ts +2 -2
  18. package/types/api/device/{ble.d.ts → bluetooth-ble.d.ts} +228 -62
  19. package/types/api/device/bluetooth-peripheral.d.ts +430 -0
  20. package/types/api/device/bluetooth.d.ts +67 -2
  21. package/types/api/device/calendar.d.ts +88 -0
  22. package/types/api/device/contact.d.ts +74 -50
  23. package/types/api/device/gyroscope.d.ts +5 -5
  24. package/types/api/device/iBeacon.d.ts +33 -19
  25. package/types/api/{ui → device}/keyboard.d.ts +0 -0
  26. package/types/api/device/{performance.d.ts → memory.d.ts} +4 -4
  27. package/types/api/device/motion.d.ts +3 -3
  28. package/types/api/device/network.d.ts +53 -12
  29. package/types/api/device/nfc.d.ts +1089 -13
  30. package/types/api/device/scan.d.ts +1 -1
  31. package/types/api/device/screen.d.ts +40 -12
  32. package/types/api/device/wifi.d.ts +41 -6
  33. package/types/api/files/index.d.ts +371 -184
  34. package/types/api/location/index.d.ts +116 -55
  35. package/types/api/media/audio.d.ts +629 -38
  36. package/types/api/media/background-audio.d.ts +8 -8
  37. package/types/api/media/camera.d.ts +38 -19
  38. package/types/api/media/editor.d.ts +22 -2
  39. package/types/api/media/image.d.ts +61 -32
  40. package/types/api/media/live.d.ts +66 -6
  41. package/types/api/media/map.d.ts +469 -49
  42. package/types/api/media/media-recorder.d.ts +92 -0
  43. package/types/api/media/recorder.d.ts +20 -20
  44. package/types/api/media/video-decoder.d.ts +117 -0
  45. package/types/api/media/video-processing.d.ts +11 -7
  46. package/types/api/media/video.d.ts +45 -16
  47. package/types/api/media/voip.d.ts +290 -0
  48. package/types/api/{open-api/navigate.d.ts → navigate/index.d.ts} +63 -25
  49. package/types/api/network/download.d.ts +39 -16
  50. package/types/api/network/request.d.ts +125 -37
  51. package/types/api/network/tcp.d.ts +181 -0
  52. package/types/api/network/udp.d.ts +154 -83
  53. package/types/api/network/upload.d.ts +41 -25
  54. package/types/api/network/websocket.d.ts +16 -15
  55. package/types/api/open-api/authorize.d.ts +41 -2
  56. package/types/api/open-api/channels.d.ts +178 -0
  57. package/types/api/open-api/facial.d.ts +3 -0
  58. package/types/api/open-api/favorites.d.ts +100 -0
  59. package/types/api/open-api/group.d.ts +59 -0
  60. package/types/api/open-api/invoice.d.ts +2 -2
  61. package/types/api/open-api/license-plate.d.ts +27 -0
  62. package/types/api/open-api/login.d.ts +21 -0
  63. package/types/api/open-api/redpackage.d.ts +24 -0
  64. package/types/api/open-api/settings.d.ts +76 -14
  65. package/types/api/open-api/soter.d.ts +2 -2
  66. package/types/api/open-api/subscribe-message.d.ts +88 -3
  67. package/types/api/open-api/user-info.d.ts +55 -18
  68. package/types/api/open-api/werun.d.ts +33 -6
  69. package/types/api/payment/index.d.ts +119 -0
  70. package/types/api/route/index.d.ts +13 -9
  71. package/types/api/share/index.d.ts +192 -9
  72. package/types/api/storage/index.d.ts +29 -83
  73. package/types/api/swan/index.d.ts +1 -1
  74. package/types/api/ui/animation.d.ts +84 -70
  75. package/types/api/ui/background.d.ts +4 -2
  76. package/types/api/ui/custom-component.d.ts +1 -1
  77. package/types/api/ui/fonts.d.ts +27 -31
  78. package/types/api/ui/navigation-bar.d.ts +1 -0
  79. package/types/api/ui/scroll.d.ts +73 -7
  80. package/types/api/ui/sticky.d.ts +4 -4
  81. package/types/api/ui/tab-bar.d.ts +7 -7
  82. package/types/api/ui/window.d.ts +22 -2
  83. package/types/api/worker/index.d.ts +9 -1
  84. package/types/api/wxml/index.d.ts +111 -107
  85. package/types/compile.d.ts +5 -0
  86. package/types/global.d.ts +142 -111
  87. package/types/taro.api.d.ts +79 -62
  88. package/types/api/open-api/payment.d.ts +0 -61
@@ -85,7 +85,7 @@ declare module '../../index' {
85
85
  interface TaroStatic {
86
86
  /**
87
87
  * 调起客户端扫码界面,扫码成功后返回对应的结果
88
- * @supported weapp, h5
88
+ * @supported weapp, h5, rn
89
89
  * @example
90
90
  * ```tsx
91
91
  * // 允许从相机和相册扫码
@@ -1,6 +1,21 @@
1
1
  import Taro from '../../index'
2
2
 
3
3
  declare module '../../index' {
4
+ namespace setVisualEffectOnCapture {
5
+ interface Option {
6
+ /** 截屏/录屏时的表现,仅支持 none / hidden,传入 hidden 则表示在截屏/录屏时隐藏屏幕
7
+ * @default "none"
8
+ */
9
+ visualEffect?: 'none' | 'hidden'
10
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
11
+ complete?: (res: TaroGeneral.CallbackResult) => void
12
+ /** 接口调用失败的回调函数 */
13
+ fail?: (res: TaroGeneral.CallbackResult) => void
14
+ /** 接口调用成功的回调函数 */
15
+ success?: (res: TaroGeneral.CallbackResult) => void
16
+ }
17
+ }
18
+
4
19
  namespace setScreenBrightness {
5
20
  interface Option {
6
21
  /** 屏幕亮度值,范围 0 ~ 1。0 最暗,1 最亮 */
@@ -31,6 +46,13 @@ declare module '../../index' {
31
46
  }
32
47
  }
33
48
 
49
+ namespace onUserCaptureScreen {
50
+ /** 用户主动截屏事件的回调函数 */
51
+ type Callback = (
52
+ result: TaroGeneral.CallbackResult,
53
+ ) => void
54
+ }
55
+
34
56
  namespace getScreenBrightness {
35
57
  interface Option {
36
58
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
@@ -48,6 +70,12 @@ declare module '../../index' {
48
70
  }
49
71
 
50
72
  interface TaroStatic {
73
+ /** 设置截屏/录屏时屏幕表现,仅支持在 Android 端调用
74
+ * @supported weapp
75
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.setVisualEffectOnCapture.html
76
+ */
77
+ setVisualEffectOnCapture(option: setVisualEffectOnCapture.Option): Promise<TaroGeneral.CallbackResult>
78
+
51
79
  /** 设置屏幕亮度。
52
80
  * @supported weapp, rn
53
81
  * @example
@@ -60,7 +88,7 @@ declare module '../../index' {
60
88
 
61
89
  /**
62
90
  * 设置是否保持常亮状态。仅在当前小程序生效,离开小程序后设置失效。
63
- * @supported weapp
91
+ * @supported weapp, rn
64
92
  * @example
65
93
  * ```tsx
66
94
  * // 保持屏幕常亮
@@ -85,7 +113,16 @@ declare module '../../index' {
85
113
  */
86
114
  onUserCaptureScreen(
87
115
  /** 用户主动截屏事件的回调函数 */
88
- callback: (res: TaroGeneral.CallbackResult) => void,
116
+ callback: onUserCaptureScreen.Callback,
117
+ ): void
118
+
119
+ /** 用户主动截屏事件。取消事件监听。
120
+ * @supported weapp
121
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.offUserCaptureScreen.html
122
+ */
123
+ offUserCaptureScreen(
124
+ /** 用户主动截屏事件的回调函数 */
125
+ callback: onUserCaptureScreen.Callback,
89
126
  ): void
90
127
 
91
128
  /**
@@ -93,20 +130,11 @@ declare module '../../index' {
93
130
  *
94
131
  * **说明**
95
132
  * - 若安卓系统设置中开启了自动调节亮度功能,则屏幕亮度会根据光线自动调整,该接口仅能获取自动调节亮度之前的值,而非实时的亮度值。
96
- * @supported weapp
133
+ * @supported weapp, rn
97
134
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.getScreenBrightness.html
98
135
  */
99
136
  getScreenBrightness(
100
137
  option?: getScreenBrightness.Option
101
138
  ): Promise<getScreenBrightness.SuccessCallbackOption>
102
-
103
- /** 用户主动截屏事件。取消事件监听。
104
- * @supported weapp
105
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.offUserCaptureScreen.html
106
- */
107
- offUserCaptureScreen(
108
- /** 用户主动截屏事件的回调函数 */
109
- callback: (...args: any[]) => any,
110
- ): void
111
139
  }
112
140
  }
@@ -46,6 +46,17 @@ declare module '../../index' {
46
46
  }
47
47
  }
48
48
 
49
+ namespace onWifiConnectedWithPartialInfo {
50
+ /** 连接上 Wi-Fi 的事件的回调函数 */
51
+ type Callback = (
52
+ result: CallbackResult,
53
+ ) => void
54
+ interface CallbackResult {
55
+ /** 只包含 SSID 属性的 WifiInfo 对象 */
56
+ wifi: Pick<WifiInfo, 'SSID'>
57
+ }
58
+ }
59
+
49
60
  namespace onWifiConnected {
50
61
  /** 连接上 Wi-Fi 的事件的回调函数 */
51
62
  type Callback = (
@@ -111,16 +122,22 @@ declare module '../../index' {
111
122
  }
112
123
  }
113
124
 
114
- /** Wifi 信息 */
125
+ /** Wifi 信息
126
+ *
127
+ * 注意:
128
+ * 安卓 Taro.connectWifi / Taro.getConnectedWifi 若设置了 partialInfo:true ,或者调用了 Taro.onWifiConnectedWithPartialInfo 事件。将会返回只包含 SSID 属性的 WifiInfo 对象。 在某些情况下,可能 Wi-Fi 已经连接成功,但会因为获取不到完整的 WifiInfo 对象报错。具体错误信息为 errCode: 12010, errMsg: can't gain current wifi 。如果开发者不需要完整的 WifiInfo 对象,则可以通过采取上述策略解决报错问题。
129
+ */
115
130
  interface WifiInfo {
116
- /** Wi-Fi 的 BSSID */
117
- BSSID: string
118
131
  /** Wi-Fi 的 SSID */
119
132
  SSID: string
133
+ /** Wi-Fi 的 BSSID */
134
+ BSSID: string
120
135
  /** Wi-Fi 是否安全 */
121
136
  secure: boolean
122
- /** Wi-Fi 信号强度 */
137
+ /** Wi-Fi 信号强度, 安卓取值 0 ~ 100 ,iOS 取值 0 ~ 1 ,值越大强度越大 */
123
138
  signalStrength: number
139
+ /** Wi-Fi 频段单位 MHz */
140
+ frequency?: number
124
141
  }
125
142
 
126
143
  interface TaroStatic {
@@ -182,6 +199,15 @@ declare module '../../index' {
182
199
  */
183
200
  setWifiList(option: setWifiList.Option): Promise<TaroGeneral.WifiError>
184
201
 
202
+ /** 监听连接上 Wi-Fi 的事件
203
+ * @supported weapp
204
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.onWifiConnectedWithPartialInfo.html
205
+ */
206
+ onWifiConnectedWithPartialInfo(
207
+ /** 连接上 Wi-Fi 的事件的回调函数 */
208
+ callback: onWifiConnectedWithPartialInfo.Callback,
209
+ ): void
210
+
185
211
  /** 监听连接上 Wi-Fi 的事件。
186
212
  * @supported weapp
187
213
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.onWifiConnected.html
@@ -200,6 +226,15 @@ declare module '../../index' {
200
226
  callback: onGetWifiList.Callback,
201
227
  ): void
202
228
 
229
+ /** 取消监听连接上 Wi-Fi 的事件
230
+ * @supported weapp
231
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.offWifiConnectedWithPartialInfo.html
232
+ */
233
+ offWifiConnectedWithPartialInfo(
234
+ /** 连接上 Wi-Fi 的事件的回调函数 */
235
+ callback: onWifiConnectedWithPartialInfo.Callback,
236
+ ): void
237
+
203
238
  /**
204
239
  * 取消监听连接上 Wi-Fi 的事件。
205
240
  * @supported weapp
@@ -207,7 +242,7 @@ declare module '../../index' {
207
242
  */
208
243
  offWifiConnected(
209
244
  /** 连接上 Wi-Fi 的事件的回调函数 */
210
- callback: (...args: any[]) => any,
245
+ callback: onWifiConnected.Callback,
211
246
  ): void
212
247
 
213
248
  /**
@@ -217,7 +252,7 @@ declare module '../../index' {
217
252
  */
218
253
  offGetWifiList(
219
254
  /** 获取到 Wi-Fi 列表数据事件的回调函数 */
220
- callback: (...args: any[]) => any,
255
+ callback: onGetWifiList.Callback,
221
256
  ): void
222
257
 
223
258
  /** 请求获取 Wi-Fi 列表。在 `onGetWifiList` 注册的回调中返回 `wifiList` 数据。 **Android 调用前需要 [用户授权](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html) scope.userLocation。**