Skip to content

Commit 12007f3

Browse files
authored
refactor(types): sync components types
1 parent 5bba1fc commit 12007f3

File tree

6 files changed

+39
-20
lines changed

6 files changed

+39
-20
lines changed

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

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,6 @@ interface ButtonProps extends StandardProps {
189189
* @supported weapp, alipay, swan, tt, jd
190190
*/
191191
onGetPhoneNumber?: CommonEventFunction<ButtonProps.onGetPhoneNumberEventDetail>
192-
/**
193-
* 手机号实时验证回调,`open-type="getRealtimePhoneNumber"` 时有效
194-
* @supported weapp
195-
*/
196-
onGetRealTimePhoneNumber?: CommonEventFunction<ButtonProps.onGetRealTimePhoneNumberEventDetail>
197192
/** 当使用开放能力时,发生错误的回调
198193
*
199194
* 生效时机:`open-type="launchApp"`
@@ -218,11 +213,6 @@ interface ButtonProps extends StandardProps {
218213
* @supported weapp
219214
*/
220215
onChooseAvatar?: CommonEventFunction
221-
/**
222-
* 用户同意隐私协议事件回调,`open-type="agreePrivacyAuthorization"`时有效
223-
* @supported weapp
224-
*/
225-
onAgreePrivacyAuthorization?: CommonEventFunction
226216
/** 点击。
227217
* 说明: 每点击一次会触发一次事件,建议自行使用代码防止重复点击,可以使用 js 防抖和节流实现。
228218
* @supported alipay
@@ -287,7 +277,11 @@ declare namespace ButtonProps {
287277
reset
288278
}
289279
/** open-type 的合法值 */
290-
type OpenType = keyof openTypeKeys['weapp'] | keyof openTypeKeys['alipay'] | keyof openTypeKeys['qq']
280+
type OpenType =
281+
| keyof openTypeKeys['weapp']
282+
| keyof openTypeKeys['alipay']
283+
| keyof openTypeKeys['qq']
284+
| keyof openTypeKeys['tt']
291285
/** open-type 的合法值 */
292286
interface openTypeKeys {
293287
weapp: {
@@ -369,6 +363,35 @@ declare namespace ButtonProps {
369363
/** 在自定义开放数据域组件中,向指定好友发起分享据 */
370364
shareMessageToFriend
371365
}
366+
/** TT 小程序专属的 open-type 合法值
367+
* @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
368+
*/
369+
tt: {
370+
/** 触发用户转发, 可以配合 data-channel 属性来设置分享的 channel,具体请参考 ShareParam */
371+
share
372+
/** 获取用户手机号,可以从 bindgetphonenumber 回调中获取到用户信息,详情请参见获取手机号 */
373+
getPhoneNumber
374+
/** 跳转到抖音IM客服,详情请参见抖音IM客服能力 */
375+
im
376+
/** 跳转到抖音平台客服,详情请参见平台客服能力 */
377+
platformIm
378+
/** 跳转视频播放页,详情请参见跳转视频播放页 */
379+
navigateToVideoView
380+
/** 跳转抖音号个人页,详情请参见跳转抖音号个人页 */
381+
openAwemeUserProfile
382+
/** 跳转抖音直播间,详情请参见跳转抖音直播间 */
383+
openWebcastRoom
384+
/** 写入系统日历,详情请参见写入系统日历 */
385+
addCalendarEvent
386+
/** 添加到桌面,详情请参见添加到桌面 */
387+
addShortcut
388+
/** 加群,详情请参见加群 */
389+
joinGroup
390+
/** 私信,详情请参见私信 */
391+
privateMessage
392+
/** 主动授权私信,详情请参见主动授权私信 */
393+
authorizePrivateMessage
394+
}
372395
}
373396
/** lang 的合法值 */
374397
interface Lang {

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/ScrollView.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ComponentType } from 'react'
2-
import { StandardProps, CommonEventFunction, BaseEventOrigFunction } from './common'
2+
import { BaseEventOrigFunction, CommonEventFunction, StandardProps } from './common'
33
interface ScrollViewProps extends StandardProps {
44
/** 允许横向滚动
55
* @default false
@@ -157,7 +157,7 @@ interface ScrollViewProps extends StandardProps {
157157
* center - 目标节点显示在视口中间
158158
* end - 目标节点显示在视口结束处
159159
* nearest - 目标节点在就近的视口边缘显示,若节点已在视口内则不触发滚动
160-
* @supported weapp
160+
* @supported weapp, h5
161161
* @default 'start'
162162
*/
163163
scrollIntoViewAlignment?: 'start' | 'center' | 'end' | 'nearest'

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)