@tarojs/taro 3.5.0-alpha.15 → 3.5.0-alpha.16

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 (64) hide show
  1. package/index.js +3 -4
  2. package/package.json +7 -8
  3. package/types/api/base/debug.d.ts +1 -1
  4. package/types/api/base/index.d.ts +3 -3
  5. package/types/api/base/performance.d.ts +5 -5
  6. package/types/api/base/system.d.ts +2 -2
  7. package/types/api/base/update.d.ts +6 -6
  8. package/types/api/base/weapp/app-event.d.ts +56 -17
  9. package/types/api/base/weapp/life-cycle.d.ts +7 -7
  10. package/types/api/canvas/index.d.ts +1 -1
  11. package/types/api/data-analysis/index.d.ts +1 -1
  12. package/types/api/device/accelerometer.d.ts +3 -3
  13. package/types/api/device/calendar.d.ts +1 -1
  14. package/types/api/device/clipboard.d.ts +2 -2
  15. package/types/api/device/compass.d.ts +3 -3
  16. package/types/api/device/gyroscope.d.ts +4 -4
  17. package/types/api/device/keyboard.d.ts +1 -1
  18. package/types/api/device/memory.d.ts +1 -1
  19. package/types/api/device/network.d.ts +2 -2
  20. package/types/api/device/phone.d.ts +1 -1
  21. package/types/api/device/scan.d.ts +1 -1
  22. package/types/api/device/screen.d.ts +5 -5
  23. package/types/api/device/vibrate.d.ts +6 -2
  24. package/types/api/device/wifi.d.ts +3 -3
  25. package/types/api/ext/index.d.ts +2 -2
  26. package/types/api/files/index.d.ts +32 -32
  27. package/types/api/framework/index.d.ts +5 -4
  28. package/types/api/location/index.d.ts +45 -9
  29. package/types/api/media/audio.d.ts +1 -1
  30. package/types/api/media/background-audio.d.ts +1 -1
  31. package/types/api/media/camera.d.ts +8 -8
  32. package/types/api/media/image.d.ts +5 -5
  33. package/types/api/media/map.d.ts +15 -15
  34. package/types/api/media/recorder.d.ts +9 -9
  35. package/types/api/media/video.d.ts +2 -2
  36. package/types/api/navigate/index.d.ts +2 -2
  37. package/types/api/network/download.d.ts +27 -8
  38. package/types/api/network/request.d.ts +3 -3
  39. package/types/api/network/upload.d.ts +19 -8
  40. package/types/api/network/websocket.d.ts +6 -6
  41. package/types/api/open-api/address.d.ts +1 -1
  42. package/types/api/open-api/authorize.d.ts +1 -1
  43. package/types/api/open-api/settings.d.ts +2 -2
  44. package/types/api/open-api/subscribe-message.d.ts +2 -2
  45. package/types/api/open-api/user-info.d.ts +2 -2
  46. package/types/api/route/index.d.ts +5 -5
  47. package/types/api/share/index.d.ts +2 -2
  48. package/types/api/storage/index.d.ts +10 -10
  49. package/types/api/ui/animation.d.ts +34 -36
  50. package/types/api/ui/interaction.d.ts +6 -6
  51. package/types/api/ui/menu.d.ts +1 -1
  52. package/types/api/ui/navigation-bar.d.ts +5 -5
  53. package/types/api/ui/pull-down-refresh.d.ts +2 -2
  54. package/types/api/ui/scroll.d.ts +4 -2
  55. package/types/api/ui/tab-bar.d.ts +8 -8
  56. package/types/api/wxml/index.d.ts +16 -16
  57. package/types/compile.d.ts +18 -4
  58. package/types/global.d.ts +1 -1
  59. package/types/taro.component.d.ts +12 -63
  60. package/types/taro.config.d.ts +29 -0
  61. package/types/taro.extend.d.ts +24 -20
  62. package/types/taro.hooks.d.ts +55 -3
  63. package/types/taro.lifecycle.d.ts +21 -14
  64. package/LICENSE +0 -21
