@tarojs/taro 3.3.10 → 3.3.14

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 (100) hide show
  1. package/html5.css +5 -5
  2. package/package.json +5 -5
  3. package/types/api/ad/index.d.ts +34 -28
  4. package/types/api/alipay/index.d.ts +11 -7
  5. package/types/api/base/debug.d.ts +60 -54
  6. package/types/api/base/env.d.ts +12 -8
  7. package/types/api/base/index.d.ts +87 -83
  8. package/types/api/base/system.d.ts +59 -54
  9. package/types/api/base/update.d.ts +37 -33
  10. package/types/api/base/weapp/app-event.d.ts +147 -131
  11. package/types/api/base/weapp/life-cycle.d.ts +14 -10
  12. package/types/api/canvas/index.d.ts +115 -110
  13. package/types/api/cloud/index.d.ts +99 -94
  14. package/types/api/data-analysis/index.d.ts +72 -0
  15. package/types/api/device/accelerometer.d.ts +57 -50
  16. package/types/api/device/battery.d.ts +19 -15
  17. package/types/api/device/ble.d.ts +241 -228
  18. package/types/api/device/bluetooth.d.ts +207 -194
  19. package/types/api/device/clipboard.d.ts +48 -43
  20. package/types/api/device/compass.d.ts +55 -48
  21. package/types/api/device/contact.d.ts +13 -9
  22. package/types/api/device/gyroscope.d.ts +41 -35
  23. package/types/api/device/iBeacon.d.ts +79 -73
  24. package/types/api/device/motion.d.ts +42 -37
  25. package/types/api/device/network.d.ts +48 -42
  26. package/types/api/device/nfc.d.ts +105 -96
  27. package/types/api/device/performance.d.ts +22 -18
  28. package/types/api/device/phone.d.ts +20 -15
  29. package/types/api/device/scan.d.ts +31 -26
  30. package/types/api/device/screen.d.ts +74 -67
  31. package/types/api/device/vibrate.d.ts +31 -25
  32. package/types/api/device/wifi.d.ts +151 -140
  33. package/types/api/ext/index.d.ts +44 -39
  34. package/types/api/files/index.d.ts +219 -209
  35. package/types/api/framework/index.d.ts +25 -20
  36. package/types/api/location/index.d.ts +140 -136
  37. package/types/api/media/audio.d.ts +139 -127
  38. package/types/api/media/background-audio.d.ts +135 -126
  39. package/types/api/media/camera.d.ts +30 -26
  40. package/types/api/media/editor.d.ts +35 -33
  41. package/types/api/media/image.d.ts +190 -137
  42. package/types/api/media/live.d.ts +88 -82
  43. package/types/api/media/map.d.ts +47 -43
  44. package/types/api/media/recorder.d.ts +90 -84
  45. package/types/api/media/video-processing.d.ts +10 -6
  46. package/types/api/media/video.d.ts +63 -58
  47. package/types/api/network/download.d.ts +34 -30
  48. package/types/api/network/mdns.d.ts +104 -91
  49. package/types/api/network/request.d.ts +83 -79
  50. package/types/api/network/udp.d.ts +20 -16
  51. package/types/api/network/upload.d.ts +60 -56
  52. package/types/api/network/websocket.d.ts +201 -194
  53. package/types/api/open-api/account.d.ts +18 -14
  54. package/types/api/open-api/address.d.ts +27 -23
  55. package/types/api/open-api/authorize.d.ts +30 -26
  56. package/types/api/open-api/card.d.ts +55 -51
  57. package/types/api/open-api/customer-service.d.ts +45 -0
  58. package/types/api/open-api/facial.d.ts +28 -24
  59. package/types/api/open-api/invoice.d.ts +38 -34
  60. package/types/api/open-api/login.d.ts +56 -52
  61. package/types/api/open-api/navigate.d.ts +79 -75
  62. package/types/api/open-api/payment.d.ts +34 -30
  63. package/types/api/open-api/settings.d.ts +54 -45
  64. package/types/api/open-api/soter.d.ts +92 -86
  65. package/types/api/open-api/subscribe-message.d.ts +24 -20
  66. package/types/api/open-api/user-info.d.ts +60 -57
  67. package/types/api/open-api/werun.d.ts +50 -46
  68. package/types/api/route/index.d.ts +122 -118
  69. package/types/api/share/index.d.ts +68 -64
  70. package/types/api/storage/background-fetch.d.ts +40 -35
  71. package/types/api/storage/index.d.ts +267 -262
  72. package/types/api/swan/index.d.ts +47 -42
  73. package/types/api/ui/animation.d.ts +21 -17
  74. package/types/api/ui/background.d.ts +38 -34
  75. package/types/api/ui/custom-component.d.ts +22 -18
  76. package/types/api/ui/fonts.d.ts +26 -21
  77. package/types/api/ui/interaction.d.ts +167 -121
  78. package/types/api/ui/keyboard.d.ts +59 -55
  79. package/types/api/ui/menu.d.ts +10 -6
  80. package/types/api/ui/navigation-bar.d.ts +67 -63
  81. package/types/api/ui/pull-down-refresh.d.ts +33 -29
  82. package/types/api/ui/scroll.d.ts +30 -26
  83. package/types/api/ui/sticky.d.ts +22 -19
  84. package/types/api/ui/tab-bar.d.ts +101 -97
  85. package/types/api/ui/window.d.ts +24 -18
  86. package/types/api/worker/index.d.ts +28 -24
  87. package/types/api/wxml/index.d.ts +42 -38
  88. package/types/global.d.ts +350 -0
  89. package/types/index.d.ts +14 -99
  90. package/types/taro.api.d.ts +94 -0
  91. package/types/taro.component.d.ts +10 -57
  92. package/types/taro.config.d.ts +24 -6
  93. package/types/taro.extend.d.ts +70 -67
  94. package/types/taro.hooks.d.ts +68 -67
  95. package/types/taro.lifecycle.d.ts +47 -28
  96. package/types/api/ad/index.ts +0 -6
  97. package/types/api/alipay/index.ts +0 -7
  98. package/types/api/index.d.ts +0 -352
  99. package/types/api/open-api/data-analysis.d.ts +0 -19
  100. package/types/api/open-api/report.d.ts +0 -19
