@tarojs/components 3.5.5 → 3.5.6

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 (73) hide show
  1. package/dist/cjs/taro-input-core.cjs.entry.js +24 -3
  2. package/dist/cjs/taro-video-control_3.cjs.entry.js +21 -3
  3. package/dist/collection/components/input/input.js +24 -3
  4. package/dist/collection/components/video/video.js +23 -3
  5. package/dist/collection/utils/json-schema-to-types.js +224 -0
  6. package/dist/esm/taro-input-core.entry.js +24 -3
  7. package/dist/esm/taro-video-control_3.entry.js +21 -3
  8. package/dist/esm-es5/taro-input-core.entry.js +1 -1
  9. package/dist/esm-es5/taro-video-control_3.entry.js +1 -1
  10. package/dist/taro-components/p-0380841f.system.js +1 -1
  11. package/dist/taro-components/p-232ebfae.system.entry.js +1 -0
  12. package/dist/taro-components/{p-7e8943d8.entry.js → p-3744e978.entry.js} +1 -1
  13. package/dist/taro-components/p-56c86512.entry.js +1 -0
  14. package/dist/taro-components/{p-ed8c1bb8.system.entry.js → p-f81a74bb.system.entry.js} +1 -1
  15. package/dist/taro-components/taro-components.esm.js +1 -1
  16. package/dist/types/components/input/input.d.ts +1 -0
  17. package/dist/types/utils/json-schema-to-types.d.ts +25 -0
  18. package/dist-h5/react/components/index.js +5 -5
  19. package/package.json +9 -5
  20. package/types/Ad.d.ts +99 -9
  21. package/types/AdCustom.d.ts +1 -3
  22. package/types/Audio.d.ts +16 -16
  23. package/types/Block.d.ts +0 -2
  24. package/types/Button.d.ts +187 -47
  25. package/types/Camera.d.ts +20 -18
  26. package/types/Canvas.d.ts +52 -13
  27. package/types/Checkbox.d.ts +13 -10
  28. package/types/CheckboxGroup.d.ts +5 -7
  29. package/types/CoverImage.d.ts +44 -5
  30. package/types/CoverView.d.ts +34 -10
  31. package/types/Editor.d.ts +4 -6
  32. package/types/Form.d.ts +23 -7
  33. package/types/FunctionalPageNavigator.d.ts +5 -3
  34. package/types/Icon.d.ts +19 -7
  35. package/types/Image.d.ts +71 -14
  36. package/types/Input.d.ts +44 -33
  37. package/types/Label.d.ts +0 -3
  38. package/types/LivePlayer.d.ts +80 -24
  39. package/types/LivePusher.d.ts +78 -37
  40. package/types/Map.d.ts +208 -66
  41. package/types/MatchMedia.d.ts +8 -10
  42. package/types/MovableArea.d.ts +1 -3
  43. package/types/MovableView.d.ts +88 -30
  44. package/types/NavigationBar.d.ts +0 -2
  45. package/types/Navigator.d.ts +35 -18
  46. package/types/OfficialAccount.d.ts +10 -3
  47. package/types/OpenData.d.ts +35 -6
  48. package/types/PageContainer.d.ts +13 -10
  49. package/types/PageMeta.d.ts +27 -13
  50. package/types/Picker.d.ts +50 -14
  51. package/types/PickerView.d.ts +31 -13
  52. package/types/PickerViewColumn.d.ts +0 -2
  53. package/types/Progress.d.ts +17 -14
  54. package/types/Radio.d.ts +16 -6
  55. package/types/RadioGroup.d.ts +6 -4
  56. package/types/RichText.d.ts +53 -5
  57. package/types/RootPortal.d.ts +2 -1
  58. package/types/ScrollView.d.ts +82 -19
  59. package/types/ShareElement.d.ts +5 -7
  60. package/types/Slider.d.ts +41 -17
  61. package/types/Swiper.d.ts +100 -22
  62. package/types/SwiperItem.d.ts +6 -3
  63. package/types/Switch.d.ts +22 -8
  64. package/types/Text.d.ts +10 -6
  65. package/types/Textarea.d.ts +61 -28
  66. package/types/Video.d.ts +331 -50
  67. package/types/View.d.ts +122 -9
  68. package/types/VoipRoom.d.ts +6 -9
  69. package/types/WebView.d.ts +9 -7
  70. package/types/common.d.ts +1 -1
  71. package/types/index.vue3.d.ts +261 -138
  72. package/dist/taro-components/p-1b356f4d.entry.js +0 -1
  73. package/dist/taro-components/p-a39276ff.system.entry.js +0 -1
