From 8c74a9991fa0c452bf73232d5a6b01681f80ab43 Mon Sep 17 00:00:00 2001 From: ZakaryCode Date: Sat, 21 Sep 2024 00:10:23 +0000 Subject: [PATCH] refactor(types): sync components types --- packages/taro-components/types/Button.d.ts | 42 ++--------- packages/taro-components/types/Camera.d.ts | 2 +- packages/taro-components/types/Checkbox.d.ts | 10 +-- .../taro-components/types/CoverImage.d.ts | 2 +- packages/taro-components/types/Form.d.ts | 4 +- packages/taro-components/types/GridView.d.ts | 7 -- packages/taro-components/types/Icon.d.ts | 6 +- packages/taro-components/types/Image.d.ts | 5 +- packages/taro-components/types/Input.d.ts | 30 ++++---- packages/taro-components/types/Label.d.ts | 2 +- packages/taro-components/types/ListView.d.ts | 2 +- packages/taro-components/types/Map.d.ts | 24 ------- .../taro-components/types/NavigationBar.d.ts | 8 +-- packages/taro-components/types/Navigator.d.ts | 2 +- packages/taro-components/types/PageMeta.d.ts | 14 ++-- packages/taro-components/types/Picker.d.ts | 49 +++++++------ .../taro-components/types/PickerView.d.ts | 2 +- .../types/PickerViewColumn.d.ts | 2 +- packages/taro-components/types/Progress.d.ts | 2 +- packages/taro-components/types/Radio.d.ts | 10 +-- .../taro-components/types/RadioGroup.d.ts | 2 +- .../taro-components/types/ScrollView.d.ts | 69 ++---------------- packages/taro-components/types/Slider.d.ts | 28 ++++---- packages/taro-components/types/Slot.d.ts | 2 +- .../taro-components/types/StickyHeader.d.ts | 2 +- .../taro-components/types/StickySection.d.ts | 8 +-- packages/taro-components/types/Swiper.d.ts | 22 +++--- .../taro-components/types/SwiperItem.d.ts | 2 +- packages/taro-components/types/Switch.d.ts | 10 +-- packages/taro-components/types/Text.d.ts | 10 +-- packages/taro-components/types/Textarea.d.ts | 14 ++-- packages/taro-components/types/Video.d.ts | 32 ++++----- packages/taro-components/types/common.d.ts | 9 +-- packages/taro-components/types/index.d.ts | 20 ------ packages/taro/types/api/base/env.d.ts | 2 +- packages/taro/types/api/base/system.d.ts | 4 +- .../taro/types/api/base/weapp/app-event.d.ts | 8 +-- .../taro/types/api/device/accelerometer.d.ts | 8 +-- packages/taro/types/api/device/battery.d.ts | 4 +- packages/taro/types/api/device/clipboard.d.ts | 28 ++++---- packages/taro/types/api/device/keyboard.d.ts | 4 +- packages/taro/types/api/device/network.d.ts | 6 +- packages/taro/types/api/device/phone.d.ts | 2 +- packages/taro/types/api/device/screen.d.ts | 4 +- packages/taro/types/api/device/vibrate.d.ts | 4 +- packages/taro/types/api/media/image.d.ts | 6 +- packages/taro/types/api/network/request.d.ts | 4 +- packages/taro/types/api/route/index.d.ts | 10 +-- packages/taro/types/api/storage/index.d.ts | 8 +-- packages/taro/types/api/swan/pay.d.ts | 8 +-- packages/taro/types/api/taro.extend.d.ts | 8 +-- packages/taro/types/api/ui/animation.d.ts | 2 +- packages/taro/types/api/ui/interaction.d.ts | 6 +- .../taro/types/api/ui/navigation-bar.d.ts | 10 +-- .../taro/types/api/ui/pull-down-refresh.d.ts | 4 +- packages/taro/types/api/ui/scroll.d.ts | 2 +- packages/taro/types/api/ui/tab-bar.d.ts | 14 ++-- packages/taro/types/api/wxml/index.d.ts | 24 +++---- packages/taro/types/compile/compiler.d.ts | 13 ++-- packages/taro/types/compile/config/h5.d.ts | 35 +++------- packages/taro/types/compile/config/index.d.ts | 2 - packages/taro/types/compile/config/mini.d.ts | 53 +++++++------- .../taro/types/compile/config/project.d.ts | 70 ++++++------------- packages/taro/types/compile/config/rn.d.ts | 21 ------ packages/taro/types/compile/config/util.d.ts | 28 ++------ packages/taro/types/compile/index.d.ts | 8 --- packages/taro/types/index.d.ts | 1 + packages/taro/types/taro.component.d.ts | 1 - packages/taro/types/taro.config.d.ts | 5 -- 69 files changed, 299 insertions(+), 573 deletions(-) diff --git a/packages/taro-components/types/Button.d.ts b/packages/taro-components/types/Button.d.ts index eda7e182ac28..b41e406e6512 100644 --- a/packages/taro-components/types/Button.d.ts +++ b/packages/taro-components/types/Button.d.ts @@ -8,27 +8,27 @@ interface ButtonProps extends StandardProps { */ size?: keyof ButtonProps.Size /** 按钮的样式类型 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid * @default default */ type?: keyof ButtonProps.Type /** 按钮是否镂空,背景色透明 - * @supported weapp, alipay, swan, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, qq, jd, h5, rn, harmony_hybrid * @default false */ plain?: boolean /** 是否禁用 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid * @default false */ disabled?: boolean /** 名称前是否带 loading 图标 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid * @default false */ loading?: boolean /** 用于 `
` 组件,点击分别会触发 `` 组件的 submit/reset 事件 - * @supported weapp, alipay, swan, tt, qq, jd, harmony + * @supported weapp, alipay, swan, tt, qq, jd */ formType?: keyof ButtonProps.FormType /** 微信开放能力 @@ -130,7 +130,7 @@ interface ButtonProps extends StandardProps { /** 群聊 id * @qq 打开群资料卡时,传递的群号 * @tt 通过创建聊天群、查询群信息获取 - * @supported qq, tt + * @supported qq */ groupId?: string /** 打开频道页面时,传递的频道号 @@ -167,15 +167,6 @@ interface ButtonProps extends StandardProps { * @supported qq */ shareMessageImg?: string - /** 跳转抖音号个人页,只支持小程序绑定的品牌号、员工号、合作号 - * @supported tt - */ - dataAwemeId?: string - /** - * 是否开启半屏模式 - * @supported tt - */ - dataIsHalfPage?: boolean /** 用户点击该按钮时,会返回获取到的用户信息,回调的detail数据与 Taro.getUserInfo 返回的一致 * * 生效时机: `open-type="getUserInfo"` @@ -200,11 +191,6 @@ interface ButtonProps extends StandardProps { * @supported weapp, alipay, swan, tt, jd */ onGetPhoneNumber?: CommonEventFunction - /** - * 手机号实时验证回调,`open-type="getRealtimePhoneNumber"` 时有效 - * @supported weapp - */ - onGetRealTimePhoneNumber?: CommonEventFunction /** 当使用开放能力时,发生错误的回调 * * 生效时机:`open-type="launchApp"` @@ -229,11 +215,6 @@ interface ButtonProps extends StandardProps { * @supported weapp */ onChooseAvatar?: CommonEventFunction - /** - * 用户同意隐私协议事件回调,`open-type="agreePrivacyAuthorization"`时有效 - * @supported weapp - */ - onAgreePrivacyAuthorization?: CommonEventFunction /** 点击。 * 说明: 每点击一次会触发一次事件,建议自行使用代码防止重复点击,可以使用 js 防抖和节流实现。 * @supported alipay @@ -272,17 +253,6 @@ interface ButtonProps extends StandardProps { * @supported qq */ onAddGroupApp?: CommonEventFunction - /** 监听跳转抖音号个人页的回调 - * - * 生效时机:`open-type="openAwemeUserProfile"` - * @supported tt - */ - onOpenAwemeUserProfile?: CommonEventFunction - /** - * 加群后触发 - * @supported tt - */ - onJoinGroup?: CommonEventFunction<{ errMsg: string; errNo: number }> } declare namespace ButtonProps { /** size 的合法值 */ diff --git a/packages/taro-components/types/Camera.d.ts b/packages/taro-components/types/Camera.d.ts index 8c82f7ba4080..0b0207e271e3 100644 --- a/packages/taro-components/types/Camera.d.ts +++ b/packages/taro-components/types/Camera.d.ts @@ -121,7 +121,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 diff --git a/packages/taro-components/types/Checkbox.d.ts b/packages/taro-components/types/Checkbox.d.ts index ea468c9e5a67..172e3cef0943 100644 --- a/packages/taro-components/types/Checkbox.d.ts +++ b/packages/taro-components/types/Checkbox.d.ts @@ -2,21 +2,21 @@ import { ComponentType } from 'react' import { StandardProps, CommonEventFunction, FormItemProps } from './common' interface CheckboxProps extends StandardProps { /** ``标识,选中时触发``的 change 事件,并携带 `` 的 value - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ value: string /** 是否禁用 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid * @default false */ disabled?: boolean /** 当前是否选中,可用来设置默认选中 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid * @default false */ checked?: boolean /** checkbox的颜色,同 css 的 color - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ color?: string /** @@ -33,7 +33,7 @@ interface CheckboxProps extends StandardProps { */ ariaLabel?: string /** 选中项发生变化时触发 change 事件,小程序无此 API - * @supported alipay, h5, rn, harmony, harmony_hybrid + * @supported alipay, h5, rn, harmony_hybrid */ onChange?: CommonEventFunction<{ value: string[] diff --git a/packages/taro-components/types/CoverImage.d.ts b/packages/taro-components/types/CoverImage.d.ts index e1cc2a628991..f4e6b43d15b9 100644 --- a/packages/taro-components/types/CoverImage.d.ts +++ b/packages/taro-components/types/CoverImage.d.ts @@ -48,7 +48,7 @@ interface CoverImageProps extends StandardProps { } /** 覆盖在原生组件之上的图片视图。可覆盖的原生组件同cover-view,支持嵌套在cover-view里。 * @classification viewContainer - * @supported weapp, alipay, swan, qq, jd, h5, harmony_hybrid + * @supported weapp, alipay, swan, qq, jd, h5, harmony, harmony_hybrid * @example_react * ```tsx * // js diff --git a/packages/taro-components/types/Form.d.ts b/packages/taro-components/types/Form.d.ts index 2539ee20a554..7b612900944b 100644 --- a/packages/taro-components/types/Form.d.ts +++ b/packages/taro-components/types/Form.d.ts @@ -43,11 +43,11 @@ interface FormProps extends StandardProps { */ clueComponentId?: string /** 携带 form 中的数据触发 submit 事件 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ onSubmit?: CommonEventFunction /** 表单重置时会触发 reset 事件 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ onReset?: CommonEventFunction } diff --git a/packages/taro-components/types/GridView.d.ts b/packages/taro-components/types/GridView.d.ts index bfcb06be1038..a06467eb10c4 100644 --- a/packages/taro-components/types/GridView.d.ts +++ b/packages/taro-components/types/GridView.d.ts @@ -33,14 +33,7 @@ interface GridViewProps extends StandardProps { * @default 0 */ maxCrossAxisExtent?: number - /** - * 长度为 4 的数组,按 top、right、bottom、left 顺序指定内边距 - * @supported weapp - * @default [0, 0, 0, 0] - */ - padding?: [number, number, number, number] } - /** * 网格布局容器,仅支持作为 scroll-view 自定义模式下的直接子节点或 sticky-section 组件直接子节点。仅 Skyline 支持。 * @classification skyline diff --git a/packages/taro-components/types/Icon.d.ts b/packages/taro-components/types/Icon.d.ts index 7ff5d5d19317..54cbed3cc001 100644 --- a/packages/taro-components/types/Icon.d.ts +++ b/packages/taro-components/types/Icon.d.ts @@ -2,16 +2,16 @@ import { ComponentType } from 'react' import { StandardProps } from './common' interface IconProps extends StandardProps { /** icon 的类型 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ type: keyof IconProps.TIconType /** icon 的大小,单位px * @default 23 * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ - size?: number + size?: string /** icon 的颜色,同 css 的 color - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ color?: string /** 无障碍访问,(属性)元素的额外描述 diff --git a/packages/taro-components/types/Image.d.ts b/packages/taro-components/types/Image.d.ts index f0cc0fafe5c2..971cfbf07071 100644 --- a/packages/taro-components/types/Image.d.ts +++ b/packages/taro-components/types/Image.d.ts @@ -2,14 +2,13 @@ import { ComponentType, ImgHTMLAttributes } from 'react' import { StandardProps, CommonEventFunction } from './common' interface ImageProps extends StandardProps { /** 图片资源地址 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ src: string /** 图片裁剪、缩放的模式 * @default "scaleToFill" - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid * @rn 部分支持 scaleToFill, aspectFit, aspectFill, widthFix - * @harmony 部分支持 scaleToFill, aspectFit, aspectFill, widthFix, heightFix */ mode?: keyof ImageProps.Mode /** 默认不解析 webP 格式,只支持网络资源 diff --git a/packages/taro-components/types/Input.d.ts b/packages/taro-components/types/Input.d.ts index 69efb7ad8692..375c9a59d50a 100644 --- a/packages/taro-components/types/Input.d.ts +++ b/packages/taro-components/types/Input.d.ts @@ -2,7 +2,7 @@ import { ComponentType } from 'react' import { StandardProps, CommonEventFunction, FormItemProps } from './common' interface InputProps extends StandardProps, FormItemProps { /** 输入框的初始内容 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ value?: string /** 设置 React 非受控输入框的初始内容 @@ -12,20 +12,20 @@ interface InputProps extends StandardProps, FormItemProps { defaultValue?: string /** input 的类型 * @default "text" - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ type?: keyof InputProps.Type /** 是否是密码类型 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ password?: boolean /** 输入框为空时占位符 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ placeholder?: string /** 指定 placeholder 的样式 - * @supported weapp, alipay, swan, tt, qq, jd, rn, harmony + * @supported weapp, alipay, swan, tt, qq, jd, rn */ placeholderStyle?: string /** 指定 placeholder 的样式类 @@ -34,7 +34,7 @@ interface InputProps extends StandardProps, FormItemProps { */ placeholderClass?: string /** 指定 placeholder 的文本颜色 - * @supported rn, harmony + * @supported rn */ placeholderTextColor?: string /** 是否禁用 @@ -44,7 +44,7 @@ interface InputProps extends StandardProps, FormItemProps { disabled?: boolean /** 最大输入长度,设置为 -1 的时候不限制最大长度 * @default 140 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ maxlength?: number /** 指定光标与键盘的距离,单位 px 。取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 @@ -66,7 +66,7 @@ interface InputProps extends StandardProps, FormItemProps { /** 设置键盘右下角按钮的文字,仅在type='text'时生效 * @alipay confirm-type 与 enableNative 属性冲突,若希望 confirm-type 生效,enableNative 不能设定为 false,而且不能设定 always-system * @default done - * @supported weapp, alipay, swan, tt, qq, jd, rn, harmony + * @supported weapp, alipay, swan, tt, qq, jd, rn */ confirmType?: keyof InputProps.ConfirmType /** 点击键盘右下角按钮时是否保持键盘不收起 @@ -75,7 +75,7 @@ interface InputProps extends StandardProps, FormItemProps { */ confirmHold?: boolean /** 指定focus时的光标位置 - * @supported weapp, alipay, swan, tt, qq, jd, rn, harmony + * @supported weapp, alipay, swan, tt, qq, jd, rn */ cursor?: number /** 光标起始位置,自动聚集时有效,需与selection-end搭配使用 @@ -90,7 +90,7 @@ interface InputProps extends StandardProps, FormItemProps { selectionEnd?: number /** 键盘弹起时,是否自动上推页面 * @default true - * @supported weapp, swan, tt, qq, jd, harmony + * @supported weapp, swan, tt, qq, jd */ adjustPosition?: boolean /** focus 时,点击页面的时候不收起键盘 @@ -171,23 +171,23 @@ interface InputProps extends StandardProps, FormItemProps { */ clueType?: number /** 当键盘输入时,触发input事件,event.detail = {value, cursor, keyCode},处理函数可以直接 return 一个字符串,将替换输入框的内容。 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ onInput?: CommonEventFunction /** 输入框聚焦时触发,event.detail = { value, height },height 为键盘高度 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ onFocus?: CommonEventFunction /** 输入框失去焦点时触发 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ onBlur?: CommonEventFunction /** 点击完成按钮时触发 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ onConfirm?: CommonEventFunction /** 键盘高度发生变化的时候触发此事件 - * @supported weapp, tt, qq, harmony + * @supported weapp, tt, qq */ onKeyboardHeightChange?: CommonEventFunction /** 用户昵称审核完毕后触发,仅在 type 为 "nickname" 时有效,event.detail = { pass, timeout } diff --git a/packages/taro-components/types/Label.d.ts b/packages/taro-components/types/Label.d.ts index 273ae03f566f..c212f3411c80 100644 --- a/packages/taro-components/types/Label.d.ts +++ b/packages/taro-components/types/Label.d.ts @@ -2,7 +2,7 @@ import { ComponentType } from 'react' import { StandardProps } from './common' interface LabelProps extends StandardProps { /** 绑定控件的 id - * @supported weapp, alipay, swan, tt, qq, jd, h5, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, harmony_hybrid */ for?: string } diff --git a/packages/taro-components/types/ListView.d.ts b/packages/taro-components/types/ListView.d.ts index 32d5f6ff1d93..cb1234947e01 100644 --- a/packages/taro-components/types/ListView.d.ts +++ b/packages/taro-components/types/ListView.d.ts @@ -12,7 +12,7 @@ interface ListViewProps extends StandardProps { /** * 列表布局容器,仅支持作为 scroll-view 自定义模式下的直接子节点或 sticky-section 组件直接子节点。仅 Skyline 支持。 * @classification skyline - * @supported weapp, harmony + * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/component/list-view.html */ declare const ListView: ComponentType diff --git a/packages/taro-components/types/Map.d.ts b/packages/taro-components/types/Map.d.ts index 472141277828..ca863b5ba5d3 100644 --- a/packages/taro-components/types/Map.d.ts +++ b/packages/taro-components/types/Map.d.ts @@ -218,30 +218,6 @@ interface MapProps extends StandardProps { * @supported weapp, swan, qq */ onPoiTap?: CommonEventFunction - /** 点击地图路线时触发,e.detail = {longitude, latitude} - * @supported weapp, swan, qq - */ - onPolylineTap?: CommonEventFunction - /** 地图能力生效时触发,e.detail = {ability, errCode, errMsg} - * @supported weapp - */ - onAbilitySuccess?: CommonEventFunction - /** 地图能力失败时触发,e.detail = {ability, errCode, errMsg} - * @supported weapp - */ - onAbilityFailed?: CommonEventFunction - /** 地图鉴权结果成功时触发,e.detail = {errCode, errMsg} - * @supported weapp - */ - onAuthSuccess?: CommonEventFunction<{ errCode: number; errMsg: string }> - /** MapContext.moveAlong 插值动画时触发。e.detail = {markerId, longitude, latitude, animationStatus: "interpolating" | "complete"} - * @supported weapp - */ - onInterpolatePoint?: CommonEventFunction - /** 组件错误时触发,例如创建或鉴权失败,e.detail = {longitude, latitude} - * @supported weapp - */ - onError: CommonEventFunction /** 点击标记点对应的气泡时触发e.detail = {markerId} * @supported weapp, swan, tt, jd */ diff --git a/packages/taro-components/types/NavigationBar.d.ts b/packages/taro-components/types/NavigationBar.d.ts index 254ce2877fd4..a2a1c575a9b8 100644 --- a/packages/taro-components/types/NavigationBar.d.ts +++ b/packages/taro-components/types/NavigationBar.d.ts @@ -2,19 +2,19 @@ import { ComponentType } from 'react' import { StandardProps, CommonEventFunction } from './common' interface NavigationBarProps extends StandardProps { /** 导航条标题 - * @supported weapp, harmony + * @supported weapp */ title?: string /** 是否在导航条显示 loading 加载提示 - * @supported weapp, harmony + * @supported weapp */ loading?: boolean /** 导航条前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000 - * @supported weapp, harmony + * @supported weapp */ frontColor?: string /** 导航条背景颜色值,有效值为十六进制颜色 - * @supported weapp, harmony + * @supported weapp */ backgroundColor?: string /** 改变导航栏颜色时的动画时长,默认为 0 (即没有动画效果) diff --git a/packages/taro-components/types/Navigator.d.ts b/packages/taro-components/types/Navigator.d.ts index dc0da4f41827..d5d6d1050af1 100644 --- a/packages/taro-components/types/Navigator.d.ts +++ b/packages/taro-components/types/Navigator.d.ts @@ -111,7 +111,7 @@ declare namespace NavigatorProps { } /** 页面链接 * @classification navig - * @supported weapp, alipay, swan, tt, qq, jd, h5, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, harmony, h5, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html */ declare const Navigator: ComponentType diff --git a/packages/taro-components/types/PageMeta.d.ts b/packages/taro-components/types/PageMeta.d.ts index f4054679eec5..72b44b73473d 100644 --- a/packages/taro-components/types/PageMeta.d.ts +++ b/packages/taro-components/types/PageMeta.d.ts @@ -6,25 +6,25 @@ interface PageMetaProps extends StandardProps { */ backgroundTextStyle?: string /** 窗口的背景色,必须为十六进制颜色值 - * @supported weapp, alipay, harmony + * @supported weapp, alipay */ backgroundColor?: string /** 顶部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持 - * @supported weapp, alipay, harmony + * @supported weapp, alipay */ backgroundColorTop?: string /** 底部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持 - * @supported weapp, alipay, harmony + * @supported weapp, alipay */ backgroundColorBottom?: string /** 滚动位置,可以使用 px 或者 rpx 为单位,在被设置时,页面会滚动到对应位置 * @default "" - * @supported weapp, alipay, harmony + * @supported weapp, alipay */ scrollTop?: string /** 滚动动画时长 * @default 300 - * @supported weapp, alipay, harmony + * @supported weapp, alipay */ scrollDuration?: number /** 页面根节点样式,页面根节点是所有页面节点的祖先节点,相当于 HTML 中的 body 节点 @@ -38,7 +38,7 @@ interface PageMetaProps extends StandardProps { */ rootFontSize?: string /** 页面内容的背景色,用于页面中的空白部分和页面大小变化 resize 动画期间的临时空闲区域 - * @supported weapp, alipay, harmony + * @supported weapp, alipay */ rootBackgroundColor?: string /** 页面 page 的字体大小,可以设置为 system ,表示使用当前用户设置的微信字体大小 @@ -92,7 +92,7 @@ declare namespace PageMetaProps { * 开发者需要在页面配置里添加:`enablePageMeta: true` * ::: * - * @supported weapp, alipay, harmony + * @supported weapp, alipay * @example_react * ```tsx * // page.config.ts diff --git a/packages/taro-components/types/Picker.d.ts b/packages/taro-components/types/Picker.d.ts index 59642506509b..a4e9af9f3679 100644 --- a/packages/taro-components/types/Picker.d.ts +++ b/packages/taro-components/types/Picker.d.ts @@ -11,7 +11,7 @@ interface PickerStandardProps extends StandardProps, FormItemProps { /** * 选择器类型,默认是普通选择器 * @default "selector" - * @supported weapp, h5, rn, harmony, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid */ mode?: keyof PickerStandardProps.Mode /** @@ -22,14 +22,9 @@ interface PickerStandardProps extends StandardProps, FormItemProps { disabled?: boolean /** * 取消选择或点遮罩层收起 picker 时触发 - * @supported weapp, h5, rn, harmony, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid */ onCancel?: CommonEventFunction - /** - * 用于替换组件内部文本 - * @supported h5, harmony, harmony_hybrid - */ - textProps?: PickerStandardProps.PickerText } declare namespace PickerStandardProps { /** 选择器类型 */ @@ -56,18 +51,18 @@ interface PickerSelectorProps extends PickerStandardProps { mode?: 'selector' /** * mode为 selector 或 multiSelector 时,range 有效 - * @supported weapp, h5, rn, harmony, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid * @default [] */ range: string[] | number[] | Record[] /** * 当 range 是一个 Object Array 时,通过 rangeKey 来指定 Object 中 key 的值作为选择器显示内容 - * @supported weapp, h5, rn, harmony, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid */ rangeKey?: string /** * 表示选择了 range 中的第几个(下标从 0 开始) - * @supported weapp, h5, rn, harmony, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid * @default 0 */ value?: number @@ -89,9 +84,14 @@ interface PickerSelectorProps extends PickerStandardProps { indicatorStyle?: StyleProp /** * value 改变时触发 change 事件 - * @supported weapp, h5, rn, harmony, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid */ onChange?: CommonEventFunction + /** + * 用于替换组件内部文本 + * @supported h5, harmony_hybrid + */ + textProps?: PickerStandardProps.PickerText } declare namespace PickerSelectorProps { interface ChangeEventDetail { @@ -105,18 +105,18 @@ interface PickerMultiSelectorProps extends PickerStandardProps { mode: 'multiSelector' /** * mode为 selector 或 multiSelector 时,range 有效 - * @supported weapp, h5, rn, harmony, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid * @default [] */ range: Array | Array | Array[]> /** * 当 range 是一个 Object Array 时,通过 rangeKey 来指定 Object 中 key 的值作为选择器显示内容 - * @supported weapp, h5, rn, harmony, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid */ rangeKey?: string /** * 表示选择了 range 中的第几个(下标从 0 开始) - * @supported weapp, h5, rn, harmony, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid * @default [] */ value: number[] | string[] | Record[] @@ -134,12 +134,12 @@ interface PickerMultiSelectorProps extends PickerStandardProps { indicatorStyle?: StyleProp /** * 当 value 改变时触发 change 事件 - * @supported weapp, h5, rn, harmony, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid */ onChange: CommonEventFunction /** * 列改变时触发 - * @supported weapp, h5, rn, harmony, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid */ onColumnChange?: CommonEventFunction } @@ -161,7 +161,7 @@ interface PickerTimeProps extends PickerStandardProps { mode: 'time' /** * value 的值表示选择了 range 中的第几个(下标从 0 开始) - * @supported weapp, h5, rn, harmony, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid */ value?: string /** 设置 React 非受控状态下的初始取值 @@ -170,17 +170,17 @@ interface PickerTimeProps extends PickerStandardProps { defaultValue?: string /** * 仅当 mode 为 "time" 或 "date" 时有效,表示有效时间范围的开始,字符串格式为"hh:mm" - * @supported weapp, h5, rn, harmony, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid */ start?: string /** * 仅当 mode 为 "time" 或 "date" 时有效,表示有效时间范围的结束,字符串格式为"hh:mm" - * @supported weapp, h5, rn, harmony, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid */ end?: string /** * value 改变时触发 change 事件 - * @supported weapp, h5, rn, harmony, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid */ onChange: CommonEventFunction } @@ -196,7 +196,7 @@ interface PickerDateProps extends PickerStandardProps { mode: 'date' /** * 表示选中的日期,格式为"YYYY-MM-DD" - * @supported weapp, h5, rn, harmony, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid * @default 0 */ value: string @@ -206,12 +206,12 @@ interface PickerDateProps extends PickerStandardProps { defaultValue?: string /** * 仅当 mode 为 "time" 或 "date" 时有效,表示有效时间范围的开始,字符串格式为"YYYY-MM-DD" - * @supported weapp, h5, rn, harmony, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid */ start?: string /** * 仅当 mode 为 "time" 或 "date" 时有效,表示有效时间范围的结束,字符串格式为"YYYY-MM-DD" - * @supported weapp, h5, rn, harmony, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid */ end?: string /** @@ -222,7 +222,7 @@ interface PickerDateProps extends PickerStandardProps { fields?: keyof PickerDateProps.Fields /** * value 改变时触发 change 事件 - * @supported weapp, h5, rn, harmony, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid */ onChange: CommonEventFunction } @@ -289,7 +289,6 @@ declare namespace PickerRegionProps { value: string code: string postcode?: string - children?: RegionData[] } interface Level { /** 省级选择器 */ diff --git a/packages/taro-components/types/PickerView.d.ts b/packages/taro-components/types/PickerView.d.ts index 1e203d0f0aa5..1f9724666895 100644 --- a/packages/taro-components/types/PickerView.d.ts +++ b/packages/taro-components/types/PickerView.d.ts @@ -60,7 +60,7 @@ declare namespace PickerViewProps { /** 嵌入页面的滚动选择器 * 其中只可放置 picker-view-column 组件,其它节点不会显示 * @classification forms - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid * @example_react * ```tsx * export default class Picks extends Component { diff --git a/packages/taro-components/types/PickerViewColumn.d.ts b/packages/taro-components/types/PickerViewColumn.d.ts index ad4ea1f132aa..767785f68697 100644 --- a/packages/taro-components/types/PickerViewColumn.d.ts +++ b/packages/taro-components/types/PickerViewColumn.d.ts @@ -5,7 +5,7 @@ type PickerViewColumnProps = StandardProps /** 滚动选择器子项 * 仅可放置于 `` 中,其孩子节点的高度会自动设置成与 picker-view 的选中框的高度一致 * @classification forms - * @supported weapp, swan, alipay, tt, h5, rn, harmony_hybrid + * @supported weapp, swan, alipay, tt, h5, rn, harmony, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/component/picker-view-column.html */ declare const PickerViewColumn: ComponentType diff --git a/packages/taro-components/types/Progress.d.ts b/packages/taro-components/types/Progress.d.ts index 2eeb570345fa..6c4cb35a2ba5 100644 --- a/packages/taro-components/types/Progress.d.ts +++ b/packages/taro-components/types/Progress.d.ts @@ -68,7 +68,7 @@ interface ProgressProps extends StandardProps { } /** 进度条。组件属性的长度单位默认为 px * @classification base - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid * @example_react * ```tsx * export default class PageView extends Component { diff --git a/packages/taro-components/types/Radio.d.ts b/packages/taro-components/types/Radio.d.ts index 5941710b4226..16658650f3b2 100644 --- a/packages/taro-components/types/Radio.d.ts +++ b/packages/taro-components/types/Radio.d.ts @@ -2,22 +2,22 @@ import { ComponentType } from 'react' import { StandardProps, CommonEventFunction, FormItemProps } from './common' interface RadioProps extends StandardProps { /** `` 标识。当该`` 选中时,``的 change 事件会携带``的 value - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ value?: string /** 当前是否选中 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ checked?: boolean /** 是否禁用 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ disabled?: boolean /** Radio 的颜色,同 css 的 color * @default "#09BB07" - * @supported weapp, alipay, swan, tt, qq, jd, rn, harmony + * @supported weapp, alipay, swan, tt, qq, jd, rn */ color?: string /** @@ -34,7 +34,7 @@ interface RadioProps extends StandardProps { */ ariaLabel?: string /** 中的选中项发生变化时触发 change 事件 - * @supported h5, rn, harmony, harmony_hybrid + * @supported h5, rn, harmony_hybrid */ onChange?: CommonEventFunction<{ value?: string diff --git a/packages/taro-components/types/RadioGroup.d.ts b/packages/taro-components/types/RadioGroup.d.ts index 18adf213afce..34bba0cf0456 100644 --- a/packages/taro-components/types/RadioGroup.d.ts +++ b/packages/taro-components/types/RadioGroup.d.ts @@ -2,7 +2,7 @@ import { ComponentType } from 'react' import { StandardProps, CommonEventFunction, FormItemProps } from './common' interface RadioGroupProps extends StandardProps, FormItemProps { /** 组件名字,用于表单提交获取数据。 - * @supported alipay, tt, harmony + * @supported alipay, tt */ name?: string /** RadioGroup 中选中项发生改变时触发 change 事件,detail = {value:[选中的radio的value的数组]} diff --git a/packages/taro-components/types/ScrollView.d.ts b/packages/taro-components/types/ScrollView.d.ts index 61183a1207ad..8f3aed972a00 100644 --- a/packages/taro-components/types/ScrollView.d.ts +++ b/packages/taro-components/types/ScrollView.d.ts @@ -3,13 +3,13 @@ import { BaseEventOrigFunction, CommonEventFunction, StandardProps } from './com interface ScrollViewProps extends StandardProps { /** 允许横向滚动 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid * @rn 二选一 */ scrollX?: boolean /** 允许纵向滚动 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid * @rn 二选一 */ scrollY?: boolean @@ -85,18 +85,13 @@ interface ScrollViewProps extends StandardProps { * @default false */ enhanced?: boolean - /** 使 scroll-view 下的 position sticky 特性生效,否则滚动一屏后 sticky 元素会被隐藏 - * @supported weapp - * @default false - */ - usingSticky?: boolean /** iOS 下 scroll-view 边界弹性控制 (同时开启 enhanced 属性后生效) * @supported weapp, swan * @default true */ bounces?: boolean /** 滚动条显隐控制 (同时开启 enhanced 属性后生效) - * @supported weapp, harmony + * @supported weapp * @default true */ showScrollbar?: boolean @@ -140,7 +135,7 @@ interface ScrollViewProps extends StandardProps { * list - 列表模式。只会渲染在屏节点,会根据直接子节点是否在屏来按需渲染,若只有一个直接子节点则性能会退化 * custom - 自定义模式。只会渲染在屏节点,子节点可以是 sticky-section list-view grid-view 等组件 * nested - 嵌套模式。用于处理父子 scroll-view 间的嵌套滚动,子节点可以是 nested-scroll-header nested-scroll-body 组件或自定义 refresher - * @supported weapp, harmony + * @supported weapp * @default 'list' */ type?: 'list' | 'custom' | 'nested' @@ -149,25 +144,10 @@ interface ScrollViewProps extends StandardProps { * @default false */ reverse?: boolean - /** 是否对溢出进行裁剪,默认开启 - * @supported weapp - * @default true - */ - clip?: boolean /** 指定视口外渲染区域的距离,默认情况下视口外节点不渲染。指定 cache-extent 可优化滚动体验和加载速度,但会提高内存占用且影响首屏速度,可按需启用。 * @supported weapp */ cacheExtent?: number - /** 指定 scroll-view 触发滚动的最小拖动距离。仅在 scroll-view 和其他组件存在手势冲突时使用,可通过调整该属性使得滚动更加灵敏。 - * @supported weapp - * @default 18 - */ - minDragDistance?: number - /** 长度为 4 的数组,按 top、right、bottom、left 顺序指定内边距 - * @supported weapp - * @default [0,0,0,0] - */ - padding?: [number, number, number, number] /** 只 scroll-into-view 到 cacheExtent 以内的目标节点,性能更佳 * @supported weapp * @default false @@ -182,41 +162,6 @@ interface ScrollViewProps extends StandardProps { * @default 'start' */ scrollIntoViewAlignment?: 'start' | 'center' | 'end' | 'nearest' - /** 开启下拉二级能力 - * @supported weapp - * @default false - */ - refresherTwoLevelEnabled?: boolean - /** 设置打开/关闭二级 - * @supported weapp - * @default false - */ - refresherTwoLevelTriggered?: boolean - /** 下拉二级阈值 - * @supported weapp - * @default 150 - */ - refresherTwoLevelThreshold?: number - /** 滑动返回时关闭二级的阈值 - * @supported weapp - * @default 80 - */ - refresherTwoLevelCloseThreshold?: number - /** 处于二级状态时是否可滑动 - * @supported weapp - * @default false - */ - refresherTwoLevelScrollEnabled?: boolean - /** 惯性滚动是否触发下拉刷新 - * @supported weapp - * @default false - */ - refresherBallisticRefreshEnabled?: boolean - /** 即将打开二级时否定住 - * @supported weapp - * @default false - */ - refresherTwoLevelPinned?: boolean /** 滚动到顶部/左边,会触发 scrolltoupper 事件 * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ @@ -226,7 +171,7 @@ interface ScrollViewProps extends StandardProps { */ onScrollToLower?: CommonEventFunction /** 滚动时触发 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ onScroll?: BaseEventOrigFunction /** 滚动开始事件 @@ -257,10 +202,6 @@ interface ScrollViewProps extends StandardProps { * @supported weapp */ onRefresherWillRefresh?: CommonEventFunction - /** 下拉刷新状态回调 - * @supported weapp - */ - onRefresherStatusChange?: CommonEventFunction /** 滑动开始事件 (同时开启 enhanced 属性后生效) * @supported weapp */ diff --git a/packages/taro-components/types/Slider.d.ts b/packages/taro-components/types/Slider.d.ts index 7fa28d638be8..6d95bd3ec4a5 100644 --- a/packages/taro-components/types/Slider.d.ts +++ b/packages/taro-components/types/Slider.d.ts @@ -3,27 +3,27 @@ import { StandardProps, CommonEventFunction, FormItemProps } from './common' interface SliderProps extends StandardProps, FormItemProps { /** 最小值 * @default 0 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ min?: number /** 最大值 * @default 100 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ max?: number /** 步长,取值必须大于 0,并且可被(max - min)整除 * @default 1 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ step?: number /** 是否禁用 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ disabled?: boolean /** 当前取值 * @default 0 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ value?: number /** 设置 React 非受控状态下的初始取值 @@ -33,37 +33,37 @@ interface SliderProps extends StandardProps, FormItemProps { defaultValue?: string /** 背景条的颜色(请使用 backgroundColor) * @default "#e9e9e9" - * @supported weapp, tt, qq, jd, harmony + * @supported weapp, tt, qq, jd */ color?: string /** 已选择的颜色(请使用 activeColor) * @default "#1aad19" - * @supported weapp, tt, qq, jd, harmony + * @supported weapp, tt, qq, jd */ selectedColor?: string /** 已选择的颜色 * @default "#1aad19" - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ activeColor?: string /** 背景条的颜色 * @default "#e9e9e9" - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ backgroundColor?: string /** 滑块的大小,取值范围为 12 - 28 * @default 28 - * @supported weapp, swan, tt, qq, jd, h5, harmony, harmony_hybrid + * @supported weapp, swan, tt, qq, jd, h5, harmony_hybrid */ blockSize?: number /** 滑块的颜色 * @default "#ffffff" - * @supported weapp, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, swan, tt, qq, jd, h5, rn, harmony_hybrid */ blockColor?: string /** 是否显示当前 value * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ showValue?: boolean /** 组件名字,用于表单提交获取数据。 @@ -89,11 +89,11 @@ interface SliderProps extends StandardProps, FormItemProps { */ ariaLabel?: string /** 完成一次拖动后触发的事件 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ onChange?: CommonEventFunction /** 拖动过程中触发的事件 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ onChanging?: CommonEventFunction } diff --git a/packages/taro-components/types/Slot.d.ts b/packages/taro-components/types/Slot.d.ts index 5739ea151900..f3a47059392a 100644 --- a/packages/taro-components/types/Slot.d.ts +++ b/packages/taro-components/types/Slot.d.ts @@ -17,7 +17,7 @@ interface SlotProps extends StandardProps { /** slot 插槽 * @classification viewContainer - * @supported weapp, swan, alipay, tt, jd, qq, h5, harmony_hybrid + * @supported weapp, swan, alipay, tt, jd, qq, harmony, h5, harmony_hybrid * @example * ```tsx * import { Slot, View, Text } from '@tarojs/components' diff --git a/packages/taro-components/types/StickyHeader.d.ts b/packages/taro-components/types/StickyHeader.d.ts index 2e08d996922d..87cc3c6f0860 100644 --- a/packages/taro-components/types/StickyHeader.d.ts +++ b/packages/taro-components/types/StickyHeader.d.ts @@ -18,7 +18,7 @@ interface StickyHeaderProps extends StandardProps { /** * 吸顶布局容器,仅支持作为 scroll-view 自定义模式下的直接子节点或 sticky-section 组件直接子节点。仅 Skyline 支持。 * @classification skyline - * @supported weapp, harmony + * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/component/sticky-header.html */ declare const StickyHeader: ComponentType diff --git a/packages/taro-components/types/StickySection.d.ts b/packages/taro-components/types/StickySection.d.ts index d7396a026bff..cbb2e51c50eb 100644 --- a/packages/taro-components/types/StickySection.d.ts +++ b/packages/taro-components/types/StickySection.d.ts @@ -6,17 +6,11 @@ interface StickySectionProps extends StandardProps { * @default true */ pushPinnedHeader?: boolean - /** - * 长度为 4 的数组,按 top、right、bottom、left 顺序指定内边距 - * @supported weapp - * @default [0, 0, 0, 0] - */ - padding?: [number, number, number, number] } /** * 吸顶布局容器,仅支持作为 scroll-view 自定义模式下的直接子节点。仅 Skyline 支持。 * @classification skyline - * @supported weapp, harmony + * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/component/sticky-section.html */ declare const StickySection: ComponentType diff --git a/packages/taro-components/types/Swiper.d.ts b/packages/taro-components/types/Swiper.d.ts index d4783a93c1e2..e3e546204cb6 100644 --- a/packages/taro-components/types/Swiper.d.ts +++ b/packages/taro-components/types/Swiper.d.ts @@ -3,27 +3,27 @@ import { StandardProps, CommonEventFunction } from './common' interface SwiperProps extends StandardProps { /** 是否显示面板指示点 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ indicatorDots?: boolean /** 指示点颜色 * @default "rgba(0, 0, 0, .3)" - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ indicatorColor?: string /** 当前选中的指示点颜色 * @default "#000000" - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ indicatorActiveColor?: string /** 是否自动切换 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ autoplay?: boolean /** 当前所在滑块的 index * @default 0 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ current?: number /** 当前所在滑块的 item-id ,不能与 current 被同时指定 @@ -34,12 +34,12 @@ interface SwiperProps extends StandardProps { currentItemId?: string /** 自动切换时间间隔 * @default 5000 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ interval?: number /** 滑动动画时长 * @default 500 - * @supported weapp, alipay, swan, tt, qq, jd, h5, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, harmony_hybrid */ duration?: number /** 是否采用衔接滑动 @@ -49,7 +49,7 @@ interface SwiperProps extends StandardProps { circular?: boolean /** 滑动方向是否为纵向 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ vertical?: boolean /** 前边距,可用于露出前一项的一小部分,接受 px 和 rpx 值 @@ -151,12 +151,8 @@ interface SwiperProps extends StandardProps { * @default 0 */ cacheExtent?: number - /** swiper11 相关的动效参数,具体见文档 https://swiperjs.com/swiper-api#parameters - * @supported h5 - */ - effectsProps?: Record /** current 改变时会触发 change 事件 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ onChange?: CommonEventFunction /** swiper-item 的位置发生改变时会触发 transition 事件 diff --git a/packages/taro-components/types/SwiperItem.d.ts b/packages/taro-components/types/SwiperItem.d.ts index 18f2e6421615..c8908eea1440 100644 --- a/packages/taro-components/types/SwiperItem.d.ts +++ b/packages/taro-components/types/SwiperItem.d.ts @@ -2,7 +2,7 @@ import { ComponentType } from 'react' import { StandardProps } from './common' interface SwiperItemProps extends StandardProps { /** 该 swiper-item 的标识符 - * @supported weapp, swan, tt, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, swan, tt, jd, h5, rn, harmony_hybrid */ itemId?: string /** 是否跳过未显示的滑块布局,设为 true 可优化复杂情况下的滑动性能,但会丢失隐藏状态滑块的布局信息 diff --git a/packages/taro-components/types/Switch.d.ts b/packages/taro-components/types/Switch.d.ts index 199d4fb4f377..e3bd221ed737 100644 --- a/packages/taro-components/types/Switch.d.ts +++ b/packages/taro-components/types/Switch.d.ts @@ -3,7 +3,7 @@ import { StandardProps, CommonEventFunction, FormItemProps } from './common' interface SwitchProps extends StandardProps, FormItemProps { /** 是否选中 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ checked?: boolean /** 设置在 React 非受控状态下,当前是否选中 @@ -13,17 +13,17 @@ interface SwitchProps extends StandardProps, FormItemProps { defaultChecked?: boolean /** 是否禁用 * @default false - * @supported weapp, alipay, swan, tt, qq, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, h5, rn, harmony_hybrid */ disabled?: boolean /** 样式,有效值:switch, checkbox * @default "switch" - * @supported weapp, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, swan, tt, qq, jd, h5, rn, harmony_hybrid */ type?: 'switch' | 'checkbox' /** switch 的颜色,同 css 的 color * @default "#04BE02" - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ color?: string /** 用于透传 `WebComponents` 上的属性到内部 H5 标签上 @@ -44,7 +44,7 @@ interface SwitchProps extends StandardProps, FormItemProps { */ ariaLabel?: string /** checked 改变时触发 change 事件 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ onChange?: CommonEventFunction } diff --git a/packages/taro-components/types/Text.d.ts b/packages/taro-components/types/Text.d.ts index b93e11dbadd7..092f949102b7 100644 --- a/packages/taro-components/types/Text.d.ts +++ b/packages/taro-components/types/Text.d.ts @@ -25,14 +25,8 @@ interface TextProps extends StandardProps { * @supported alipay */ numberOfLines?: number - /** - * 文本溢出处理 - * @supported weapp-skyline - * @default 'visible' - */ - overflow?: keyof TextProps.Overflow /** 限制文本最大行数 - * @supported weapp, harmony + * @supported weapp */ maxLines?: number } @@ -59,7 +53,7 @@ declare namespace TextProps { } /** 文本 * @classification base - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid * @example_react * ```tsx * export default class PageView extends Component { diff --git a/packages/taro-components/types/Textarea.d.ts b/packages/taro-components/types/Textarea.d.ts index be1322484e7e..f9fb83a96bd9 100644 --- a/packages/taro-components/types/Textarea.d.ts +++ b/packages/taro-components/types/Textarea.d.ts @@ -2,7 +2,7 @@ import { ComponentType } from 'react' import { StandardProps, CommonEventFunction, FormItemProps } from './common' interface TextareaProps extends StandardProps, FormItemProps { /** 输入框的内容 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ value?: string /** 设置 React 非受控输入框的初始内容 @@ -11,11 +11,11 @@ interface TextareaProps extends StandardProps, FormItemProps { */ defaultValue?: string /** 输入框为空时占位符 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ placeholder?: string /** 指定 placeholder 的样式 - * @supported weapp, alipay, swan, tt, qq, jd, harmony + * @supported weapp, alipay, swan, tt, qq, jd */ placeholderStyle?: string /** 指定 placeholder 的样式类 @@ -129,11 +129,11 @@ interface TextareaProps extends StandardProps, FormItemProps { */ adjustKeyboardTo?: boolean /** 输入框聚焦时触发 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ onFocus?: CommonEventFunction /** 输入框失去焦点时触发 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ onBlur?: CommonEventFunction /** 输入框行数变化时调用 @@ -143,7 +143,7 @@ interface TextareaProps extends StandardProps, FormItemProps { /** 当键盘输入时,触发 input 事件 * * **onInput 处理函数的返回值并不会反映到 textarea 上** - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ onInput?: CommonEventFunction /** 点击完成时, 触发 confirm 事件 @@ -151,7 +151,7 @@ interface TextareaProps extends StandardProps, FormItemProps { */ onConfirm?: CommonEventFunction /** 键盘高度发生变化的时候触发此事件 - * @supported weapp, tt, harmony + * @supported weapp, tt */ onKeyboardHeightChange?: CommonEventFunction } diff --git a/packages/taro-components/types/Video.d.ts b/packages/taro-components/types/Video.d.ts index fe40bded39e2..7cb6276134d9 100644 --- a/packages/taro-components/types/Video.d.ts +++ b/packages/taro-components/types/Video.d.ts @@ -2,16 +2,16 @@ import { ComponentType } from 'react' import { StandardProps, CommonEventFunction } from './common' interface VideoProps extends StandardProps { /** 要播放视频的资源地址 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ src: string /** 指定视频时长 - * @supported weapp, alipay, qq, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, qq, h5, rn, harmony_hybrid */ duration?: number /** 是否显示默认播放控件(播放/暂停按钮、播放进度、时间) * @default true - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ controls?: boolean /** 弹幕列表 @@ -30,17 +30,17 @@ interface VideoProps extends StandardProps { enableDanmu?: boolean /** 是否自动播放 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ autoplay?: boolean /** 是否循环播放 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ loop?: boolean /** 是否静音播放 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ muted?: boolean /** 指定视频初始播放位置 @@ -83,7 +83,7 @@ interface VideoProps extends StandardProps { enableProgressGesture?: boolean /** 当视频大小与 video 容器大小不一致时,视频的表现形式 * @default "contain" - * @supported weapp, alipay, swan, tt, qq, jd, h5, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, harmony_hybrid */ objectFit?: keyof VideoProps.ObjectFit /** 视频封面的图片网络资源地址,如果 controls 属性值为 false 则设置 poster 无效 @@ -298,24 +298,24 @@ interface VideoProps extends StandardProps { */ definition?: string /** 当开始/继续播放时触发 play 事件 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ onPlay?: CommonEventFunction /** 当暂停播放时触发 pause 事件 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ onPause?: CommonEventFunction /** 当播放到末尾时触发 ended 事件 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ onEnded?: CommonEventFunction /** 播放进度变化时触发, 触发频率 250ms 一次 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ onTimeUpdate?: CommonEventFunction /** 当视频进入和退出全屏时触发 * - * @supported alipay, h5, rn, harmony, harmony_hybrid + * @supported h5, rn, harmony_hybrid */ onFullscreenChange?: CommonEventFunction /** 视频出现缓冲时触发 @@ -328,11 +328,11 @@ interface VideoProps extends StandardProps { */ onError?: CommonEventFunction /** 加载进度变化时触发,只支持一段加载 - * @supported weapp, tt, qq, h5, harmony, harmony_hybrid + * @supported weapp, tt, qq, h5, harmony_hybrid */ onProgress?: CommonEventFunction /** 视频元数据加载完成时触发 - * @supported weapp, swan, tt, jd, rn, harmony + * @supported weapp, swan, tt, jd, rn */ onLoadedMetaData?: CommonEventFunction /** @@ -433,11 +433,11 @@ interface VideoProps extends StandardProps { */ onLoadStart?: CommonEventFunction /** 否 - * @supported jd, harmony + * @supported jd */ onSeeked?: CommonEventFunction /** 否 - * @supported jd, harmony + * @supported jd */ onSeeking?: CommonEventFunction /** 贴片广告加载成功时触发,event.detail = { adType: 'preRollAd' | 'postRollAd' } diff --git a/packages/taro-components/types/common.d.ts b/packages/taro-components/types/common.d.ts index 1095225b39c5..ccd56263e377 100644 --- a/packages/taro-components/types/common.d.ts +++ b/packages/taro-components/types/common.d.ts @@ -3,7 +3,7 @@ import { CSSProperties, LegacyRef, ReactNode } from 'react' export interface StandardProps = ITouchEvent> extends EventProps { /** 组件的唯一标示, 保持整个页面唯一 */ id?: string - /** 同 `class`,在 React/Preact 里一般使用 `className` 作为 `class` 的代称 */ + /** 同 `class`,在 React/Nerv 里一般使用 `className` 作为 `class` 的代称 */ className?: string /** 组件的内联样式, 可以动态设置的内联样式 */ style?: string | CSSProperties @@ -30,12 +30,7 @@ export interface StandardProps = * 是否开启编译模式 * @supported weapp, harmony */ - compileMode?: boolean | string - /** - * 自定义容器组件的方向 - * @supported harmony - */ - harmonyDirection?: 'row' | 'column' | 'flex' + compileMode?: boolean } export interface FormItemProps { diff --git a/packages/taro-components/types/index.d.ts b/packages/taro-components/types/index.d.ts index b9e401cbe090..ac618d98119a 100644 --- a/packages/taro-components/types/index.d.ts +++ b/packages/taro-components/types/index.d.ts @@ -15,7 +15,6 @@ export { ScrollView } from './ScrollView' export { Swiper } from './Swiper' export { SwiperItem } from './SwiperItem' export { View } from './View' -export { AnimationView } from './AnimationView' /** 基础内容 */ export { Icon } from './Icon' @@ -60,25 +59,20 @@ export { NestedScrollBody } from './NestedScrollBody' export { FunctionalPageNavigator } from './FunctionalPageNavigator' export { Navigator } from './Navigator' export { NavigationBar } from './NavigationBar' -export { Tabs } from './Tabs' // export { Tabbar } from './Tabbar' // export { TabbarItem } from './TabbarItem' /** 媒体组件 */ export { Audio } from './Audio' export { Camera } from './Camera' -export { ArCamera } from './ArCamera' export { ChannelLive } from './ChannelLive' export { ChannelVideo } from './ChannelVideo' export { Image } from './Image' export { LivePlayer } from './LivePlayer' export { LivePusher } from './LivePusher' export { Video } from './Video' -export { AnimationVideo } from './AnimationVideo' export { VoipRoom } from './VoipRoom' export { Lottie } from './Lottie' -export { RtcRoom } from './RtcRoom' -export { RtcRoomItem } from './RtcRoomItem' /** 地图 */ export { Map } from './Map' @@ -88,29 +82,15 @@ export { Canvas } from './Canvas' /** 开放能力 */ export { Ad } from './Ad' -export { AwemeData } from './AwemeData' export { AdCustom } from './AdCustom' export { OfficialAccount } from './OfficialAccount' export { OpenData } from './OpenData' export { WebView } from './WebView' -export { FollowSwan } from './FollowSwan' -export { InlinePaymentPanel } from './InlinePaymentPanel' -export { Lifestyle } from './Lifestyle' -export { Login } from './Login' /** 配置节点 */ export { PageMeta } from './PageMeta' -/** 内容服务组件 **/ -export { CommentDetail } from './CommentDetail' -export { CommentList } from './CommentList' -export { Like } from './Like' - -/** 客服能力 **/ -export { ContactButton } from './ContactButton' - export { CustomWrapper } from './CustomWrapper' export { Slot } from './Slot' export { NativeSlot } from './NativeSlot' export { Script } from './Script' -export { PullToRefresh } from './PullToRefresh' \ No newline at end of file diff --git a/packages/taro/types/api/base/env.d.ts b/packages/taro/types/api/base/env.d.ts index 2eb5a32b346f..4af6ec22599a 100644 --- a/packages/taro/types/api/base/env.d.ts +++ b/packages/taro/types/api/base/env.d.ts @@ -9,7 +9,7 @@ declare module '../../index' { env: { [key: string]: string | undefined /** 框架 */ - FRAMEWORK: 'react' | 'preact' | 'solid' | 'vue3' + FRAMEWORK: 'react' | 'preact' | 'nerv' | 'vue' | 'vue3' /** Taro 环境变量 */ TARO_ENV: 'weapp' | 'h5' | 'rn' | 'swan' | 'alipay' | 'tt' | 'qq' | 'jd' | 'quickapp' /** 文件系统中的用户目录路径 (本地路径) */ diff --git a/packages/taro/types/api/base/system.d.ts b/packages/taro/types/api/base/system.d.ts index 3e20b53b49f8..09bd8430117f 100644 --- a/packages/taro/types/api/base/system.d.ts +++ b/packages/taro/types/api/base/system.d.ts @@ -546,7 +546,7 @@ declare module '../../index' { getSystemSetting(): getSystemSetting.Result /** [Taro.getSystemInfo](./getSystemInfo) 的同步版本 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @h5 不支持 version、statusBarHeight、fontSizeSetting、SDKVersion * @weapp 小程序可以在微信和企业微信中调用此接口,但是在企业微信中调用此接口时,会额外返回一个 environment 字段(微信中不返回),如此字段值为 wxwork,则表示当前小程序运行在企业微信环境中。 * @example @@ -591,7 +591,7 @@ declare module '../../index' { getSystemInfoAsync(res?: getSystemInfoAsync.Option): Promise /** 获取系统信息,支持 `Promise` 化使用。 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @h5 不支持 version、statusBarHeight、fontSizeSetting、SDKVersion * @weapp 小程序可以在微信和企业微信中调用此接口,但是在企业微信中调用此接口时,会额外返回一个 environment 字段(微信中不返回),如此字段值为 wxwork,则表示当前小程序运行在企业微信环境中。 * @example diff --git a/packages/taro/types/api/base/weapp/app-event.d.ts b/packages/taro/types/api/base/weapp/app-event.d.ts index b67bd4bfca12..9613b3c9c72d 100644 --- a/packages/taro/types/api/base/weapp/app-event.d.ts +++ b/packages/taro/types/api/base/weapp/app-event.d.ts @@ -113,7 +113,7 @@ declare module '../../../index' { * * **注意** * - 所有的 unhandledRejection 都可以被这一监听捕获,但只有 Error 类型的才会在小程序后台触发报警。 - * @supported weapp, tt, h5, harmony, harmony_hybrid + * @supported weapp, tt, h5, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onUnhandledRejection.html */ onUnhandledRejection(callback: onUnhandledRejection.Callback): void @@ -137,7 +137,7 @@ declare module '../../../index' { onPageNotFound(callback: onPageNotFound.Callback): void /** 监听小程序错误事件。如脚本错误或 API 调用报错等。该事件与 [`App.onError`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onerrorstring-error) 的回调时机与参数一致。 - * @supported weapp, tt, h5, harmony, harmony_hybrid + * @supported weapp, tt, h5, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onError.html */ onError(callback: onError.Callback): void @@ -196,7 +196,7 @@ declare module '../../../index' { ): void /** 取消监听未处理的 Promise 拒绝事件 - * @supported weapp, tt, h5, harmony, harmony_hybrid + * @supported weapp, tt, h5, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offUnhandledRejection.html */ offUnhandledRejection(callback: onUnhandledRejection.Callback): void @@ -217,7 +217,7 @@ declare module '../../../index' { ): void /** 取消监听音频播放错误事件 - * @supported weapp, tt, h5, harmony, harmony_hybrid + * @supported weapp, tt, h5, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offError.html */ diff --git a/packages/taro/types/api/device/accelerometer.d.ts b/packages/taro/types/api/device/accelerometer.d.ts index 3d5e8bbba23f..02cf4b7a0e2c 100644 --- a/packages/taro/types/api/device/accelerometer.d.ts +++ b/packages/taro/types/api/device/accelerometer.d.ts @@ -56,7 +56,7 @@ declare module '../../index' { * ```tsx * Taro.startAccelerometer({ interval: 'game' }) * ``` - * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony + * @supported weapp, alipay, swan, jd, qq, tt, h5, rn * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.startAccelerometer.html */ startAccelerometer (res?: startAccelerometer.Option): Promise @@ -67,14 +67,14 @@ declare module '../../index' { * ```tsx * Taro.stopAccelerometer() * ``` - * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony + * @supported weapp, alipay, swan, jd, qq, tt, h5, rn * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.stopAccelerometer.html */ stopAccelerometer (res?: stopAccelerometer.Option): Promise /** * 监听加速度数据,频率:5次/秒,接口调用后会自动开始监听,可使用 `Taro.stopAccelerometer` 停止监听。 - * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony + * @supported weapp, alipay, swan, jd, qq, tt, h5, rn * @example * ```tsx * Taro.onAccelerometerChange(res => { @@ -91,7 +91,7 @@ declare module '../../index' { /** * 取消监听加速度数据事件,参数为空,则取消所有的事件监听。 - * @supported weapp, alipay, swan, jd, tt, h5, rn, harmony + * @supported weapp, alipay, swan, jd, tt, h5, rn * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.offAccelerometerChange.html */ offAccelerometerChange( diff --git a/packages/taro/types/api/device/battery.d.ts b/packages/taro/types/api/device/battery.d.ts index 516bd4695435..58baf1180378 100644 --- a/packages/taro/types/api/device/battery.d.ts +++ b/packages/taro/types/api/device/battery.d.ts @@ -32,13 +32,13 @@ declare module '../../index' { interface TaroStatic { /** Taro.getBatteryInfo 的同步版本 - * @supported weapp, alipay, swan, jd, qq, harmony + * @supported weapp, alipay, swan, jd, qq * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/battery/wx.getBatteryInfoSync.html */ getBatteryInfoSync(): getBatteryInfoSync.Result /** 获取设备电量。同步 API Taro.getBatteryInfoSync 在 iOS 上不可用。 - * @supported weapp, alipay, swan, jd, qq, h5, harmony, harmony_hybrid + * @supported weapp, alipay, swan, jd, qq, h5, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/battery/wx.getBatteryInfo.html */ getBatteryInfo(option?: getBatteryInfo.Option): Promise diff --git a/packages/taro/types/api/device/clipboard.d.ts b/packages/taro/types/api/device/clipboard.d.ts index 37d3bf314e05..6294af99e554 100644 --- a/packages/taro/types/api/device/clipboard.d.ts +++ b/packages/taro/types/api/device/clipboard.d.ts @@ -43,7 +43,7 @@ declare module '../../index' { interface TaroStatic { /** 设置系统剪贴板的内容。调用成功后,会弹出 toast 提示"内容已复制",持续 1.5s - * @supported weapp, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid + * @supported weapp, swan, jd, qq, h5, rn, tt, harmony_hybrid * @h5 部分实现 * @example * ```tsx @@ -63,19 +63,19 @@ declare module '../../index' { setClipboardData(option: setClipboardData.Option): Promise /** - * 获取系统剪贴板内容 - * @supported weapp, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid - * @h5 部分实现 - * @example - * ```tsx - * Taro.getClipboardData({ - * success: function (res){ - * console.log(res.data) - * } - * }) - * ``` - * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/clipboard/wx.getClipboardData.html - */ + * 获取系统剪贴板内容 + * @supported weapp, swan, jd, qq, h5, rn, tt, harmony_hybrid + * @h5 部分实现 + * @example + * ```tsx + * Taro.getClipboardData({ + * success: function (res){ + * console.log(res.data) + * } + * }) + * ``` + * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/clipboard/wx.getClipboardData.html + */ getClipboardData(res?: getClipboardData.Option): Promise } } diff --git a/packages/taro/types/api/device/keyboard.d.ts b/packages/taro/types/api/device/keyboard.d.ts index bf6f1bbae5f9..a49f6830adfc 100644 --- a/packages/taro/types/api/device/keyboard.d.ts +++ b/packages/taro/types/api/device/keyboard.d.ts @@ -71,7 +71,7 @@ declare module '../../index' { getSelectedTextRange(option?: getSelectedTextRange.Option): Promise /** 监听键盘高度变化 - * @supported weapp, swan, jd, qq, rn, harmony + * @supported weapp, swan, jd, qq, rn * @example * ```tsx * Taro.onKeyboardHeightChange(res => { @@ -86,7 +86,7 @@ declare module '../../index' { /** * 取消监听键盘高度变化事件。 - * @supported weapp, swan, jd, rn, harmony + * @supported weapp, swan, jd, rn * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/keyboard/wx.offKeyboardHeightChange.html */ offKeyboardHeightChange( diff --git a/packages/taro/types/api/device/network.d.ts b/packages/taro/types/api/device/network.d.ts index 7864bba8bc52..82fa43b82583 100644 --- a/packages/taro/types/api/device/network.d.ts +++ b/packages/taro/types/api/device/network.d.ts @@ -107,7 +107,7 @@ declare module '../../index' { ): void /** 监听网络状态变化。 - * @supported weapp, swan, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, swan, h5, rn, tt, harmony_hybrid * @example * ```tsx * Taro.onNetworkStatusChange(function (res) { @@ -132,7 +132,7 @@ declare module '../../index' { ): void /** 取消监听网络状态变化事件,参数为空,则取消所有的事件监听。 - * @supported weapp, swan, h5, rn, harmony, harmony_hybrid + * @supported weapp, swan, h5, rn, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.offNetworkStatusChange.html */ offNetworkStatusChange( @@ -141,7 +141,7 @@ declare module '../../index' { ): void /** 获取网络类型。 - * @supported weapp, swan, qq, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, swan, qq, h5, rn, tt, harmony_hybrid * @example * ```tsx * Taro.getNetworkType({ diff --git a/packages/taro/types/api/device/phone.d.ts b/packages/taro/types/api/device/phone.d.ts index a7062e35dda0..72e268820c1e 100644 --- a/packages/taro/types/api/device/phone.d.ts +++ b/packages/taro/types/api/device/phone.d.ts @@ -16,7 +16,7 @@ declare module '../../index' { interface TaroStatic { /** 拨打电话 - * @supported weapp, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid + * @supported weapp, swan, jd, qq, tt, h5, rn, harmony_hybrid * @example * ```tsx * Taro.makePhoneCall({ diff --git a/packages/taro/types/api/device/screen.d.ts b/packages/taro/types/api/device/screen.d.ts index 6f539167aba3..4851daaa0137 100644 --- a/packages/taro/types/api/device/screen.d.ts +++ b/packages/taro/types/api/device/screen.d.ts @@ -179,7 +179,7 @@ declare module '../../index' { /** 取消用户录屏事件的监听函数 * @supported weapp - * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.offScreenRecordingStateChanged.html + * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.offScreenRecordingStateChanged.html */ offScreenRecordingStateChanged( /** 用户录屏事件的监听函数 */ @@ -207,7 +207,7 @@ declare module '../../index' { * * **说明** * - 若安卓系统设置中开启了自动调节亮度功能,则屏幕亮度会根据光线自动调整,该接口仅能获取自动调节亮度之前的值,而非实时的亮度值。 - * @supported weapp, alipay, swan, jd, qq, rn, harmony + * @supported weapp, alipay, swan, jd, qq, rn * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.getScreenBrightness.html */ getScreenBrightness( diff --git a/packages/taro/types/api/device/vibrate.d.ts b/packages/taro/types/api/device/vibrate.d.ts index 9acbd72220ac..7e3838b5d3de 100644 --- a/packages/taro/types/api/device/vibrate.d.ts +++ b/packages/taro/types/api/device/vibrate.d.ts @@ -29,7 +29,7 @@ declare module '../../index' { /** 使手机发生较短时间的振动(15 ms)。仅在 iPhone `7 / 7 Plus` 以上及 Android 机型生效 * * 仅微信小程序平台支持 type 参数 - * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony + * @supported weapp, alipay, swan, jd, qq, tt, h5, rn * @example * ```tsx * Taro.vibrateShort(params).then(...) @@ -39,7 +39,7 @@ declare module '../../index' { vibrateShort(option?: vibrateShort.Option): Promise /** 使手机发生较长时间的振动(400ms) - * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony + * @supported weapp, alipay, swan, jd, qq, tt, h5, rn * @example * ```tsx * Taro.vibrateLong(params).then(...) diff --git a/packages/taro/types/api/media/image.d.ts b/packages/taro/types/api/media/image.d.ts index fe0f4b240403..8648583e25c0 100644 --- a/packages/taro/types/api/media/image.d.ts +++ b/packages/taro/types/api/media/image.d.ts @@ -19,7 +19,7 @@ declare module '../../index' { /** 需要预览的图片链接列表。 */ urls: string[] /** - * 当前显示图片的http链接 + * 微信端为当前显示图片的链接,支付宝端为当前显示图片的索引值 */ current?: string | number /** @@ -221,7 +221,7 @@ declare module '../../index' { /** 压缩后图片的宽度,单位为px,若不填写则默认以 compressedHeight 为准等比缩放。 */ compressedWidth?: number /** 压缩后图片的高度,单位为px,若不填写则默认以 compressedWidth 为准等比缩放。 */ - compressedHeight?: number + compressHeight?: number /** 接口调用成功的回调函数 */ success?: (result: SuccessCallbackResult) => void } @@ -361,7 +361,7 @@ declare module '../../index' { previewImage(option: previewImage.Option): Promise /** 获取图片信息。网络图片需先配置download域名才能生效。 - * @supported weapp, alipay, swan, tt, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, h5, rn, harmony_hybrid * @example * ```tsx * Taro.getImageInfo({ diff --git a/packages/taro/types/api/network/request.d.ts b/packages/taro/types/api/network/request.d.ts index 4fac0617ef1a..416a73fba41c 100644 --- a/packages/taro/types/api/network/request.d.ts +++ b/packages/taro/types/api/network/request.d.ts @@ -78,7 +78,7 @@ declare module '../../index' { /** 接口调用失败的回调函数 */ fail?: (res: TaroGeneral.CallbackResult) => void /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: (res: Partial & TaroGeneral.CallbackResult) => void + complete?: (res: TaroGeneral.CallbackResult) => void /** 设置是否使用 jsonp 方式获取数据 * @default false * @supported h5 @@ -400,7 +400,7 @@ declare module '../../index' { * - 对于 `GET` 方法的数据,会将数据转换成 query string(`encodeURIComponent(k)=encodeURIComponent(v)&encodeURIComponent(k)=encodeURIComponent(v)...`) * - 对于 `POST` 方法且 `header['content-type']` 为 `application/json` 的数据,会对数据进行 JSON 序列化 * - 对于 `POST` 方法且 `header['content-type']` 为 `application/x-www-form-urlencoded` 的数据,会将数据转换成 query string `(encodeURIComponent(k)=encodeURIComponent(v)&encodeURIComponent(k)=encodeURIComponent(v)...)` - * @supported weapp, h5, rn, alipay, swan, tt, qq, harmony, harmony_hybrid + * @supported weapp, h5, rn, alipay, swan, tt, qq, harmony_hybrid * @example * ```tsx * Taro.request({ diff --git a/packages/taro/types/api/route/index.d.ts b/packages/taro/types/api/route/index.d.ts index 4d5cbf8e4e84..5d908282c434 100644 --- a/packages/taro/types/api/route/index.d.ts +++ b/packages/taro/types/api/route/index.d.ts @@ -117,7 +117,7 @@ declare module '../../index' { interface TaroStatic { /** 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @example * ```json * { @@ -143,7 +143,7 @@ declare module '../../index' { switchTab(option: switchTab.Option): Promise /** 关闭所有页面,打开到应用内的某个页面 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @example * ```tsx * Taro.reLaunch({ @@ -155,7 +155,7 @@ declare module '../../index' { reLaunch(option: reLaunch.Option): Promise /** 关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @h5 未针对 tabbar 页面做限制处理 * @example * ```tsx @@ -168,7 +168,7 @@ declare module '../../index' { redirectTo(option: redirectTo.Option): Promise /** 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。使用 Taro.navigateBack 可以返回到原页面。小程序中页面栈最多十层。 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @h5 未针对 tabbar 页面做限制处理 * @example * ```tsx @@ -195,7 +195,7 @@ declare module '../../index' { navigateTo(option: navigateTo.Option): Promise /** 关闭当前页面,返回上一页面或多级页面。可通过 getCurrentPages 获取当前的页面栈,决定需要返回几层。 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @h5 若入参 delta 大于现有页面数时,返回应用打开的第一个页面(如果想要返回首页请使用 reLaunch 方法)。 * @example * ```tsx diff --git a/packages/taro/types/api/storage/index.d.ts b/packages/taro/types/api/storage/index.d.ts index 120b4227e090..7d7389b46fa6 100644 --- a/packages/taro/types/api/storage/index.d.ts +++ b/packages/taro/types/api/storage/index.d.ts @@ -177,7 +177,7 @@ declare module '../../index' { ): void /** 将数据存储在本地缓存中指定的 key 中。会覆盖掉原来该 key 对应的内容。除非用户主动删除或因存储空间原因被系统清理,否则数据都一直可用。单个 key 允许存储的最大数据长度为 1MB,所有数据存储上限为 10MB。 - * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony_hybrid * @example * ```tsx * Taro.setStorage({ @@ -221,7 +221,7 @@ declare module '../../index' { ): void /** 从本地缓存中移除指定 key - * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony_hybrid * @example * ```tsx * Taro.removeStorage({ @@ -289,7 +289,7 @@ declare module '../../index' { getStorageInfo(option?: getStorageInfo.Option): Promise /** 从本地缓存中异步获取指定 key 的内容 - * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony_hybrid * @example * ```tsx * Taro.getStorage({ @@ -327,7 +327,7 @@ declare module '../../index' { clearStorageSync(): void /** 清理本地数据缓存 - * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony_hybrid * @example * ```tsx * Taro.clearStorage() diff --git a/packages/taro/types/api/swan/pay.d.ts b/packages/taro/types/api/swan/pay.d.ts index 8c4611c91453..1ebbc2f25164 100644 --- a/packages/taro/types/api/swan/pay.d.ts +++ b/packages/taro/types/api/swan/pay.d.ts @@ -1,4 +1,4 @@ -import { Interface } from 'node:readline' +import { Interface } from 'readline' import Taro from '../../index' declare module '../../index' { @@ -117,12 +117,12 @@ declare module '../../index' { } interface TaroStatic { - /** + /** * 1)百度收银台,聚合了主流的百度钱包、微信、支付宝、网银等多种支付渠道,方便开发者一站式快速接入多种支付渠道,让百度用户能在智能小程序场景下,直接完成支付、交易闭环,提升用户支付体验的同时,提高智能小程序的订单转化率。 * 2)上述支付渠道在 C 端收银台有两种展示方式,开发者可以选择其中一种实现。 * 方式一:将支付渠道内嵌在小程序提单页面中,实现方式参考文档[inline-payment-panel内嵌支付组件](https://smartprogram.baidu.com/docs/develop/component/inline_payment_panel/)。 * 方式二:在用户确认订单后,调起收银台半屏面板承载支付渠道,实现方式参考文档调起[百度收银台](https://smartprogram.baidu.com/docs/develop/function/tune_up_2.0/#%E7%99%BE%E5%BA%A6%E6%94%B6%E9%93%B6%E5%8F%B0%E6%8E%A5%E5%8F%A32-0-%E8%AF%B4%E6%98%8E)。 - * + * * Web 态说明:为了保证用户交易行为全流程闭环体验,在 Web 态下调用该方法会做打开百度 App 对应小程序页面的降级处理。 * @supported swan * @see https://smartprogram.baidu.com/docs/develop/api/open/payment_swan-requestPolymerPayment/ @@ -136,4 +136,4 @@ declare module '../../index' { */ getOptimalPriceInfo(option: getOptimalPriceInfo.Option): void } -} +} \ No newline at end of file diff --git a/packages/taro/types/api/taro.extend.d.ts b/packages/taro/types/api/taro.extend.d.ts index 4519a77168a8..9a948e318d7a 100644 --- a/packages/taro/types/api/taro.extend.d.ts +++ b/packages/taro/types/api/taro.extend.d.ts @@ -38,15 +38,13 @@ declare module '../index' { /** @ignore */ interface TARO_ENV_TYPE { [TaroGeneral.ENV_TYPE.WEAPP]: TaroGeneral.ENV_TYPE.WEAPP + [TaroGeneral.ENV_TYPE.WEB]: TaroGeneral.ENV_TYPE.WEB + [TaroGeneral.ENV_TYPE.RN]: TaroGeneral.ENV_TYPE.RN [TaroGeneral.ENV_TYPE.SWAN]: TaroGeneral.ENV_TYPE.SWAN [TaroGeneral.ENV_TYPE.ALIPAY]: TaroGeneral.ENV_TYPE.ALIPAY [TaroGeneral.ENV_TYPE.TT]: TaroGeneral.ENV_TYPE.TT [TaroGeneral.ENV_TYPE.QQ]: TaroGeneral.ENV_TYPE.QQ [TaroGeneral.ENV_TYPE.JD]: TaroGeneral.ENV_TYPE.JD - [TaroGeneral.ENV_TYPE.WEB]: TaroGeneral.ENV_TYPE.WEB - [TaroGeneral.ENV_TYPE.RN]: TaroGeneral.ENV_TYPE.RN - [TaroGeneral.ENV_TYPE.HARMONY]: TaroGeneral.ENV_TYPE.HARMONY - [TaroGeneral.ENV_TYPE.QUICKAPP]: TaroGeneral.ENV_TYPE.QUICKAPP [TaroGeneral.ENV_TYPE.HARMONYHYBRID]: TaroGeneral.ENV_TYPE.HARMONYHYBRID } @@ -100,7 +98,7 @@ declare module '../index' { }): void /** 小程序获取和 Taro 相关的 App 信息 - * @supported weapp, alipay, jd, qq, swan, tt, h5, harmony, harmony_hybrid + * @supported weapp, alipay, jd, qq, swan, tt, h5, harmony_hybrid */ getAppInfo(): getAppInfo.AppInfo diff --git a/packages/taro/types/api/ui/animation.d.ts b/packages/taro/types/api/ui/animation.d.ts index 5339ffd7bef4..d527889114b6 100644 --- a/packages/taro/types/api/ui/animation.d.ts +++ b/packages/taro/types/api/ui/animation.d.ts @@ -410,7 +410,7 @@ declare module '../../index' { interface TaroStatic { /** 创建一个动画实例 [animation](../Animation)。调用实例的方法来描述动画。最后通过动画实例的 export 方法导出动画数据传递给组件的 animation 属性。 - * @supported weapp, tt, h5, harmony, harmony_hybrid + * @supported weapp, h5, tt, harmony_hybrid * @example * ```tsx * var animation = Taro.createAnimation({ diff --git a/packages/taro/types/api/ui/interaction.d.ts b/packages/taro/types/api/ui/interaction.d.ts index d5682a10554f..e14e9b19b9db 100644 --- a/packages/taro/types/api/ui/interaction.d.ts +++ b/packages/taro/types/api/ui/interaction.d.ts @@ -160,7 +160,7 @@ declare module '../../index' { * **注意** * - Taro.showLoading 和 Taro.showToast 同时只能显示一个 * - Taro.showToast 应与 Taro.hideToast 配对使用 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @example * ```tsx * Taro.showToast({ @@ -177,7 +177,7 @@ declare module '../../index' { * **注意** * - Android 6.7.2 以下版本,点击取消或蒙层时,回调 fail, errMsg 为 "fail cancel"; * - Android 6.7.2 及以上版本 和 iOS 点击蒙层不会关闭模态弹窗,所以尽量避免使用「取消」分支中实现业务逻辑 - * @supported weapp, swan, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, swan, h5, rn, tt, harmony_hybrid * @example * ```tsx * Taro.showModal({ @@ -220,7 +220,7 @@ declare module '../../index' { * **注意** * - Android 6.7.2 以下版本,点击取消或蒙层时,回调 fail, errMsg 为 "fail cancel"; * - Android 6.7.2 及以上版本 和 iOS 点击蒙层不会关闭模态弹窗,所以尽量避免使用「取消」分支中实现业务逻辑 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @example * ```tsx * Taro.showActionSheet({ diff --git a/packages/taro/types/api/ui/navigation-bar.d.ts b/packages/taro/types/api/ui/navigation-bar.d.ts index d978a3fe2642..8da578bc504d 100644 --- a/packages/taro/types/api/ui/navigation-bar.d.ts +++ b/packages/taro/types/api/ui/navigation-bar.d.ts @@ -79,13 +79,13 @@ declare module '../../index' { interface TaroStatic { /** 在当前页面显示导航条加载动画 - * @supported weapp, rn, tt, harmony + * @supported weapp, rn, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.showNavigationBarLoading.html */ showNavigationBarLoading(option?: showNavigationBarLoading.Option): void /** 动态设置当前页面的标题 - * @supported weapp, alipay, tt, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, h5, rn, tt, harmony_hybrid * @example * ```tsx * Taro.setNavigationBarTitle({ @@ -97,7 +97,7 @@ declare module '../../index' { setNavigationBarTitle(option: setNavigationBarTitle.Option): Promise /** 设置页面导航条颜色 - * @supported weapp, tt, h5, rn, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @h5 不支持 animation 参数 * @rn 不支持 animation 参数 * @example @@ -116,13 +116,13 @@ declare module '../../index' { setNavigationBarColor(option: setNavigationBarColor.Option): Promise /** 在当前页面隐藏导航条加载动画 - * @supported weapp, rn, tt, harmony + * @supported weapp, rn, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.hideNavigationBarLoading.html */ hideNavigationBarLoading(option?: hideNavigationBarLoading.Option): void /** 隐藏返回首页按钮。微信7.0.7版本起,当用户打开的小程序最底层页面是非首页时,默认展示“返回首页”按钮,开发者可在页面 onShow 中调用 hideHomeButton 进行隐藏。 - * @supported weapp, tt, harmony + * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.hideHomeButton.html */ hideHomeButton(option?: hideHomeButton.Option): Promise diff --git a/packages/taro/types/api/ui/pull-down-refresh.d.ts b/packages/taro/types/api/ui/pull-down-refresh.d.ts index ed28fd8a551d..129b9985faf5 100644 --- a/packages/taro/types/api/ui/pull-down-refresh.d.ts +++ b/packages/taro/types/api/ui/pull-down-refresh.d.ts @@ -25,7 +25,7 @@ declare module '../../index' { interface TaroStatic { /** 停止当前页面下拉刷新。 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @example * ```tsx * onPullDownRefresh: function (){ @@ -37,7 +37,7 @@ declare module '../../index' { stopPullDownRefresh(option?: stopPullDownRefresh.Option): void /** 开始下拉刷新。调用后触发下拉刷新动画,效果与用户手动下拉刷新一致。 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @rn 无动画效果 * @example * ```tsx diff --git a/packages/taro/types/api/ui/scroll.d.ts b/packages/taro/types/api/ui/scroll.d.ts index cbc7ae854972..3153696825cb 100644 --- a/packages/taro/types/api/ui/scroll.d.ts +++ b/packages/taro/types/api/ui/scroll.d.ts @@ -99,7 +99,7 @@ declare module '../../index' { * - 后代选择器:.the-ancestor .the-descendant * - 跨自定义组件的后代选择器:.the-ancestor >>> .the-descendant * - 多选择器的并集:#a-node, .some-other-nodes - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @example * ```tsx * Taro.pageScrollTo({ diff --git a/packages/taro/types/api/ui/tab-bar.d.ts b/packages/taro/types/api/ui/tab-bar.d.ts index 57e3be1292b6..afca2e227aa8 100644 --- a/packages/taro/types/api/ui/tab-bar.d.ts +++ b/packages/taro/types/api/ui/tab-bar.d.ts @@ -121,13 +121,13 @@ declare module '../../index' { interface TaroStatic { /** 显示 tabBar 某一项的右上角的红点 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.showTabBarRedDot.html */ showTabBarRedDot(option: showTabBarRedDot.Option): Promise /** 显示 tabBar - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.showTabBar.html */ showTabBar(option?: showTabBar.Option): Promise @@ -148,7 +148,7 @@ declare module '../../index' { setTabBarStyle(option?: setTabBarStyle.Option): Promise /** 动态设置 tabBar 某一项的内容,`2.7.0` 起图片支持临时文件和网络文件。 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @example * ```tsx * Taro.setTabBarItem({ @@ -163,7 +163,7 @@ declare module '../../index' { setTabBarItem(option: setTabBarItem.Option): Promise /** 为 tabBar 某一项的右上角添加文本 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @example * ```tsx * Taro.setTabBarBadge({ @@ -176,19 +176,19 @@ declare module '../../index' { setTabBarBadge(option: setTabBarBadge.Option): Promise /** 移除 tabBar 某一项右上角的文本 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.removeTabBarBadge.html */ removeTabBarBadge(option: removeTabBarBadge.Option): Promise /** 隐藏 tabBar 某一项的右上角的红点 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.hideTabBarRedDot.html */ hideTabBarRedDot(option: hideTabBarRedDot.Option): Promise /** 隐藏 tabBar - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.hideTabBar.html */ hideTabBar(option?: hideTabBar.Option): Promise diff --git a/packages/taro/types/api/wxml/index.d.ts b/packages/taro/types/api/wxml/index.d.ts index 79dabc91e51a..dc033bf72154 100644 --- a/packages/taro/types/api/wxml/index.d.ts +++ b/packages/taro/types/api/wxml/index.d.ts @@ -66,25 +66,19 @@ declare module '../../index' { } namespace IntersectionObserver { - /** 监听相交状态变化的回调函数 - * @description Harmony 找不到对应元素时,回调会返回一个 Error 对象 - */ + /** 监听相交状态变化的回调函数 */ type ObserveCallback = (result: ObserveCallbackResult) => void - interface ObserveCallbackResult extends TaroGeneral.CallbackResult { - /** 错误信息,会在找不到对应元素时返回 - * @supported harmony - */ - errMsg?: string + interface ObserveCallbackResult { /** 目标边界 */ - boundingClientRect?: BoundingClientRectResult + boundingClientRect: BoundingClientRectResult /** 相交比例 */ - intersectionRatio?: number + intersectionRatio: number /** 相交区域的边界 */ - intersectionRect?: IntersectionRectResult + intersectionRect: IntersectionRectResult /** 参照区域的边界 */ - relativeRect?: RelativeRectResult + relativeRect: RelativeRectResult /** 相交检测时的时间戳 */ - time?: number + time: number } /** 参照区域的边界 */ interface RelativeRectResult { @@ -490,7 +484,7 @@ declare module '../../index' { interface TaroStatic { /** 返回一个 SelectorQuery 对象实例。在自定义组件或包含自定义组件的页面中,应使用 `this.createSelectorQuery()` 来代替。 - * @supported weapp, h5, tt, harmony, harmony_hybrid + * @supported weapp, h5, tt, harmony_hybrid * @example * ```tsx * const query = Taro.createSelectorQuery() @@ -506,7 +500,7 @@ declare module '../../index' { createSelectorQuery(): SelectorQuery /** 创建并返回一个 IntersectionObserver 对象实例。在自定义组件或包含自定义组件的页面中,应使用 `this.createIntersectionObserver([options])` 来代替。 - * @supported weapp, h5, tt, harmony, harmony_hybrid + * @supported weapp, h5, tt, harmony_hybrid * @example * ```tsx * const observer = Taro.createIntersectionObserver(this, { thresholds: [0], observeAll: true }) diff --git a/packages/taro/types/compile/compiler.d.ts b/packages/taro/types/compile/compiler.d.ts index 8a82fc30175e..148fdc9000fe 100644 --- a/packages/taro/types/compile/compiler.d.ts +++ b/packages/taro/types/compile/compiler.d.ts @@ -1,11 +1,7 @@ import type { swc } from '@tarojs/helper' import type Webpack from 'webpack' -export type CompilerViteTypes = 'vite' - -export type CompilerWebpackTypes = 'webpack5' - -export type CompilerTypes = CompilerWebpackTypes | CompilerViteTypes +type CompilerTypes = 'webpack4' | 'webpack5' interface IPrebundle { enable?: boolean @@ -21,12 +17,11 @@ interface IPrebundle { } } -interface ICompiler { - type: T +interface ICompiler { + type: CompilerTypes prebundle?: IPrebundle - vitePlugins?: any /** 错误处理级别。可选值:0、1 */ errorLevel?: number } -export type Compiler = T | ICompiler +export type Compiler = CompilerTypes | ICompiler diff --git a/packages/taro/types/compile/config/h5.d.ts b/packages/taro/types/compile/config/h5.d.ts index 088d4164c5c1..5aeaec609640 100644 --- a/packages/taro/types/compile/config/h5.d.ts +++ b/packages/taro/types/compile/config/h5.d.ts @@ -2,10 +2,7 @@ import type Webpack from 'webpack' import type Chain from 'webpack-chain' import type webpackDevServer from 'webpack-dev-server' import type HtmlWebpackPlugin from 'html-webpack-plugin' -import type { IOption, IPostcssOption, IUrlLoaderOption } from './util' -import type { OutputOptions as RollupOutputOptions } from 'rollup' -import type { Compiler, CompilerTypes, CompilerWebpackTypes } from '../compiler' -import type { OutputExt } from './project' +import type { IOption, IPostcssOption } from './util' export interface IH5RouterConfig { /** 配置路由模式 */ @@ -17,11 +14,9 @@ export interface IH5RouterConfig { lazyload?: boolean | ((pagename: string) => boolean) renamePagename?: (pagename: string) => string forcePath?: string - /** 加上这个参数,可以解决返回页面的时候白屏的问题,但是某些不支持 :has() 选择器的浏览器会有问题 */ - enhanceAnimation?: boolean } -export interface IH5Config { +export interface IH5Config { /** 设置输出解析文件的目录(默认值:'/')*/ publicPath?: string @@ -40,12 +35,8 @@ export interface IH5Config { */ webpackChain?: (chain: Chain, webpack: typeof Webpack) => void - /** webpack 编译模式下,可用于修改、拓展 Webpack 的 output 选项,配置项参考[官方文档](https://webpack.js.org/configuration/output/) - * vite 编译模式下,用于修改、扩展 rollup 的 output,目前仅适配 chunkFileNames 和 assetFileNames 两个配置,修改其他配置请使用 vite 插件进行修改。配置想参考[官方文档](https://rollupjs.org/configuration-options/) - */ - output?: T extends 'vite' - ? Pick & OutputExt - : Webpack.Configuration['output'] + /** 可用于修改、拓展 Webpack 的 output 选项,配置项参考[官方文档](https://webpack.js.org/configuration/output/) */ + output?: Webpack.Configuration['output'] /** 路由相关的配置 */ router?: IH5RouterConfig @@ -91,13 +82,13 @@ export interface IH5Config { stylusLoaderOption?: IOption /** 针对 mp4 | webm | ogg | mp3 | wav | flac | aac 文件的 [url-loader](https://github.com/webpack-contrib/url-loader) 配置 */ - mediaUrlLoaderOption?: IUrlLoaderOption + mediaUrlLoaderOption?: IOption /** 针对 woff | woff2 | eot | ttf | otf 文件的 [url-loader](https://github.com/webpack-contrib/url-loader) 配置 */ - fontUrlLoaderOption?: IUrlLoaderOption + fontUrlLoaderOption?: IOption /** 针对 png | jpg | jpeg | gif | bpm | svg 文件的 [url-loader](https://github.com/webpack-contrib/url-loader) 配置 */ - imageUrlLoaderOption?: IUrlLoaderOption + imageUrlLoaderOption?: IOption /** [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) 的附加配置 */ miniCssExtractPluginOption?: IOption @@ -112,20 +103,14 @@ export interface IH5Config { useDeprecatedAdapterComponent?: boolean /** 配置 postcss 相关插件 */ - postcss?: IPostcssOption<'h5'> + postcss?: IPostcssOption /** html-webpack-plugin 的具体配置 */ htmlPluginOption?: HtmlWebpackPlugin.Options /** Web 编译过程的相关配置 */ compile?: { - exclude?: (string | RegExp)[] - include?: (string | RegExp)[] - filter?: (filename: string) => boolean + exclude?: any[] + include?: any[] } - /** 生成的代码是否要兼容旧版浏览器,值为 true 时,会去读取 package.json 的 browserslist 字段。只在 vite 编译模式下有效 */ - legacy?: T extends 'vite' ? boolean : undefined - - /** 使用的编译工具。可选值:webpack5、vite */ - compiler?: Compiler } diff --git a/packages/taro/types/compile/config/index.d.ts b/packages/taro/types/compile/config/index.d.ts index 543da6a95253..97fb95fc56a9 100644 --- a/packages/taro/types/compile/config/index.d.ts +++ b/packages/taro/types/compile/config/index.d.ts @@ -1,7 +1,5 @@ export * from './h5' -export * from './harmony' export * from './mini' -export * from './rn' export * from './manifest' export * from './project' diff --git a/packages/taro/types/compile/config/mini.d.ts b/packages/taro/types/compile/config/mini.d.ts index d3cad4e908b6..04c1ff3f8312 100644 --- a/packages/taro/types/compile/config/mini.d.ts +++ b/packages/taro/types/compile/config/mini.d.ts @@ -1,9 +1,6 @@ import type Webpack from 'webpack' import type Chain from 'webpack-chain' -import type { IOption, IPostcssOption, IUrlLoaderOption } from './util' -import type { OutputOptions as RollupOutputOptions } from 'rollup' -import type { Compiler, CompilerTypes, CompilerWebpackTypes } from '../compiler' -import type { OutputExt } from './project' +import type { IOption, IPostcssOption } from './util' interface Runtime { enableInnerHTML?: boolean @@ -15,7 +12,7 @@ interface Runtime { enableMutationObserver?: boolean } -export interface IMiniAppConfig { +export interface IMiniAppConfig { /** 用于控制是否生成 js、css 对应的 sourceMap (默认值:watch 模式下为 true,否则为 false) */ enableSourceMap?: boolean @@ -43,15 +40,24 @@ export interface IMiniAppConfig */ webpackChain?: (chain: Chain, webpack: typeof Webpack, PARSE_AST_TYPE: any) => void - /** webpack 编译模式下,可用于修改、拓展 Webpack 的 output 选项,配置项参考[官方文档](https://webpack.js.org/configuration/output/) - * vite 编译模式下,用于修改、扩展 rollup 的 output,目前仅适配 chunkFileNames 和 assetFileNames 两个配置,修改其他配置请使用 vite 插件进行修改。配置想参考[官方文档](https://rollupjs.org/configuration-options/) - */ - output?: T extends 'vite' - ? Pick & OutputExt - : Webpack.Configuration['output'] & OutputExt + /** 可用于修改、拓展 Webpack 的 [output](https://webpack.js.org/configuration/output/) 选项 */ + output?: Webpack.Configuration['output'] & { + /** + * 编译前清空输出目录 + * @since Taro v3.6.9 + * @description + * - 默认清空输出目录,可设置 clean: false 不清空 + * - 可设置 clean: { keep: ['project.config.json'] } 保留指定文件 + * - 注意 clean.keep 不支持函数 + */ + clean?: boolean | { + /** 保留指定文件不删除 */ + keep?: Array | string | RegExp + } + } /** 配置 postcss 相关插件 */ - postcss?: IPostcssOption<'mini'> + postcss?: IPostcssOption /** [css-loader](https://github.com/webpack-contrib/css-loader) 的附加配置 */ cssLoaderOption?: IOption @@ -66,13 +72,13 @@ export interface IMiniAppConfig stylusLoaderOption?: IOption /** 针对 mp4 | webm | ogg | mp3 | wav | flac | aac 文件的 [url-loader](https://github.com/webpack-contrib/url-loader) 配置 */ - mediaUrlLoaderOption?: IUrlLoaderOption + mediaUrlLoaderOption?: IOption /** 针对 woff | woff2 | eot | ttf | otf 文件的 [url-loader](https://github.com/webpack-contrib/url-loader) 配置 */ - fontUrlLoaderOption?: IUrlLoaderOption + fontUrlLoaderOption?: IOption /** 针对 png | jpg | jpeg | gif | bpm | svg 文件的 [url-loader](https://github.com/webpack-contrib/url-loader) 配置 */ - imageUrlLoaderOption?: IUrlLoaderOption + imageUrlLoaderOption?: IOption /** [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) 的附加配置 */ miniCssExtractPluginOption?: IOption @@ -91,27 +97,16 @@ export interface IMiniAppConfig /** 小程序编译过程的相关配置 */ compile?: { - exclude?: (string | RegExp)[] - include?: (string | RegExp)[] - filter?: (filename: string) => boolean + exclude?: any[] + include?: any[] } /** 插件内部使用 */ runtime?: Runtime - /** 使用的编译工具。可选值:webpack5、vite */ - compiler?: Compiler - /** 体验式功能 */ experimental?: { /** 是否开启编译模式 */ - compileMode?: boolean | string - } -} - -export interface IMiniFilesConfig { - [configName: string]: { - content: any - path: string + compileMode?: boolean } } diff --git a/packages/taro/types/compile/config/project.d.ts b/packages/taro/types/compile/config/project.d.ts index 6905e408cd9b..12ef67dd465f 100644 --- a/packages/taro/types/compile/config/project.d.ts +++ b/packages/taro/types/compile/config/project.d.ts @@ -1,14 +1,13 @@ import type Webpack from 'webpack' import type Chain from 'webpack-chain' -import type { Input } from 'postcss' -import type { AppConfig } from '../../index' -import type { Compiler, CompilerTypes, CompilerWebpackTypes } from '../compiler' +import { type Input } from 'postcss' +import type { Compiler } from '../compiler' import type { IModifyChainData } from '../hooks' import type { ICopyOptions, IOption, ISassOptions, TogglableOptions } from './util' import type { IH5Config } from './h5' -import type { IHarmonyConfig } from './harmony' -import type { IMiniAppConfig, IMiniFilesConfig } from './mini' -import type { IRNConfig } from './rn' +import type { IMiniAppConfig } from './mini' +import { IRNConfig } from './rn' +import { AppConfig } from '../..' export type PluginItem = string | [string, T] | [string, () => T | Promise] @@ -116,7 +115,7 @@ export interface IProjectBaseConfig { jsMinimizer?: 'terser' | 'esbuild' /** 配置 CSS 压缩工具 (默认 csso) */ - cssMinimizer?: 'csso' | 'esbuild' | 'lightningcss' + cssMinimizer?: 'csso' | 'esbuild' | 'parcelCss' /** 配置 csso 工具以压缩 CSS 代码 */ csso?: TogglableOptions @@ -140,11 +139,11 @@ export interface IProjectBaseConfig { /** 模板循环次数 */ baseLevel?: number - /** 使用的开发框架。可选值:react、preact、vue3 */ - framework?: 'react' | 'preact' | 'solid' | 'vue3' + /** 使用的开发框架。可选值:react、preact、nerv、vue、vue3 */ + framework?: 'react' | 'preact' | 'nerv' | 'vue' | 'vue3' frameworkExts?: string[] - /** 使用的编译工具。可选值:webpack5 */ + /** 使用的编译工具。可选值:webpack4、webpack5 */ compiler?: Compiler /** Webpack5 持久化缓存配置。具体配置请参考 [WebpackConfig.cache](https://webpack.js.org/configuration/cache/#cache) */ @@ -186,28 +185,18 @@ export interface IProjectBaseConfig { modifyWebpackChain?: (chain: Chain, webpack: typeof Webpack, data: IModifyChainData) => Promise /** - * 编译中修改 vite 配置 + * 修改编译过程中的页面组件配置 */ - modifyViteConfig?: (viteConfig: any, data: IModifyChainData) => void + modifyMiniConfigs?: (configMap: any) => Promise /** * 修改编译后的结果 */ modifyBuildAssets?: (assets: any, miniPlugin?: any) => Promise - - /** - * 修改编译过程中的页面组件配置 - */ - modifyMiniConfigs?: (configMap: IMiniFilesConfig) => Promise - - /** - * 修改 Taro 编译配置 - */ - modifyRunnerOpts?: (opts: any) => Promise } /** 暴露出来给 config/index 使用的配置类型,参考 https://github.com/NervJS/taro-doctor/blob/main/assets/config_schema.json */ -export interface IProjectConfig { +export interface IProjectConfig { /** 项目名称 */ projectName?: string @@ -277,7 +266,7 @@ export interface IProjectConfig jsMinimizer?: 'terser' | 'esbuild' /** 配置 CSS 压缩工具 (默认 csso) */ - cssMinimizer?: 'csso' | 'esbuild' | 'lightningcss' + cssMinimizer?: 'csso' | 'esbuild' | 'parcelCss' /** 配置 csso 工具以压缩 CSS 代码 */ csso?: TogglableOptions @@ -296,8 +285,11 @@ export interface IProjectConfig /** 一个 preset 是一系列 Taro 插件的集合,配置语法同 plugins */ presets?: PluginItem[] - /** 使用的开发框架。可选值:react、preact、solid、vue3、 none */ - framework?: 'react' | 'preact' | 'solid' | 'vue3' | 'none' + /** 使用的开发框架。可选值:react、preact、nerv、vue、vue3 */ + framework?: 'react' | 'preact' | 'nerv' | 'vue' | 'vue3' + + /** 使用的编译工具。可选值:webpack4、webpack5 */ + compiler?: Compiler /** Webpack5 持久化缓存配置。具体配置请参考 [WebpackConfig.cache](https://webpack.js.org/configuration/cache/#cache) */ cache?: ICache @@ -305,34 +297,14 @@ export interface IProjectConfig /** 控制 Taro 编译日志的输出方式 */ logger?: ILogger - /** 使用的编译工具。可选值:webpack5、vite */ - compiler?: Compiler + /** 专属于小程序的配置 */ + mini?: IMiniAppConfig /** 专属于 H5 的配置 */ - h5?: IH5Config - - /** 专属于小程序的配置 */ - mini?: IMiniAppConfig + h5?: IH5Config /** 专属于 RN 的配置 */ rn?: IRNConfig - harmony?: IHarmonyConfig - [key: string]: any } - -export interface OutputExt { - /** - * 编译前清空输出目录 - * @since Taro v3.6.9 - * @description - * - 默认清空输出目录,可设置 clean: false 不清空 - * - 可设置 clean: { keep: ['project.config.json'] } 保留指定文件 - * - 注意 clean.keep 不支持函数 - */ - clean?: boolean | { - /** 保留指定文件不删除 */ - keep?: Array | string | RegExp - } -} diff --git a/packages/taro/types/compile/config/rn.d.ts b/packages/taro/types/compile/config/rn.d.ts index 90d16d586272..a7a481e261fd 100644 --- a/packages/taro/types/compile/config/rn.d.ts +++ b/packages/taro/types/compile/config/rn.d.ts @@ -2,7 +2,6 @@ import type Webpack from 'webpack' import type Chain from 'webpack-chain' import type webpackDevServer from 'webpack-dev-server' import type HtmlWebpackPlugin from 'html-webpack-plugin' -import type { RollupOptions } from 'rollup' import type { IOption, IPostcssOption } from './util' export interface IRNConfig { @@ -62,24 +61,4 @@ export interface IRNConfig { /** 设计稿尺寸换算规则 */ deviceRatio?: TaroGeneral.TDeviceRatio - - /** 原生组件编译配置 */ - nativeComponents?: { - /** - * 外部依赖 - */ - external?: Array | ((arr: Array) => Array) - /** - * 设置外部依赖,如果返回 string, 则将该值作为 external, 我们默认将 node_modules 路径下的文件设置为外部依赖 - */ - exteranlResolve?: (importee: string, importer: string) => string - /** - * 组件输出路径,默认值为 'dist' - */ - output?: string - /** - * 修改 Rollup 打包配置 - */ - modifyRollupConfig?: (config: RollupOptions, innerPlugins: { taroResolver: typeof taroResolver, styleTransformer: typeof styleTransformer }) => RollupOptions - } } diff --git a/packages/taro/types/compile/config/util.d.ts b/packages/taro/types/compile/config/util.d.ts index 3643c5e58c2b..7729464a10a6 100644 --- a/packages/taro/types/compile/config/util.d.ts +++ b/packages/taro/types/compile/config/util.d.ts @@ -1,5 +1,4 @@ -import type { Input } from 'postcss' -import type { Options as PostcssUrlOption } from 'postcss-url' +import { type Input } from 'postcss' export type Func = (...args: any[]) => any @@ -10,11 +9,6 @@ export type TogglableOptions = { config?: T } -export interface IUrlLoaderOption extends IOption { - limit?: number | boolean - name?: ((moduleId: string) => string) | string -} - export namespace PostcssOption { export type cssModules = TogglableOptions<{ /** 转换模式,取值为 global/module */ @@ -22,7 +16,10 @@ export namespace PostcssOption { /** 自定义生成的class名称规则 */ generateScopedName: string | ((localName: string, absoluteFilePath: string) => string) }> - export type url = TogglableOptions + export type url = TogglableOptions<{ + limit: number + basePath?: string | string[] + }> } export interface IHtmlTransformOption { @@ -75,29 +72,18 @@ export interface IPxTransformOption { designWidth?: number | ((size?: string | number | Input) => number) /** 设计稿尺寸换算规则 */ deviceRatio?: TaroGeneral.TDeviceRatio - /** 平台 */ - platform?: 'weapp' | 'h5' | string - /** 启用的能力 Scope 默认为 ['platform', 'size'] */ - methods?: string[] - /** filter 回调函数,可 exclude 不处理的文件 */ - exclude?: (fileName: string) => boolean } -interface IBasePostcssOption { +export interface IPostcssOption { autoprefixer?: TogglableOptions pxtransform?: TogglableOptions cssModules?: PostcssOption.cssModules + url?: PostcssOption.url /** 插件 postcss-html-transform 相关配置, 一般启用了 @tarojs/plugin-html 插件才配置 */ htmltransform?: IHtmlTransformOption [key: string]: any } -export type IPostcssOption = T extends 'h5' - ? IBasePostcssOption & { url?: PostcssOption.url } - : IBasePostcssOption - -export type Config = ViteConfig | WebpackConfig - export interface ICopyOptions { patterns: { from: string diff --git a/packages/taro/types/compile/index.d.ts b/packages/taro/types/compile/index.d.ts index 8310943aace3..8d887a2d88bc 100644 --- a/packages/taro/types/compile/index.d.ts +++ b/packages/taro/types/compile/index.d.ts @@ -1,11 +1,3 @@ export { Current } from '@tarojs/runtime' -export interface IFileType { - style: string - script: string - templ: string - config: string - xs?: string -} - export * from './config' diff --git a/packages/taro/types/index.d.ts b/packages/taro/types/index.d.ts index da8ec8360884..5623c3254ae0 100644 --- a/packages/taro/types/index.d.ts +++ b/packages/taro/types/index.d.ts @@ -187,6 +187,7 @@ export as namespace Taro declare const Taro: Taro.TaroStatic declare namespace Taro { + // eslint-disable-next-line @typescript-eslint/no-empty-interface interface TaroStatic {} } declare global { diff --git a/packages/taro/types/taro.component.d.ts b/packages/taro/types/taro.component.d.ts index d1d36c31a059..0d0a4c502728 100644 --- a/packages/taro/types/taro.component.d.ts +++ b/packages/taro/types/taro.component.d.ts @@ -19,7 +19,6 @@ declare module './index' { shareTicket: string | undefined scene: number | undefined exitState?: any - $taroPath?: string } interface Show { diff --git a/packages/taro/types/taro.config.d.ts b/packages/taro/types/taro.config.d.ts index 1bae7fbde63f..d5681eb0c0ba 100644 --- a/packages/taro/types/taro.config.d.ts +++ b/packages/taro/types/taro.config.d.ts @@ -32,11 +32,6 @@ declare module './index' { * @default: "#ffffff" */ backgroundColor?: string - /** 页面容器背景色, HexColor - * @see: https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/custom-route.html#%E8%AE%BE%E7%BD%AE%E9%A1%B5%E9%9D%A2%E9%80%8F%E6%98%8E - * @default: "#ffffff" - */ - backgroundColorContent?: string /** 下拉背景字体、loading 图的样式,仅支持 dark/light * 当 app.json 中配置 darkmode 为 true 时可通过变量的形式配置 * @see: https://developers.weixin.qq.com/miniprogram/dev/framework/ability/darkmode.html