Skip to content

Commit 19555d0

Browse files
authored
refactor(types): sync components types
1 parent bab6f51 commit 19555d0

File tree

11 files changed

+665
-534
lines changed

11 files changed

+665
-534
lines changed

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

Lines changed: 1 addition & 31 deletions
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/GridView.d.ts

Lines changed: 0 additions & 7 deletions
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/Map.d.ts

Lines changed: 0 additions & 24 deletions
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/ScrollView.d.ts

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,6 @@ interface ScrollViewProps extends StandardProps {
8585
* @default false
8686
*/
8787
enhanced?: boolean
88-
/** 使 scroll-view 下的 position sticky 特性生效,否则滚动一屏后 sticky 元素会被隐藏
89-
* @supported weapp
90-
* @default false
91-
*/
92-
usingSticky?: boolean
9388
/** iOS 下 scroll-view 边界弹性控制 (同时开启 enhanced 属性后生效)
9489
* @supported weapp, swan
9590
* @default true
@@ -149,25 +144,10 @@ interface ScrollViewProps extends StandardProps {
149144
* @default false
150145
*/
151146
reverse?: boolean
152-
/** 是否对溢出进行裁剪,默认开启
153-
* @supported weapp
154-
* @default true
155-
*/
156-
clip?: boolean
157147
/** 指定视口外渲染区域的距离,默认情况下视口外节点不渲染。指定 cache-extent 可优化滚动体验和加载速度,但会提高内存占用且影响首屏速度,可按需启用。
158148
* @supported weapp
159149
*/
160150
cacheExtent?: number
161-
/** 指定 scroll-view 触发滚动的最小拖动距离。仅在 scroll-view 和其他组件存在手势冲突时使用,可通过调整该属性使得滚动更加灵敏。
162-
* @supported weapp
163-
* @default 18
164-
*/
165-
minDragDistance?: number
166-
/** 长度为 4 的数组,按 top、right、bottom、left 顺序指定内边距
167-
* @supported weapp
168-
* @default [0,0,0,0]
169-
*/
170-
padding?: [number, number, number, number]
171151
/** 只 scroll-into-view 到 cacheExtent 以内的目标节点,性能更佳
172152
* @supported weapp
173153
* @default false
@@ -182,41 +162,6 @@ interface ScrollViewProps extends StandardProps {
182162
* @default 'start'
183163
*/
184164
scrollIntoViewAlignment?: 'start' | 'center' | 'end' | 'nearest'
185-
/** 开启下拉二级能力
186-
* @supported weapp
187-
* @default false
188-
*/
189-
refresherTwoLevelEnabled?: boolean
190-
/** 设置打开/关闭二级
191-
* @supported weapp
192-
* @default false
193-
*/
194-
refresherTwoLevelTriggered?: boolean
195-
/** 下拉二级阈值
196-
* @supported weapp
197-
* @default 150
198-
*/
199-
refresherTwoLevelThreshold?: number
200-
/** 滑动返回时关闭二级的阈值
201-
* @supported weapp
202-
* @default 80
203-
*/
204-
refresherTwoLevelCloseThreshold?: number
205-
/** 处于二级状态时是否可滑动
206-
* @supported weapp
207-
* @default false
208-
*/
209-
refresherTwoLevelScrollEnabled?: boolean
210-
/** 惯性滚动是否触发下拉刷新
211-
* @supported weapp
212-
* @default false
213-
*/
214-
refresherBallisticRefreshEnabled?: boolean
215-
/** 即将打开二级时否定住
216-
* @supported weapp
217-
* @default false
218-
*/
219-
refresherTwoLevelPinned?: boolean
220165
/** 滚动到顶部/左边,会触发 scrolltoupper 事件
221166
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
222167
*/
@@ -257,10 +202,6 @@ interface ScrollViewProps extends StandardProps {
257202
* @supported weapp
258203
*/
259204
onRefresherWillRefresh?: CommonEventFunction
260-
/** 下拉刷新状态回调
261-
* @supported weapp
262-
*/
263-
onRefresherStatusChange?: CommonEventFunction<ScrollViewProps.RefresherStatusChange>
264205
/** 滑动开始事件 (同时开启 enhanced 属性后生效)
265206
* @supported weapp
266207
*/

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ interface StickySectionProps extends StandardProps {
66
* @default true
77
*/
88
pushPinnedHeader?: boolean
9-
/**
10-
* 长度为 4 的数组,按 top、right、bottom、left 顺序指定内边距
11-
* @supported weapp
12-
* @default [0, 0, 0, 0]
13-
*/
14-
padding?: [number, number, number, number]
159
}
1610
/**
1711
* 吸顶布局容器,仅支持作为 scroll-view 自定义模式下的直接子节点。仅 Skyline 支持。

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ interface TextProps extends StandardProps {
2525
* @supported alipay
2626
*/
2727
numberOfLines?: number
28-
/**
29-
* 文本溢出处理
30-
* @supported weapp-skyline
31-
* @default 'visible'
32-
*/
33-
overflow?: keyof TextProps.Overflow
3428
/** 限制文本最大行数
3529
* @supported weapp
3630
*/

packages/taro/types/api/network/request.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ declare module '../../index' {
7878
/** 接口调用失败的回调函数 */
7979
fail?: (res: TaroGeneral.CallbackResult) => void
8080
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
81-
complete?: (res: Partial<SuccessCallbackResult> & TaroGeneral.CallbackResult) => void
81+
complete?: (res: TaroGeneral.CallbackResult) => void
8282
/** 设置是否使用 jsonp 方式获取数据
8383
* @default false
8484
* @supported h5

packages/taro/types/compile/config/h5.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ export interface IH5RouterConfig {
1414
lazyload?: boolean | ((pagename: string) => boolean)
1515
renamePagename?: (pagename: string) => string
1616
forcePath?: string
17-
/** 加上这个参数,可以解决返回页面的时候白屏的问题,但是某些不支持 :has() 选择器的浏览器会有问题 */
18-
enhanceAnimation?: boolean
1917
}
2018

2119
export interface IH5Config {

packages/taro/types/compile/config/index.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export * from './h5'
22
export * from './mini'
3-
export * from './rn'
43

54
export * from './manifest'
65
export * from './project'

packages/taro/types/compile/config/rn.d.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type Webpack from 'webpack'
22
import type Chain from 'webpack-chain'
33
import type webpackDevServer from 'webpack-dev-server'
44
import type HtmlWebpackPlugin from 'html-webpack-plugin'
5-
import type { RollupOptions } from 'rollup'
65
import type { IOption, IPostcssOption } from './util'
76

87
export interface IRNConfig {
@@ -62,24 +61,4 @@ export interface IRNConfig {
6261

6362
/** 设计稿尺寸换算规则 */
6463
deviceRatio?: TaroGeneral.TDeviceRatio
65-
66-
/** 原生组件编译配置 */
67-
nativeComponents?: {
68-
/**
69-
* 外部依赖
70-
*/
71-
external?: Array<string | RegExp> | ((arr: Array<string | RegExp>) => Array<string | RegExp>)
72-
/**
73-
* 设置外部依赖,如果返回 string, 则将该值作为 external, 我们默认将 node_modules 路径下的文件设置为外部依赖
74-
*/
75-
exteranlResolve?: (importee: string, importer: string) => string
76-
/**
77-
* 组件输出路径,默认值为 'dist'
78-
*/
79-
output?: string
80-
/**
81-
* 修改 Rollup 打包配置
82-
*/
83-
modifyRollupConfig?: (config: RollupOptions, innerPlugins: { taroResolver: typeof taroResolver, styleTransformer: typeof styleTransformer }) => RollupOptions
84-
}
8564
}

0 commit comments

Comments
 (0)