@tarojs/taro 3.3.13 → 3.3.17

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 (98) hide show
  1. package/package.json +5 -5
  2. package/types/api/ad/index.d.ts +34 -28
  3. package/types/api/alipay/index.d.ts +11 -7
  4. package/types/api/base/debug.d.ts +60 -54
  5. package/types/api/base/env.d.ts +12 -8
  6. package/types/api/base/index.d.ts +87 -83
  7. package/types/api/base/system.d.ts +59 -54
  8. package/types/api/base/update.d.ts +37 -33
  9. package/types/api/base/weapp/app-event.d.ts +147 -131
  10. package/types/api/base/weapp/life-cycle.d.ts +14 -10
  11. package/types/api/canvas/index.d.ts +116 -111
  12. package/types/api/cloud/index.d.ts +99 -94
  13. package/types/api/data-analysis/index.d.ts +68 -64
  14. package/types/api/device/accelerometer.d.ts +57 -50
  15. package/types/api/device/battery.d.ts +19 -15
  16. package/types/api/device/ble.d.ts +241 -228
  17. package/types/api/device/bluetooth.d.ts +207 -194
  18. package/types/api/device/clipboard.d.ts +48 -43
  19. package/types/api/device/compass.d.ts +55 -48
  20. package/types/api/device/contact.d.ts +13 -9
  21. package/types/api/device/gyroscope.d.ts +41 -35
  22. package/types/api/device/iBeacon.d.ts +79 -73
  23. package/types/api/device/motion.d.ts +42 -37
  24. package/types/api/device/network.d.ts +80 -42
  25. package/types/api/device/nfc.d.ts +105 -96
  26. package/types/api/device/performance.d.ts +32 -18
  27. package/types/api/device/phone.d.ts +20 -15
  28. package/types/api/device/scan.d.ts +31 -26
  29. package/types/api/device/screen.d.ts +74 -67
  30. package/types/api/device/vibrate.d.ts +31 -25
  31. package/types/api/device/wifi.d.ts +151 -140
  32. package/types/api/ext/index.d.ts +44 -39
  33. package/types/api/files/index.d.ts +219 -209
  34. package/types/api/framework/index.d.ts +25 -20
  35. package/types/api/location/index.d.ts +140 -136
  36. package/types/api/media/audio.d.ts +135 -127
  37. package/types/api/media/background-audio.d.ts +135 -126
  38. package/types/api/media/camera.d.ts +30 -26
  39. package/types/api/media/editor.d.ts +35 -33
  40. package/types/api/media/image.d.ts +163 -150
  41. package/types/api/media/live.d.ts +88 -82
  42. package/types/api/media/map.d.ts +47 -43
  43. package/types/api/media/recorder.d.ts +90 -84
  44. package/types/api/media/video-processing.d.ts +10 -6
  45. package/types/api/media/video.d.ts +63 -58
  46. package/types/api/network/download.d.ts +40 -30
  47. package/types/api/network/mdns.d.ts +104 -91
  48. package/types/api/network/request.d.ts +83 -79
  49. package/types/api/network/udp.d.ts +20 -16
  50. package/types/api/network/upload.d.ts +66 -56
  51. package/types/api/network/websocket.d.ts +201 -194
  52. package/types/api/open-api/account.d.ts +18 -14
  53. package/types/api/open-api/address.d.ts +27 -23
  54. package/types/api/open-api/authorize.d.ts +30 -26
  55. package/types/api/open-api/card.d.ts +55 -51
  56. package/types/api/open-api/customer-service.d.ts +21 -17
  57. package/types/api/open-api/facial.d.ts +28 -24
  58. package/types/api/open-api/invoice.d.ts +38 -34
  59. package/types/api/open-api/login.d.ts +56 -52
  60. package/types/api/open-api/navigate.d.ts +79 -75
  61. package/types/api/open-api/payment.d.ts +34 -30
  62. package/types/api/open-api/settings.d.ts +49 -45
  63. package/types/api/open-api/soter.d.ts +92 -86
  64. package/types/api/open-api/subscribe-message.d.ts +24 -20
  65. package/types/api/open-api/user-info.d.ts +60 -57
  66. package/types/api/open-api/werun.d.ts +50 -46
  67. package/types/api/route/index.d.ts +122 -118
  68. package/types/api/share/index.d.ts +68 -64
  69. package/types/api/storage/background-fetch.d.ts +40 -35
  70. package/types/api/storage/index.d.ts +267 -262
  71. package/types/api/swan/index.d.ts +47 -42
  72. package/types/api/ui/animation.d.ts +21 -17
  73. package/types/api/ui/background.d.ts +38 -34
  74. package/types/api/ui/custom-component.d.ts +22 -18
  75. package/types/api/ui/fonts.d.ts +26 -21
  76. package/types/api/ui/interaction.d.ts +159 -150
  77. package/types/api/ui/keyboard.d.ts +59 -55
  78. package/types/api/ui/menu.d.ts +10 -6
  79. package/types/api/ui/navigation-bar.d.ts +67 -63
  80. package/types/api/ui/pull-down-refresh.d.ts +33 -29
  81. package/types/api/ui/scroll.d.ts +30 -26
  82. package/types/api/ui/sticky.d.ts +22 -19
  83. package/types/api/ui/tab-bar.d.ts +101 -97
  84. package/types/api/ui/window.d.ts +24 -18
  85. package/types/api/worker/index.d.ts +28 -24
  86. package/types/api/wxml/index.d.ts +42 -38
  87. package/types/compile.d.ts +1 -5
  88. package/types/global.d.ts +392 -0
  89. package/types/index.d.ts +12 -98
  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 +28 -6
  93. package/types/taro.extend.d.ts +50 -75
  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
