Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types): 类型同步优化 fix #12551 #12559

Merged
merged 7 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/dependabot-update-lockfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
version: 7
run_install: |
- recursive: true
args: [--no-frozen-lockfile]
- run: |
git add pnpm-lock.yaml
git commit -m "build(deps-dev): update pnpm-lock.yaml"
Expand Down
1 change: 0 additions & 1 deletion packages/taro-components/types/Button.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ interface ButtonProps extends StandardProps {
* 当点击按钮时触发。
* event.detail = { followStatus },followStatus 合法值有 1、2、3,其中 1 表示已关注。2 表示用户不允许关注。3 表示发生未知错误;
* 已知问题:基础库 1.0,当用户在点击按钮前已关注生活号,event.detail.followStatus 的值为 true。
* 版本要求:基础库 1.11.0 及以上
* @supported alipay
*/
onFollowLifestyle?: CommonEventFunction<{
Expand Down
11 changes: 0 additions & 11 deletions packages/taro-components/types/Canvas.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@ interface CanvasProps extends StandardProps<any, CanvasTouchEvent> {
*/
id?: string

/** -
* @supported alipay
*/
style?: string

/** -
* @supported alipay
*/
class?: string

/**
* @supported alipay
*/
Expand All @@ -89,7 +79,6 @@ interface CanvasProps extends StandardProps<any, CanvasTouchEvent> {
onTap?: CommonEventFunction

/** canvas 组件初始化成功触发。
* 版本要求:基础库 2.7.0 及以上
* @supported alipay
*/
onReady?: CommonEventFunction
Expand Down
1 change: 0 additions & 1 deletion packages/taro-components/types/CoverImage.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ interface CoverImageProps extends StandardProps {
referrerPolicy?: 'origin' | 'no-referrer'

/** 点击事件回调。
* 版本要求: 基础库 1.9.0 及以上
* @supported alipay
*/
onTap?: CommonEventFunction
Expand Down
1 change: 0 additions & 1 deletion packages/taro-components/types/CoverView.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ interface CoverViewProps extends ViewProps {
scrollTop?: number

/** 点击事件回调。
* 版本要求:基础库 1.9.0 及以上
* @supported alipay
*/
onTap?: CommonEventFunction
Expand Down
11 changes: 0 additions & 11 deletions packages/taro-components/types/Image.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,7 @@ interface ImageProps extends StandardProps {
*/
nativeProps?: Record<string, unknown>

/** 外部样式。
* @supported alipay
*/
class?: string

/** 内联样式。
* @supported alipay
*/
style?: string

/** 默认图片地址,若设置默认图片地址,会先显示默认图片,等 src 对应的图片加载成功后,再渲染对应的图片。
* 版本要求: 基础库 1.19.0 及以上
* @supported alipay
*/
defaultSource?: string
Expand Down
1 change: 0 additions & 1 deletion packages/taro-components/types/Input.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ interface InputProps extends StandardProps, FormItemProps {
name?: string

/** 是否强制使用系统键盘和 Web-view 创建的 input 元素。为 true 时,confirm-type、confirm-hold 可能失效。
* 版本要求:基础库 2.7.3 及以上
* @supported alipay
*/
alwaysSystem?: string
Expand Down
30 changes: 1 addition & 29 deletions packages/taro-components/types/Map.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,19 +234,7 @@ interface MapProps extends StandardProps {
*/
onAnchorPointTap?: CommonEventFunction

/** 内联样式。
* @supported alipay
*/
style?: string

/** 样式名。
* @supported alipay
*/
class?: string

/** 覆盖物,多边形。
*
* 版本要求:基础库 1.10.0 及以上
* @supported alipay
*/
polygon?: string
Expand All @@ -255,37 +243,21 @@ interface MapProps extends StandardProps {
*
* default:默认样式
* light:精简样式
*
* 版本要求:基础库 1.20.0 及以上
* @supported alipay
*/
customMapStyle?: string

/** 基于 map 高级定制渲染,设置覆盖在地图上的 view。
*
* 版本要求:基础库 1.23.0 及以上
* @supported alipay
*/
panels?: string

/** 点击 panel 时触发。
*
* {
*
*    panelId,
*
*    layoutId,
*
* }
*
* 版本要求:基础库 1.23.0 及以上
* @supported alipay
*/
onPanelTap?: CommonEventFunction
onPanelTap?: CommonEventFunction<{ panelId, layoutId }>

/** 地图初始化完成即将开始渲染第一帧时触发。
*
* 版本要求:基础库 2.7.2 及以上
* @supported alipay
*/
onInitComplete?: CommonEventFunction
Expand Down
7 changes: 2 additions & 5 deletions packages/taro-components/types/MovableView.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,11 @@ interface MovableViewProps extends Omit<StandardProps, 'animation'> {
onScale?: CommonEventFunction<MovableViewProps.onScaleEventDetail>

/** 触摸动作开始,事件会向父节点传递。
* 版本要求: 基础库 1.11.5 及以上
* @supported alipay
*/
onTouchStart?: CommonEventFunction

/** 触摸移动事件,事件会向父节点传递。
* 版本要求: 基础库 1.11.5 及以上
/** 触摸动作开始,事件仅作用于组件,不向父节点传递。
* @supported alipay
*/
onTouchMove?: CommonEventFunction
Expand All @@ -144,8 +142,7 @@ interface MovableViewProps extends Omit<StandardProps, 'animation'> {
*/
onVTouchMove?: TouchEventFunction

/** 触摸动作开始,事件仅作用于组件,不向父节点传递。
* 版本要求: 基础库 1.11.5 及以上
/** 触摸移动事件,事件仅作用于组件,不向父节点传递。
* @supported alipay
*/
catchTouchStart?: CommonEventFunction
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/NavigationBar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ interface NavigationBarProps extends StandardProps {
/** 页面导航条配置节点,用于指定导航栏的一些属性。只能是 PageMeta 组件内的第一个节点,需要配合它一同使用。
* 通过这个节点可以获得类似于调用 Taro.setNavigationBarTitle Taro.setNavigationBarColor 等接口调用的效果。
* @supported weapp
* @see https://developers.weixin.qq.com/miniprogram/dev/component/open-data.html
* @see https://developers.weixin.qq.com/miniprogram/dev/component/navigation-bar.html
*/
declare const NavigationBar: ComponentType<NavigationBarProps>
export { NavigationBar, NavigationBarProps }
2 changes: 0 additions & 2 deletions packages/taro-components/types/PickerView.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,11 @@ interface PickerViewProps extends StandardProps {
ariaLabel?: string

/** 当滚动选择开始时候触发事件。
* 版本要求: 基础库 2.7.23 及以上
* @supported alipay
*/
onPickerStart?: CommonEventFunction

/** 当滚动选择结束时候触发事件。
* 版本要求: 基础库 2.7.23 及以上
* @supported alipay
*/
onPickerEnd?: CommonEventFunction
Expand Down
20 changes: 1 addition & 19 deletions packages/taro-components/types/ScrollView.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,61 +176,43 @@ interface ScrollViewProps extends StandardProps {
*/
onDragend?: CommonEventFunction

/** 外部样式名。
* @supported alipay
*/
class?: string

/** 内联样式名。
* @supported alipay
*/
style?: string

/** 当 scroll-with-animation设置为 true 时,可以设置 scroll-animation-duration 来控制动画的执行时间,单位 ms。
* 版本要求: 基础库 1.9.0 及以上
* @supported alipay
*/
scrollAnimationDuration?: string

/** 纵向滚动时,当滚动到顶部或底部时,强制禁止触发页面滚动,仍然只触发 scroll-view 自身的滚动。
* 默认值: false
* 版本要求: 基础库 1.11.2 及以上
* @supported alipay
* @default false
*/
trapScroll?: string

/** 触摸动作开始。
* 版本要求: 基础库 1.15.0 及以上
* @supported alipay
*/
onTouchStart?: CommonEventFunction

/** 触摸后移动。
* 版本要求: 基础库 1.15.0 及以上
* @supported alipay
*/
onTouchMove?: CommonEventFunction

/** 触摸动作结束。
* 版本要求: 基础库 1.15.0 及以上
* @supported alipay
*/
onTouchEnd?: CommonEventFunction

/** 触摸动作被打断,如来电提醒、弹窗。
* 版本要求: 基础库 1.15.0 及以上
* @supported alipay
*/
onTouchCancel?: CommonEventFunction

/** 发生滚动前,对滚动方向进行判断,当方向是顶部/左边时,如果值为 always 将始终禁止滚动,如果值为 out-of-bounds 且当前已经滚动到顶部/左边,禁止滚动。
* 版本要求:基础库 2.6.2 及以上
* @supported alipay
*/
disableLowerScroll?: string

/** 发生滚动前,对滚动方向进行判断,当方向是底部/右边时,如果值为 always 将始终禁止滚动,如果值为 out-of-bounds 且当前已经滚动到底部/右边,禁止滚动。
* 版本要求:基础库 2.6.2 及以上
* @supported alipay
*/
disableUpperScroll?: string
Expand Down
9 changes: 0 additions & 9 deletions packages/taro-components/types/Swiper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,26 +119,22 @@ interface SwiperProps extends StandardProps {
disableTouch?: boolean

/** swiper-item 可见时的 class。
* 版本要求: 基础库 1.13.7 以及上。
* @supported alipay
*/
activeClass?: string

/** acceleration 设置为 {{true}} 时且处于滑动过程中,中间若干屏处于可见时的 class。
* 版本要求: 基础库 1.13.7 以及上。
* @supported alipay
*/
changingClass?: string

/** 当开启时,会根据滑动速度,连续滑动多屏。
* 版本要求: 基础库 1.13.7 及以上
* @default false
* @supported alipay
*/
acceleration?: string

/** 是否禁用代码变动触发 swiper 切换时使用动画。
* 版本要求: 基础库 1.13.7 及以上
* @default false
* @supported alipay
*/
Expand All @@ -150,31 +146,26 @@ interface SwiperProps extends StandardProps {
onAnimationEnd?: CommonEventFunction<SwiperProps.onCommonEventDetail>

/** 滑动距离阈值,当滑动距离超过阈值时进行 swiper-item 切换。
* 版本要求:基础库 1.24.11 及以上
* @supported alipay
*/
swipeRatio?: string

/** 滑动综合速度阈值,当超过阈值时进行 swiper-item 切换,数值越小越敏感。
* 版本要求:基础库 1.24.11 及以上
* @supported alipay
*/
swipeSpeed?: string

/** 计算用户手势时所依赖的滑动角度。角度根据 touchstart 事件和首次 touchmove 事件的坐标计算得出。数值越小越对用户的滑动方向准确度要求越高。
* 版本要求:基础库 1.24.11 及以上
* @supported alipay
*/
touchAngle?: string

/** 自动以指定滑块的高度为整个容器的高度。当 vertical 为 true 时,默认不调整。可选值为:
* 版本要求:基础库 2.6.4 及以上
* @supported alipay
*/
adjustHeight?: 'first' | 'current' | 'highest' | 'none'

/** vertical 为 true 时强制使 adjust-height 生效。
* 版本要求:基础库 2.6.4 及以上
* @supported alipay
*/
adjustVerticalHeight?: string
Expand Down
1 change: 0 additions & 1 deletion packages/taro-components/types/Switch.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ interface SwitchProps extends StandardProps, FormItemProps {
name?: string

/** 是否为受控组件,为 true 时,checked 会完全受 setData 控制。
* 版本要求: 基础库 1.8.0 及以上
* @default false
* @supported alipay
*/
Expand Down
2 changes: 0 additions & 2 deletions packages/taro-components/types/Textarea.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,11 @@ interface TextareaProps extends StandardProps, FormItemProps {
name?: string

/** 是否渲染字数统计功能(是否删除默认计数器/是否显示字数统计)。
* 版本要求: 基础库 1.8.0 及以上
* @supported alipay
*/
showCount?: string

/** 是否为受控组件。为 true 时,value 内容会完全受 setData 控制。
* 版本要求: 基础库 1.8.0 及以上
* @supported alipay
*/
controlled?: string
Expand Down
15 changes: 0 additions & 15 deletions packages/taro-components/types/Video.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,23 +336,12 @@ interface VideoProps extends StandardProps {
*/
onControlsToggle?: CommonEventFunction<VideoProps.onControlsToggleEventDetail>

/** 内联样式。
* @supported alipay
*/
style?: string

/** 外部样式名。
* @supported alipay
*/
class?: string

/** 当 poster 高宽比跟视频高宽不匹配时,如何显示 poster,设置规则同 background-size 一致。
* @supported alipay
*/
posterSize?: string

/** 当底部工具条隐藏时,是否显示细进度条(controls=false 时设置无效)。
* 版本要求: 基础库 1.15.0 及以上
* @supported alipay
*/
showThinProgressBar?: string
Expand All @@ -364,7 +353,6 @@ interface VideoProps extends StandardProps {
* 2 - 阻塞提醒(无消耗流量大小)
* 3 - 阻塞提醒(有消耗流量大小提醒)
*
* 版本要求: 基础库 1.13.0 及以上
* @supported alipay, jd
*/
mobilenetHintType?: string
Expand All @@ -385,13 +373,11 @@ interface VideoProps extends StandardProps {
onUserAction?: CommonEventFunction<VideoProps.onUserActionEventDetail>

/** 视频播放终止。
* 版本要求: 基础库 1.9.0 及以上
* @supported alipay
*/
onStop?: CommonEventFunction

/** 当视频加载完真正开始播放时触发。
* 版本要求: 基础库 1.13.6 及以上
* @supported alipay
*/
onRenderStart?: CommonEventFunction
Expand All @@ -401,7 +387,6 @@ interface VideoProps extends StandardProps {
*
* none:无浮窗。
* page:页面内浮窗。
* 版本要求:基础库 1.24.6 及以上
* @supported alipay
*/
floatingMode?: string
Expand Down
Loading