Skip to content

Commit

Permalink
refactor(types): sync components types
Browse files Browse the repository at this point in the history
  • Loading branch information
learner-pm authored Dec 17, 2022
1 parent 6b09635 commit 6ce09a4
Show file tree
Hide file tree
Showing 32 changed files with 49 additions and 54 deletions.
2 changes: 1 addition & 1 deletion packages/taro-components/types/Button.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ declare namespace ButtonProps {

/** 按钮
* @classification forms
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
* @example_react
* ```tsx
* export default class PageButton extends Component {
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/Camera.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ declare namespace CameraProps {

/** 系统相机
* @classification media
* @supported weapp, alipay, swan, tt, qq, jd, rn
* @supported weapp, alipay, swan, tt, qq, jd, rn, harmony
* @see https://developers.weixin.qq.com/miniprogram/dev/component/camera.html
*/
declare const Camera: ComponentType<CameraProps>
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/Checkbox.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ interface CheckboxProps extends StandardProps {

/** 多选项目
* @classification forms
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
* @example_react
* ```tsx
* export default class PageCheckbox extends Component {
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/CheckboxGroup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface CheckboxGroupProps extends StandardProps, FormItemProps {

/** 多项选择器,内部由多个checkbox组成
* @classification forms
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
* @example
* ```tsx
* export default class PageCheckbox extends Component {
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/CoverImage.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ interface CoverImageProps extends StandardProps {

/** 覆盖在原生组件之上的图片视图。可覆盖的原生组件同cover-view,支持嵌套在cover-view里。
* @classification viewContainer
* @supported weapp, alipay, swan, qq, h5
* @supported weapp, alipay, swan, qq, h5, harmony
* @example_react
* ```tsx
* // js
Expand Down
1 change: 1 addition & 0 deletions packages/taro-components/types/CustomWrapper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ interface CustomWrapperProps extends StandardProps {

/** custom-wrapper 自定义组件包裹器
* 当数据更新层级较深时,可用此组件将需要更新的区域包裹起来,这样更新层级将大大减少
* @classification viewContainer
* @supported weapp, swan, alipay, tt, jd, qq, h5
* @example
* ```tsx
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/Form.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ declare namespace FormProps {
*
* 当点击 form 表单中 form-type 为 submit 的 button 组件时,会将表单组件中的 value 值进行提交,需要在表单组件中加上 name 来作为 key。
* @classification forms
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
* @example_react
* ```tsx
* class App extends Component {
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/Icon.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ declare namespace IconProps {

/** 图标。组件属性的长度单位默认为 px
* @classification base
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
* @example_react
* ```tsx
* export default class PageView extends Component {
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/Image.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ declare namespace ImageProps {
*
* **Note:** 为实现小程序的 `mode` 特性,在 H5 组件中使用一个 `div` 容器来对内部的 `img` 进行展示区域的裁剪,因此请勿使用元素选择器来重置 `img` 的样式!
* @classification media
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
* @example_react
* ```tsx
* export default class PageView extends Component {
Expand Down
22 changes: 15 additions & 7 deletions packages/taro-components/types/Input.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,6 @@ interface InputProps extends StandardProps, FormItemProps {
*/
alwaysSystem?: boolean

/** 使用原生键盘
* @default true
* @supported alipay
*/
enableNative?: boolean

/** 无障碍访问,(属性)元素的额外描述
* @supported qq
*/
Expand Down Expand Up @@ -231,52 +225,66 @@ declare namespace InputProps {
* @supported weapp, alipay, h5, rn
*/
text

/** 数字输入键盘
* @supported weapp, alipay, h5, rn
*/
number

/** 身份证输入键盘
*@supported weapp, alipay, rn
*/
idcard

/** 带小数点的数字键盘
* @supported weapp, alipay, h5, rn
*/
digit

/** 密码安全输入键盘[指引](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/safe-password.html)
* @supported weapp, alipay
*/
'safe-password'

/** 昵称输入键盘
* @supported weapp, alipay
*/
nickname

/** 数字输入键盘
* @supported alipay
*/
numberpad

/** 带小数点的数字键盘
* @supported alipay
*/
digitpad

/** 身份证输入键盘
* @supported alipay
*/
idcardpad
}

/** Confirm 类型 */
interface ConfirmType {
/** 右下角按钮为“发送” */
send

/** 右下角按钮为“搜索” */
search

/** 右下角按钮为“下一个” */
next

/** 右下角按钮为“前往” */
go

/** 右下角按钮为“完成” */
done
}

/** > 注意:React-Native 端 `inputEventDetail` 仅实现参数 `value`,若需实时获取光标位置则可通过 [`onSelectionChange`](https://reactnative.dev/docs/textinput#onselectionchange) 实现。 */
interface inputEventDetail {
/** 输入值 */
Expand Down Expand Up @@ -310,7 +318,7 @@ declare namespace InputProps {

/** 输入框。该组件是原生组件,使用时请注意相关限制
* @classification forms
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
* @example_react
* ```tsx
* class App extends Component {
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/Label.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface LabelProps extends StandardProps {
*
* 使用for属性找到对应的id,或者将控件放在该标签下,当点击时,就会触发对应的控件。 for优先级高于内部控件,内部有多个控件的时候默认触发第一个控件。 目前可以绑定的控件有:button, checkbox, radio, switch。
* @classification forms
* @supported weapp, swan, alipay, tt, h5, rn
* @supported weapp, swan, alipay, tt, h5, rn, harmony
* @example_react
* ```tsx
* class App extends Components {
Expand Down
1 change: 1 addition & 0 deletions packages/taro-components/types/NativeSlot.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface NativeSlotProps {
}

/** 编译的原生组件支持使用 slot 插槽
* @classification viewContainer
* @supported weapp, swan, alipay, tt, jd, qq
* @version 3.5.7+
* @example
Expand Down
3 changes: 2 additions & 1 deletion packages/taro-components/types/NavigationBar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ interface NavigationBarProps extends StandardProps {

/** 页面导航条配置节点,用于指定导航栏的一些属性。只能是 PageMeta 组件内的第一个节点,需要配合它一同使用。
* 通过这个节点可以获得类似于调用 Taro.setNavigationBarTitle Taro.setNavigationBarColor 等接口调用的效果。
* @supported weapp
* @classification navig
* @supported weapp, harmony
* @see https://developers.weixin.qq.com/miniprogram/dev/component/navigation-bar.html
*/
declare const NavigationBar: ComponentType<NavigationBarProps>
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/Navigator.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ declare namespace NavigatorProps {

/** 页面链接
* @classification navig
* @supported weapp, alipay, swan, tt, qq, jd
* @supported weapp, alipay, swan, tt, qq, jd, harmony
* @see https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html
*/
declare const Navigator: ComponentType<NavigatorProps>
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/Picker.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ declare namespace PickerRegionProps {
/**
* 从底部弹起的滚动选择器
* @classification forms
* @supported weapp, swan, alipay, tt, h5, rn
* @supported weapp, swan, alipay, tt, h5, rn, harmony
* @example_react
* ```tsx
* export default class PagePicker extends Component {
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/PickerView.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ declare namespace PickerViewProps {
/** 嵌入页面的滚动选择器
* 其中只可放置 picker-view-column 组件,其它节点不会显示
* @classification forms
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
* @example_react
* ```tsx
* export default class Picks extends Component {
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/PickerViewColumn.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type PickerViewColumnProps = StandardProps
/** 滚动选择器子项
* 仅可放置于 `<PickerView />` 中,其孩子节点的高度会自动设置成与 picker-view 的选中框的高度一致
* @classification forms
* @supported weapp, swan, alipay, tt, h5, rn
* @supported weapp, swan, alipay, tt, h5, rn, harmony
* @see https://developers.weixin.qq.com/miniprogram/dev/component/picker-view-column.html
*/
declare const PickerViewColumn: ComponentType<StandardProps>
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/Progress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ interface ProgressProps extends StandardProps {

/** 进度条。组件属性的长度单位默认为 px
* @classification base
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
* @example_react
* ```tsx
* export default class PageView extends Component {
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/Radio.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ interface RadioProps extends StandardProps {

/** 单选项目
* @classification forms
* @supported weapp, alipay, swan, tt, qq, h5, rn
* @supported weapp, alipay, swan, tt, qq, h5, rn, harmony
* @example_react
* ```tsx
* export default class PageRadio extends Component {
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/RadioGroup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ declare namespace RadioGroupProps {

/** 单项选择器,内部由多个 Radio 组成。
* @classification forms
* @supported weapp, alipay, swan, tt, qq, h5, rn
* @supported weapp, alipay, swan, tt, qq, h5, rn, harmony
* @see https://developers.weixin.qq.com/miniprogram/dev/component/radio-group.html
*/
declare const RadioGroup: ComponentType<RadioGroupProps>
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/RichText.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ declare namespace RichTextProps {

/** 富文本
* @classification base
* @supported weapp, swan, alipay, tt, h5, rn
* @supported weapp, swan, alipay, tt, h5, rn, harmony
* @example_react
* ```tsx
* class App extends Components {
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/ScrollView.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ declare namespace ScrollViewProps {
* H5 中 ScrollView 组件是通过一个高度(或宽度)固定的容器内部滚动来实现的,因此务必正确的设置容器的高度。例如: 如果 ScrollView 的高度将 body 撑开,就会同时存在两个滚动条(body 下的滚动条,以及 ScrollView 的滚动条)。
* 微信小程序 中 ScrollView 组件如果设置 scrollX 横向滚动时,并且子元素为多个时(单个子元素时设置固定宽度则可以正常横向滚动),需要通过 WXSS 设置 `white-space: nowrap` 来保证元素不换行,并对 ScrollView 内部元素设置 `display: inline-block` 来使其能够横向滚动。
* @classification viewContainer
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
* @example_react
* ```tsx
* export default class PageView extends Component {
Expand Down
9 changes: 2 additions & 7 deletions packages/taro-components/types/ShareElement.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@ import { ComponentType } from 'react'
import { StandardProps, CommonEventFunction } from './common'
interface ShareElementProps extends StandardProps {
/** 映射标记
* @supported weapp
* @supported weapp
*/
key?: string

/** 映射标记
* @supported weapp
*/
mapkey?: string

/** 映射标记
* @supported alipay
* @supported alipay
*/
name?: string

Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/Slider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ declare namespace SliderProps {

/** 滑动选择器
* @classification forms
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
* @example_react
* ```tsx
* export default class PageView extends Component {
Expand Down
3 changes: 2 additions & 1 deletion packages/taro-components/types/Slot.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ interface SlotProps {
}

/** slot 插槽
* @supported weapp, swan, alipay, tt, jd, qq
* @classification viewContainer
* @supported weapp, swan, alipay, tt, jd, qq, harmony
* @example
* ```tsx
* import { Slot, View, Text } from '@tarojs/components'
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/Swiper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ declare namespace SwiperProps {
/** 滑块视图容器。其中只可放置 swiper-item 组件,否则会导致未定义的行为。
* > 不要为 `SwiperItem` 设置 **style** 属性,可以通过 class 设置样式。[7147](https://github.com/NervJS/taro/issues/7147)
* @classification viewContainer
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
* @example_react
* ```tsx
* class App extends Component {
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/SwiperItem.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface SwiperItemProps extends StandardProps {
/** 仅可放置在 swiper 组件中,宽高自动设置为100%
* > 不要为 `SwiperItem` 设置 **style** 属性,可以通过 class 设置样式。[7147](https://github.com/NervJS/taro/issues/7147)
* @classification viewContainer
* @supported weapp, alipay, swan, tt, jd, h5, rn
* @supported weapp, alipay, swan, tt, jd, h5, rn, harmony
* @example_react
* ```tsx
* class App extends Component {
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/Switch.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ declare namespace SwitchProps {
* </view>
* </template>
* ```
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
* @see https://developers.weixin.qq.com/miniprogram/dev/component/switch.html
*/
declare const Switch: ComponentType<SwitchProps>
Expand Down
8 changes: 1 addition & 7 deletions packages/taro-components/types/Textarea.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,6 @@ interface TextareaProps extends StandardProps, FormItemProps {
*/
controlled?: string

/** 使用原生键盘
* @default false
* @supported alipay
*/
enableNative?: boolean

/** 无障碍访问,(属性)元素的额外描述
* @supported qq
*/
Expand Down Expand Up @@ -224,7 +218,7 @@ declare namespace TextareaProps {

/** 多行输入框。该组件是原生组件,使用时请注意相关限制
* @classification forms
* @supported weapp, alipay, swan, tt, qq, h5, rn
* @supported weapp, alipay, swan, tt, qq, h5, rn, harmony
* @example_react
* ```tsx
* export default class PageView extends Component {
Expand Down
8 changes: 1 addition & 7 deletions packages/taro-components/types/Video.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,6 @@ interface VideoProps extends StandardProps {
*/
mobilenetHintType?: string

/** 使用原生
* @default true
* @supported alipay
*/
enableNative?: boolean

/** 浮窗设置。暂时不支持全局浮窗。
* 可选值:
*
Expand Down Expand Up @@ -643,7 +637,7 @@ declare namespace VideoProps {

/** 视频。相关api:Taro.createVideoContext
* @classification media
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
* @example_react
* ```tsx
* export default class PageView extends Component {
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components/types/View.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ interface ViewProps extends StandardProps {

/** 视图容器
* @classification viewContainer
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony
* @example_react
* ```tsx
* export default class PageView extends Component {
Expand Down
Loading

0 comments on commit 6ce09a4

Please sign in to comment.