-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Expand file tree
/
Copy pathButton.d.ts
More file actions
740 lines (740 loc) · 26.6 KB
/
Copy pathButton.d.ts
File metadata and controls
740 lines (740 loc) · 26.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
import { ComponentType } from 'react'
import { StandardProps, CommonEventFunction } from './common'
import { StyleProp, ViewStyle } from 'react-native'
interface ButtonProps extends StandardProps {
/** 按钮的大小
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid, ascf
* @default default
*/
size?: keyof ButtonProps.Size
/** 按钮的样式类型
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid, ascf
* @default default
*/
type?: keyof ButtonProps.Type
/** 按钮是否镂空,背景色透明
* @supported weapp, alipay, swan, qq, jd, h5, rn, harmony, harmony_hybrid, ascf
* @default false
*/
plain?: boolean
/** 是否禁用
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid, ascf
* @default false
*/
disabled?: boolean
/** 名称前是否带 loading 图标
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid, ascf
* @default false
*/
loading?: boolean
/** 用于 `<form/>` 组件,点击分别会触发 `<form/>` 组件的 submit/reset 事件
* @supported weapp, alipay, swan, tt, qq, jd, harmony, ascf
*/
formType?: keyof ButtonProps.FormType
/** 微信开放能力
* @supported weapp, alipay, swan, tt, qq, jd, ascf
*/
openType?: ButtonProps.OpenType
/** 指定按下去的样式类。当 `hover-class="none"` 时,没有点击态效果
* @default button-hover
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid, ascf
* @rn 支持 hoverStyle 属性,但框架未支持 hoverClass
*/
hoverClass?: string
/** open-type=launchApp时有效,表示待启动Ability所在的应用Bundle名称。
* @default none
* @supported ascf
*/
appBundleName?: string
/** open-type=launchApp时有效,表示待启动Ability所属的模块名称。
* @default none
* @supported ascf
*/
appModuleName?: string
/** open-type=launchApp时有效,表示待启动Ability名称。
* @default none
* @supported ascf
*/
appAbilityName?: string
/** open-type=launchApp时有效,表示启动Ability时的自定义参数。
* @default none
* @supported ascf
*/
appParameters?: Object
/** open-type=liveActivity时有效,表示子场景ID,当open-type=liveActivity时,该参数必填。
* @default none
* @supported ascf
*/
activityType?: string
/** 由于 RN 不支持 hoverClass,故 RN 端的 Button 组件实现了 `hoverStyle`属性,写法和 style 类似,只不过 `hoverStyle` 的样式是指定按下去的样式。
* @default none
* @supported rn
*/
hoverStyle?: StyleProp<ViewStyle>
/** 指定是否阻止本节点的祖先节点出现点击态
* @default false
* @supported weapp, alipay, swan, tt, qq, jd, ascf
*/
hoverStopPropagation?: boolean
/** 按住后多久出现点击态,单位毫秒
* @default 20
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid, ascf
*/
hoverStartTime?: number
/** 手指松开后点击态保留时间,单位毫秒
* @default 70
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid, ascf
*/
hoverStayTime?: number
/** 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。
*
* 生效时机: `open-type="getUserInfo"`
* @supported weapp, qq, jd
*/
lang?: keyof ButtonProps.Lang
/** 会话来源
*
* 生效时机:`open-type="contact"`
* @supported weapp, swan
*/
sessionFrom?: string
/** 会话内消息卡片标题
*
* 生效时机:`open-type="contact"`
* @default 当前标题
* @supported weapp, swan
*/
sendMessageTitle?: string
/** 会话内消息卡片点击跳转小程序路径
*
* 生效时机:`open-type="contact"`
* @default 当前标题
* @supported weapp, swan
*/
sendMessagePath?: string
/** 会话内消息卡片图片
*
* 生效时机:`open-type="contact"`
* @default 截图
* @supported weapp, swan
*/
sendMessageImg?: string
/** 打开 APP 时,向 APP 传递的参数
*
* 生效时机:`open-type="launchApp"`
* @supported weapp, qq, jd
*/
appParameter?: string
/** 支付宝小程序 scope
*
* 生效时机:`open-type="getAuthorize"`
* @supported alipay
*/
scope?: 'userInfo' | 'phoneNumber'
/** 显示会话内消息卡片
*
* 生效时机:`open-type="contact"`
* @supported weapp, swan
* @default false
*/
showMessageCard?: boolean
/** 生活号 id,必须是当前小程序同主体且已关联的生活号,open-type="lifestyle" 时有效。
* @supported alipay, qq
*/
publicId?: string
/** 发送订阅类模板消息所用的模板库标题 ID ,可通过 getTemplateLibraryList 获取
* 当参数类型为 Array 时,可传递 1~3 个模板库标题 ID
* @supported swan
*/
templateId?: string | Array<string>
/** 发送订阅类模板消息时所使用的唯一标识符,内容由开发者自定义,用来标识订阅场景
* 注意:同一用户在同一 subscribe-id 下的多次授权不累积下发权限,只能下发一条。若要订阅多条,需要不同 subscribe-id
* @supported swan
*/
subscribeId?: string
/** 群聊 id
* @qq 打开群资料卡时,传递的群号
* @tt 通过创建聊天群、查询群信息获取
* @supported qq, tt
*/
groupId?: string
/** 打开频道页面时,传递的频道号
* @supported qq
*/
guildId?: string
/** 分享类型集合,请参考下面share-type有效值说明。share-type后续将不再维护,请更新为share-mode
* @supported qq
* @default 27
*/
shareType?: string
/** 分享类型集合,请参考下面share-mode有效值说明
* @supported qq
* @default ['qq', 'qzone']
*/
shareMode?: string
/** 无障碍访问,(属性)元素的额外描述
* @supported qq
*/
ariaLabel?: string
/** 添加好友时,对方的 openid
* @supported qq
*/
openId?: string
/** 发送对象的 FriendInfo
* @supported qq
*/
shareMessageFriendInfo?: string
/** 转发标题,不传则默认使用当前小程序的昵称。 FriendInfo
* @supported qq
*/
shareMessageTitle?: string
/** 转发显示图片的链接,可以是网络图片路径(仅 QQ CDN 域名路径)或本地图片文件路径或相对代码包根目录的图片文件路径。显示图片长宽比是 5:4FriendInfo
* @supported qq
*/
shareMessageImg?: string
/** 跳转抖音号个人页,只支持小程序绑定的品牌号、员工号、合作号
* @supported tt
*/
dataAwemeId?: string
/**
* 是否开启半屏模式
* @supported tt
*/
dataIsHalfPage?: boolean
/** 用户点击该按钮时,会返回获取到的用户信息,回调的detail数据与 Taro.getUserInfo 返回的一致
*
* 生效时机: `open-type="getUserInfo"`
* @supported weapp, alipay, swan, qq, jd
*/
onGetUserInfo?: CommonEventFunction<ButtonProps.onGetUserInfoEventDetail>
/** 支付宝获取会员基础信息授权回调
*
* 生效时机:`open-type="getAuthorize"`
* @supported alipay
*/
onGetAuthorize?: CommonEventFunction
/** 客服消息回调
*
* 生效时机:`open-type="contact"`
* @supported weapp, swan, qq
*/
onContact?: CommonEventFunction<ButtonProps.onContactEventDetail>
/** 获取用户手机号回调
*
* 生效时机:`open-type="getPhoneNumber"`
* @supported weapp, alipay, swan, tt, jd, ascf
*/
onGetPhoneNumber?: CommonEventFunction<ButtonProps.onGetPhoneNumberEventDetail>
/** 获取手机号和风险等级的回调
*
* 生效时机:`open-type="getPhoneNumberAndRiskLevel"`
* @supported ascf
*/
onGetPhoneNumberAndRiskLevel?: CommonEventFunction<ButtonProps.onGetPhoneNumberAndRiskLevelEventDetail>
/** 获取服务动态授权码的回调
*
* 生效时机:`open-type="liveActivity"`
* @supported weapp, ascf
*/
onCreateLiveActivity?: CommonEventFunction<ButtonProps.onCreateLiveActivityEventDetail>
/**
* 手机号实时验证回调,`open-type="getRealtimePhoneNumber"` 时有效
* @supported weapp
*/
onGetRealTimePhoneNumber?: CommonEventFunction<ButtonProps.onGetRealTimePhoneNumberEventDetail>
/** 当使用开放能力时,发生错误的回调
*
* 生效时机:`open-type="launchApp"`
* @supported weapp, alipay, qq, jd, ascf
*/
onError?: CommonEventFunction
/** 在打开授权设置页后回调
*
* 生效时机:`open-type="openSetting"`
* @supported weapp, swan, tt, qq, jd, ascf
*/
onOpenSetting?: CommonEventFunction<ButtonProps.onOpenSettingEventDetail>
/** 打开 APP 成功的回调
*
* 生效时机:`open-type="launchApp"`
* @supported weapp, qq, ascf
*/
onLaunchApp?: CommonEventFunction
/** 获取用户头像回调
*
* 生效时机:`open-type="chooseAvatar"`
* @supported weapp
*/
onChooseAvatar?: CommonEventFunction
/**
* 用户同意隐私协议事件回调,`open-type="agreePrivacyAuthorization"`时有效
* @supported weapp
*/
onAgreePrivacyAuthorization?: CommonEventFunction
/** 点击。
* 说明: 每点击一次会触发一次事件,建议自行使用代码防止重复点击,可以使用 js 防抖和节流实现。
* @supported alipay
*/
onTap?: CommonEventFunction
/** 当 open-type 为 lifestyle 时有效。
* 当点击按钮时触发。
* event.detail = { followStatus },followStatus 合法值有 1、2、3,其中 1 表示已关注。2 表示用户不允许关注。3 表示发生未知错误;
* 已知问题:基础库 1.0,当用户在点击按钮前已关注生活号,event.detail.followStatus 的值为 true。
* @supported alipay
*/
onFollowLifestyle?: CommonEventFunction<{
followStatus: 1 | 2 | 3 | true
}>
/** 用户点击该按钮时,调起用户编辑收货地址原生界面,并在编辑完成后返回用户选择的地址,从返回参数的 detail 中获取,和 swan.chooseAddress 一样的。和 open-type 搭配使用,使用时机:open-type="chooseAddress"
* @supported swan
*/
onChooseAddress?: CommonEventFunction
/** 用户点击该按钮时,选择用户的发票抬头,和 swan.chooseInvoiceTitle 一样的。和 open-type 搭配使用,使用时机:open-type="chooseInvoiceTitle"
* @supported swan
*/
onChooseInvoiceTitle?: CommonEventFunction
/** 登录回调,和 open-type 搭配使用,使用时机:open-type="login"。可以通过返回参数的 detail 判断是否登录成功,当 errMsg 为'login:ok'时即为成功。如想获取登录凭证请使用 swan.getLoginCode
* @supported swan
*/
onLogin?: CommonEventFunction
/** 订阅消息授权回调,和 open-type 搭配使用,使用时机:open-type="subscribe"
* @supported swan
*/
onSubscribe?: CommonEventFunction
/** 添加好友的回调
* @supported qq
*/
onAddFriend?: CommonEventFunction
/** 添加群应用的回调。errCode 错误码:41004(当前用户非管理员或群主,无权操作),41005(超过可添加群应用的群数量)
* @supported qq
*/
onAddGroupApp?: CommonEventFunction
/** 监听跳转抖音号个人页的回调
*
* 生效时机:`open-type="openAwemeUserProfile"`
* @supported tt
*/
onOpenAwemeUserProfile?: CommonEventFunction
/**
* 加群后触发
* @supported tt
*/
onJoinGroup?: CommonEventFunction<{ errMsg: string; errNo: number }>
}
declare namespace ButtonProps {
/** size 的合法值 */
interface Size {
/** 默认大小 */
default
/** 小尺寸 */
mini
}
/** type 的合法值 */
interface Type {
/** 绿色 */
primary
/** 白色 */
default
/** 红色 */
warn
}
/** form-type 的合法值 */
interface FormType {
/** 提交表单 */
submit
/** 重置表单 */
reset
}
/** open-type 的合法值 */
type OpenType =
| keyof openTypeKeys['weapp']
| keyof openTypeKeys['alipay']
| keyof openTypeKeys['qq']
| keyof openTypeKeys['tt']
| keyof openTypeKeys['ascf']
/** open-type 的合法值 */
interface openTypeKeys {
ascf: {
/** 获取用户手机号码,当open-type等于该值时,为保障用户隐私,button组件采用同层渲染ArkUI原生functionalButton组件的方式实现。 */
getPhoneNumber,
/** 打开授权设置页面。 */
openSetting,
/** 打开应用,可以通过app-bundle-name,app-module-name,app-ability-name,app-parameters属性打开指定应用。当前只支持打开系统应用,或者在元服务跳转三方应用的场景下只能打开同系列开发者的应用,否则会遭到系统生态管控拦截,提示应用无法打开 */
launchApp,
/** 触发用户分享,用户点击按钮后触发Page.onShareAppMessage事件,只支持分享首页。 */
share,
/** 获取服务动态授权码,用于推送服务动态。当open-type等于该值时,必须同时指定activity-type属性。 */
liveActivity,
/** 获取手机号和风险等级。 */
getPhoneNumberAndRiskLevel
}
weapp: {
/** 打开客服会话,如果用户在会话中点击消息卡片后返回小程序,可以从回调中获得具体信息
* @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/customer-message/customer-message.html
*/
contact
/** 触发用户转发,使用前建议先阅读使用指引
* @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
*/
share
/** 获取用户手机号,可以从回调中获取到用户信息
* @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html
*/
getPhoneNumber
/**
* 手机号实时验证,向用户申请,并在用户同意后,快速填写和实时验证手机号。(*小程序插件中不能使用*)
* @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getRealtimePhoneNumber.html
*/
getRealtimePhoneNumber
/** 获取用户信息,可以从回调中获取到用户信息 */
getUserInfo
/** 打开APP,可以通过 app-parameter 属性设定向APP传的参数
* @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/launchApp.html
*/
launchApp
/** 打开授权设置页 */
openSetting
/** 打开“意见反馈”页面,用户可提交反馈内容并上传日志,开发者可以登录小程序管理后台后进入左侧菜单“客服反馈”页面获取到反馈内容 */
feedback
/** 获取用户头像,可以从回调中获得具体信息 */
chooseAvatar
/**
* 用户同意隐私协议按钮。可通过 bindagreeprivacyauthorization 监听用户同意隐私协议事件
*/
agreePrivacyAuthorization
/**
* 从基础库 2.32.3 版本起,隐私同意按钮支持与手机号快速验证组件耦合使用,调用方式为:
* <button open-type="getPhoneNumber|agreePrivacyAuthorization">
*/
['getPhoneNumber|agreePrivacyAuthorization']
/**
* 从基础库 2.32.3 版本起,支持隐私同意按钮与手机号实时验证组件耦合使用,调用方式为:
* <button open-type="getRealtimePhoneNumber|agreePrivacyAuthorization">
*/
['getRealtimePhoneNumber|agreePrivacyAuthorization']
/**
* 从基础库 2.32.3 版本起,支持隐私同意按钮与获取用户信息组件耦合使用,调用方式为:
* <button open-type="getUserInfo|agreePrivacyAuthorization">
*/
['getUserInfo|agreePrivacyAuthorization']
}
/** 支付宝小程序专属的 open-type 合法值
* @see https://opendocs.alipay.com/mini/component/button
*/
alipay: {
/** 触发 自定义分享 */
share
/** 支持小程序授权 */
getAuthorize
/** 分享到通讯录好友 */
contactShare
/** 关注生活号 */
lifestyle
}
/** QQ 小程序专属的 open-type 合法值
* @see https://q.qq.com/wiki/develop/miniprogram/component/form/button.html
*/
qq: {
/** 触发用户转发,使用前建议先阅读使用指引
* @see https://q.qq.com/wiki/develop/miniprogram/frame/open_ability/open_share.html#%E8%BD%AC%E5%8F%91-2
*/
share
/** 获取用户信息,可以从 onGetUserInfo 回调中获取到用户信息 */
getUserInfo
/** 打开APP,可以通过 app-parameter 属性设定向APP传的参数
* @see https://q.qq.com/wiki/develop/miniprogram/frame/open_ability/open_app.html
*/
launchApp
/** 打开授权设置页 */
openSetting
/** 呼起吐个槽反馈页面,开发者可以到官网查看反馈 */
feedback
/** 呼起群资料卡页面,可以通过 group-id 属性设定需要打开的群资料卡的群号,同时 app.json 中必须配置 groupIdList(数量不超过 10 个),表明可以打开群资料卡的群号 */
openGroupProfile
/** 添加好友,对方需要通过该小程序进行授权,允许被加好友后才能调用成功[用户授权](https://q.qq.com/wiki/develop/miniprogram/frame/open_ability/open_userinfo.html#%E6%8E%88%E6%9D%83) */
addFriend
/** 添加彩签,点击后添加状态有用户提示,无回调 */
addColorSign
/** 打开公众号资料卡,可以通过 public-id 属性设定需要打开的公众号资料卡的号码,同时 app.json 中必须配置 publicIdList(目前只能配置 1 个),表明可以打开的公众号资料卡的号码 */
openPublicProfile
/** 添加群应用(只有管理员或群主有权操作,建议先调用 qq.getGroupInfo 获取当前用户是否为管理员,如果是管理员才显示该按钮),添加后给button绑定 onAddGroupApp 事件接收回调数据。 */
addGroupApp
/** 在自定义开放数据域组件中,向指定好友发起分享据 */
shareMessageToFriend
}
/** TT 小程序专属的 open-type 合法值
* @see https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/component/list/button/#open-type-%E7%9A%84%E5%90%88%E6%B3%95%E5%80%BC
*/
tt: {
/** 触发用户转发, 可以配合 data-channel 属性来设置分享的 channel,具体请参考 ShareParam */
share
/** 获取用户手机号,可以从 bindgetphonenumber 回调中获取到用户信息,详情请参见获取手机号 */
getPhoneNumber
/** 跳转到抖音IM客服,详情请参见抖音IM客服能力 */
im
/** 跳转到抖音平台客服,详情请参见平台客服能力 */
platformIm
/** 跳转视频播放页,详情请参见跳转视频播放页 */
navigateToVideoView
/** 跳转抖音号个人页,详情请参见跳转抖音号个人页 */
openAwemeUserProfile
/** 跳转抖音直播间,详情请参见跳转抖音直播间 */
openWebcastRoom
/** 写入系统日历,详情请参见写入系统日历 */
addCalendarEvent
/** 添加到桌面,详情请参见添加到桌面 */
addShortcut
/** 加群,详情请参见加群 */
joinGroup
/** 私信,详情请参见私信 */
privateMessage
/** 主动授权私信,详情请参见主动授权私信 */
authorizePrivateMessage
}
}
/** lang 的合法值 */
interface Lang {
/** 英文 */
en
/** 简体中文 */
zh_CN
/** 繁体中文 */
zh_TW
}
interface onGetUserInfoEventDetail {
userInfo: {
/** 昵称 */
nickName: string
/** 头像链接 */
avatarUrl: string
/** 头像
* @supported alipay
*/
avatar: string
/** 性别 */
gender: keyof Gender
/** 省份,如:`Yunnan` */
province: string
/** 城市,如:`Dalian` */
city: string
/** 国家,如:`China` */
country: string
}
/** 不包括敏感信息的原始数据 `JSON` 字符串,用于计算签名 */
rawData: string
/** 使用 `sha1(rawData + sessionkey)` 得到字符串,用于校验用户信息 */
signature: string
/** 包括敏感数据在内的完整用户信息的加密数据 */
encryptedData: string
/** 加密算法的初始向量 */
iv: string
/* 用户信息的调用状态 */
errMsg: string
/** 敏感数据对应的云 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) */
cloudID?: string
}
/** 性别的合法值 */
interface Gender {
/** 未知 */
0
/** 男 */
1
/** 女 */
2
}
interface onContactEventDetail {
/* 小程序消息的调用状态 */
errMsg: string
/** 小程序消息指定的路径 */
path: string
/** 小程序消息指定的查询参数 */
query: Record<string, any>
}
interface onGetPhoneNumberEventDetail {
/* 获取用户手机号的调用状态 */
errMsg: string
/** 包括敏感数据在内的完整用户信息的加密数据 */
encryptedData: string
/** 加密算法的初始向量 */
iv: string
/** 动态令牌。可通过动态令牌换取用户手机号。
* @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
*/
code?: string
/**
* 签名信息,如果在开放平台后台配置了加签方式后有此字段
* @supported alipay
*/
sign: string
}
interface onGetPhoneNumberAndRiskLevelEventDetail {
code: string
}
interface onCreateLiveActivityEventDetail {
code: string
}
interface onGetRealTimePhoneNumberEventDetail {
code: string
}
interface onOpenSettingEventDetail {
/* 打开授权设置页的调用状态 */
errMsg: string
/* 用户授权结果 */
authSetting: Record<string, boolean>
}
}
/** 按钮
* @classification forms
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid, ascf
* @example_react
* ```tsx
* export default class PageButton extends Component {
* state = {
* btn: [
* {
* text: '页面主操作 Normal',
* size: 'default',
* type: 'primary'
* },
* {
* text: '页面主操作 Loading',
* size: 'default',
* type: 'primary',
* loading: true,
* },
* {
* text: '页面主操作 Disabled',
* size: 'default',
* type: 'primary',
* disabled: true,
* },
* {
* text: '页面次要操作 Normal',
* size: 'default',
* type: 'default'
* },
* {
* text: '页面次要操作 Disabled',
* size: 'default',
* type: 'default',
* disabled: true,
* },
* {
* text: '警告类操作 Normal',
* size: 'default',
* type: 'warn'
* },
* {
* text: '警告类操作 Disabled',
* size: 'default',
* type: 'warn',
* disabled: true,
* }
* ]
* }
* render () {
* return (
* <View className='container'>
* {this.state.btn.map(item => {
* return (
* <Button
* size={item.size ? item.size : ''}
* type={item.type ? item.type : ''}
* loading={item.loading ? item.loading : false}
* disabled={item.disabled ? item.disabled : false}
* >
* {item.text}
* </Button>
* )
* })}
* <Button className='btn-max-w' plain type='primary'>按钮</Button>
* <Button className='btn-max-w' plain type='primary' disabled>不可点击的按钮</Button>
* <Button className='btn-max-w' plain >按钮</Button>
* <Button className='btn-max-w' plain disabled >按钮</Button>
* <Button size='mini' type='primary'>按钮</Button>
* <Button size='mini' >按钮</Button>
* <Button size='mini' type='warn'>按钮</Button>
* <Button openType='getPhoneNumber' onGetPhoneNumber="callback">按钮</Button>
* </View>
* )
* }
* }
* ```
* @example_vue
* ```html
* <template>
* <view class="container">
* <button
* v-for="item in btn"
* :size="item.size ? item.size : ''"
* :type="item.type ? item.type : ''"
* :loading="item.loading ? item.loading : false"
* :disabled="item.disabled ? item.disabled : false"
* >
* {{ item.text }}
* </button>
* <button class="btn-max-w" :plain="true" type="primary">按钮</button>
* <button class="btn-max-w" :plain="true" type="primary" :disabled="true">不可点击的按钮</button>
* <button class="btn-max-w" :plain="true">按钮</button>
* <button class="btn-max-w" :plain="true" :disabled="true">按钮</button>
* <button size="mini" type="primary">按钮</button>
* <button size="mini" >按钮</button>
* <button size="mini" type="warn">按钮</button>
* <button open-type="getPhoneNumber" `@getphonenumber="callback">按钮</button>
* </view>
* </template>
*
* <script>
* export default {
* data() {
* return {
* btn: [
* {
* text: '页面主操作 Normal',
* size: 'default',
* type: 'primary'
* },
* {
* text: '页面主操作 Loading',
* size: 'default',
* type: 'primary',
* loading: true,
* },
* {
* text: '页面主操作 Disabled',
* size: 'default',
* type: 'primary',
* disabled: true,
* },
* {
* text: '页面次要操作 Normal',
* size: 'default',
* type: 'default'
* },
* {
* text: '页面次要操作 Disabled',
* size: 'default',
* type: 'default',
* disabled: true,
* },
* {
* text: '警告类操作 Normal',
* size: 'default',
* type: 'warn'
* },
* {
* text: '警告类操作 Disabled',
* size: 'default',
* type: 'warn',
* disabled: true,
* }
* ]
* }
* }
* }
* </script>
* ```
* @see https://developers.weixin.qq.com/miniprogram/dev/component/button.html
*/
declare const Button: ComponentType<ButtonProps>
export { Button, ButtonProps }