@tarojs/components 3.5.5-alpha.1 → 3.5.6-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/taro-input-core.cjs.entry.js +23 -2
- package/dist/cjs/taro-video-control_3.cjs.entry.js +21 -3
- package/dist/collection/components/input/input.js +23 -2
- package/dist/collection/components/video/video.js +23 -3
- package/dist/collection/utils/json-schema-to-types.js +224 -0
- package/dist/esm/taro-input-core.entry.js +23 -2
- package/dist/esm/taro-video-control_3.entry.js +21 -3
- package/dist/esm-es5/taro-input-core.entry.js +1 -1
- package/dist/esm-es5/taro-video-control_3.entry.js +1 -1
- package/dist/taro-components/p-0380841f.system.js +1 -1
- package/dist/taro-components/p-232ebfae.system.entry.js +1 -0
- package/dist/taro-components/{p-7e8943d8.entry.js → p-3744e978.entry.js} +1 -1
- package/dist/taro-components/p-56c86512.entry.js +1 -0
- package/dist/taro-components/{p-ed8c1bb8.system.entry.js → p-f81a74bb.system.entry.js} +1 -1
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/input/input.d.ts +1 -0
- package/dist/types/utils/json-schema-to-types.d.ts +25 -0
- package/package.json +7 -3
- package/types/Ad.d.ts +99 -9
- package/types/AdCustom.d.ts +1 -3
- package/types/Audio.d.ts +16 -16
- package/types/Block.d.ts +0 -2
- package/types/Button.d.ts +187 -47
- package/types/Camera.d.ts +20 -18
- package/types/Canvas.d.ts +52 -13
- package/types/Checkbox.d.ts +13 -10
- package/types/CheckboxGroup.d.ts +5 -7
- package/types/CoverImage.d.ts +44 -5
- package/types/CoverView.d.ts +34 -10
- package/types/Editor.d.ts +4 -6
- package/types/Form.d.ts +23 -7
- package/types/FunctionalPageNavigator.d.ts +5 -3
- package/types/Icon.d.ts +19 -7
- package/types/Image.d.ts +71 -14
- package/types/Input.d.ts +44 -33
- package/types/Label.d.ts +0 -3
- package/types/LivePlayer.d.ts +80 -24
- package/types/LivePusher.d.ts +78 -37
- package/types/Map.d.ts +204 -61
- package/types/MatchMedia.d.ts +8 -10
- package/types/MovableArea.d.ts +1 -3
- package/types/MovableView.d.ts +88 -30
- package/types/NavigationBar.d.ts +0 -2
- package/types/Navigator.d.ts +35 -18
- package/types/OfficialAccount.d.ts +10 -3
- package/types/OpenData.d.ts +35 -6
- package/types/PageContainer.d.ts +13 -10
- package/types/PageMeta.d.ts +27 -13
- package/types/Picker.d.ts +50 -14
- package/types/PickerView.d.ts +31 -13
- package/types/PickerViewColumn.d.ts +0 -2
- package/types/Progress.d.ts +17 -14
- package/types/Radio.d.ts +16 -6
- package/types/RadioGroup.d.ts +6 -4
- package/types/RichText.d.ts +53 -5
- package/types/ScrollView.d.ts +82 -19
- package/types/ShareElement.d.ts +5 -7
- package/types/Slider.d.ts +41 -17
- package/types/Swiper.d.ts +100 -22
- package/types/SwiperItem.d.ts +6 -3
- package/types/Switch.d.ts +22 -8
- package/types/Text.d.ts +10 -6
- package/types/Textarea.d.ts +61 -28
- package/types/Video.d.ts +322 -48
- package/types/View.d.ts +122 -9
- package/types/VoipRoom.d.ts +6 -9
- package/types/WebView.d.ts +9 -7
- package/types/common.d.ts +1 -1
- package/dist/taro-components/p-1f4ab9e7.entry.js +0 -1
- package/dist/taro-components/p-b0df2c4a.system.entry.js +0 -1
package/types/Image.d.ts
CHANGED
|
@@ -1,34 +1,33 @@
|
|
|
1
1
|
import { ComponentType, ImgHTMLAttributes } from 'react'
|
|
2
2
|
import { StandardProps, CommonEventFunction } from './common'
|
|
3
|
-
|
|
4
3
|
interface ImageProps extends StandardProps {
|
|
5
4
|
/** 图片资源地址
|
|
6
|
-
* @supported weapp,
|
|
5
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
7
6
|
*/
|
|
8
7
|
src: string
|
|
9
8
|
|
|
10
9
|
/** 图片裁剪、缩放的模式
|
|
11
10
|
* @default "scaleToFill"
|
|
12
|
-
* @supported weapp,
|
|
11
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
13
12
|
* @rn 部分支持 scaleToFill, aspectFit, aspectFill, widthFix
|
|
14
13
|
*/
|
|
15
14
|
mode?: keyof ImageProps.Mode
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
/** 默认不解析 webP 格式,只支持网络资源
|
|
18
17
|
* @default false
|
|
19
|
-
* @supported weapp
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
* @supported weapp, swan
|
|
19
|
+
*/
|
|
20
|
+
webp?: boolean
|
|
22
21
|
|
|
23
22
|
/** 默认不解析 svg 格式,svg 图片只支持 aspectFit
|
|
24
23
|
* @default false
|
|
25
24
|
* @supported rn
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
*/
|
|
26
|
+
svg?: boolean
|
|
28
27
|
|
|
29
28
|
/** 图片懒加载。只针对 page 与 scroll-view 下的 image 有效
|
|
30
29
|
* @default false
|
|
31
|
-
* @supported weapp,
|
|
30
|
+
* @supported weapp, alipay, swan, tt, qq, h5
|
|
32
31
|
*/
|
|
33
32
|
lazyLoad?: boolean
|
|
34
33
|
|
|
@@ -39,12 +38,12 @@ interface ImageProps extends StandardProps {
|
|
|
39
38
|
showMenuByLongpress?: boolean
|
|
40
39
|
|
|
41
40
|
/** 当错误发生时,发布到 AppService 的事件名,事件对象
|
|
42
|
-
* @supported weapp,
|
|
41
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
43
42
|
*/
|
|
44
43
|
onError?: CommonEventFunction<ImageProps.onErrorEventDetail>
|
|
45
44
|
|
|
46
45
|
/** 当图片载入完毕时,发布到 AppService 的事件名,事件对象
|
|
47
|
-
* @supported weapp,
|
|
46
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
48
47
|
*/
|
|
49
48
|
onLoad?: CommonEventFunction<ImageProps.onLoadEventDetail>
|
|
50
49
|
|
|
@@ -58,37 +57,95 @@ interface ImageProps extends StandardProps {
|
|
|
58
57
|
* @supported h5
|
|
59
58
|
*/
|
|
60
59
|
nativeProps?: Record<string, unknown>
|
|
61
|
-
}
|
|
62
60
|
|
|
61
|
+
/** 外部样式。
|
|
62
|
+
* @supported alipay
|
|
63
|
+
*/
|
|
64
|
+
class?: string
|
|
65
|
+
|
|
66
|
+
/** 内联样式。
|
|
67
|
+
* @supported alipay
|
|
68
|
+
*/
|
|
69
|
+
style?: string
|
|
70
|
+
|
|
71
|
+
/** 默认图片地址,若设置默认图片地址,会先显示默认图片,等 src 对应的图片加载成功后,再渲染对应的图片。
|
|
72
|
+
* 版本要求: 基础库 1.19.0 及以上
|
|
73
|
+
* @supported alipay
|
|
74
|
+
*/
|
|
75
|
+
defaultSource?: string
|
|
76
|
+
|
|
77
|
+
/** 点击图片时触发。
|
|
78
|
+
* @supported alipay
|
|
79
|
+
*/
|
|
80
|
+
onTap?: CommonEventFunction
|
|
81
|
+
|
|
82
|
+
/** 点击图片时触发,阻止事件冒泡。
|
|
83
|
+
* @supported alipay
|
|
84
|
+
*/
|
|
85
|
+
catchTap?: CommonEventFunction
|
|
86
|
+
|
|
87
|
+
/** 阻止长按图片时弹起默认菜单(即将该属性设置为image-menu-prevent="true"或image-menu-prevent),只在初始化时有效,不能动态变更;若不想阻止弹起默认菜单,则不需要设置此属性。注:长按菜单后的操作暂不支持 svg 格式
|
|
88
|
+
* @supported swan
|
|
89
|
+
*/
|
|
90
|
+
imageMenuPrevent?: string
|
|
91
|
+
|
|
92
|
+
/** 点击后是否预览图片。在不设置的情况下,若 image 未监听点击事件且宽度大于 1/4 屏宽,则默认开启
|
|
93
|
+
* @supported swan
|
|
94
|
+
*/
|
|
95
|
+
preview?: string
|
|
96
|
+
|
|
97
|
+
/** 预览时显示的图片地址
|
|
98
|
+
* @supported swan
|
|
99
|
+
*/
|
|
100
|
+
originalSrc?: string
|
|
101
|
+
|
|
102
|
+
/** 无障碍访问,(属性)元素的额外描述
|
|
103
|
+
* @supported qq
|
|
104
|
+
*/
|
|
105
|
+
ariaLabel?: string
|
|
106
|
+
}
|
|
63
107
|
declare namespace ImageProps {
|
|
64
108
|
/** mode 的合法值 */
|
|
65
109
|
interface Mode {
|
|
66
110
|
/** 缩放模式,不保持纵横比缩放图片,使图片的宽高完全拉伸至填满 image 元素 */
|
|
67
111
|
scaleToFill
|
|
112
|
+
|
|
68
113
|
/** 缩放模式,保持纵横比缩放图片,使图片的长边能完全显示出来。也就是说,可以完整地将图片显示出来。 */
|
|
69
114
|
aspectFit
|
|
115
|
+
|
|
70
116
|
/** 缩放模式,保持纵横比缩放图片,只保证图片的短边能完全显示出来。也就是说,图片通常只在水平或垂直方向是完整的,另一个方向将会发生截取。 */
|
|
71
117
|
aspectFill
|
|
118
|
+
|
|
72
119
|
/** 缩放模式,宽度不变,高度自动变化,保持原图宽高比不变 */
|
|
73
120
|
widthFix
|
|
121
|
+
|
|
74
122
|
/** 缩放模式,高度不变,宽度自动变化,保持原图宽高比不变 */
|
|
75
123
|
heightFix
|
|
124
|
+
|
|
76
125
|
/** 裁剪模式,不缩放图片,只显示图片的顶部区域 */
|
|
77
126
|
top
|
|
127
|
+
|
|
78
128
|
/** 裁剪模式,不缩放图片,只显示图片的底部区域 */
|
|
79
129
|
bottom
|
|
130
|
+
|
|
80
131
|
/** 裁剪模式,不缩放图片,只显示图片的中间区域 */
|
|
81
132
|
center
|
|
133
|
+
|
|
82
134
|
/** 裁剪模式,不缩放图片,只显示图片的左边区域 */
|
|
83
135
|
left
|
|
136
|
+
|
|
84
137
|
/** 裁剪模式,不缩放图片,只显示图片的右边区域 */
|
|
85
138
|
right
|
|
139
|
+
|
|
86
140
|
/** 裁剪模式,不缩放图片,只显示图片的左上边区域 */
|
|
87
141
|
'top left'
|
|
142
|
+
|
|
88
143
|
/** 裁剪模式,不缩放图片,只显示图片的右上边区域 */
|
|
89
144
|
'top right'
|
|
145
|
+
|
|
90
146
|
/** 裁剪模式,不缩放图片,只显示图片的左下边区域 */
|
|
91
147
|
'bottom left'
|
|
148
|
+
|
|
92
149
|
/** 裁剪模式,不缩放图片,只显示图片的右下边区域 */
|
|
93
150
|
'bottom right'
|
|
94
151
|
}
|
|
@@ -99,6 +156,7 @@ declare namespace ImageProps {
|
|
|
99
156
|
interface onLoadEventDetail {
|
|
100
157
|
/** 图片高度 */
|
|
101
158
|
height: number | string
|
|
159
|
+
|
|
102
160
|
/** 图片宽度 */
|
|
103
161
|
width: number | string
|
|
104
162
|
}
|
|
@@ -150,5 +208,4 @@ declare namespace ImageProps {
|
|
|
150
208
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/image.html
|
|
151
209
|
*/
|
|
152
210
|
declare const Image: ComponentType<ImageProps>
|
|
153
|
-
|
|
154
211
|
export { Image, ImageProps }
|
package/types/Input.d.ts
CHANGED
|
@@ -1,37 +1,36 @@
|
|
|
1
1
|
import { ComponentType } from 'react'
|
|
2
2
|
import { StandardProps, CommonEventFunction, FormItemProps } from './common'
|
|
3
|
-
|
|
4
3
|
interface InputProps extends StandardProps, FormItemProps {
|
|
5
4
|
/** 输入框的初始内容
|
|
6
|
-
* @supported weapp,
|
|
5
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
7
6
|
*/
|
|
8
7
|
value?: string
|
|
9
8
|
|
|
10
9
|
/** input 的类型
|
|
11
10
|
* @default "text"
|
|
12
|
-
* @supported weapp,
|
|
11
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
13
12
|
* @rn 部分支持
|
|
14
13
|
*/
|
|
15
14
|
type?: 'text' | 'number' | 'idcard' | 'digit' | 'safe-password' | 'nickname'
|
|
16
15
|
|
|
17
16
|
/** 是否是密码类型
|
|
18
|
-
* @supported weapp,
|
|
17
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
19
18
|
*/
|
|
20
19
|
password?: boolean
|
|
21
20
|
|
|
22
21
|
/** 输入框为空时占位符
|
|
23
|
-
* @supported weapp,
|
|
22
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
24
23
|
*/
|
|
25
24
|
placeholder?: string
|
|
26
25
|
|
|
27
26
|
/** 指定 placeholder 的样式
|
|
28
|
-
* @supported weapp,
|
|
27
|
+
* @supported weapp, alipay, swan, tt, qq, jd, rn
|
|
29
28
|
*/
|
|
30
29
|
placeholderStyle?: string
|
|
31
30
|
|
|
32
31
|
/** 指定 placeholder 的样式类
|
|
33
32
|
* @default "input-placeholder"
|
|
34
|
-
* @supported weapp, tt
|
|
33
|
+
* @supported weapp, alipay, swan, tt, qq, jd
|
|
35
34
|
*/
|
|
36
35
|
placeholderClass?: string
|
|
37
36
|
|
|
@@ -41,71 +40,71 @@ interface InputProps extends StandardProps, FormItemProps {
|
|
|
41
40
|
placeholderTextColor?: string
|
|
42
41
|
|
|
43
42
|
/** 是否禁用
|
|
44
|
-
* @supported weapp,
|
|
43
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
45
44
|
*/
|
|
46
45
|
disabled?: boolean
|
|
47
46
|
|
|
48
47
|
/** 最大输入长度,设置为 -1 的时候不限制最大长度
|
|
49
48
|
* @default 140
|
|
50
|
-
* @supported weapp,
|
|
49
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
51
50
|
*/
|
|
52
51
|
maxlength?: number
|
|
53
52
|
|
|
54
53
|
/** 指定光标与键盘的距离,单位 px 。取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离
|
|
55
54
|
* @default 0
|
|
56
|
-
* @supported weapp, tt
|
|
55
|
+
* @supported weapp, swan, tt, qq, jd
|
|
57
56
|
*/
|
|
58
57
|
cursorSpacing?: number
|
|
59
58
|
|
|
60
59
|
/** (即将废弃,请直接使用 focus )自动聚焦,拉起键盘
|
|
61
60
|
* @default false
|
|
62
|
-
* @supported weapp
|
|
61
|
+
* @supported weapp, qq, jd
|
|
63
62
|
*/
|
|
64
63
|
autoFocus?: boolean
|
|
65
64
|
|
|
66
65
|
/** 获取焦点
|
|
67
|
-
* @supported weapp,
|
|
66
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
68
67
|
*/
|
|
69
68
|
focus?: boolean
|
|
70
69
|
|
|
71
70
|
/** 设置键盘右下角按钮的文字
|
|
72
71
|
* @default done
|
|
73
|
-
* @supported weapp,
|
|
72
|
+
* @supported weapp, alipay, swan, tt, qq, jd, rn
|
|
74
73
|
*/
|
|
75
74
|
confirmType?: 'send' | 'search' | 'next' | 'go' | 'done'
|
|
76
75
|
|
|
77
76
|
/** 点击键盘右下角按钮时是否保持键盘不收起
|
|
78
77
|
* @default false
|
|
79
|
-
* @supported weapp
|
|
78
|
+
* @supported weapp, alipay, swan, tt, qq, jd
|
|
80
79
|
*/
|
|
81
80
|
confirmHold?: boolean
|
|
82
81
|
|
|
83
82
|
/** 指定focus时的光标位置
|
|
84
|
-
* @supported weapp,
|
|
83
|
+
* @supported weapp, alipay, swan, tt, qq, jd, rn
|
|
85
84
|
*/
|
|
86
85
|
cursor?: number
|
|
87
86
|
|
|
88
87
|
/** 光标起始位置,自动聚集时有效,需与selection-end搭配使用
|
|
89
88
|
* @default -1
|
|
90
|
-
* @supported weapp,
|
|
89
|
+
* @supported weapp, alipay, swan, tt, qq, jd, rn
|
|
91
90
|
*/
|
|
92
91
|
selectionStart?: number
|
|
93
92
|
|
|
94
93
|
/** 光标结束位置,自动聚集时有效,需与selection-start搭配使用
|
|
95
94
|
* @default -1
|
|
96
|
-
* @supported weapp,
|
|
95
|
+
* @supported weapp, alipay, swan, tt, qq, jd, rn
|
|
97
96
|
*/
|
|
98
97
|
selectionEnd?: number
|
|
99
98
|
|
|
100
99
|
/** 键盘弹起时,是否自动上推页面
|
|
101
100
|
* @default false
|
|
102
|
-
* @supported weapp, tt
|
|
101
|
+
* @supported weapp, swan, tt, qq, jd
|
|
103
102
|
*/
|
|
104
103
|
adjustPosition?: boolean
|
|
105
104
|
|
|
106
105
|
/** focus 时,点击页面的时候不收起键盘
|
|
107
106
|
* @default false
|
|
108
|
-
* @supported weapp
|
|
107
|
+
* @supported weapp, tt
|
|
109
108
|
*/
|
|
110
109
|
holdKeyboard?: boolean
|
|
111
110
|
|
|
@@ -139,6 +138,7 @@ interface InputProps extends StandardProps, FormItemProps {
|
|
|
139
138
|
* @supported weapp
|
|
140
139
|
*/
|
|
141
140
|
safePasswordNonce?: string
|
|
141
|
+
|
|
142
142
|
/**
|
|
143
143
|
* 安全键盘计算hash盐值,若指定custom-hash 则无效
|
|
144
144
|
* @supported weapp
|
|
@@ -166,34 +166,28 @@ interface InputProps extends StandardProps, FormItemProps {
|
|
|
166
166
|
controlled?: boolean
|
|
167
167
|
|
|
168
168
|
/** 当键盘输入时,触发input事件,event.detail = {value, cursor, keyCode},处理函数可以直接 return 一个字符串,将替换输入框的内容。
|
|
169
|
-
* @supported weapp,
|
|
169
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
170
170
|
*/
|
|
171
171
|
onInput?: CommonEventFunction<InputProps.inputEventDetail>
|
|
172
172
|
|
|
173
173
|
/** 输入框聚焦时触发,event.detail = { value, height },height 为键盘高度
|
|
174
|
-
* @supported weapp,
|
|
174
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
175
175
|
*/
|
|
176
176
|
onFocus?: CommonEventFunction<InputProps.inputForceEventDetail>
|
|
177
177
|
|
|
178
178
|
/** 输入框失去焦点时触发
|
|
179
|
-
*
|
|
180
|
-
* event.detail = {value: value}
|
|
181
|
-
* @supported weapp, h5, rn, tt
|
|
179
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
182
180
|
*/
|
|
183
181
|
onBlur?: CommonEventFunction<InputProps.inputValueEventDetail>
|
|
184
182
|
|
|
185
183
|
/** 点击完成按钮时触发
|
|
186
|
-
*
|
|
187
|
-
* event.detail = {value: value}
|
|
188
|
-
* @supported weapp, rn, tt
|
|
184
|
+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
|
|
189
185
|
* @h5 借用[Form 组件](./form)的`onSubmit`事件来替代
|
|
190
186
|
*/
|
|
191
187
|
onConfirm?: CommonEventFunction<InputProps.inputValueEventDetail>
|
|
192
188
|
|
|
193
189
|
/** 键盘高度发生变化的时候触发此事件
|
|
194
|
-
*
|
|
195
|
-
* event.detail = {height: height, duration: duration}
|
|
196
|
-
* @supported weapp
|
|
190
|
+
* @supported weapp, qq
|
|
197
191
|
*/
|
|
198
192
|
onKeyboardHeightChange?: CommonEventFunction<InputProps.onKeyboardHeightChangeEventDetail>
|
|
199
193
|
|
|
@@ -201,21 +195,39 @@ interface InputProps extends StandardProps, FormItemProps {
|
|
|
201
195
|
* @supported h5
|
|
202
196
|
*/
|
|
203
197
|
nativeProps?: Record<string, unknown>
|
|
204
|
-
}
|
|
205
198
|
|
|
199
|
+
/** 组件名字,用于表单提交获取数据。
|
|
200
|
+
* @supported alipay
|
|
201
|
+
*/
|
|
202
|
+
name?: string
|
|
203
|
+
|
|
204
|
+
/** 是否强制使用系统键盘和 Web-view 创建的 input 元素。为 true 时,confirm-type、confirm-hold 可能失效。
|
|
205
|
+
* 版本要求:基础库 2.7.3 及以上
|
|
206
|
+
* @supported alipay
|
|
207
|
+
*/
|
|
208
|
+
alwaysSystem?: string
|
|
209
|
+
|
|
210
|
+
/** 无障碍访问,(属性)元素的额外描述
|
|
211
|
+
* @supported qq
|
|
212
|
+
*/
|
|
213
|
+
ariaLabel?: string
|
|
214
|
+
}
|
|
206
215
|
declare namespace InputProps {
|
|
207
216
|
/** > 注意:React-Native 端 `inputEventDetail` 仅实现参数 `value`,若需实时获取光标位置则可通过 [`onSelectionChange`](https://reactnative.dev/docs/textinput#onselectionchange) 实现。 */
|
|
208
217
|
interface inputEventDetail {
|
|
209
218
|
/** 输入值 */
|
|
210
219
|
value: string
|
|
220
|
+
|
|
211
221
|
/** 光标位置 */
|
|
212
222
|
cursor: number
|
|
223
|
+
|
|
213
224
|
/** 键值 */
|
|
214
225
|
keyCode: number
|
|
215
226
|
}
|
|
216
227
|
interface inputForceEventDetail {
|
|
217
228
|
/** 输入值 */
|
|
218
229
|
value: string
|
|
230
|
+
|
|
219
231
|
/** 键盘高度 */
|
|
220
232
|
height: number
|
|
221
233
|
}
|
|
@@ -223,10 +235,10 @@ declare namespace InputProps {
|
|
|
223
235
|
/** 输入值 */
|
|
224
236
|
value: string
|
|
225
237
|
}
|
|
226
|
-
|
|
227
238
|
interface onKeyboardHeightChangeEventDetail {
|
|
228
239
|
/** 键盘高度 */
|
|
229
240
|
height: number
|
|
241
|
+
|
|
230
242
|
/** 持续时间 */
|
|
231
243
|
duration: number
|
|
232
244
|
}
|
|
@@ -284,5 +296,4 @@ declare namespace InputProps {
|
|
|
284
296
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/input.html
|
|
285
297
|
*/
|
|
286
298
|
declare const Input: ComponentType<InputProps>
|
|
287
|
-
|
|
288
299
|
export { Input, InputProps }
|
package/types/Label.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { ComponentType } from 'react'
|
|
2
2
|
import { StandardProps } from './common'
|
|
3
|
-
|
|
4
3
|
interface LabelProps extends StandardProps {
|
|
5
|
-
|
|
6
4
|
/** 绑定控件的 id */
|
|
7
5
|
for?: string
|
|
8
6
|
}
|
|
@@ -50,5 +48,4 @@ interface LabelProps extends StandardProps {
|
|
|
50
48
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/label.html
|
|
51
49
|
*/
|
|
52
50
|
declare const Label: ComponentType<LabelProps>
|
|
53
|
-
|
|
54
51
|
export { Label, LabelProps }
|
package/types/LivePlayer.d.ts
CHANGED
|
@@ -1,96 +1,89 @@
|
|
|
1
1
|
import { ComponentType } from 'react'
|
|
2
2
|
import { StandardProps, CommonEventFunction, NetStatus } from './common'
|
|
3
|
-
|
|
4
3
|
interface LivePlayerProps extends StandardProps {
|
|
5
4
|
/** 音视频地址。目前仅支持 flv, rtmp 格式
|
|
6
|
-
* @supported weapp, tt
|
|
5
|
+
* @supported weapp, swan, tt, qq, jd
|
|
7
6
|
*/
|
|
8
7
|
src?: string
|
|
9
8
|
|
|
10
9
|
/** 模式
|
|
11
10
|
* @default "live"
|
|
12
|
-
* @supported weapp
|
|
11
|
+
* @supported weapp, qq, jd
|
|
13
12
|
*/
|
|
14
13
|
mode?: keyof LivePlayerProps.Mode
|
|
15
14
|
|
|
16
15
|
/** 自动播放
|
|
17
16
|
* @default false
|
|
18
|
-
* @supported weapp, tt
|
|
17
|
+
* @supported weapp, swan, tt, qq, jd
|
|
19
18
|
*/
|
|
20
19
|
autoplay?: boolean
|
|
21
20
|
|
|
22
21
|
/** 是否静音
|
|
23
22
|
* @default false
|
|
24
|
-
* @supported weapp, tt
|
|
23
|
+
* @supported weapp, swan, tt, qq, jd
|
|
25
24
|
*/
|
|
26
25
|
muted?: boolean
|
|
27
26
|
|
|
28
27
|
/** 画面方向
|
|
29
28
|
* @default "vertical"
|
|
30
|
-
* @supported weapp, tt
|
|
29
|
+
* @supported weapp, swan, tt, qq, jd
|
|
31
30
|
*/
|
|
32
31
|
orientation?: keyof LivePlayerProps.Orientation
|
|
33
32
|
|
|
34
33
|
/** 填充模式
|
|
35
34
|
* @default "contain"
|
|
36
|
-
* @supported weapp, tt
|
|
35
|
+
* @supported weapp, swan, tt, qq, jd
|
|
37
36
|
*/
|
|
38
37
|
objectFit?: keyof LivePlayerProps.objectFit
|
|
39
38
|
|
|
40
39
|
/** 进入后台时是否静音(已废弃,默认退台静音)
|
|
41
40
|
* @default false
|
|
42
|
-
* @supported weapp
|
|
41
|
+
* @supported weapp, swan
|
|
43
42
|
* @deprecated
|
|
44
43
|
*/
|
|
45
44
|
backgroundMute?: boolean
|
|
46
45
|
|
|
47
46
|
/** 最小缓冲区,单位s
|
|
48
47
|
* @default 1
|
|
49
|
-
* @supported weapp
|
|
48
|
+
* @supported weapp, swan, qq
|
|
50
49
|
*/
|
|
51
50
|
minCache?: number
|
|
52
51
|
|
|
53
52
|
/** 最大缓冲区,单位s
|
|
54
53
|
* @default 3
|
|
55
|
-
* @supported weapp
|
|
54
|
+
* @supported weapp, swan, qq
|
|
56
55
|
*/
|
|
57
56
|
maxCache?: number
|
|
58
57
|
|
|
59
58
|
/** 声音输出方式
|
|
60
59
|
* @default "speaker"
|
|
61
|
-
* @supported weapp
|
|
60
|
+
* @supported weapp, qq, jd
|
|
62
61
|
*/
|
|
63
62
|
soundMode?: keyof LivePlayerProps.soundMode
|
|
64
63
|
|
|
65
64
|
/** 当跳转到本小程序的其他页面时,是否自动暂停本页面的实时音视频播放
|
|
66
65
|
* @default true
|
|
67
|
-
* @supported weapp
|
|
66
|
+
* @supported weapp, qq
|
|
68
67
|
*/
|
|
69
68
|
autoPauseIfNavigate?: boolean
|
|
70
69
|
|
|
71
|
-
/** 当跳转到其它微信原生页面时,是否自动暂停本页面的实时音视频播放
|
|
72
|
-
* @default true
|
|
73
|
-
* @supported weapp
|
|
74
|
-
*/
|
|
75
|
-
autoPauseIfOpenNavigate?: boolean
|
|
76
|
-
|
|
77
70
|
/** 设置小窗模式: push, pop,空字符串或通过数组形式设置多种模式(如: ["push", "pop"])
|
|
78
71
|
* @supported weapp
|
|
79
72
|
*/
|
|
80
73
|
pictureInPictureMode?: ('push' | 'pop')[] | 'push' | 'pop' | ''
|
|
81
74
|
|
|
82
75
|
/** 播放状态变化事件,detail = {code}
|
|
83
|
-
* @supported weapp, tt
|
|
76
|
+
* @supported weapp, swan, tt, qq, jd
|
|
84
77
|
*/
|
|
85
78
|
onStateChange?: CommonEventFunction<LivePlayerProps.onStateChangeEventDetail>
|
|
86
79
|
|
|
87
80
|
/** 全屏变化事件,detail = {direction, fullScreen}
|
|
88
|
-
* @supported weapp, tt
|
|
81
|
+
* @supported weapp, swan, tt, qq, jd
|
|
89
82
|
*/
|
|
90
83
|
onFullScreenChange?: CommonEventFunction<LivePlayerProps.onFullScreenChangeEventDetail>
|
|
91
84
|
|
|
92
85
|
/** 网络状态通知,detail = {info}
|
|
93
|
-
* @supported weapp
|
|
86
|
+
* @supported weapp, swan, qq
|
|
94
87
|
*/
|
|
95
88
|
onNetStatus?: CommonEventFunction<LivePlayerProps.onNetStatusEventDetail>
|
|
96
89
|
|
|
@@ -108,38 +101,78 @@ interface LivePlayerProps extends StandardProps {
|
|
|
108
101
|
* @supported weapp
|
|
109
102
|
*/
|
|
110
103
|
onLeavePictureInPicture?: CommonEventFunction
|
|
111
|
-
}
|
|
112
104
|
|
|
105
|
+
/** 当跳转到其它微信原生页面时,是否自动暂停本页面的实时音视频播放
|
|
106
|
+
* @supported weapp, qq
|
|
107
|
+
*/
|
|
108
|
+
autoPauseIfOpenNative?: string
|
|
109
|
+
|
|
110
|
+
/** 格式固定为 https://servicewechat.com/{appid}/{version}/page-frame.html,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本;
|
|
111
|
+
* @supported weapp
|
|
112
|
+
*/
|
|
113
|
+
referrerPolicy?: 'origin' | 'no-referrer'
|
|
114
|
+
|
|
115
|
+
/** 设置署名水印
|
|
116
|
+
* @supported tt
|
|
117
|
+
*/
|
|
118
|
+
signature?: string
|
|
119
|
+
|
|
120
|
+
/** 播放错误事件
|
|
121
|
+
* @supported tt
|
|
122
|
+
*/
|
|
123
|
+
onError?: CommonEventFunction
|
|
124
|
+
|
|
125
|
+
/** 是否回调metadata
|
|
126
|
+
* @supported qq
|
|
127
|
+
*/
|
|
128
|
+
enableMetadata?: string
|
|
129
|
+
|
|
130
|
+
/** metadata通知,detail = {info}
|
|
131
|
+
* @supported qq
|
|
132
|
+
*/
|
|
133
|
+
onMetaDataChange?: CommonEventFunction
|
|
134
|
+
|
|
135
|
+
/** live-player 属性的唯一标志符
|
|
136
|
+
* @supported swan
|
|
137
|
+
*/
|
|
138
|
+
id?: string
|
|
139
|
+
}
|
|
113
140
|
declare namespace LivePlayerProps {
|
|
114
141
|
/** mode 的合法值 */
|
|
115
142
|
interface Mode {
|
|
116
143
|
/** 直播 */
|
|
117
144
|
live
|
|
145
|
+
|
|
118
146
|
/** 实时通话,该模式时延更低 */
|
|
119
147
|
RTC
|
|
120
148
|
}
|
|
149
|
+
|
|
121
150
|
/** orientation 的合法值 */
|
|
122
151
|
interface Orientation {
|
|
123
152
|
/** 竖直 */
|
|
124
153
|
vertical
|
|
154
|
+
|
|
125
155
|
/** 水平 */
|
|
126
156
|
horizontal
|
|
127
157
|
}
|
|
158
|
+
|
|
128
159
|
/** objectFit 的合法值 */
|
|
129
160
|
interface objectFit {
|
|
130
161
|
/** 图像长边填满屏幕,短边区域会被填充⿊⾊ */
|
|
131
162
|
contain
|
|
163
|
+
|
|
132
164
|
/** 图像铺满屏幕,超出显示区域的部分将被截掉 */
|
|
133
165
|
fillCrop
|
|
134
166
|
}
|
|
167
|
+
|
|
135
168
|
/** soundMode 的合法值 */
|
|
136
169
|
interface soundMode {
|
|
137
170
|
/** 扬声器 */
|
|
138
171
|
speaker
|
|
172
|
+
|
|
139
173
|
/** 听筒 */
|
|
140
174
|
ear
|
|
141
175
|
}
|
|
142
|
-
|
|
143
176
|
interface onStateChangeEventDetail {
|
|
144
177
|
/** 状态码 */
|
|
145
178
|
code: number
|
|
@@ -147,58 +180,82 @@ declare namespace LivePlayerProps {
|
|
|
147
180
|
interface onFullScreenChangeEventDetail {
|
|
148
181
|
/** 方向 */
|
|
149
182
|
direction: number
|
|
183
|
+
|
|
150
184
|
/** 全屏 */
|
|
151
185
|
fullScreen: number | boolean
|
|
152
186
|
}
|
|
153
187
|
interface onNetStatusEventDetail {
|
|
154
188
|
info: NetStatus
|
|
155
189
|
}
|
|
190
|
+
|
|
156
191
|
/** 状态码 */
|
|
157
192
|
interface Status {
|
|
158
193
|
/** 已经连接服务器 */
|
|
159
194
|
2001
|
|
195
|
+
|
|
160
196
|
/** 已经连接 RTMP 服务器,开始拉流 */
|
|
161
197
|
2002
|
|
198
|
+
|
|
162
199
|
/** 网络接收到首个视频数据包(IDR) */
|
|
163
200
|
2003
|
|
201
|
+
|
|
164
202
|
/** 视频播放开始 */
|
|
165
203
|
2004
|
|
204
|
+
|
|
166
205
|
/** 视频播放进度 */
|
|
167
206
|
2005
|
|
207
|
+
|
|
168
208
|
/** 视频播放结束 */
|
|
169
209
|
2006
|
|
210
|
+
|
|
170
211
|
/** 视频播放Loading */
|
|
171
212
|
2007
|
|
213
|
+
|
|
172
214
|
/** 解码器启动 */
|
|
173
215
|
2008
|
|
216
|
+
|
|
174
217
|
/** 视频分辨率改变 */
|
|
175
218
|
2009
|
|
219
|
+
|
|
176
220
|
/** 网络断连,且经多次重连抢救无效,更多重试请自行重启播放 */
|
|
177
221
|
'-2301'
|
|
222
|
+
|
|
178
223
|
/** 获取加速拉流地址失败 */
|
|
179
224
|
'-2302'
|
|
225
|
+
|
|
180
226
|
/** 当前视频帧解码失败 */
|
|
181
227
|
2101
|
|
228
|
+
|
|
182
229
|
/** 当前音频帧解码失败 */
|
|
183
230
|
2102
|
|
231
|
+
|
|
184
232
|
/** 网络断连, 已启动自动重连 */
|
|
185
233
|
2103
|
|
234
|
+
|
|
186
235
|
/** 网络来包不稳:可能是下行带宽不足,或由于主播端出流不均匀 */
|
|
187
236
|
2104
|
|
237
|
+
|
|
188
238
|
/** 当前视频播放出现卡顿 */
|
|
189
239
|
2105
|
|
240
|
+
|
|
190
241
|
/** 硬解启动失败,采用软解 */
|
|
191
242
|
2106
|
|
243
|
+
|
|
192
244
|
/** 当前视频帧不连续,可能丢帧 */
|
|
193
245
|
2107
|
|
246
|
+
|
|
194
247
|
/** 当前流硬解第一个I帧失败,SDK自动切软解 */
|
|
195
248
|
2108
|
|
249
|
+
|
|
196
250
|
/** RTMP -DNS解析失败 */
|
|
197
251
|
3001
|
|
252
|
+
|
|
198
253
|
/** RTMP服务器连接失败 */
|
|
199
254
|
3002
|
|
255
|
+
|
|
200
256
|
/** RTMP服务器握手失败 */
|
|
201
257
|
3003
|
|
258
|
+
|
|
202
259
|
/** RTMP 读/写失败 */
|
|
203
260
|
3005
|
|
204
261
|
}
|
|
@@ -228,5 +285,4 @@ declare namespace LivePlayerProps {
|
|
|
228
285
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/live-player.html
|
|
229
286
|
*/
|
|
230
287
|
declare const LivePlayer: ComponentType<LivePlayerProps>
|
|
231
|
-
|
|
232
288
|
export { LivePlayer, LivePlayerProps }
|