Skip to content

Commit f602aa6

Browse files
authored
refactor(types): sync components types
1 parent 786c0bb commit f602aa6

23 files changed

+197
-554
lines changed

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

+1-31
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ interface ButtonProps extends StandardProps {
130130
/** 群聊 id
131131
* @qq 打开群资料卡时,传递的群号
132132
* @tt 通过创建聊天群、查询群信息获取
133-
* @supported qq, tt
133+
* @supported qq
134134
*/
135135
groupId?: string
136136
/** 打开频道页面时,传递的频道号
@@ -167,15 +167,6 @@ interface ButtonProps extends StandardProps {
167167
* @supported qq
168168
*/
169169
shareMessageImg?: string
170-
/** 跳转抖音号个人页,只支持小程序绑定的品牌号、员工号、合作号
171-
* @supported tt
172-
*/
173-
dataAwemeId?: string
174-
/**
175-
* 是否开启半屏模式
176-
* @supported tt
177-
*/
178-
dataIsHalfPage?: boolean
179170
/** 用户点击该按钮时,会返回获取到的用户信息,回调的detail数据与 Taro.getUserInfo 返回的一致
180171
*
181172
* 生效时机: `open-type="getUserInfo"`
@@ -200,11 +191,6 @@ interface ButtonProps extends StandardProps {
200191
* @supported weapp, alipay, swan, tt, jd
201192
*/
202193
onGetPhoneNumber?: CommonEventFunction<ButtonProps.onGetPhoneNumberEventDetail>
203-
/**
204-
* 手机号实时验证回调,`open-type="getRealtimePhoneNumber"` 时有效
205-
* @supported weapp
206-
*/
207-
onGetRealTimePhoneNumber?: CommonEventFunction<ButtonProps.onGetRealTimePhoneNumberEventDetail>
208194
/** 当使用开放能力时,发生错误的回调
209195
*
210196
* 生效时机:`open-type="launchApp"`
@@ -229,11 +215,6 @@ interface ButtonProps extends StandardProps {
229215
* @supported weapp
230216
*/
231217
onChooseAvatar?: CommonEventFunction
232-
/**
233-
* 用户同意隐私协议事件回调,`open-type="agreePrivacyAuthorization"`时有效
234-
* @supported weapp
235-
*/
236-
onAgreePrivacyAuthorization?: CommonEventFunction
237218
/** 点击。
238219
* 说明: 每点击一次会触发一次事件,建议自行使用代码防止重复点击,可以使用 js 防抖和节流实现。
239220
* @supported alipay
@@ -272,17 +253,6 @@ interface ButtonProps extends StandardProps {
272253
* @supported qq
273254
*/
274255
onAddGroupApp?: CommonEventFunction
275-
/** 监听跳转抖音号个人页的回调
276-
*
277-
* 生效时机:`open-type="openAwemeUserProfile"`
278-
* @supported tt
279-
*/
280-
onOpenAwemeUserProfile?: CommonEventFunction
281-
/**
282-
* 加群后触发
283-
* @supported tt
284-
*/
285-
onJoinGroup?: CommonEventFunction<{ errMsg: string; errNo: number }>
286256
}
287257
declare namespace ButtonProps {
288258
/** size 的合法值 */

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

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,48 @@ import { StandardProps, CommonEventFunction } from './common'
33
interface EditorProps extends StandardProps {
44
/** 设置编辑器为只读
55
* @default false
6-
* @supported weapp, jd
6+
* @supported weapp
77
*/
88
readOnly?: boolean
99
/** 提示信息
10-
* @supported weapp, jd
10+
* @supported weapp
1111
*/
1212
placeholder?: string
1313
/** 点击图片时显示图片大小控件
1414
* @default false
15-
* @supported weapp, jd
15+
* @supported weapp
1616
*/
1717
showImgSize?: boolean
1818
/** 点击图片时显示工具栏控件
1919
* @default false
20-
* @supported weapp, jd
20+
* @supported weapp
2121
*/
2222
showImgToolbar?: boolean
2323
/** 点击图片时显示修改尺寸控件
2424
* @default false
25-
* @supported weapp, jd
25+
* @supported weapp
2626
*/
2727
showImgResize?: boolean
2828
/** 编辑器初始化完成时触发
29-
* @supported weapp, jd
29+
* @supported weapp
3030
*/
3131
onReady?: CommonEventFunction
3232
/** 编辑器聚焦时触发
33-
* @supported weapp, jd
33+
* @supported weapp
3434
*/
3535
onFocus?: CommonEventFunction<EditorProps.editorEventDetail>
3636
/** 编辑器失去焦点时触发
3737
* detail = { html, text, delta }
38-
* @supported weapp, jd
38+
* @supported weapp
3939
*/
4040
onBlur?: CommonEventFunction<EditorProps.editorEventDetail>
4141
/** 编辑器内容改变时触发
4242
* detail = { html, text, delta }
43-
* @supported weapp, jd
43+
* @supported weapp
4444
*/
4545
onInput?: CommonEventFunction<EditorProps.editorEventDetail>
4646
/** 通过 Context 方法改变编辑器内样式时触发,返回选区已设置的样式
47-
* @supported weapp, jd
47+
* @supported weapp
4848
*/
4949
onStatusChange?: CommonEventFunction
5050
}

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

-7
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,7 @@ interface GridViewProps extends StandardProps {
3333
* @default 0
3434
*/
3535
maxCrossAxisExtent?: number
36-
/**
37-
* 长度为 4 的数组,按 top、right、bottom、left 顺序指定内边距
38-
* @supported weapp
39-
* @default [0, 0, 0, 0]
40-
*/
41-
padding?: [number, number, number, number]
4236
}
43-
4437
/**
4538
* 网格布局容器,仅支持作为 scroll-view 自定义模式下的直接子节点或 sticky-section 组件直接子节点。仅 Skyline 支持。
4639
* @classification skyline

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

-24
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ interface InputProps extends StandardProps, FormItemProps {
7878
* @supported weapp, alipay, swan, tt, qq, jd, rn, harmony
7979
*/
8080
cursor?: number
81-
/** 光标颜色。iOS 下的格式为十六进制颜色值 #000000,安卓下的只支持 default 和 green,Skyline 下无限制
82-
* @supported weapp
83-
*/
84-
cursorColor?: string
8581
/** 光标起始位置,自动聚集时有效,需与selection-end搭配使用
8682
* @default -1
8783
* @supported weapp, alipay, swan, tt, qq, jd, rn
@@ -198,26 +194,6 @@ interface InputProps extends StandardProps, FormItemProps {
198194
* @supported weapp
199195
*/
200196
onNickNameReview?: CommonEventFunction
201-
/** 选区改变事件, {selectionStart, selectionEnd}
202-
* @supported weapp
203-
*/
204-
onSelectionChange?: CommonEventFunction
205-
/** 输入法开始新的输入时触发 (仅当输入法支持时触发)
206-
* @supported weapp
207-
*/
208-
onKeyboardCompositionStart?: CommonEventFunction
209-
/** 输入法输入字符时触发(仅当输入法支持时触发)
210-
* @supported weapp
211-
*/
212-
onKeyboardCompositionUpdate?: CommonEventFunction
213-
/** 输入法输入结束时触发(仅当输入法支持时触发)
214-
* @supported weapp
215-
*/
216-
onKeyboardCompositionEnd?: CommonEventFunction
217-
/** 键盘高度变化时触发。event.detail = {height: height, pageBottomPadding: pageBottomPadding}; height: 键盘高度,pageBottomPadding: 页面上推高度
218-
* @supported weapp
219-
*/
220-
onKeyoardHeightChangeWorklet?: string
221197
}
222198
declare namespace InputProps {
223199
/** Input 类型 */

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

-24
Original file line numberDiff line numberDiff line change
@@ -218,30 +218,6 @@ interface MapProps extends StandardProps {
218218
* @supported weapp, swan, qq
219219
*/
220220
onPoiTap?: CommonEventFunction<MapProps.onPoiTapEventDetail>
221-
/** 点击地图路线时触发,e.detail = {longitude, latitude}
222-
* @supported weapp, swan, qq
223-
*/
224-
onPolylineTap?: CommonEventFunction<MapProps.onPolylineTapEventDetail>
225-
/** 地图能力生效时触发,e.detail = {ability, errCode, errMsg}
226-
* @supported weapp
227-
*/
228-
onAbilitySuccess?: CommonEventFunction<MapProps.onAbilityEventDetail>
229-
/** 地图能力失败时触发,e.detail = {ability, errCode, errMsg}
230-
* @supported weapp
231-
*/
232-
onAbilityFailed?: CommonEventFunction<MapProps.onAbilityEventDetail>
233-
/** 地图鉴权结果成功时触发,e.detail = {errCode, errMsg}
234-
* @supported weapp
235-
*/
236-
onAuthSuccess?: CommonEventFunction<{ errCode: number; errMsg: string }>
237-
/** MapContext.moveAlong 插值动画时触发。e.detail = {markerId, longitude, latitude, animationStatus: "interpolating" | "complete"}
238-
* @supported weapp
239-
*/
240-
onInterpolatePoint?: CommonEventFunction<MapProps.onInterpolatePointEventDetail>
241-
/** 组件错误时触发,例如创建或鉴权失败,e.detail = {longitude, latitude}
242-
* @supported weapp
243-
*/
244-
onError: CommonEventFunction<MapProps.point>
245221
/** 点击标记点对应的气泡时触发e.detail = {markerId}
246222
* @supported weapp, swan, tt, jd
247223
*/

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@ import { ComponentType } from 'react'
22
import { StandardProps } from './common'
33
interface MatchMediaProps extends StandardProps {
44
/** 页面最小宽度( px 为单位)
5-
* @supported weapp, alipay, jd
5+
* @supported weapp, alipay
66
*/
77
minWidth?: number
88
/** 页面最大宽度( px 为单位)
9-
* @supported weapp, alipay, jd
9+
* @supported weapp, alipay
1010
*/
1111
maxWidth?: number
1212
/** 页面宽度( px 为单位)
13-
* @supported weapp, alipay, jd
13+
* @supported weapp, alipay
1414
*/
1515
width?: number
1616
/** 页面最小高度( px 为单位)
17-
* @supported weapp, alipay, jd
17+
* @supported weapp, alipay
1818
*/
1919
minHeight?: number
2020
/** 页面最大高度( px 为单位)
21-
* @supported weapp, alipay, jd
21+
* @supported weapp, alipay
2222
*/
2323
maxHeight?: number
2424
/** 页面高度( px 为单位)
25-
* @supported weapp, alipay, jd
25+
* @supported weapp, alipay
2626
*/
2727
height?: number
2828
/** 屏幕方向( landscape 或 portrait )
29-
* @supported weapp, alipay, jd
29+
* @supported weapp, alipay
3030
*/
3131
orientation?: string
3232
}

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

+15-15
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { StandardProps, CommonEventFunction } from './common'
33
interface PageContainerProps extends StandardProps {
44
/** 是否显示容器组件
55
* @default false
6-
* @supported weapp, alipay, jd, rn
6+
* @supported weapp, alipay, rn
77
*/
88
show?: boolean
99
/** 动画时长,单位毫秒
1010
* @default 300
11-
* @supported weapp, alipay, jd, rn
11+
* @supported weapp, alipay, rn
1212
*/
1313
duration?: number
1414
/** z-index 层级
@@ -18,58 +18,58 @@ interface PageContainerProps extends StandardProps {
1818
zIndex?: number
1919
/** 是否显示遮罩层
2020
* @default true
21-
* @supported weapp, alipay, jd, rn
21+
* @supported weapp, alipay, rn
2222
*/
2323
overlay?: boolean
2424
/** 弹出位置,可选值为 top bottom right center
2525
* @default bottom
26-
* @supported weapp, alipay, jd, rn
26+
* @supported weapp, alipay, rn
2727
*/
2828
position?: keyof PageContainerProps.Position
2929
/** 是否显示圆角
3030
* @default false
31-
* @supported weapp, alipay, jd, rn
31+
* @supported weapp, alipay, rn
3232
*/
3333
round?: boolean
3434
/** 自定义遮罩层样式
35-
* @supported weapp, alipay, jd, rn
35+
* @supported weapp, alipay, rn
3636
*/
3737
overlayStyle?: string
3838
/** 自定义弹出层样式
39-
* @supported weapp, alipay, jd, rn
39+
* @supported weapp, alipay, rn
4040
*/
4141
customStyle?: string
4242
/** 是否在下滑一段距离后关闭
43-
* @supported weapp, alipay, jd
43+
* @supported weapp, alipay
4444
* @default false
4545
*/
4646
closeOnSlideDown?: boolean
4747
/** 进入前触发
48-
* @supported weapp, alipay, jd, rn
48+
* @supported weapp, alipay, rn
4949
*/
5050
onBeforeEnter?: CommonEventFunction
5151
/** 进入中触发
52-
* @supported weapp, alipay, jd, rn
52+
* @supported weapp, alipay, rn
5353
*/
5454
onEnter?: CommonEventFunction
5555
/** 进入后触发
56-
* @supported weapp, alipay, jd, rn
56+
* @supported weapp, alipay, rn
5757
*/
5858
onAfterEnter?: CommonEventFunction
5959
/** 离开前触发
60-
* @supported weapp, alipay, jd, rn
60+
* @supported weapp, alipay, rn
6161
*/
6262
onBeforeLeave?: CommonEventFunction
6363
/** 离开中触发
64-
* @supported weapp, alipay, jd, rn
64+
* @supported weapp, alipay, rn
6565
*/
6666
onLeave?: CommonEventFunction
6767
/** 离开后触发
68-
* @supported weapp, alipay, jd, rn
68+
* @supported weapp, alipay, rn
6969
*/
7070
onAfterLeave?: CommonEventFunction
7171
/** 点击遮罩层时触发
72-
* @supported weapp, alipay, jd
72+
* @supported weapp, alipay
7373
*/
7474
onClickOverlay?: CommonEventFunction
7575
/** 进入被打断时触发(通过 a: if 打断时不会触发)。

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

+3-8
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import { CommonEventFunction, StandardProps } from './common'
33
interface RichTextProps extends StandardProps {
44
/** 文本是否可选,该属性会使节点显示为 block
55
* @default false
6-
* @supported weapp, jd, h5, harmony_hybrid
6+
* @supported weapp, h5, harmony_hybrid
77
*/
88
userSelect?: boolean
99
/** 节点列表/ HTML String
10-
* @supported weapp, jd, alipay, swan, tt, qq, h5, rn, harmony, harmony_hybrid
10+
* @supported weapp, alipay, swan, tt, qq, h5, rn, harmony, harmony_hybrid
1111
*/
1212
nodes?: Nodes
1313
/** 显示连续空格
14-
* @supported weapp, jd, alipay, tt, qq, h5, rn, harmony_hybrid
14+
* @supported weapp, alipay, tt, qq, h5, rn, harmony_hybrid
1515
*/
1616
space?: keyof RichTextProps.TSpace
1717
/** 富文本是否可以长按选中,可用于复制,粘贴,长按搜索等场景
@@ -52,11 +52,6 @@ interface RichTextProps extends StandardProps {
5252
* @supported alipay
5353
*/
5454
onLongtap?: CommonEventFunction
55-
/** 布局兼容模式
56-
* @supported weapp
57-
* @default default
58-
*/
59-
mode?: 'default' | 'compat' | 'aggressive' | 'inline-block' | 'web'
6055
}
6156
/** 节点类型
6257
* > 现支持两种节点,通过type来区分,分别是元素节点和文本节点,默认是元素节点,在富文本区域里显示的HTML节点 元素节点:type = node*

0 commit comments

Comments
 (0)