package/types/Button.d.ts CHANGED
@@ -1,51 +1,50 @@
1
1
  import { ComponentType } from 'react'
2
2
  import { StandardProps, CommonEventFunction } from './common'
3
3
  import { StyleProp, ViewStyle } from 'react-native'
4
-
5
4
  interface ButtonProps extends StandardProps {
6
5
  /** 按钮的大小
7
- * @supported weapp, h5, rn, alipay, tt
6
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
8
7
  * @default default
9
8
  */
10
9
  size?: keyof ButtonProps.Size
11
10
 
12
11
  /** 按钮的样式类型
13
- * @supported weapp, h5, rn, alipay, tt
12
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
14
13
  * @default default
15
14
  */
16
15
  type?: keyof ButtonProps.Type
17
16
 
18
17
  /** 按钮是否镂空,背景色透明
19
- * @supported weapp, h5, rn, alipay
18
+ * @supported weapp, alipay, swan, qq, jd, h5, rn
20
19
  * @default false
21
20
  */
22
21
  plain?: boolean
23
22
 
24
23
  /** 是否禁用
25
- * @supported weapp, h5, rn, alipay, tt
24
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
26
25
  * @default false
27
26
  */
28
27
  disabled?: boolean
29
28
 
30
29
  /** 名称前是否带 loading 图标
31
- * @supported weapp, h5, rn, alipay, tt
30
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
32
31
  * @default false
33
32
  */
34
33
  loading?: boolean
35
34
 
36
35
  /** 用于 `<form/>` 组件,点击分别会触发 `<form/>` 组件的 submit/reset 事件
37
- * @supported weapp, alipay, tt
36
+ * @supported weapp, alipay, swan, tt, qq, jd
38
37
  */
39
38
  formType?: keyof ButtonProps.FormType
40
39
 
41
40
  /** 微信开放能力
42
- * @supported weapp, alipay, qq, tt
41
+ * @supported weapp, alipay, swan, tt, qq, jd
43
42
  */
44
43
  openType?: ButtonProps.OpenType
45
44
 
46
45
  /** 指定按下去的样式类。当 `hover-class="none"` 时,没有点击态效果
47
46
  * @default button-hover
48
- * @supported weapp, alipay, h5, tt
47
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
49
48
  * @rn 支持 hoverStyle 属性,但框架未支持 hoverClass
50
49
  */
51
50
  hoverClass?: string
@@ -58,26 +57,26 @@ interface ButtonProps extends StandardProps {
58
57
 
59
58
  /** 指定是否阻止本节点的祖先节点出现点击态
60
59
  * @default false
61
- * @supported weapp, alipay, tt
60
+ * @supported weapp, alipay, swan, tt, qq, jd
62
61
  */
63
62
  hoverStopPropagation?: boolean
64
63
 
65
64
  /** 按住后多久出现点击态,单位毫秒
66
65
  * @default 20
67
- * @supported weapp, alipay, h5, rn, tt
66
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
68
67
  */
69
68
  hoverStartTime?: number
70
69
 
71
70
  /** 手指松开后点击态保留时间,单位毫秒
72
71
  * @default 70
73
- * @supported weapp, alipay, h5, rn, tt
72
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
74
73
  */
75
74
  hoverStayTime?: number
76
75
 
77
76
  /** 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。
78
77
  *
79
78
  * 生效时机: `open-type="getUserInfo"`
80
- * @supported weapp
79
+ * @supported weapp, qq, jd
81
80
  */
82
81
  lang?: keyof ButtonProps.Lang
83
82
 
@@ -115,21 +114,14 @@ interface ButtonProps extends StandardProps {
115
114
  /** 打开 APP 时,向 APP 传递的参数
116
115
  *
117
116
  * 生效时机:`open-type="launchApp"`
118
- * @supported weapp, qq
117
+ * @supported weapp, qq, jd
119
118
  */
120
119
  appParameter?: string
121
120
 
122
- /** 微信小程序子商户能力中,添加 business-id 字段指向子商户
123
- *
124
- * 生效时机:`open-type="contact"`
125
- * @supported weapp
126
- */
127
- businessId?: string
128
-
129
121
  /** 支付宝小程序 scope
130
122
  *
131
123
  * 生效时机:`open-type="getAuthorize"`
132
- * @supported weapp
124
+ * @supported alipay
133
125
  */
134
126
  scope?: 'userInfo' | 'phoneNumber'
135
127
 
@@ -143,7 +135,7 @@ interface ButtonProps extends StandardProps {
143
135
  /** 用户点击该按钮时,会返回获取到的用户信息,回调的detail数据与 Taro.getUserInfo 返回的一致
144
136
  *
145
137
  * 生效时机: `open-type="getUserInfo"`
146
- * @supported weapp
138
+ * @supported weapp, swan, qq, jd
147
139
  */
148
140
  onGetUserInfo?: CommonEventFunction<ButtonProps.onGetUserInfoEventDetail>
149
141
 
@@ -157,43 +149,35 @@ interface ButtonProps extends StandardProps {
157
149
  /** 客服消息回调
158
150
  *
159
151
  * 生效时机:`open-type="contact"`
160
- * @supported weapp
152
+ * @supported weapp, swan, qq
161
153
  */
162
154
  onContact?: CommonEventFunction<ButtonProps.onContactEventDetail>
163
155
 
164
156
  /** 获取用户手机号回调
165
157
  *
166
158
  * 生效时机:`open-type="getphonenumber"`
167
- * @supported weapp, tt
159
+ * @supported weapp, swan, tt, jd
168
160
  */
169
161
  onGetPhoneNumber?: CommonEventFunction<ButtonProps.onGetPhoneNumberEventDetail>
170
162
 
171
- /** 获取用户实名
172
- *
173
- * 生效时机:`open-type="getRealnameAuthInfo"`
174
- * @deprecated
175
- * @supported weapp
176
- */
177
- onGetRealNameAuthInfo?: CommonEventFunction
178
-
179
163
  /** 当使用开放能力时,发生错误的回调
180
164
  *
181
165
  * 生效时机:`open-type="launchApp"`
182
- * @supported weapp
166
+ * @supported weapp, alipay, qq, jd
183
167
  */
184
168
  onError?: CommonEventFunction
185
169
 
186
170
  /** 在打开授权设置页后回调
187
171
  *
188
172
  * 生效时机:`open-type="openSetting"`
189
- * @supported weapp
173
+ * @supported weapp, swan, qq, jd
190
174
  */
191
175
  onOpenSetting?: CommonEventFunction<ButtonProps.onOpenSettingEventDetail>
192
176
 
193
177
  /** 打开 APP 成功的回调
194
178
  *
195
179
  * 生效时机:`open-type="launchApp"`
196
- * @supported weapp
180
+ * @supported weapp, qq
197
181
  */
198
182
  onLaunchApp?: CommonEventFunction
199
183
 
@@ -203,34 +187,155 @@ interface ButtonProps extends StandardProps {
203
187
  * @supported weapp
204
188
  */
205
189
  onChooseAvatar?: CommonEventFunction
206
- }
207
190
 
191
+ /** 点击。
192
+ * 说明: 每点击一次会触发一次事件,建议自行使用代码防止重复点击,可以使用 js 防抖和节流实现。
193
+ * @supported alipay
194
+ */
195
+ onTap?: CommonEventFunction
196
+
197
+ /** 生活号 id,必须是当前小程序同主体且已关联的生活号,open-type="lifestyle" 时有效。
198
+ * @supported alipay, qq
199
+ */
200
+ publicId?: string
201
+
202
+ /** 当 open-type 为 lifestyle 时有效。
203
+ * 当点击按钮时触发。
204
+ * event.detail = { followStatus },followStatus 合法值有 1、2、3,其中 1 表示已关注。2 表示用户不允许关注。3 表示发生未知错误;
205
+ * 已知问题:基础库 1.0,当用户在点击按钮前已关注生活号,event.detail.followStatus 的值为 true。
206
+ * 版本要求:基础库 1.11.0 及以上
207
+ * @supported alipay
208
+ */
209
+ onFollowLifestyle?: CommonEventFunction<{
210
+ followStatus: 1 | 2 | 3 | true
211
+ }>
212
+
213
+ /** 发送订阅类模板消息所用的模板库标题 ID ,可通过 getTemplateLibraryList 获取
214
+ * 当参数类型为 Array 时,可传递 1~3 个模板库标题 ID
215
+ * @supported swan
216
+ */
217
+ templateId?: string | Array<string>
218
+
219
+ /** 发送订阅类模板消息时所使用的唯一标识符,内容由开发者自定义,用来标识订阅场景
220
+ * 注意:同一用户在同一 subscribe-id 下的多次授权不累积下发权限,只能下发一条。若要订阅多条,需要不同 subscribe-id
221
+ * @supported swan
222
+ */
223
+ subscribeId?: string
224
+
225
+ /** 用户点击该按钮时,调起用户编辑收货地址原生界面,并在编辑完成后返回用户选择的地址,从返回参数的 detail 中获取,和 swan.chooseAddress 一样的。和 open-type 搭配使用,使用时机:open-type="chooseAddress"
226
+ * @supported swan
227
+ */
228
+ onChooseAddress?: CommonEventFunction
229
+
230
+ /** 用户点击该按钮时,选择用户的发票抬头,和 swan.chooseInvoiceTitle 一样的。和 open-type 搭配使用,使用时机:open-type="chooseInvoiceTitle"
231
+ * @supported swan
232
+ */
233
+ onChooseInvoiceTitle?: CommonEventFunction
234
+
235
+ /** 登录回调,和 open-type 搭配使用,使用时机:open-type="login"。可以通过返回参数的 detail 判断是否登录成功,当 errMsg 为'login:ok'时即为成功。如想获取登录凭证请使用 swan.getLoginCode
236
+ * @supported swan
237
+ */
238
+ onLogin?: CommonEventFunction
239
+
240
+ /** 订阅消息授权回调,和 open-type 搭配使用,使用时机:open-type="subscribe"
241
+ * @supported swan
242
+ */
243
+ onSubscribe?: CommonEventFunction
244
+
245
+ /** 打开群资料卡时,传递的群号
246
+ * @supported qq
247
+ */
248
+ groupId?: string
249
+
250
+ /** 打开频道页面时,传递的频道号
251
+ * @supported qq
252
+ */
253
+ guildId?: string
254
+
255
+ /** 分享类型集合,请参考下面share-type有效值说明。share-type后续将不再维护,请更新为share-mode
256
+ * @supported qq
257
+ * @default 27
258
+ */
259
+ shareType?: string
260
+
261
+ /** 分享类型集合,请参考下面share-mode有效值说明
262
+ * @supported qq
263
+ * @default ['qq', 'qzone']
264
+ */
265
+ shareMode?: string
266
+
267
+ /** 无障碍访问,(属性)元素的额外描述
268
+ * @supported qq
269
+ */
270
+ ariaLabel?: string
271
+
272
+ /** 添加好友时,对方的 openid
273
+ * @supported qq
274
+ */
275
+ openId?: string
276
+
277
+ /** 发送对象的 FriendInfo
278
+ * @supported qq
279
+ */
280
+ shareMessageFriendInfo?: string
281
+
282
+ /** 转发标题,不传则默认使用当前小程序的昵称。 FriendInfo
283
+ * @supported qq
284
+ */
285
+ shareMessageTitle?: string
286
+
287
+ /** 转发显示图片的链接,可以是网络图片路径(仅 QQ CDN 域名路径)或本地图片文件路径或相对代码包根目录的图片文件路径。显示图片长宽比是 5:4FriendInfo
288
+ * @supported qq
289
+ */
290
+ shareMessageImg?: string
291
+
292
+ /** 添加好友的回调
293
+ * @supported qq
294
+ */
295
+ onAddFriend?: CommonEventFunction
296
+
297
+ /** 添加群应用的回调。errCode 错误码:41004(当前用户非管理员或群主,无权操作),41005(超过可添加群应用的群数量)
298
+ * @supported qq
299
+ */
300
+ onAddGroupApp?: CommonEventFunction
301
+ }
208
302
  declare namespace ButtonProps {
209
303
  /** size 的合法值 */
210
304
  interface Size {
211
305
  /** 默认大小 */
212
306
  default
307
+
213
308
  /** 小尺寸 */
214
309
  mini
215
310
  }
311
+
216
312
  /** type 的合法值 */
217
313
  interface Type {
218
314
  /** 绿色 */
219
315
  primary
316
+
220
317
  /** 白色 */
221
318
  default
319
+
222
320
  /** 红色 */
223
321
  warn
224
322
  }
323
+
225
324
  /** form-type 的合法值 */
226
325
  interface FormType {
227
326
  /** 提交表单 */
228
327
  submit
328
+
229
329
  /** 重置表单 */
230
330
  reset
231
331
  }
332
+
232
333
  /** open-type 的合法值 */
233
- type OpenType = keyof openTypeKeys["weapp"] | keyof openTypeKeys["alipay"] | keyof openTypeKeys["qq"]
334
+ type OpenType =
335
+ | keyof openTypeKeys['weapp']
336
+ | keyof openTypeKeys['alipay']
337
+ | keyof openTypeKeys['qq']
338
+
234
339
  /** open-type 的合法值 */
235
340
  interface openTypeKeys {
236
341
  weapp: {
@@ -238,44 +343,52 @@ declare namespace ButtonProps {
238
343
  * @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/customer-message/customer-message.html
239
344
  */
240
345
  contact
346
+
241
347
  /** 触发用户转发,使用前建议先阅读使用指引
242
348
  * @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html#%E4%BD%BF%E7%94%A8%E6%8C%87%E5%BC%95
243
349
  */
244
350
  share
351
+
245
352
  /** 获取用户手机号,可以从回调中获取到用户信息
246
353
  * @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html
247
354
  */
248
355
  getPhoneNumber
356
+
249
357
  /** 获取用户信息,可以从回调中获取到用户信息 */
250
358
  getUserInfo
251
- /** 用户实名信息授权
252
- * @deprecated
253
- */
254
- getRealNameAuthInfo
359
+
255
360
  /** 打开APP,可以通过 app-parameter 属性设定向APP传的参数
256
361
  * @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/launchApp.html
257
362
  */
258
363
  launchApp
364
+
259
365
  /** 打开授权设置页 */
260
366
  openSetting
367
+
261
368
  /** 打开“意见反馈”页面,用户可提交反馈内容并上传日志,开发者可以登录小程序管理后台后进入左侧菜单“客服反馈”页面获取到反馈内容 */
262
369
  feedback
370
+
263
371
  /** 获取用户头像,可以从回调中获得具体信息 */
264
372
  chooseAvatar
265
373
  }
374
+
266
375
  /** 支付宝小程序专属的 open-type 合法值
267
376
  * @see https://opendocs.alipay.com/mini/component/button
268
377
  */
269
378
  alipay: {
270
379
  /** 触发 自定义分享 */
271
380
  share
381
+
272
382
  /** 支持小程序授权 */
273
383
  getAuthorize
384
+
274
385
  /** 分享到通讯录好友 */
275
386
  contactShare
387
+
276
388
  /** 关注生活号 */
277
389
  lifestyle
278
390
  }
391
+
279
392
  /** QQ 小程序专属的 open-type 合法值
280
393
  * @see https://q.qq.com/wiki/develop/miniprogram/component/form/button.html
281
394
  */
@@ -284,65 +397,88 @@ declare namespace ButtonProps {
284
397
  * @see https://q.qq.com/wiki/develop/miniprogram/frame/open_ability/open_share.html#%E8%BD%AC%E5%8F%91-2
285
398
  */
286
399
  share
400
+
287
401
  /** 获取用户信息,可以从 onGetUserInfo 回调中获取到用户信息 */
288
402
  getUserInfo
403
+
289
404
  /** 打开APP,可以通过 app-parameter 属性设定向APP传的参数
290
405
  * @see https://q.qq.com/wiki/develop/miniprogram/frame/open_ability/open_app.html
291
406
  */
292
407
  launchApp
408
+
293
409
  /** 打开授权设置页 */
294
410
  openSetting
411
+
295
412
  /** 呼起吐个槽反馈页面,开发者可以到官网查看反馈 */
296
413
  feedback
414
+
297
415
  /** 呼起群资料卡页面,可以通过 group-id 属性设定需要打开的群资料卡的群号,同时 app.json 中必须配置 groupIdList(数量不超过 10 个),表明可以打开群资料卡的群号 */
298
416
  openGroupProfile
417
+
299
418
  /** 添加好友,对方需要通过该小程序进行授权,允许被加好友后才能调用成功[用户授权](https://q.qq.com/wiki/develop/miniprogram/frame/open_ability/open_userinfo.html#%E6%8E%88%E6%9D%83) */
300
419
  addFriend
420
+
301
421
  /** 添加彩签,点击后添加状态有用户提示,无回调 */
302
422
  addColorSign
423
+
303
424
  /** 打开公众号资料卡,可以通过 public-id 属性设定需要打开的公众号资料卡的号码,同时 app.json 中必须配置 publicIdList(目前只能配置 1 个),表明可以打开的公众号资料卡的号码 */
304
425
  openPublicProfile
426
+
305
427
  /** 添加群应用(只有管理员或群主有权操作,建议先调用 qq.getGroupInfo 获取当前用户是否为管理员,如果是管理员才显示该按钮),添加后给button绑定 onAddGroupApp 事件接收回调数据。 */
306
428
  addGroupApp
429
+
307
430
  /** 在自定义开放数据域组件中,向指定好友发起分享据 */
308
431
  shareMessageToFriend
309
432
  }
310
433
  }
434
+
311
435
  /** lang 的合法值 */
312
436
  interface Lang {
313
437
  /** 英文 */
314
438
  en
439
+
315
440
  /** 简体中文 */
316
441
  zh_CN
442
+
317
443
  /** 繁体中文 */
318
444
  zh_TW
319
445
  }
320
-
321
446
  interface onGetUserInfoEventDetail {
322
447
  userInfo: {
323
448
  /** 昵称 */
324
449
  nickName: string
450
+
325
451
  /** 头像 */
326
452
  avatarUrl: string
453
+
327
454
  /** 性别 */
328
455
  gender: keyof Gender
456
+
329
457
  /** 省份,如:`Yunnan` */
330
458
  province: string
459
+
331
460
  /** 城市,如:`Dalian` */
332
461
  city: string
462
+
333
463
  /** 国家,如:`China` */
334
464
  country: string
335
465
  }
466
+
336
467
  /** 不包括敏感信息的原始数据 `JSON` 字符串,用于计算签名 */
337
468
  rawData: string
469
+
338
470
  /** 使用 `sha1(rawData + sessionkey)` 得到字符串,用于校验用户信息 */
339
471
  signature: string
472
+
340
473
  /** 包括敏感数据在内的完整用户信息的加密数据 */
341
474
  encryptedData: string
475
+
342
476
  /** 加密算法的初始向量 */
343
477
  iv: string
478
+
344
479
  /* 用户信息的调用状态 */
345
480
  errMsg: string
481
+
346
482
  /** 敏感数据对应的云 ID,开通[云开发](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html)的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#method-cloud) */
347
483
  cloudID?: string
348
484
  }
@@ -351,37 +487,42 @@ declare namespace ButtonProps {
351
487
  interface Gender {
352
488
  /** 未知 */
353
489
  0
490
+
354
491
  /** 男 */
355
492
  1
493
+
356
494
  /** 女 */
357
495
  2
358
496
  }
359
-
360
497
  interface onContactEventDetail {
361
498
  /* 小程序消息的调用状态 */
362
499
  errMsg: string
500
+
363
501
  /** 小程序消息指定的路径 */
364
502
  path: string
503
+
365
504
  /** 小程序消息指定的查询参数 */
366
505
  query: Record<string, any>
367
506
  }
368
-
369
507
  interface onGetPhoneNumberEventDetail {
370
508
  /* 获取用户手机号的调用状态 */
371
509
  errMsg: string
510
+
372
511
  /** 包括敏感数据在内的完整用户信息的加密数据 */
373
512
  encryptedData: string
513
+
374
514
  /** 加密算法的初始向量 */
375
515
  iv: string
516
+
376
517
  /** 动态令牌。可通过动态令牌换取用户手机号。
377
518
  * @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html#%E4%BD%BF%E7%94%A8%E6%8C%87%E5%BC%95
378
519
  */
379
520
  code?: string
380
521
  }
381
-
382
522
  interface onOpenSettingEventDetail {
383
523
  /* 打开授权设置页的调用状态 */
384
524
  errMsg: string
525
+
385
526
  /* 用户授权结果 */
386
527
  authSetting: Record<string, boolean>
387
528
  }
@@ -539,5 +680,4 @@ declare namespace ButtonProps {
539
680
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/button.html
540
681
  */
541
682
  declare const Button: ComponentType<ButtonProps>
542
-
543
683
  export { Button, ButtonProps }
package/types/Camera.d.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  import { ComponentType } from 'react'
2
2
  import { StandardProps, CommonEventFunction } from './common'
3
-
4
3
  interface CameraProps extends StandardProps {
5
4
  /** 模式,有效值为normal, scanCode
6
5
  * @default "normal"
7
- * @supported weapp, rn, tt
6
+ * @supported weapp, tt, qq, jd, rn
8
7
  */
9
8
  mode?: keyof CameraProps.Mode
10
9
 
@@ -16,13 +15,13 @@ interface CameraProps extends StandardProps {
16
15
 
17
16
  /** 摄像头朝向
18
17
  * @default "back"
19
- * @supported weapp, rn, tt
18
+ * @supported weapp, swan, tt, qq, jd, rn
20
19
  */
21
20
  devicePosition?: keyof CameraProps.DevicePosition
22
21
 
23
22
  /** 闪光灯
24
23
  * @default "auto"
25
- * @supported weapp, rn, tt
24
+ * @supported weapp, swan, tt, qq, jd, rn
26
25
  */
27
26
  flash?: keyof CameraProps.Flash
28
27
 
@@ -32,81 +31,85 @@ interface CameraProps extends StandardProps {
32
31
  */
33
32
  frameSize?: keyof CameraProps.FrameSize
34
33
 
35
- /** 扫码识别区域,格式为[x, y, w, h],
36
- * x,y是相对于camera显示区域的左上角,
37
- * w,h为区域宽度,单位px,仅在 mode="scanCode" 时生效
38
- * @supported weapp
39
- */
40
- scanArea?: number[]
41
-
42
34
  /** 摄像头在非正常终止时触发,
43
35
  * 如退出后台等情况
44
- * @supported weapp, rn, tt
36
+ * @supported weapp, swan, tt, qq, jd, rn
45
37
  */
46
38
  onStop?: CommonEventFunction
47
39
 
48
40
  /** 用户不允许使用摄像头时触发
49
- * @supported weapp, rn, tt
41
+ * @supported weapp, swan, tt, qq, jd, rn
50
42
  */
51
43
  onError?: CommonEventFunction
52
44
 
53
45
  /** 相机初始化完成时触发
54
- * @supported weapp, rn, tt
46
+ * @supported weapp, tt, rn
55
47
  */
56
48
  onInitDone?: CommonEventFunction<CameraProps.onInitDoneEventDetail>
57
49
 
58
50
  /** 在成功识别到一维码时触发,
59
51
  * 仅在 mode="scanCode" 时生效
60
- * @supported weapp, rn, tt
52
+ * @supported weapp, tt, qq, rn
61
53
  */
62
54
  onScanCode?: CommonEventFunction
63
55
  }
64
-
65
56
  declare namespace CameraProps {
66
57
  /** mode 的合法值 */
67
58
  interface Mode {
68
59
  /** 相机模式 */
69
60
  normal
61
+
70
62
  /** 扫码模式 */
71
63
  scanCode
72
64
  }
65
+
73
66
  /** resolution 的合法值 */
74
67
  interface Resolution {
75
68
  /** 低 */
76
69
  low
70
+
77
71
  /** 中 */
78
72
  medium
73
+
79
74
  /** 高 */
80
75
  high
81
76
  }
77
+
82
78
  /** device-position 的合法值 */
83
79
  interface DevicePosition {
84
80
  /** 前置 */
85
81
  front
82
+
86
83
  /** 后置 */
87
84
  back
88
85
  }
86
+
89
87
  /** flash 的合法值 */
90
88
  interface Flash {
91
89
  /** 自动 */
92
90
  auto
91
+
93
92
  /** 打开 */
94
93
  on
94
+
95
95
  /** 关闭 */
96
96
  off
97
+
97
98
  /** 常亮 */
98
99
  torch
99
100
  }
101
+
100
102
  /** frame-size 的合法值 */
101
103
  interface FrameSize {
102
104
  /** 小尺寸帧数据 */
103
105
  small
106
+
104
107
  /** 中尺寸帧数据 */
105
108
  medium
109
+
106
110
  /** 大尺寸帧数据 */
107
111
  large
108
112
  }
109
-
110
113
  interface onInitDoneEventDetail {
111
114
  /** 最大变焦 */
112
115
  maxZoom: number
@@ -119,5 +122,4 @@ declare namespace CameraProps {
119
122
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/camera.html
120
123
  */
121
124
  declare const Camera: ComponentType<CameraProps>
122
-
123
125
  export { Camera, CameraProps }