@@ -1,4 +1,6 @@
1
- declare namespace Taro {
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
2
4
  namespace startAccelerometer {
3
5
  type Option = {
4
6
  /**
@@ -7,11 +9,11 @@ declare namespace Taro {
7
9
  */
8
10
  interval?: keyof interval
9
11
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
10
- complete?: (res: General.CallbackResult) => void
12
+ complete?: (res: TaroGeneral.CallbackResult) => void
11
13
  /** 接口调用失败的回调函数 */
12
- fail?: (res: General.CallbackResult) => void
14
+ fail?: (res: TaroGeneral.CallbackResult) => void
13
15
  /** 接口调用成功的回调函数 */
14
- success?: (res: General.CallbackResult) => void
16
+ success?: (res: TaroGeneral.CallbackResult) => void
15
17
  }
16
18
 
17
19
  type interval = {
@@ -23,37 +25,17 @@ declare namespace Taro {
23
25
  normal: 'normal'
24
26
  }
25
27
  }
26
- /**
27
- * 开始监听加速度数据。
28
- * @example
29
- * ```tsx
30
- * Taro.startAccelerometer({ interval: 'game' })
31
- * ```
32
- * @supported weapp, h5, rn
33
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.startAccelerometer.html
34
- */
35
- function startAccelerometer (res?: startAccelerometer.Option): Promise<General.CallbackResult>
36
28
 
37
29
  namespace stopAccelerometer {
38
30
  type Option = {
39
31
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
40
- complete?: (res: General.CallbackResult) => void
32
+ complete?: (res: TaroGeneral.CallbackResult) => void
41
33
  /** 接口调用失败的回调函数 */
42
- fail?: (res: General.CallbackResult) => void
34
+ fail?: (res: TaroGeneral.CallbackResult) => void
43
35
  /** 接口调用成功的回调函数 */
44
- success?: (res: General.CallbackResult) => void
36
+ success?: (res: TaroGeneral.CallbackResult) => void
45
37
  }
46
38
  }
47
- /**
48
- * 停止监听加速度数据。
49
- * @example
50
- * ```tsx
51
- * Taro.stopAccelerometer()
52
- * ```
53
- * @supported weapp, h5, rn
54
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.stopAccelerometer.html
55
- */
56
- function stopAccelerometer (res?: stopAccelerometer.Option): Promise<General.CallbackResult>
57
39
 
58
40
  namespace onAccelerometerChange {
59
41
  type Callback = (res: Result) => void
@@ -66,28 +48,53 @@ declare namespace Taro {
66
48
  z: number
67
49
  }
68
50
  }
69
- /**
70
- * 监听加速度数据,频率:5次/秒,接口调用后会自动开始监听,可使用 `Taro.stopAccelerometer` 停止监听。
71
- * @supported weapp, h5, rn
72
- * @example
73
- * ```tsx
74
- * Taro.onAccelerometerChange(res => {
75
- * console.log(res.x)
76
- * console.log(res.y)
77
- * console.log(res.z)
78
- * })
79
- * ```
80
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.onAccelerometerChange.html
81
- */
82
- function onAccelerometerChange (callback: onAccelerometerChange.Callback): void
83
51
 
84
- /**
85
- * 取消监听加速度数据事件,参数为空,则取消所有的事件监听。
86
- * @supported weapp, rn
87
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.offAccelerometerChange.html
88
- */
89
- function offAccelerometerChange(
90
- /** 加速度数据事件的回调函数 */
91
- callback?: (...args: any[]) => any,
92
- ): void
52
+ interface TaroStatic {
53
+ /**
54
+ * 开始监听加速度数据。
55
+ * @example
56
+ * ```tsx
57
+ * Taro.startAccelerometer({ interval: 'game' })
58
+ * ```
59
+ * @supported weapp, h5, rn
60
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.startAccelerometer.html
61
+ */
62
+ startAccelerometer (res?: startAccelerometer.Option): Promise<TaroGeneral.CallbackResult>
63
+
64
+ /**
65
+ * 停止监听加速度数据。
66
+ * @example
67
+ * ```tsx
68
+ * Taro.stopAccelerometer()
69
+ * ```
70
+ * @supported weapp, h5, rn
71
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.stopAccelerometer.html
72
+ */
73
+ stopAccelerometer (res?: stopAccelerometer.Option): Promise<TaroGeneral.CallbackResult>
74
+
75
+ /**
76
+ * 监听加速度数据,频率:5次/秒,接口调用后会自动开始监听,可使用 `Taro.stopAccelerometer` 停止监听。
77
+ * @supported weapp, h5, rn
78
+ * @example
79
+ * ```tsx
80
+ * Taro.onAccelerometerChange(res => {
81
+ * console.log(res.x)
82
+ * console.log(res.y)
83
+ * console.log(res.z)
84
+ * })
85
+ * ```
86
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.onAccelerometerChange.html
87
+ */
88
+ onAccelerometerChange (callback: onAccelerometerChange.Callback): void
89
+
90
+ /**
91
+ * 取消监听加速度数据事件,参数为空,则取消所有的事件监听。
92
+ * @supported weapp, rn
93
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.offAccelerometerChange.html
94
+ */
95
+ offAccelerometerChange(
96
+ /** 加速度数据事件的回调函数 */
97
+ callback?: (...args: any[]) => any,
98
+ ): void
99
+ }
93
100
  }
@@ -1,10 +1,6 @@
1
- declare namespace Taro {
2
- /** Taro.getBatteryInfo 的同步版本
3
- * @supported weapp
4
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/battery/wx.getBatteryInfoSync.html
5
- */
6
- function getBatteryInfoSync(): getBatteryInfoSync.Result
1
+ import Taro from '../../index'
7
2
 
3
+ declare module '../../index' {
8
4
  namespace getBatteryInfoSync {
9
5
  interface Result {
10
6
  /** 是否正在充电中 */
@@ -14,23 +10,17 @@ declare namespace Taro {
14
10
  }
15
11
  }
16
12
 
17
- /** 获取设备电量。同步 API Taro.getBatteryInfoSync 在 iOS 上不可用。
18
- * @supported weapp
19
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/battery/wx.getBatteryInfo.html
20
- */
21
- function getBatteryInfo(option?: getBatteryInfo.Option): Promise<getBatteryInfo.SuccessCallbackResult>
22
-
23
13
  namespace getBatteryInfo {
24
14
  interface Option {
25
15
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
26
- complete?: (res: General.CallbackResult) => void
16
+ complete?: (res: TaroGeneral.CallbackResult) => void
27
17
  /** 接口调用失败的回调函数 */
28
- fail?: (res: General.CallbackResult) => void
18
+ fail?: (res: TaroGeneral.CallbackResult) => void
29
19
  /** 接口调用成功的回调函数 */
30
20
  success?: (res: SuccessCallbackResult) => void
31
21
  }
32
22
 
33
- interface SuccessCallbackResult extends General.CallbackResult {
23
+ interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
34
24
  /** 是否正在充电中 */
35
25
  isCharging: boolean
36
26
  /** 设备电量,范围 1 - 100 */
@@ -39,4 +29,18 @@ declare namespace Taro {
39
29
  errMsg: string
40
30
  }
41
31
  }
32
+
33
+ interface TaroStatic {
34
+ /** Taro.getBatteryInfo 的同步版本
35
+ * @supported weapp
36
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/battery/wx.getBatteryInfoSync.html
37
+ */
38
+ getBatteryInfoSync(): getBatteryInfoSync.Result
39
+
40
+ /** 获取设备电量。同步 API Taro.getBatteryInfoSync 在 iOS 上不可用。
41
+ * @supported weapp
42
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/battery/wx.getBatteryInfo.html
43
+ */
44
+ getBatteryInfo(option?: getBatteryInfo.Option): Promise<getBatteryInfo.SuccessCallbackResult>
45
+ }
42
46
  }