@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.
- package/package.json +5 -5
- package/types/api/ai/face.d.ts +133 -0
- package/types/api/ai/visionkit.d.ts +303 -0
- package/types/api/base/crypto.d.ts +90 -0
- package/types/api/base/debug.d.ts +152 -13
- package/types/api/base/env.d.ts +2 -1
- package/types/api/base/index.d.ts +10 -2
- package/types/api/base/performance.d.ts +195 -0
- package/types/api/base/system.d.ts +539 -101
- package/types/api/base/update.d.ts +59 -7
- package/types/api/base/weapp/app-event.d.ts +46 -23
- package/types/api/base/weapp/life-cycle.d.ts +141 -1
- package/types/api/canvas/index.d.ts +150 -136
- package/types/api/cloud/index.d.ts +2 -2
- package/types/api/device/accelerometer.d.ts +3 -3
- package/types/api/device/accessibility.d.ts +26 -0
- package/types/api/device/battery.d.ts +2 -2
- package/types/api/device/{ble.d.ts → bluetooth-ble.d.ts} +228 -62
- package/types/api/device/bluetooth-peripheral.d.ts +430 -0
- package/types/api/device/bluetooth.d.ts +67 -2
- package/types/api/device/calendar.d.ts +88 -0
- package/types/api/device/contact.d.ts +74 -50
- package/types/api/device/gyroscope.d.ts +5 -5
- package/types/api/device/iBeacon.d.ts +33 -19
- package/types/api/{ui → device}/keyboard.d.ts +0 -0
- package/types/api/device/{performance.d.ts → memory.d.ts} +4 -4
- package/types/api/device/motion.d.ts +3 -3
- package/types/api/device/network.d.ts +53 -12
- package/types/api/device/nfc.d.ts +1089 -13
- package/types/api/device/scan.d.ts +1 -1
- package/types/api/device/screen.d.ts +40 -12
- package/types/api/device/wifi.d.ts +41 -6
- package/types/api/files/index.d.ts +371 -184
- package/types/api/location/index.d.ts +116 -55
- package/types/api/media/audio.d.ts +629 -38
- package/types/api/media/background-audio.d.ts +8 -8
- package/types/api/media/camera.d.ts +38 -19
- package/types/api/media/editor.d.ts +22 -2
- package/types/api/media/image.d.ts +61 -32
- package/types/api/media/live.d.ts +66 -6
- package/types/api/media/map.d.ts +469 -49
- package/types/api/media/media-recorder.d.ts +92 -0
- package/types/api/media/recorder.d.ts +20 -20
- package/types/api/media/video-decoder.d.ts +117 -0
- package/types/api/media/video-processing.d.ts +11 -7
- package/types/api/media/video.d.ts +45 -16
- package/types/api/media/voip.d.ts +290 -0
- package/types/api/{open-api/navigate.d.ts → navigate/index.d.ts} +63 -25
- package/types/api/network/download.d.ts +39 -16
- package/types/api/network/request.d.ts +125 -37
- package/types/api/network/tcp.d.ts +181 -0
- package/types/api/network/udp.d.ts +154 -83
- package/types/api/network/upload.d.ts +41 -25
- package/types/api/network/websocket.d.ts +16 -15
- package/types/api/open-api/authorize.d.ts +41 -2
- package/types/api/open-api/channels.d.ts +178 -0
- package/types/api/open-api/facial.d.ts +3 -0
- package/types/api/open-api/favorites.d.ts +100 -0
- package/types/api/open-api/group.d.ts +59 -0
- package/types/api/open-api/invoice.d.ts +2 -2
- package/types/api/open-api/license-plate.d.ts +27 -0
- package/types/api/open-api/login.d.ts +21 -0
- package/types/api/open-api/redpackage.d.ts +24 -0
- package/types/api/open-api/settings.d.ts +76 -14
- package/types/api/open-api/soter.d.ts +2 -2
- package/types/api/open-api/subscribe-message.d.ts +88 -3
- package/types/api/open-api/user-info.d.ts +55 -18
- package/types/api/open-api/werun.d.ts +33 -6
- package/types/api/payment/index.d.ts +119 -0
- package/types/api/route/index.d.ts +13 -9
- package/types/api/share/index.d.ts +192 -9
- package/types/api/storage/index.d.ts +29 -83
- package/types/api/swan/index.d.ts +1 -1
- package/types/api/ui/animation.d.ts +84 -70
- package/types/api/ui/background.d.ts +4 -2
- package/types/api/ui/custom-component.d.ts +1 -1
- package/types/api/ui/fonts.d.ts +27 -31
- package/types/api/ui/navigation-bar.d.ts +1 -0
- package/types/api/ui/scroll.d.ts +73 -7
- package/types/api/ui/sticky.d.ts +4 -4
- package/types/api/ui/tab-bar.d.ts +7 -7
- package/types/api/ui/window.d.ts +22 -2
- package/types/api/worker/index.d.ts +9 -1
- package/types/api/wxml/index.d.ts +111 -107
- package/types/compile.d.ts +5 -0
- package/types/global.d.ts +142 -111
- package/types/taro.api.d.ts +79 -62
- package/types/api/open-api/payment.d.ts +0 -61
|
@@ -59,6 +59,32 @@ declare module '../../index' {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
namespace choosePoi {
|
|
63
|
+
interface Option {
|
|
64
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
65
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
66
|
+
/** 接口调用失败的回调函数 */
|
|
67
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
68
|
+
/** 接口调用成功的回调函数 */
|
|
69
|
+
success?: (result: SuccessCallbackResult) => void
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
|
|
73
|
+
/** 选择城市时,值为 1,选择精确位置时,值为 2 */
|
|
74
|
+
type: number
|
|
75
|
+
/** 城市名称 */
|
|
76
|
+
city: number
|
|
77
|
+
/** 位置名称 */
|
|
78
|
+
name: string
|
|
79
|
+
/** 详细地址 */
|
|
80
|
+
address: string
|
|
81
|
+
/** 纬度,浮点数,范围为-90~90,负数表示南纬。使用 gcj02 国测局坐标系 */
|
|
82
|
+
latitude: string
|
|
83
|
+
/** 经度,浮点数,范围为-180~180,负数表示西经。使用 gcj02 国测局坐标系 */
|
|
84
|
+
longitude: string
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
62
88
|
namespace chooseLocation {
|
|
63
89
|
interface Option {
|
|
64
90
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
@@ -120,6 +146,18 @@ declare module '../../index' {
|
|
|
120
146
|
}
|
|
121
147
|
}
|
|
122
148
|
|
|
149
|
+
namespace onLocationChangeError {
|
|
150
|
+
/** 监听持续定位接口返回失败时触发的回调函数 */
|
|
151
|
+
type Callback = (
|
|
152
|
+
result: CallbackResult,
|
|
153
|
+
) => void
|
|
154
|
+
|
|
155
|
+
interface CallbackResult {
|
|
156
|
+
/** 错误码 */
|
|
157
|
+
errCode: number
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
123
161
|
namespace onLocationChange {
|
|
124
162
|
/** 实时地理位置变化事件的回调函数 */
|
|
125
163
|
type Callback = (
|
|
@@ -145,6 +183,34 @@ declare module '../../index' {
|
|
|
145
183
|
}
|
|
146
184
|
|
|
147
185
|
interface TaroStatic {
|
|
186
|
+
/** 关闭监听实时位置变化,前后台都停止消息接收
|
|
187
|
+
* @supported weapp
|
|
188
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.stopLocationUpdate.html
|
|
189
|
+
*/
|
|
190
|
+
stopLocationUpdate(option?: stopLocationUpdate.Option): void
|
|
191
|
+
|
|
192
|
+
/** 开启小程序进入前后台时均接收位置消息,需引导用户开启[授权](./apis/open-api/authorize/authorize.md#后台定位)。授权以后,小程序在运行中或进入后台均可接受位置消息变化。
|
|
193
|
+
*
|
|
194
|
+
* **注意**
|
|
195
|
+
* - 安卓微信7.0.6版本,iOS 7.0.5版本起支持该接口
|
|
196
|
+
* - 需在app.json中配置requiredBackgroundModes: ['location']后使用
|
|
197
|
+
* - 获取位置信息需配置[地理位置用途说明](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#permission)。
|
|
198
|
+
* @supported weapp
|
|
199
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.startLocationUpdateBackground.html
|
|
200
|
+
*/
|
|
201
|
+
startLocationUpdateBackground(
|
|
202
|
+
option?: startLocationUpdateBackground.Option,
|
|
203
|
+
): void
|
|
204
|
+
|
|
205
|
+
/** 开启小程序进入前台时接收位置消息
|
|
206
|
+
*
|
|
207
|
+
* **注意**
|
|
208
|
+
* - 获取位置信息需配置[地理位置用途说明](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#permission)。
|
|
209
|
+
* @supported weapp
|
|
210
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.startLocationUpdate.html
|
|
211
|
+
*/
|
|
212
|
+
startLocationUpdate(option?: startLocationUpdate.Option): void
|
|
213
|
+
|
|
148
214
|
/** 使用微信内置地图查看位置
|
|
149
215
|
* @supported weapp, h5
|
|
150
216
|
* @example
|
|
@@ -166,6 +232,50 @@ declare module '../../index' {
|
|
|
166
232
|
*/
|
|
167
233
|
openLocation(option: openLocation.Option): Promise<TaroGeneral.CallbackResult>
|
|
168
234
|
|
|
235
|
+
/** 监听持续定位接口返回失败时触发
|
|
236
|
+
* @supported weapp
|
|
237
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.onLocationChangeError.html
|
|
238
|
+
*/
|
|
239
|
+
onLocationChangeError(
|
|
240
|
+
/** 监听持续定位接口返回失败时触发的回调函数 */
|
|
241
|
+
callback: onLocationChangeError.Callback,
|
|
242
|
+
): void
|
|
243
|
+
|
|
244
|
+
/** 监听实时地理位置变化事件,需结合 Taro.startLocationUpdateBackground、Taro.startLocationUpdate 使用。
|
|
245
|
+
* @supported weapp
|
|
246
|
+
* @example
|
|
247
|
+
* ```tsx
|
|
248
|
+
* const _locationChangeFn = function (res) {
|
|
249
|
+
* console.log('location change', res)
|
|
250
|
+
* }
|
|
251
|
+
* Taro.onLocationChange(_locationChangeFn)
|
|
252
|
+
* Taro.offLocationChange(_locationChangeFn)
|
|
253
|
+
* ```
|
|
254
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.onLocationChange.html
|
|
255
|
+
*/
|
|
256
|
+
onLocationChange(
|
|
257
|
+
/** 实时地理位置变化事件的回调函数 */
|
|
258
|
+
callback: onLocationChange.Callback,
|
|
259
|
+
): void
|
|
260
|
+
|
|
261
|
+
/** 取消监听持续定位接口返回失败时触发
|
|
262
|
+
* @supported weapp
|
|
263
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.offLocationChangeError.html
|
|
264
|
+
*/
|
|
265
|
+
offLocationChangeError(
|
|
266
|
+
/** 监听持续定位接口返回失败时触发的回调函数 */
|
|
267
|
+
callback: onLocationChangeError.Callback,
|
|
268
|
+
): void
|
|
269
|
+
|
|
270
|
+
/** 取消监听实时地理位置变化事件
|
|
271
|
+
* @supported weapp
|
|
272
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.offLocationChange.html
|
|
273
|
+
*/
|
|
274
|
+
offLocationChange(
|
|
275
|
+
/** 实时地理位置变化事件的回调函数 */
|
|
276
|
+
callback: (res: TaroGeneral.CallbackResult) => void,
|
|
277
|
+
): void
|
|
278
|
+
|
|
169
279
|
/** 获取当前的地理位置、速度。当用户离开小程序后,此接口无法调用。开启高精度定位,接口耗时会增加,可指定 highAccuracyExpireTime 作为超时时间。
|
|
170
280
|
*
|
|
171
281
|
* **注意**
|
|
@@ -188,12 +298,17 @@ declare module '../../index' {
|
|
|
188
298
|
*/
|
|
189
299
|
getLocation(option: getLocation.Option): Promise<getLocation.SuccessCallbackResult>
|
|
190
300
|
|
|
301
|
+
/** 打开POI列表选择位置,支持模糊定位(精确到市)和精确定位混选。
|
|
302
|
+
* @supported weapp
|
|
303
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.choosePoi.html
|
|
304
|
+
*/
|
|
305
|
+
choosePoi(option: choosePoi.Option): Promise<choosePoi.SuccessCallbackResult>
|
|
306
|
+
|
|
191
307
|
/** 打开地图选择位置。
|
|
192
308
|
*
|
|
193
309
|
* `chooseLocation` api功能是依赖于腾讯位置服务,所以需要使用 api 密钥。如果您没有,可以前往腾讯位置服务[开发者控制台](https://lbs.qq.com/console/mykey.html?console=mykey)进行申请。
|
|
194
310
|
* @supported weapp, h5
|
|
195
311
|
* @example
|
|
196
|
-
*
|
|
197
312
|
* ```tsx
|
|
198
313
|
* // config/index.js
|
|
199
314
|
*
|
|
@@ -208,59 +323,5 @@ declare module '../../index' {
|
|
|
208
323
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.chooseLocation.html
|
|
209
324
|
*/
|
|
210
325
|
chooseLocation(option: chooseLocation.Option): Promise<chooseLocation.SuccessCallbackResult>
|
|
211
|
-
|
|
212
|
-
/** 关闭监听实时位置变化,前后台都停止消息接收
|
|
213
|
-
* @supported weapp
|
|
214
|
-
* @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.stopLocationUpdate.html
|
|
215
|
-
*/
|
|
216
|
-
stopLocationUpdate(option?: stopLocationUpdate.Option): void
|
|
217
|
-
|
|
218
|
-
/** 开启小程序进入前后台时均接收位置消息,需引导用户开启[授权]((open-ability/authorize#后台定位))。授权以后,小程序在运行中或进入后台均可接受位置消息变化。
|
|
219
|
-
*
|
|
220
|
-
* **注意**
|
|
221
|
-
* - 安卓微信7.0.6版本,iOS 7.0.5版本起支持该接口
|
|
222
|
-
* - 需在app.json中配置requiredBackgroundModes: ['location']后使用
|
|
223
|
-
* - 获取位置信息需配置[地理位置用途说明](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#permission)。
|
|
224
|
-
* @supported weapp
|
|
225
|
-
* @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.startLocationUpdateBackground.html
|
|
226
|
-
*/
|
|
227
|
-
startLocationUpdateBackground(
|
|
228
|
-
option?: startLocationUpdateBackground.Option,
|
|
229
|
-
): void
|
|
230
|
-
|
|
231
|
-
/** 开启小程序进入前台时接收位置消息
|
|
232
|
-
*
|
|
233
|
-
* **注意**
|
|
234
|
-
* - 获取位置信息需配置[地理位置用途说明](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#permission)。
|
|
235
|
-
* @supported weapp
|
|
236
|
-
* @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.startLocationUpdate.html
|
|
237
|
-
*/
|
|
238
|
-
startLocationUpdate(option?: startLocationUpdate.Option): void
|
|
239
|
-
|
|
240
|
-
/** 监听实时地理位置变化事件,需结合 Taro.startLocationUpdateBackground、Taro.startLocationUpdate 使用。
|
|
241
|
-
* @supported weapp
|
|
242
|
-
* @example
|
|
243
|
-
* ```tsx
|
|
244
|
-
* const _locationChangeFn = function (res) {
|
|
245
|
-
* console.log('location change', res)
|
|
246
|
-
* }
|
|
247
|
-
* Taro.onLocationChange(_locationChangeFn)
|
|
248
|
-
* Taro.offLocationChange(_locationChangeFn)
|
|
249
|
-
* ```
|
|
250
|
-
* @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.onLocationChange.html
|
|
251
|
-
*/
|
|
252
|
-
onLocationChange(
|
|
253
|
-
/** 实时地理位置变化事件的回调函数 */
|
|
254
|
-
callback: onLocationChange.Callback,
|
|
255
|
-
): void
|
|
256
|
-
|
|
257
|
-
/** 取消监听实时地理位置变化事件
|
|
258
|
-
* @supported weapp
|
|
259
|
-
* @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.offLocationChange.html
|
|
260
|
-
*/
|
|
261
|
-
offLocationChange(
|
|
262
|
-
/** 实时地理位置变化事件的回调函数 */
|
|
263
|
-
callback: (res: TaroGeneral.CallbackResult) => void,
|
|
264
|
-
): void
|
|
265
326
|
}
|
|
266
327
|
}
|