@@ -1,15 +1,7 @@
1
- declare namespace Taro {
2
- /** 创建 camera 上下文 CameraContext 对象。
3
- * @supported weapp
4
- * @example
5
- * ```tsx
6
- * const cameraContext = Taro.createCameraContext()
7
- * ```
8
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/wx.createCameraContext.html
9
- */
10
- function createCameraContext(): CameraContext
1
+ import Taro from '../../index'
11
2
 
12
- /**
3
+ declare module '../../index' {
4
+ /**
13
5
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraContext.html
14
6
  */
15
7
  interface CameraContext {
@@ -53,11 +45,11 @@ declare namespace Taro {
53
45
  namespace CameraContext {
54
46
  interface StartRecordOption {
55
47
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
56
- complete?: (res: General.CallbackResult) => void
48
+ complete?: (res: TaroGeneral.CallbackResult) => void
57
49
  /** 接口调用失败的回调函数 */
58
- fail?: (res: General.CallbackResult) => void
50
+ fail?: (res: TaroGeneral.CallbackResult) => void
59
51
  /** 接口调用成功的回调函数 */
60
- success?: (res: General.CallbackResult) => void
52
+ success?: (res: TaroGeneral.CallbackResult) => void
61
53
  /** 超过30s或页面 `onHide` 时会结束录像 */
62
54
  timeoutCallback?: StartRecordTimeoutCallback
63
55
  }
@@ -73,13 +65,13 @@ declare namespace Taro {
73
65
  }
74
66
  interface StopRecordOption {
75
67
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
76
- complete?: (res: General.CallbackResult) => void
68
+ complete?: (res: TaroGeneral.CallbackResult) => void
77
69
  /** 接口调用失败的回调函数 */
78
- fail?: (res: General.CallbackResult) => void
70
+ fail?: (res: TaroGeneral.CallbackResult) => void
79
71
  /** 接口调用成功的回调函数 */
80
72
  success?: (result: StopRecordSuccessCallbackResult) => void
81
73
  }
82
- interface StopRecordSuccessCallbackResult extends General.CallbackResult {
74
+ interface StopRecordSuccessCallbackResult extends TaroGeneral.CallbackResult {
83
75
  /** 封面图片文件的临时路径 */
84
76
  tempThumbPath: string
85
77
  /** 视频的文件的临时路径 */
@@ -89,15 +81,15 @@ declare namespace Taro {
89
81
  }
90
82
  interface TakePhotoOption {
91
83
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
92
- complete?: (res: General.CallbackResult) => void
84
+ complete?: (res: TaroGeneral.CallbackResult) => void
93
85
  /** 接口调用失败的回调函数 */
94
- fail?: (res: General.CallbackResult) => void
86
+ fail?: (res: TaroGeneral.CallbackResult) => void
95
87
  /** 成像质量 */
96
88
  quality?: keyof quality
97
89
  /** 接口调用成功的回调函数 */
98
90
  success?: (result: TakePhotoSuccessCallbackResult) => void
99
91
  }
100
- interface TakePhotoSuccessCallbackResult extends General.CallbackResult {
92
+ interface TakePhotoSuccessCallbackResult extends TaroGeneral.CallbackResult {
101
93
  /** 照片文件的临时路径,安卓是jpg图片格式,ios是png */
102
94
  tempImagePath: string
103
95
  /** 调用结果 */
@@ -142,19 +134,31 @@ declare namespace Taro {
142
134
  namespace CameraFrameListener {
143
135
  interface StartOption {
144
136
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
145
- complete?: (res: General.CallbackResult) => void
137
+ complete?: (res: TaroGeneral.CallbackResult) => void
146
138
  /** 接口调用失败的回调函数 */
147
- fail?: (res: General.CallbackResult) => void
139
+ fail?: (res: TaroGeneral.CallbackResult) => void
148
140
  /** 接口调用成功的回调函数 */
149
- success?: (res: General.CallbackResult) => void
141
+ success?: (res: TaroGeneral.CallbackResult) => void
150
142
  }
151
143
  interface StopOption {
152
144
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
153
- complete?: (res: General.CallbackResult) => void
145
+ complete?: (res: TaroGeneral.CallbackResult) => void
154
146
  /** 接口调用失败的回调函数 */
155
- fail?: (res: General.CallbackResult) => void
147
+ fail?: (res: TaroGeneral.CallbackResult) => void
156
148
  /** 接口调用成功的回调函数 */
157
- success?: (res: General.CallbackResult) => void
149
+ success?: (res: TaroGeneral.CallbackResult) => void
158
150
  }
159
151
  }
152
+
153
+ interface TaroStatic {
154
+ /** 创建 camera 上下文 CameraContext 对象。
155
+ * @supported weapp
156
+ * @example
157
+ * ```tsx
158
+ * const cameraContext = Taro.createCameraContext()
159
+ * ```
160
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/wx.createCameraContext.html
161
+ */
162
+ createCameraContext(): CameraContext
163
+ }
160
164
  }
@@ -1,4 +1,6 @@
1
- declare namespace Taro {
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
2
4
  /** `EditorContext` 实例,可通过 `Taro.createSelectorQuery` 获取。
3
5
  * `EditorContext` 通过 `id` 跟一个 `editor` 组件绑定,操作对应的 `editor` 组件。
4
6
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.html
@@ -115,35 +117,35 @@ declare namespace Taro {
115
117
  namespace EditorContext {
116
118
  interface BlurOption {
117
119
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
118
- complete?: (res: General.CallbackResult) => void
120
+ complete?: (res: TaroGeneral.CallbackResult) => void
119
121
  /** 接口调用失败的回调函数 */
120
- fail?: (res: General.CallbackResult) => void
122
+ fail?: (res: TaroGeneral.CallbackResult) => void
121
123
  /** 接口调用成功的回调函数 */
122
- success?: (res: General.CallbackResult) => void
124
+ success?: (res: TaroGeneral.CallbackResult) => void
123
125
  }
124
126
  interface ClearOption {
125
127
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
126
- complete?: (res: General.CallbackResult) => void
128
+ complete?: (res: TaroGeneral.CallbackResult) => void
127
129
  /** 接口调用失败的回调函数 */
128
- fail?: (res: General.CallbackResult) => void
130
+ fail?: (res: TaroGeneral.CallbackResult) => void
129
131
  /** 接口调用成功的回调函数 */
130
- success?: (res: General.CallbackResult) => void
132
+ success?: (res: TaroGeneral.CallbackResult) => void
131
133
  }
132
134
  interface GetContentsOption {
133
135
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
134
- complete?: (res: General.CallbackResult) => void
136
+ complete?: (res: TaroGeneral.CallbackResult) => void
135
137
  /** 接口调用失败的回调函数 */
136
- fail?: (res: General.CallbackResult) => void
138
+ fail?: (res: TaroGeneral.CallbackResult) => void
137
139
  /** 接口调用成功的回调函数 */
138
- success?: (res: General.CallbackResult) => void
140
+ success?: (res: TaroGeneral.CallbackResult) => void
139
141
  }
140
142
  interface InsertDividerOption {
141
143
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
142
- complete?: (res: General.CallbackResult) => void
144
+ complete?: (res: TaroGeneral.CallbackResult) => void
143
145
  /** 接口调用失败的回调函数 */
144
- fail?: (res: General.CallbackResult) => void
146
+ fail?: (res: TaroGeneral.CallbackResult) => void
145
147
  /** 接口调用成功的回调函数 */
146
- success?: (res: General.CallbackResult) => void
148
+ success?: (res: TaroGeneral.CallbackResult) => void
147
149
  }
148
150
  interface InsertImageOption {
149
151
  /** 图片地址,仅支持 http(s)、base64、云图片(2.8.0)、临时文件(2.8.3)。 */
@@ -151,65 +153,65 @@ declare namespace Taro {
151
153
  /** 图像无法显示时的替代文本 */
152
154
  alt?: string
153
155
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
154
- complete?: (res: General.CallbackResult) => void
156
+ complete?: (res: TaroGeneral.CallbackResult) => void
155
157
  /** data 被序列化为 name=value;name1=value2 的格式挂在属性 data-custom 上 */
156
- data?: General.IAnyObject
158
+ data?: TaroGeneral.IAnyObject
157
159
  /** 添加到图片 img 标签上的类名 */
158
160
  extClass?: string
159
161
  /** 接口调用失败的回调函数 */
160
- fail?: (res: General.CallbackResult) => void
162
+ fail?: (res: TaroGeneral.CallbackResult) => void
161
163
  /** 图片高度 (pixels/百分比) */
162
164
  height?: string
163
165
  /** 接口调用成功的回调函数 */
164
- success?: (res: General.CallbackResult) => void
166
+ success?: (res: TaroGeneral.CallbackResult) => void
165
167
  /** 图片宽度(pixels/百分比) */
166
168
  width?: string
167
169
  }
168
170
  interface InsertTextOption {
169
171
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
170
- complete?: (res: General.CallbackResult) => void
172
+ complete?: (res: TaroGeneral.CallbackResult) => void
171
173
  /** 接口调用失败的回调函数 */
172
- fail?: (res: General.CallbackResult) => void
174
+ fail?: (res: TaroGeneral.CallbackResult) => void
173
175
  /** 接口调用成功的回调函数 */
174
- success?: (res: General.CallbackResult) => void
176
+ success?: (res: TaroGeneral.CallbackResult) => void
175
177
  /** 文本内容 */
176
178
  text?: string
177
179
  }
178
180
  interface RedoOption {
179
181
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
180
- complete?: (res: General.CallbackResult) => void
182
+ complete?: (res: TaroGeneral.CallbackResult) => void
181
183
  /** 接口调用失败的回调函数 */
182
- fail?: (res: General.CallbackResult) => void
184
+ fail?: (res: TaroGeneral.CallbackResult) => void
183
185
  /** 接口调用成功的回调函数 */
184
- success?: (res: General.CallbackResult) => void
186
+ success?: (res: TaroGeneral.CallbackResult) => void
185
187
  }
186
188
  interface RemoveFormatOption {
187
189
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
188
- complete?: (res: General.CallbackResult) => void
190
+ complete?: (res: TaroGeneral.CallbackResult) => void
189
191
  /** 接口调用失败的回调函数 */
190
- fail?: (res: General.CallbackResult) => void
192
+ fail?: (res: TaroGeneral.CallbackResult) => void
191
193
  /** 接口调用成功的回调函数 */
192
- success?: (res: General.CallbackResult) => void
194
+ success?: (res: TaroGeneral.CallbackResult) => void
193
195
  }
194
196
  interface SetContentsOption {
195
197
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
196
- complete?: (res: General.CallbackResult) => void
198
+ complete?: (res: TaroGeneral.CallbackResult) => void
197
199
  /** 表示内容的delta对象 */
198
- delta?: General.IAnyObject
200
+ delta?: TaroGeneral.IAnyObject
199
201
  /** 接口调用失败的回调函数 */
200
- fail?: (res: General.CallbackResult) => void
202
+ fail?: (res: TaroGeneral.CallbackResult) => void
201
203
  /** 带标签的HTML内容 */
202
204
  html?: string
203
205
  /** 接口调用成功的回调函数 */
204
- success?: (res: General.CallbackResult) => void
206
+ success?: (res: TaroGeneral.CallbackResult) => void
205
207
  }
206
208
  interface UndoOption {
207
209
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
208
- complete?: (res: General.CallbackResult) => void
210
+ complete?: (res: TaroGeneral.CallbackResult) => void
209
211
  /** 接口调用失败的回调函数 */
210
- fail?: (res: General.CallbackResult) => void
212
+ fail?: (res: TaroGeneral.CallbackResult) => void
211
213
  /** 接口调用成功的回调函数 */
212
- success?: (res: General.CallbackResult) => void
214
+ success?: (res: TaroGeneral.CallbackResult) => void
213
215
  }
214
216
  }
215
217
  }