@@ -3,6 +3,8 @@ import Taro from '../../index'
3
3
  declare module '../../index' {
4
4
  namespace vibrateShort {
5
5
  interface Option {
6
+ /** 震动强度类型,有效值为:heavy、medium、light */
7
+ type: 'heavy' | 'medium' | 'light'
6
8
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
7
9
  complete?: (res: TaroGeneral.CallbackResult) => void
8
10
  /** 接口调用失败的回调函数 */
@@ -25,7 +27,9 @@ declare module '../../index' {
25
27
 
26
28
  interface TaroStatic {
27
29
  /** 使手机发生较短时间的振动(15 ms)。仅在 iPhone `7 / 7 Plus` 以上及 Android 机型生效
28
- * @supported weapp, h5, rn
30
+ * @h5 不支持 type 参数
31
+ * @rn 不支持 type 参数
32
+ * @supported weapp, h5, rn, tt
29
33
  * @example
30
34
  * ```tsx
31
35
  * Taro.vibrateShort(params).then(...)
@@ -35,7 +39,7 @@ declare module '../../index' {
35
39
  vibrateShort(option?: vibrateShort.Option): Promise<TaroGeneral.CallbackResult>
36
40
 
37
41
  /** 使手机发生较长时间的振动(400ms)
38
- * @supported weapp, h5, rn
42
+ * @supported weapp, h5, rn, tt
39
43
  * @example
40
44
  * ```tsx
41
45
  * Taro.vibrateLong(params).then(...)
@@ -218,7 +218,7 @@ declare module '../../index' {
218
218
  ): void
219
219
 
220
220
  /** 监听获取到 Wi-Fi 列表数据事件
221
- * @supported weapp
221
+ * @supported weapp, tt
222
222
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.onGetWifiList.html
223
223
  */
224
224
  onGetWifiList(
@@ -247,7 +247,7 @@ declare module '../../index' {
247
247
 
248
248
  /**
249
249
  * 取消监听获取到 Wi-Fi 列表数据事件。
250
- * @supported weapp
250
+ * @supported weapp, tt
251
251
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.offGetWifiList.html
252
252
  */
253
253
  offGetWifiList(
@@ -258,7 +258,7 @@ declare module '../../index' {
258
258
  /** 请求获取 Wi-Fi 列表。在 `onGetWifiList` 注册的回调中返回 `wifiList` 数据。 **Android 调用前需要 [用户授权](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html) scope.userLocation。**
259
259
  *
260
260
  * iOS 将跳转到系统的 Wi-Fi 界面,Android 不会跳转。 iOS 11.0 及 iOS 11.1 两个版本因系统问题,该方法失效。但在 iOS 11.2 中已修复。
261
- * @supported weapp
261
+ * @supported weapp, tt
262
262
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.getWifiList.html
263
263
  */
264
264
  getWifiList(option?: getWifiList.Option): Promise<TaroGeneral.WifiError>
@@ -31,7 +31,7 @@ declare module '../../index' {
31
31
  *
32
32
  * **Tips**
33
33
  * 1. 本接口暂时无法通过 Taro.canIUse 判断是否兼容,开发者需要自行判断 Taro.getExtConfigSync 是否存在来兼容
34
- * @supported weapp
34
+ * @supported weapp, tt
35
35
  * @example
36
36
  * ```tsx
37
37
  * let extConfig = Taro.getExtConfigSync? Taro.getExtConfigSync(): {}
@@ -46,7 +46,7 @@ declare module '../../index' {
46
46
  *
47
47
  * **Tips**
48
48
  * 1. 本接口暂时无法通过 Taro.canIUse 判断是否兼容,开发者需要自行判断 Taro.getExtConfig 是否存在来兼容
49
- * @supported weapp
49
+ * @supported weapp, tt
50
50
  * @example
51
51
  * ```tsx
52
52
  * if(Taro.getExtConfig) {
@@ -180,17 +180,17 @@ declare module '../../index' {
180
180
  }
181
181
 
182
182
  /** 文件管理器,可通过 [Taro.getFileSystemManager](./getFileSystemManager) 获取。
183
- * @supported weapp
183
+ * @supported weapp, tt
184
184
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.html
185
185
  */
186
186
  interface FileSystemManager {
187
187
  /** 判断文件/目录是否存在
188
- * @supported weapp
188
+ * @supported weapp, tt
189
189
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.access.html
190
190
  */
191
191
  access(option: FileSystemManager.AccessOption): void
192
192
  /** [FileSystemManager.access](#access) 的同步版本
193
- * @supported weapp
193
+ * @supported weapp, tt
194
194
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.accessSync.html
195
195
  */
196
196
  accessSync(
@@ -225,12 +225,12 @@ declare module '../../index' {
225
225
  */
226
226
  closeSync(option: FileSystemManager.CloseSyncOption): void
227
227
  /** 复制文件
228
- * @supported weapp
228
+ * @supported weapp, tt
229
229
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.copyFile.html
230
230
  */
231
231
  copyFile(option: FileSystemManager.CopyFileOption): void
232
232
  /** [FileSystemManager.copyFile](#copyfile) 的同步版本
233
- * @supported weapp
233
+ * @supported weapp, tt
234
234
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.copyFileSync.html
235
235
  */
236
236
  copyFileSync(
@@ -260,22 +260,22 @@ declare module '../../index' {
260
260
  */
261
261
  ftruncateSync(option: FileSystemManager.FtruncateSyncOption): void
262
262
  /** 获取该小程序下的 `本地临时文件` 或 `本地缓存文件` 信息
263
- * @supported weapp
263
+ * @supported weapp, tt
264
264
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.getFileInfo.html
265
265
  */
266
266
  getFileInfo(option: FileSystemManager.getFileInfoOption): void
267
267
  /** 获取该小程序下已保存的本地缓存文件列表
268
- * @supported weapp
268
+ * @supported weapp, tt
269
269
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.getSavedFileList.html
270
270
  */
271
271
  getSavedFileList(option?: FileSystemManager.getSavedFileListOption): void
272
272
  /** 创建目录
273
- * @supported weapp
273
+ * @supported weapp, tt
274
274
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.mkdir.html
275
275
  */
276
276
  mkdir(option: FileSystemManager.MkdirOption): void
277
277
  /** [FileSystemManager.mkdir](#mkdir) 的同步版本
278
- * @supported weapp
278
+ * @supported weapp, tt
279
279
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.mkdirSync.html
280
280
  */
281
281
  mkdirSync(
@@ -310,12 +310,12 @@ declare module '../../index' {
310
310
  */
311
311
  readCompressedFileSync(option: FileSystemManager.readCompressedFileSync.Option): ArrayBuffer /** 文件读取结果 */
312
312
  /** 读取目录内文件列表
313
- * @supported weapp
313
+ * @supported weapp, tt
314
314
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readdir.html
315
315
  */
316
316
  readdir(option: FileSystemManager.ReaddirOption): void
317
317
  /** [FileSystemManager.readdir](#readdir) 的同步版本
318
- * @supported weapp
318
+ * @supported weapp, tt
319
319
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readdirSync.html
320
320
  */
321
321
  readdirSync(
@@ -323,12 +323,12 @@ declare module '../../index' {
323
323
  dirPath: string,
324
324
  ): string[]
325
325
  /** 读取本地文件内容
326
- * @supported weapp
326
+ * @supported weapp, tt
327
327
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readFile.html
328
328
  */
329
329
  readFile(option: FileSystemManager.ReadFileOption): void
330
330
  /** [FileSystemManager.readFile](#readfile) 的同步版本
331
- * @supported weapp
331
+ * @supported weapp, tt
332
332
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readFileSync.html
333
333
  */
334
334
  readFileSync(
@@ -364,12 +364,12 @@ declare module '../../index' {
364
364
  */
365
365
  removeSavedFile(option: FileSystemManager.RemoveSavedFileOption): void
366
366
  /** 重命名文件。可以把文件从 oldPath 移动到 newPath
367
- * @supported weapp
367
+ * @supported weapp, tt
368
368
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.rename.html
369
369
  */
370
370
  rename(option: FileSystemManager.RenameOption): void
371
371
  /** [FileSystemManager.rename](#rename) 的同步版本
372
- * @supported weapp
372
+ * @supported weapp, tt
373
373
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.renameSync.html
374
374
  */
375
375
  renameSync(
@@ -379,12 +379,12 @@ declare module '../../index' {
379
379
  newPath: string,
380
380
  ): void
381
381
  /** 删除目录
382
- * @supported weapp
382
+ * @supported weapp, tt
383
383
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.rmdir.html
384
384
  */
385
385
  rmdir(option: FileSystemManager.RmdirOption): void
386
386
  /** [FileSystemManager.rmdir](#rmdir) 的同步版本
387
- * @supported weapp
387
+ * @supported weapp, tt
388
388
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.rmdirSync.html
389
389
  */
390
390
  rmdirSync(
@@ -394,12 +394,12 @@ declare module '../../index' {
394
394
  recursive?: boolean,
395
395
  ): void
396
396
  /** 保存临时文件到本地。此接口会移动临时文件,因此调用成功后,tempFilePath 将不可用。
397
- * @supported weapp
397
+ * @supported weapp, tt
398
398
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.saveFile.html
399
399
  */
400
400
  saveFile(option: FileSystemManager.SaveFileOption): void
401
401
  /** [FileSystemManager.saveFile](#savefile) 的同步版本
402
- * @supported weapp
402
+ * @supported weapp, tt
403
403
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.saveFileSync.html
404
404
  */
405
405
  saveFileSync(
@@ -409,12 +409,12 @@ declare module '../../index' {
409
409
  filePath?: string,
410
410
  ): string
411
411
  /** 获取文件 Stats 对象
412
- * @supported weapp
412
+ * @supported weapp, tt
413
413
  * https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.stat.html
414
414
  */
415
415
  stat(option: FileSystemManager.StatOption): void
416
416
  /** [FileSystemManager.stat](#stat) 的同步版本
417
- * @supported weapp
417
+ * @supported weapp, tt
418
418
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.statSync.html
419
419
  */
420
420
  statSync(
@@ -434,12 +434,12 @@ declare module '../../index' {
434
434
  */
435
435
  truncateSync(option: FileSystemManager.TruncateSyncOption): void
436
436
  /** 删除文件
437
- * @supported weapp
437
+ * @supported weapp, tt
438
438
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.unlink.html
439
439
  */
440
440
  unlink(option: FileSystemManager.UnlinkOption): void
441
441
  /** [FileSystemManager.unlink](#unlink) 的同步版本
442
- * @supported weapp
442
+ * @supported weapp, tt
443
443
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.unlinkSync.html
444
444
  */
445
445
  unlinkSync(
@@ -447,7 +447,7 @@ declare module '../../index' {
447
447
  filePath: string,
448
448
  ): void
449
449
  /** 解压文件
450
- * @supported weapp
450
+ * @supported weapp, tt
451
451
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.unzip.html
452
452
  */
453
453
  unzip(option: FileSystemManager.UnzipOption): void
@@ -457,12 +457,12 @@ declare module '../../index' {
457
457
  */
458
458
  write(option: FileSystemManager.WriteOption): void
459
459
  /** 写文件
460
- * @supported weapp
460
+ * @supported weapp, tt
461
461
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.writeFile.html
462
462
  */
463
463
  writeFile(option: FileSystemManager.WriteFileOption): void
464
464
  /** [FileSystemManager.writeFile](#writefile) 的同步版本
465
- * @supported weapp
465
+ * @supported weapp, tt
466
466
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.writeFileSync.html
467
467
  */
468
468
  writeFileSync(
@@ -1326,7 +1326,7 @@ declare module '../../index' {
1326
1326
  saveFileToDisk(option: saveFileToDisk.Option): Promise<TaroGeneral.CallbackResult>
1327
1327
 
1328
1328
  /** 保存文件到本地。**注意:saveFile 会把临时文件移动,因此调用成功后传入的 tempFilePath 将不可用**
1329
- * @supported weapp, rn
1329
+ * @supported weapp, rn, tt
1330
1330
  * @example
1331
1331
  * ```tsx
1332
1332
  * Taro.chooseImage({
@@ -1346,7 +1346,7 @@ declare module '../../index' {
1346
1346
  saveFile(option: saveFile.Option): Promise<saveFile.SuccessCallbackResult | saveFile.FailCallbackResult>
1347
1347
 
1348
1348
  /** 删除该小程序下已保存的本地缓存文件
1349
- * @supported weapp, rn
1349
+ * @supported weapp, rn, tt
1350
1350
  * @example
1351
1351
  * ```tsx
1352
1352
  * Taro.getSavedFileList({
@@ -1367,7 +1367,7 @@ declare module '../../index' {
1367
1367
  removeSavedFile(option: removeSavedFile.Option): Promise<TaroGeneral.CallbackResult>
1368
1368
 
1369
1369
  /** 新开页面打开文档,支持格式
1370
- * @supported weapp
1370
+ * @supported weapp, tt
1371
1371
  * @example
1372
1372
  ```tsx
1373
1373
  * Taro.downloadFile({
@@ -1388,7 +1388,7 @@ declare module '../../index' {
1388
1388
  openDocument(option: openDocument.Option): Promise<TaroGeneral.CallbackResult>
1389
1389
 
1390
1390
  /** 获取本地已保存的文件列表
1391
- * @supported weapp, rn
1391
+ * @supported weapp, rn, tt
1392
1392
  * @example
1393
1393
  * ```tsx
1394
1394
  * Taro.getSavedFileList({
@@ -1419,7 +1419,7 @@ declare module '../../index' {
1419
1419
 
1420
1420
  /**
1421
1421
  * 获取该小程序下的 本地临时文件 或 本地缓存文件 信息
1422
- * @supported weapp, rn
1422
+ * @supported weapp, rn, tt
1423
1423
  * @example
1424
1424
  * ```tsx
1425
1425
  * Taro.getFileInfo({
@@ -1434,7 +1434,7 @@ declare module '../../index' {
1434
1434
  getFileInfo(option: getFileInfo.Option): Promise<getFileInfo.SuccessCallbackResult | getFileInfo.FailCallbackResult>
1435
1435
 
1436
1436
  /** 获取全局唯一的文件管理器
1437
- * @supported weapp
1437
+ * @supported weapp, tt
1438
1438
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/wx.getFileSystemManager.html
1439
1439
  */
1440
1440
  getFileSystemManager(): FileSystemManager
@@ -3,10 +3,11 @@ import Taro from '../../index'
3
3
  declare module '../../index' {
4
4
  /** 注册小程序中的一个页面。接受一个 `Object` 类型参数,其指定页面的初始数据、生命周期回调、事件处理函数等。 */
5
5
  interface Page {
6
- /**
7
- * 当前页面的路径
6
+ /** 当前页面的路径
7
+ * @note 推荐使用 Taro.getCurrentInstance().router?.path 方法
8
8
  */
9
- route: string
9
+ route?: string
10
+ __route__?: string
10
11
  /** @ignore */
11
12
  [k: string]: any
12
13
  }
@@ -32,7 +33,7 @@ declare module '../../index' {
32
33
  * __注意:__
33
34
  * - __不要尝试修改页面栈,会导致路由以及页面状态错误。__
34
35
  * - 不要在 `App.onLaunch` 的时候调用 `getCurrentPages()`,此时 `page` 还没有生成。
35
- * @supported weapp, h5
36
+ * @supported weapp, h5, rn, tt
36
37
  * @example
37
38
  * ```tsx
38
39
  * Taro.getCurrentPages().length
@@ -188,9 +188,29 @@ declare module '../../index' {
188
188
  }
189
189
  }
190
190
 
191
+ namespace getFuzzyLocation {
192
+ interface Option {
193
+ /** wgs84 返回 gps 坐标,gcj02 返回可用于 Taro.openLocation 的坐标 */
194
+ type?: 'wgs84' | 'gcj02'
195
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
196
+ complete?: (res: TaroGeneral.CallbackResult) => void
197
+ /** 接口调用失败的回调函数 */
198
+ fail?: (res: TaroGeneral.CallbackResult) => void
199
+ /** 接口调用成功的回调函数 */
200
+ success?: (result: SuccessCallbackResult) => void
201
+ }
202
+
203
+ interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
204
+ /** 纬度,范围为 -90~90,负数表示南纬 */
205
+ latitude: string
206
+ /** 经度,范围为 -180~180,负数表示西经 */
207
+ longitude: string
208
+ }
209
+ }
210
+
191
211
  interface TaroStatic {
192
212
  /** 关闭监听实时位置变化,前后台都停止消息接收
193
- * @supported weapp
213
+ * @supported weapp, rn, tt
194
214
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.stopLocationUpdate.html
195
215
  */
196
216
  stopLocationUpdate(option?: stopLocationUpdate.Option): void
@@ -212,13 +232,13 @@ declare module '../../index' {
212
232
  *
213
233
  * **注意**
214
234
  * - 获取位置信息需配置[地理位置用途说明](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#permission)。
215
- * @supported weapp
235
+ * @supported weapp, rn, tt
216
236
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.startLocationUpdate.html
217
237
  */
218
238
  startLocationUpdate(option?: startLocationUpdate.Option): void
219
239
 
220
240
  /** 使用微信内置地图查看位置
221
- * @supported weapp, h5
241
+ * @supported weapp, h5, tt
222
242
  * @example
223
243
  * ```tsx
224
244
  * Taro.getLocation({
@@ -239,7 +259,7 @@ declare module '../../index' {
239
259
  openLocation(option: openLocation.Option): Promise<TaroGeneral.CallbackResult>
240
260
 
241
261
  /** 监听持续定位接口返回失败时触发
242
- * @supported weapp
262
+ * @supported weapp, tt
243
263
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.onLocationChangeError.html
244
264
  */
245
265
  onLocationChangeError(
@@ -248,7 +268,7 @@ declare module '../../index' {
248
268
  ): void
249
269
 
250
270
  /** 监听实时地理位置变化事件,需结合 Taro.startLocationUpdateBackground、Taro.startLocationUpdate 使用。
251
- * @supported weapp
271
+ * @supported weapp, rn, tt
252
272
  * @example
253
273
  * ```tsx
254
274
  * const _locationChangeFn = function (res) {
@@ -265,7 +285,7 @@ declare module '../../index' {
265
285
  ): void
266
286
 
267
287
  /** 取消监听持续定位接口返回失败时触发
268
- * @supported weapp
288
+ * @supported weapp, tt
269
289
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.offLocationChangeError.html
270
290
  */
271
291
  offLocationChangeError(
@@ -274,7 +294,7 @@ declare module '../../index' {
274
294
  ): void
275
295
 
276
296
  /** 取消监听实时地理位置变化事件
277
- * @supported weapp
297
+ * @supported weapp, rn, tt
278
298
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.offLocationChange.html
279
299
  */
280
300
  offLocationChange(
@@ -287,7 +307,7 @@ declare module '../../index' {
287
307
  * **注意**
288
308
  * - 工具中定位模拟使用IP定位,可能会有一定误差。且工具目前仅支持 gcj02 坐标。
289
309
  * - 使用第三方服务进行逆地址解析时,请确认第三方服务默认的坐标系,正确进行坐标转换。
290
- * @supported weapp
310
+ * @supported weapp, rn, tt
291
311
  * @example
292
312
  * ```tsx
293
313
  * Taro.getLocation({
@@ -313,7 +333,7 @@ declare module '../../index' {
313
333
  /** 打开地图选择位置。
314
334
  *
315
335
  * `chooseLocation` api功能是依赖于腾讯位置服务,所以需要使用 api 密钥。如果您没有,可以前往腾讯位置服务[开发者控制台](https://lbs.qq.com/console/mykey.html?console=mykey)进行申请。
316
- * @supported weapp, h5
336
+ * @supported weapp, h5, tt
317
337
  * @example
318
338
  * ```tsx
319
339
  * // config/index.js
@@ -329,5 +349,21 @@ declare module '../../index' {
329
349
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.chooseLocation.html
330
350
  */
331
351
  chooseLocation(option: chooseLocation.Option): Promise<chooseLocation.SuccessCallbackResult>
352
+
353
+ /** 获取当前的模糊地理位置
354
+ * @supported weapp
355
+ * @example
356
+ * ```tsx
357
+ * Taro.getFuzzyLocation({
358
+ * type: 'wgs84',
359
+ * success (res) {
360
+ * const latitude = res.latitude
361
+ * const longitude = res.longitude
362
+ * },
363
+ * })
364
+ * ```
365
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.getFuzzyLocation.html
366
+ */
367
+ getFuzzyLocation(option: getFuzzyLocation.Option): Promise<getFuzzyLocation.SuccessCallbackResult>
332
368
  }
333
369
  }
@@ -943,7 +943,7 @@ declare module '../../index' {
943
943
  createMediaAudioPlayer(): MediaAudioPlayer
944
944
 
945
945
  /** 创建内部 audio 上下文 InnerAudioContext 对象。
946
- * @supported weapp, h5, rn
946
+ * @supported weapp, h5, rn, tt
947
947
  * @example
948
948
  * ```tsx
949
949
  * const innerAudioContext = Taro.createInnerAudioContext()
@@ -274,7 +274,7 @@ declare module '../../index' {
274
274
  * 小程序切入后台,如果音频处于播放状态,可以继续播放。但是后台状态不能通过调用API操纵音频的播放状态。
275
275
  *
276
276
  * 从微信客户端6.7.2版本开始,若需要在小程序切后台后继续播放音频,需要在 [app.json](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html) 中配置 `requiredBackgroundModes` 属性。开发版和体验版上可以直接生效,正式版还需通过审核。
277
- * @supported weapp
277
+ * @supported weapp, tt
278
278
  * @example
279
279
  * ```tsx
280
280
  * const backgroundAudioManager = Taro.getBackgroundAudioManager()
@@ -10,7 +10,7 @@ declare module '../../index' {
10
10
  * ****
11
11
  *
12
12
  * 注: 使用该接口需同时在 [camera](/docs/components/media/camera) 组件属性中指定 frame-size。
13
- * @supported weapp
13
+ * @supported weapp, tt
14
14
  * @example
15
15
  * ```tsx
16
16
  * const context = wx.createCameraContext()
@@ -26,22 +26,22 @@ declare module '../../index' {
26
26
  callback: CameraContext.OnCameraFrameCallback,
27
27
  ): CameraFrameListener
28
28
  /** 设置缩放级别
29
- * @supported weapp
29
+ * @supported weapp, tt
30
30
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraContext.setZoom.html
31
31
  */
32
32
  setZoom(option: CameraContext.SetZoomOption): void
33
33
  /** 开始录像
34
- * @supported weapp, rn
34
+ * @supported weapp, rn, tt
35
35
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraContext.startRecord.html
36
36
  */
37
37
  startRecord(option: CameraContext.StartRecordOption): void
38
38
  /** 结束录像
39
- * @supported weapp, rn
39
+ * @supported weapp, rn, tt
40
40
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraContext.stopRecord.html
41
41
  */
42
42
  stopRecord(option?: CameraContext.StopRecordOption): void
43
43
  /** 拍摄照片
44
- * @supported weapp, rn
44
+ * @supported weapp, rn, tt
45
45
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraContext.takePhoto.html
46
46
  */
47
47
  takePhoto(option: CameraContext.TakePhotoOption): void
@@ -139,12 +139,12 @@ declare module '../../index' {
139
139
  */
140
140
  interface CameraFrameListener {
141
141
  /** 开始监听帧数据
142
- * @supported weapp
142
+ * @supported weapp, tt
143
143
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraFrameListener.start.html
144
144
  */
145
145
  start(option?: CameraFrameListener.StartOption): void
146
146
  /** 停止监听帧数据
147
- * @supported weapp
147
+ * @supported weapp, tt
148
148
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraFrameListener.stop.html
149
149
  */
150
150
  stop(option?: CameraFrameListener.StopOption): void
@@ -171,7 +171,7 @@ declare module '../../index' {
171
171
 
172
172
  interface TaroStatic {
173
173
  /** 创建 camera 上下文 CameraContext 对象。
174
- * @supported weapp, rn
174
+ * @supported weapp, rn, tt
175
175
  * @example
176
176
  * ```tsx
177
177
  * const cameraContext = Taro.createCameraContext()
@@ -262,7 +262,7 @@ declare module '../../index' {
262
262
 
263
263
  interface TaroStatic {
264
264
  /** 保存图片到系统相册。需要[用户授权](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html) scope.writePhotosAlbum
265
- * @supported weapp, rn, alipay, swan
265
+ * @supported weapp, rn, alipay, swan, tt
266
266
  * @example
267
267
  * ```tsx
268
268
  * Taro.saveImageToPhotosAlbum({
@@ -286,7 +286,7 @@ declare module '../../index' {
286
286
  previewMedia(option: previewMedia.Option): Promise<TaroGeneral.CallbackResult>
287
287
 
288
288
  /** 在新页面中全屏预览图片。预览的过程中用户可以进行保存图片、发送给朋友等操作。
289
- * @supported weapp, h5, rn, alipay, swan
289
+ * @supported weapp, h5, rn, alipay, swan, tt
290
290
  * @example
291
291
  * ```tsx
292
292
  * Taro.previewImage({
@@ -299,7 +299,7 @@ declare module '../../index' {
299
299
  previewImage(option: previewImage.Option): Promise<TaroGeneral.CallbackResult>
300
300
 
301
301
  /** 获取图片信息。网络图片需先配置download域名才能生效。
302
- * @supported weapp, h5, rn, alipay, swan
302
+ * @supported weapp, h5, rn, alipay, swan, tt
303
303
  * @example
304
304
  * ```tsx
305
305
  * Taro.getImageInfo({
@@ -338,7 +338,7 @@ declare module '../../index' {
338
338
  editImage(option: editImage.Option): Promise<editImage.SuccessCallbackResult>
339
339
 
340
340
  /** 压缩图片接口,可选压缩质量
341
- * @supported weapp, rn
341
+ * @supported weapp, rn, tt
342
342
  * @example
343
343
  * ```tsx
344
344
  * Taro.compressImage({
@@ -369,7 +369,7 @@ declare module '../../index' {
369
369
 
370
370
  /**
371
371
  * 从本地相册选择图片或使用相机拍照。
372
- * @supported weapp, h5, rn, alipay, swan
372
+ * @supported weapp, h5, rn, alipay, swan, tt
373
373
  * @example
374
374
  * ```tsx
375
375
  * Taro.chooseImage({