@tarojs/taro 3.3.12 → 3.4.0-beta.0
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/ad/index.d.ts +34 -28
- package/types/api/alipay/index.d.ts +11 -7
- package/types/api/base/debug.d.ts +60 -54
- package/types/api/base/env.d.ts +12 -8
- package/types/api/base/index.d.ts +87 -83
- package/types/api/base/system.d.ts +59 -54
- package/types/api/base/update.d.ts +37 -33
- package/types/api/base/weapp/app-event.d.ts +147 -131
- package/types/api/base/weapp/life-cycle.d.ts +14 -10
- package/types/api/canvas/index.d.ts +115 -110
- package/types/api/cloud/index.d.ts +99 -94
- package/types/api/data-analysis/index.d.ts +68 -64
- package/types/api/device/accelerometer.d.ts +57 -50
- package/types/api/device/battery.d.ts +19 -15
- package/types/api/device/ble.d.ts +241 -228
- package/types/api/device/bluetooth.d.ts +207 -194
- package/types/api/device/clipboard.d.ts +48 -43
- package/types/api/device/compass.d.ts +55 -48
- package/types/api/device/contact.d.ts +13 -9
- package/types/api/device/gyroscope.d.ts +41 -35
- package/types/api/device/iBeacon.d.ts +79 -73
- package/types/api/device/motion.d.ts +42 -37
- package/types/api/device/network.d.ts +80 -42
- package/types/api/device/nfc.d.ts +105 -96
- package/types/api/device/performance.d.ts +32 -18
- package/types/api/device/phone.d.ts +20 -15
- package/types/api/device/scan.d.ts +31 -26
- package/types/api/device/screen.d.ts +74 -67
- package/types/api/device/vibrate.d.ts +31 -25
- package/types/api/device/wifi.d.ts +151 -140
- package/types/api/ext/index.d.ts +44 -39
- package/types/api/files/index.d.ts +219 -209
- package/types/api/framework/index.d.ts +25 -20
- package/types/api/location/index.d.ts +140 -136
- package/types/api/media/audio.d.ts +135 -127
- package/types/api/media/background-audio.d.ts +135 -126
- package/types/api/media/camera.d.ts +30 -26
- package/types/api/media/editor.d.ts +35 -33
- package/types/api/media/image.d.ts +161 -150
- package/types/api/media/live.d.ts +88 -82
- package/types/api/media/map.d.ts +47 -43
- package/types/api/media/recorder.d.ts +90 -84
- package/types/api/media/video-processing.d.ts +10 -6
- package/types/api/media/video.d.ts +63 -58
- package/types/api/network/download.d.ts +34 -30
- package/types/api/network/mdns.d.ts +104 -91
- package/types/api/network/request.d.ts +83 -79
- package/types/api/network/udp.d.ts +20 -16
- package/types/api/network/upload.d.ts +60 -56
- package/types/api/network/websocket.d.ts +201 -194
- package/types/api/open-api/account.d.ts +18 -14
- package/types/api/open-api/address.d.ts +27 -23
- package/types/api/open-api/authorize.d.ts +30 -26
- package/types/api/open-api/card.d.ts +55 -51
- package/types/api/open-api/customer-service.d.ts +21 -17
- package/types/api/open-api/facial.d.ts +28 -24
- package/types/api/open-api/invoice.d.ts +38 -34
- package/types/api/open-api/login.d.ts +56 -52
- package/types/api/open-api/navigate.d.ts +79 -75
- package/types/api/open-api/payment.d.ts +34 -30
- package/types/api/open-api/settings.d.ts +49 -45
- package/types/api/open-api/soter.d.ts +92 -86
- package/types/api/open-api/subscribe-message.d.ts +24 -20
- package/types/api/open-api/user-info.d.ts +60 -57
- package/types/api/open-api/werun.d.ts +50 -46
- package/types/api/route/index.d.ts +122 -118
- package/types/api/share/index.d.ts +68 -64
- package/types/api/storage/background-fetch.d.ts +40 -35
- package/types/api/storage/index.d.ts +267 -262
- package/types/api/swan/index.d.ts +47 -42
- package/types/api/ui/animation.d.ts +21 -17
- package/types/api/ui/background.d.ts +38 -34
- package/types/api/ui/custom-component.d.ts +22 -18
- package/types/api/ui/fonts.d.ts +26 -21
- package/types/api/ui/interaction.d.ts +167 -121
- package/types/api/ui/keyboard.d.ts +59 -55
- package/types/api/ui/menu.d.ts +10 -6
- package/types/api/ui/navigation-bar.d.ts +67 -63
- package/types/api/ui/pull-down-refresh.d.ts +33 -29
- package/types/api/ui/scroll.d.ts +30 -26
- package/types/api/ui/sticky.d.ts +22 -19
- package/types/api/ui/tab-bar.d.ts +101 -97
- package/types/api/ui/window.d.ts +24 -18
- package/types/api/worker/index.d.ts +28 -24
- package/types/api/wxml/index.d.ts +42 -38
- package/types/global.d.ts +390 -0
- package/types/index.d.ts +12 -98
- package/types/taro.api.d.ts +94 -0
- package/types/taro.component.d.ts +10 -57
- package/types/taro.config.d.ts +24 -6
- package/types/taro.extend.d.ts +52 -75
- package/types/taro.hooks.d.ts +68 -67
- package/types/taro.lifecycle.d.ts +47 -28
- package/types/api/ad/index.ts +0 -6
- package/types/api/alipay/index.ts +0 -7
- package/types/api/index.d.ts +0 -352
package/types/api/index.d.ts
DELETED
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
declare namespace Taro {
|
|
2
|
-
namespace General {
|
|
3
|
-
type IAnyObject = Record<string, any>
|
|
4
|
-
type Optional<F> = F extends (arg: infer P) => infer R ? (arg?: P) => R : F
|
|
5
|
-
type OptionalInterface<T> = { [K in keyof T]: Optional<T[K]> }
|
|
6
|
-
/** 事件监听函数 */
|
|
7
|
-
type EventCallback = (
|
|
8
|
-
/** 触发事件参数 */
|
|
9
|
-
...args: any
|
|
10
|
-
) => void
|
|
11
|
-
/** 通用错误 */
|
|
12
|
-
interface CallbackResult {
|
|
13
|
-
/** 错误信息 */
|
|
14
|
-
errMsg: string
|
|
15
|
-
}
|
|
16
|
-
type CommonEventFunction<T = any> = (event: BaseEventOrig<T>) => any
|
|
17
|
-
interface BaseEventOrig<T> {
|
|
18
|
-
/** 事件类型 */
|
|
19
|
-
type: string
|
|
20
|
-
|
|
21
|
-
/** 事件生成时的时间戳 */
|
|
22
|
-
timeStamp: number
|
|
23
|
-
|
|
24
|
-
/** 触发事件的组件的一些属性值集合 */
|
|
25
|
-
target: Target
|
|
26
|
-
|
|
27
|
-
/** 当前组件的一些属性值集合 */
|
|
28
|
-
currentTarget: currentTarget
|
|
29
|
-
|
|
30
|
-
/** 额外的信息 */
|
|
31
|
-
detail: T
|
|
32
|
-
|
|
33
|
-
/** 阻止元素发生默认的行为 */
|
|
34
|
-
preventDefault: () => void
|
|
35
|
-
|
|
36
|
-
/** 阻止事件冒泡到父元素,阻止任何父事件处理程序被执行 */
|
|
37
|
-
stopPropagation: () => void
|
|
38
|
-
}
|
|
39
|
-
interface currentTarget extends Target {}
|
|
40
|
-
interface Target {
|
|
41
|
-
/** 事件源组件的id */
|
|
42
|
-
id: string
|
|
43
|
-
/** 当前组件的类型 */
|
|
44
|
-
tagName: string
|
|
45
|
-
/** 事件源组件上由data-开头的自定义属性组成的集合 */
|
|
46
|
-
dataset: {
|
|
47
|
-
[key: string]: any
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
/** 蓝牙错误 */
|
|
51
|
-
interface BluetoothError extends General.CallbackResult {
|
|
52
|
-
/** 错误信息 */
|
|
53
|
-
errMsg: string
|
|
54
|
-
/** 错误码 */
|
|
55
|
-
errCode: keyof BluetoothErrCode
|
|
56
|
-
}
|
|
57
|
-
/** WIFI 错误 */
|
|
58
|
-
interface WifiError extends General.CallbackResult {
|
|
59
|
-
/** 错误信息 */
|
|
60
|
-
errMsg: string
|
|
61
|
-
/** 错误码 */
|
|
62
|
-
errCode: keyof WifiErrCode
|
|
63
|
-
}
|
|
64
|
-
/** NFC 错误 */
|
|
65
|
-
interface NFCError extends General.CallbackResult {
|
|
66
|
-
/** 错误信息 */
|
|
67
|
-
errMsg: string
|
|
68
|
-
/** 错误码 */
|
|
69
|
-
errCode: keyof NFCErrCode
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/** iBeacon 错误 */
|
|
73
|
-
interface IBeaconError extends General.CallbackResult {
|
|
74
|
-
/** 错误信息 */
|
|
75
|
-
errMsg: string
|
|
76
|
-
/** 错误码 */
|
|
77
|
-
errCode: keyof IBeaconErrCode
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/** 在竖屏正方向下的安全区域 */
|
|
81
|
-
interface SafeAreaResult {
|
|
82
|
-
/** 安全区域右下角纵坐标 */
|
|
83
|
-
bottom: number
|
|
84
|
-
/** 安全区域的高度,单位逻辑像素 */
|
|
85
|
-
height: number
|
|
86
|
-
/** 安全区域左上角横坐标 */
|
|
87
|
-
left: number
|
|
88
|
-
/** 安全区域右下角横坐标 */
|
|
89
|
-
right: number
|
|
90
|
-
/** 安全区域左上角纵坐标 */
|
|
91
|
-
top: number
|
|
92
|
-
/** 安全区域的宽度,单位逻辑像素 */
|
|
93
|
-
width: number
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* 广告错误码
|
|
97
|
-
*
|
|
98
|
-
* 错误码是通过onError获取到的错误信息。调试期间,可以通过异常返回来捕获信息。
|
|
99
|
-
* 在小程序发布上线之后,如果遇到异常问题,可以在[“运维中心“](https://mp.weixin.qq.com/)里面搜寻错误日志,还可以针对异常返回加上适当的监控信息。
|
|
100
|
-
*/
|
|
101
|
-
interface AdErrCode {
|
|
102
|
-
/**
|
|
103
|
-
* @abnormal 后端接口调用失败
|
|
104
|
-
* @reason 该项错误不是开发者的异常情况
|
|
105
|
-
* @solution 一般情况下忽略一段时间即可恢复。
|
|
106
|
-
*/
|
|
107
|
-
1000
|
|
108
|
-
/**
|
|
109
|
-
* @abnormal 参数错误
|
|
110
|
-
* @reason 使用方法错误
|
|
111
|
-
* @solution 可以前往 developers.weixin.qq.com 确认具体教程(小程序和小游戏分别有各自的教程,可以在顶部选项中,“设计”一栏的右侧进行切换。
|
|
112
|
-
*/
|
|
113
|
-
1001
|
|
114
|
-
/**
|
|
115
|
-
* @abnormal 广告单元无效
|
|
116
|
-
* @reason 可能是拼写错误、或者误用了其他APP的广告ID
|
|
117
|
-
* @solution 请重新前往 mp.weixin.qq.com 确认广告位ID。
|
|
118
|
-
*/
|
|
119
|
-
1002
|
|
120
|
-
/**
|
|
121
|
-
* @abnormal 内部错误
|
|
122
|
-
* @reason 该项错误不是开发者的异常情况
|
|
123
|
-
* @solution 一般情况下忽略一段时间即可恢复。
|
|
124
|
-
*/
|
|
125
|
-
1003
|
|
126
|
-
/**
|
|
127
|
-
* @abnormal 无合适的广告
|
|
128
|
-
* @reason 广告不是每一次都会出现,这次没有出现可能是由于该用户不适合浏览广告
|
|
129
|
-
* @solution 属于正常情况,且开发者需要针对这种情况做形态上的兼容。
|
|
130
|
-
*/
|
|
131
|
-
1004
|
|
132
|
-
/**
|
|
133
|
-
* @abnormal 广告组件审核中
|
|
134
|
-
* @reason 你的广告正在被审核,无法展现广告
|
|
135
|
-
* @solution 请前往 mp.weixin.qq.com 确认审核状态,且开发者需要针对这种情况做形态上的兼容。
|
|
136
|
-
*/
|
|
137
|
-
1005
|
|
138
|
-
/**
|
|
139
|
-
* @abnormal 广告组件被驳回
|
|
140
|
-
* @reason 你的广告审核失败,无法展现广告
|
|
141
|
-
* @solution 请前往 mp.weixin.qq.com 确认审核状态,且开发者需要针对这种情况做形态上的兼容。
|
|
142
|
-
*/
|
|
143
|
-
1006
|
|
144
|
-
/**
|
|
145
|
-
* @abnormal 广告组件被封禁
|
|
146
|
-
* @reason 你的广告能力已经被封禁,封禁期间无法展现广告
|
|
147
|
-
* @solution 请前往 mp.weixin.qq.com 确认小程序广告封禁状态。
|
|
148
|
-
*/
|
|
149
|
-
1007
|
|
150
|
-
/**
|
|
151
|
-
* @abnormal 广告单元已关闭
|
|
152
|
-
* @reason 该广告位的广告能力已经被关闭
|
|
153
|
-
* @solution 请前往 mp.weixin.qq.com 重新打开对应广告位的展现。
|
|
154
|
-
*/
|
|
155
|
-
1008
|
|
156
|
-
// [key: number]: string
|
|
157
|
-
}
|
|
158
|
-
/** 蓝牙错误码 */
|
|
159
|
-
interface BluetoothErrCode {
|
|
160
|
-
/** 正常
|
|
161
|
-
* @abnormal ok
|
|
162
|
-
*/
|
|
163
|
-
0
|
|
164
|
-
/** 未初始化蓝牙适配器
|
|
165
|
-
* @abnormal not init
|
|
166
|
-
*/
|
|
167
|
-
10000
|
|
168
|
-
/** 当前蓝牙适配器不可用
|
|
169
|
-
* @abnormal not available
|
|
170
|
-
*/
|
|
171
|
-
10001
|
|
172
|
-
/** 没有找到指定设备
|
|
173
|
-
* @abnormal no device
|
|
174
|
-
*/
|
|
175
|
-
10002
|
|
176
|
-
/** 连接失败
|
|
177
|
-
* @abnormal connection fail
|
|
178
|
-
*/
|
|
179
|
-
10003
|
|
180
|
-
/** 没有找到指定服务
|
|
181
|
-
* @abnormal no service
|
|
182
|
-
*/
|
|
183
|
-
10004
|
|
184
|
-
/** 没有找到指定特征值
|
|
185
|
-
* @abnormal no characteristic
|
|
186
|
-
*/
|
|
187
|
-
10005
|
|
188
|
-
/** 当前连接已断开
|
|
189
|
-
* @abnormal no connection
|
|
190
|
-
*/
|
|
191
|
-
10006
|
|
192
|
-
/** 当前特征值不支持此操作
|
|
193
|
-
* @abnormal property not support
|
|
194
|
-
*/
|
|
195
|
-
10007
|
|
196
|
-
/** 其余所有系统上报的异常
|
|
197
|
-
* @abnormal system error
|
|
198
|
-
*/
|
|
199
|
-
10008
|
|
200
|
-
/** Android 系统特有,系统版本低于 4.3 不支持 BLE
|
|
201
|
-
* @abnormal system not support
|
|
202
|
-
*/
|
|
203
|
-
10009
|
|
204
|
-
/** 连接超时
|
|
205
|
-
* @abnormal operate time out
|
|
206
|
-
*/
|
|
207
|
-
10012
|
|
208
|
-
/** 连接 deviceId 为空或者是格式不正确
|
|
209
|
-
* @abnormal invalid_data
|
|
210
|
-
*/
|
|
211
|
-
10013
|
|
212
|
-
}
|
|
213
|
-
/** iBeacon 错误码 */
|
|
214
|
-
interface IBeaconErrCode {
|
|
215
|
-
/** 正常
|
|
216
|
-
* @abnormal ok
|
|
217
|
-
*/
|
|
218
|
-
0
|
|
219
|
-
/** 系统或设备不支持
|
|
220
|
-
* @abnormal unsupport
|
|
221
|
-
*/
|
|
222
|
-
11000
|
|
223
|
-
/** 蓝牙服务不可用
|
|
224
|
-
* @abnormal bluetooth service unavailable
|
|
225
|
-
*/
|
|
226
|
-
11001
|
|
227
|
-
/** 位置服务不可用
|
|
228
|
-
* @abnormal location service unavailable
|
|
229
|
-
*/
|
|
230
|
-
11002
|
|
231
|
-
/** 已经开始搜索
|
|
232
|
-
* @abnormal already start
|
|
233
|
-
*/
|
|
234
|
-
11003
|
|
235
|
-
/** 还未开始搜索
|
|
236
|
-
* @abnormal not startBeaconDiscovery
|
|
237
|
-
*/
|
|
238
|
-
11004
|
|
239
|
-
/** 系统错误
|
|
240
|
-
* @abnormal system error
|
|
241
|
-
*/
|
|
242
|
-
11005
|
|
243
|
-
/** 参数不正确
|
|
244
|
-
* @abnormal invalid data
|
|
245
|
-
*/
|
|
246
|
-
11006
|
|
247
|
-
}
|
|
248
|
-
/** WIFI 错误码 */
|
|
249
|
-
interface WifiErrCode {
|
|
250
|
-
/** 正常
|
|
251
|
-
* @abnormal ok
|
|
252
|
-
*/
|
|
253
|
-
0
|
|
254
|
-
/** 未先调用 `startWifi` 接口
|
|
255
|
-
* @abnormal not init
|
|
256
|
-
*/
|
|
257
|
-
12000
|
|
258
|
-
/** 当前系统不支持相关能力
|
|
259
|
-
* @abnormal system not support
|
|
260
|
-
*/
|
|
261
|
-
12001
|
|
262
|
-
/** 密码错误
|
|
263
|
-
* @abnormal password error Wi-Fi
|
|
264
|
-
*/
|
|
265
|
-
12002
|
|
266
|
-
/** 连接超时
|
|
267
|
-
* @abnormal connection timeout
|
|
268
|
-
*/
|
|
269
|
-
12003
|
|
270
|
-
/** 重复连接 Wi-Fi
|
|
271
|
-
* @abnormal duplicate request
|
|
272
|
-
*/
|
|
273
|
-
12004
|
|
274
|
-
/** Android 特有,未打开 Wi-Fi 开关
|
|
275
|
-
* @abnormal wifi not turned on
|
|
276
|
-
*/
|
|
277
|
-
12005
|
|
278
|
-
/** Android 特有,未打开 GPS 定位开关
|
|
279
|
-
* @abnormal wifi not turned on
|
|
280
|
-
*/
|
|
281
|
-
12006
|
|
282
|
-
/** 用户拒绝授权链接 Wi-Fi
|
|
283
|
-
* @abnormal user denied
|
|
284
|
-
*/
|
|
285
|
-
12007
|
|
286
|
-
/** 无效 SSID
|
|
287
|
-
* @abnormal invalid SSID
|
|
288
|
-
*/
|
|
289
|
-
12008
|
|
290
|
-
/** 系统运营商配置拒绝连接 Wi-Fi
|
|
291
|
-
* @abnormal system config err
|
|
292
|
-
*/
|
|
293
|
-
12009
|
|
294
|
-
/** 系统其他错误,需要在 errmsg 打印具体的错误原因
|
|
295
|
-
* @abnormal system internal error
|
|
296
|
-
*/
|
|
297
|
-
12010
|
|
298
|
-
/** 应用在后台无法配置 Wi-Fi
|
|
299
|
-
* @abnormal weapp in background
|
|
300
|
-
*/
|
|
301
|
-
12011
|
|
302
|
-
/** 系统保存的 Wi-Fi 配置过期,建议忘记 Wi-Fi 后重试
|
|
303
|
-
* @abnormal wifi config may be expired
|
|
304
|
-
*/
|
|
305
|
-
12013
|
|
306
|
-
}
|
|
307
|
-
/** NFC 错误码 */
|
|
308
|
-
interface NFCErrCode {
|
|
309
|
-
/** 正常
|
|
310
|
-
* @abnormal ok
|
|
311
|
-
*/
|
|
312
|
-
0
|
|
313
|
-
/** 当前设备不支持NFC */
|
|
314
|
-
13000
|
|
315
|
-
/** 当前设备支持NFC,但系统NFC开关未开启 */
|
|
316
|
-
13001
|
|
317
|
-
/** 当前设备支持NFC,但不支持HCE */
|
|
318
|
-
13002
|
|
319
|
-
/** AID列表参数格式错误 */
|
|
320
|
-
13003
|
|
321
|
-
/** 未设置微信为默认NFC支付应用 */
|
|
322
|
-
13004
|
|
323
|
-
/** 返回的指令不合法 */
|
|
324
|
-
13005
|
|
325
|
-
/** 注册AID失败 */
|
|
326
|
-
13006
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
/** 启动参数 */
|
|
330
|
-
interface LaunchOptionsApp {
|
|
331
|
-
/** 启动小程序的路径 */
|
|
332
|
-
path: string
|
|
333
|
-
/** 启动小程序的 query 参数 */
|
|
334
|
-
query: IAnyObject
|
|
335
|
-
/** 来源信息。从另一个小程序、公众号或 App 进入小程序时返回。否则返回 `{}`。(参见后文注意) */
|
|
336
|
-
referrerInfo: LaunchOptionsApp.ReferrerInfo
|
|
337
|
-
/** 启动小程序的[场景值](https://developers.weixin.qq.com/miniprogram/dev/framework/app-service/scene.html) */
|
|
338
|
-
scene: number
|
|
339
|
-
/** shareTicket,详见[获取更多转发信息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) */
|
|
340
|
-
shareTicket: string
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
namespace LaunchOptionsApp {
|
|
344
|
-
interface ReferrerInfo {
|
|
345
|
-
/** 来源小程序、公众号或 App 的 appId */
|
|
346
|
-
appId: string
|
|
347
|
-
/** 来源小程序传过来的数据,scene=1037或1038时支持 */
|
|
348
|
-
extraData: IAnyObject
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
}
|