Skip to content

Commit 05ba525

Browse files
authored
refactor(types): sync components types
1 parent d1171ac commit 05ba525

File tree

6 files changed

+34
-39
lines changed

6 files changed

+34
-39
lines changed

packages/taro-components/types/Button.d.ts

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,6 @@ interface ButtonProps extends StandardProps {
165165
* @supported qq
166166
*/
167167
shareMessageImg?: string
168-
/** 跳转抖音号个人页,只支持小程序绑定的品牌号、员工号、合作号
169-
* @supported tt
170-
*/
171-
dataAwemeId?: string
172168
/** 用户点击该按钮时,会返回获取到的用户信息,回调的detail数据与 Taro.getUserInfo 返回的一致
173169
*
174170
* 生效时机: `open-type="getUserInfo"`
@@ -193,11 +189,6 @@ interface ButtonProps extends StandardProps {
193189
* @supported weapp, alipay, swan, tt, jd
194190
*/
195191
onGetPhoneNumber?: CommonEventFunction<ButtonProps.onGetPhoneNumberEventDetail>
196-
/**
197-
* 手机号实时验证回调,`open-type="getRealtimePhoneNumber"` 时有效
198-
* @supported weapp
199-
*/
200-
onGetRealTimePhoneNumber?: CommonEventFunction<ButtonProps.onGetRealTimePhoneNumberEventDetail>
201192
/** 当使用开放能力时,发生错误的回调
202193
*
203194
* 生效时机:`open-type="launchApp"`
@@ -222,11 +213,6 @@ interface ButtonProps extends StandardProps {
222213
* @supported weapp
223214
*/
224215
onChooseAvatar?: CommonEventFunction
225-
/**
226-
* 用户同意隐私协议事件回调,`open-type="agreePrivacyAuthorization"`时有效
227-
* @supported weapp
228-
*/
229-
onAgreePrivacyAuthorization?: CommonEventFunction
230216
/** 点击。
231217
* 说明: 每点击一次会触发一次事件,建议自行使用代码防止重复点击,可以使用 js 防抖和节流实现。
232218
* @supported alipay
@@ -265,12 +251,6 @@ interface ButtonProps extends StandardProps {
265251
* @supported qq
266252
*/
267253
onAddGroupApp?: CommonEventFunction
268-
/** 监听跳转抖音号个人页的回调
269-
*
270-
* 生效时机:`open-type="openAwemeUserProfile"`
271-
* @supported tt
272-
*/
273-
onOpenAwemeUserProfile?: CommonEventFunction
274254
}
275255
declare namespace ButtonProps {
276256
/** size 的合法值 */
@@ -297,7 +277,11 @@ declare namespace ButtonProps {
297277
reset
298278
}
299279
/** open-type 的合法值 */
300-
type OpenType = keyof openTypeKeys['weapp'] | keyof openTypeKeys['alipay'] | keyof openTypeKeys['qq'] | keyof openTypeKeys['tt']
280+
type OpenType =
281+
| keyof openTypeKeys['weapp']
282+
| keyof openTypeKeys['alipay']
283+
| keyof openTypeKeys['qq']
284+
| keyof openTypeKeys['tt']
301285
/** open-type 的合法值 */
302286
interface openTypeKeys {
303287
weapp: {
@@ -334,6 +318,21 @@ declare namespace ButtonProps {
334318
* 用户同意隐私协议按钮。可通过 bindagreeprivacyauthorization 监听用户同意隐私协议事件
335319
*/
336320
agreePrivacyAuthorization
321+
/**
322+
* 从基础库 2.32.3 版本起,隐私同意按钮支持与手机号快速验证组件耦合使用,调用方式为:
323+
* <button open-type="getPhoneNumber|agreePrivacyAuthorization">
324+
*/
325+
['getPhoneNumber|agreePrivacyAuthorization']
326+
/**
327+
* 从基础库 2.32.3 版本起,支持隐私同意按钮与手机号实时验证组件耦合使用,调用方式为:
328+
* <button open-type="getRealtimePhoneNumber|agreePrivacyAuthorization">
329+
*/
330+
['getRealtimePhoneNumber|agreePrivacyAuthorization']
331+
/**
332+
* 从基础库 2.32.3 版本起,支持隐私同意按钮与获取用户信息组件耦合使用,调用方式为:
333+
* <button open-type="getUserInfo|agreePrivacyAuthorization">
334+
*/
335+
['getUserInfo|agreePrivacyAuthorization']
337336
}
338337
/** 支付宝小程序专属的 open-type 合法值
339338
* @see https://opendocs.alipay.com/mini/component/button

packages/taro-components/types/Canvas.d.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,37 @@ interface CanvasProps extends StandardProps<any, CanvasTouchEvent> {
1414
* @supported weapp, alipay, swan, qq, jd
1515
*/
1616
disableScroll?: boolean
17-
/** 用于透传 `WebComponents` 上的属性到内部 H5 标签上
18-
* @supported h5
19-
*/
20-
nativeProps?: Record<string, unknown>
2117
/** 组件唯一标识符。
2218
* 注意:同一页面中的 id 不可重复。
23-
* @supported alipay
19+
* @supported alipay, h5
2420
*/
2521
id?: string
2622
/**
27-
* @supported alipay
23+
* @supported alipay, h5
2824
*/
2925
width?: string
3026
/**
31-
* @supported alipay
27+
* @supported alipay, h5
3228
*/
3329
height?: string
30+
/** 用于透传 `WebComponents` 上的属性到内部 H5 标签上
31+
* @supported h5
32+
*/
33+
nativeProps?: Record<string, unknown>
3434
/** 手指触摸动作开始
35-
* @supported weapp, alipay, swan, tt, qq, jd
35+
* @supported weapp, alipay, swan, tt, qq, jd, h5
3636
*/
3737
onTouchStart?: CanvasTouchEventFunction
3838
/** 手指触摸后移动
39-
* @supported weapp, alipay, swan, tt, qq, jd
39+
* @supported weapp, alipay, swan, tt, qq, jd, h5
4040
*/
4141
onTouchMove?: CanvasTouchEventFunction
4242
/** 手指触摸动作结束
43-
* @supported weapp, alipay, swan, tt, qq, jd
43+
* @supported weapp, alipay, swan, tt, qq, jd, h5
4444
*/
4545
onTouchEnd?: CanvasTouchEventFunction
4646
/** 手指触摸动作被打断,如来电提醒,弹窗
47-
* @supported weapp, alipay, swan, tt, qq, jd
47+
* @supported weapp, alipay, swan, tt, qq, jd, h5
4848
*/
4949
onTouchCancel?: CanvasTouchEventFunction
5050
/** 手指长按 500ms 之后触发,触发了长按事件后进行移动不会触发屏幕的滚动

packages/taro-components/types/NativeSlot.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface NativeSlotProps {
1010

1111
/** 编译的原生组件支持使用 slot 插槽
1212
* @classification viewContainer
13-
* @supported weapp, swan, alipay, tt, jd, qq
13+
* @supported weapp, swan, alipay, tt, jd, qq, h5
1414
* @version 3.5.7+
1515
* @example
1616
* ```tsx

packages/taro-components/types/ShareElement.d.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ interface ShareElementProps extends StandardProps {
66
* @deprecated 使用mapkey替换key
77
*/
88
key?: string
9-
/** 映射标记
10-
* @supported weapp
11-
*/
12-
mapkey?: string
139
/** 映射标记
1410
* @supported alipay
1511
*/

packages/taro-components/types/Slot.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface SlotProps {
1515

1616
/** slot 插槽
1717
* @classification viewContainer
18-
* @supported weapp, swan, alipay, tt, jd, qq, harmony
18+
* @supported weapp, swan, alipay, tt, jd, qq, harmony, h5
1919
* @example
2020
* ```tsx
2121
* import { Slot, View, Text } from '@tarojs/components'

packages/taro-components/types/Textarea.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ interface TextareaProps extends StandardProps, FormItemProps {
9999
/** 点击键盘右下角按钮时是否保持键盘不收起
100100
* @supported weapp, swan, tt
101101
*/
102-
confirmHold?: string
102+
confirmHold?: boolean
103103
/** 组件名字,用于表单提交获取数据。
104104
* @supported alipay
105105
*/

0 commit comments

Comments
 (0)