@tarojs/taro 3.5.0-canary.1 → 3.5.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/html.css +50 -14
- package/html5.css +167 -64
- package/index.js +3 -4
- package/package.json +21 -11
- package/types/api/ad/index.d.ts +2 -2
- package/types/api/ai/face.d.ts +133 -0
- package/types/api/ai/visionkit.d.ts +303 -0
- package/types/api/base/crypto.d.ts +90 -0
- package/types/api/base/debug.d.ts +152 -13
- package/types/api/base/env.d.ts +2 -1
- package/types/api/base/index.d.ts +11 -3
- package/types/api/base/performance.d.ts +195 -0
- package/types/api/base/system.d.ts +541 -103
- package/types/api/base/update.d.ts +60 -8
- package/types/api/base/weapp/app-event.d.ts +99 -37
- package/types/api/base/weapp/life-cycle.d.ts +142 -2
- package/types/api/canvas/index.d.ts +151 -137
- package/types/api/cloud/index.d.ts +17 -2
- package/types/api/data-analysis/index.d.ts +1 -1
- package/types/api/device/accelerometer.d.ts +6 -6
- package/types/api/device/accessibility.d.ts +26 -0
- package/types/api/device/battery.d.ts +2 -2
- package/types/api/device/{ble.d.ts → bluetooth-ble.d.ts} +228 -62
- package/types/api/device/bluetooth-peripheral.d.ts +430 -0
- package/types/api/device/bluetooth.d.ts +67 -2
- package/types/api/device/calendar.d.ts +88 -0
- package/types/api/device/clipboard.d.ts +2 -2
- package/types/api/device/compass.d.ts +3 -3
- package/types/api/device/contact.d.ts +74 -50
- package/types/api/device/gyroscope.d.ts +6 -6
- package/types/api/device/iBeacon.d.ts +33 -19
- package/types/api/{ui → device}/keyboard.d.ts +1 -1
- package/types/api/device/{performance.d.ts → memory.d.ts} +5 -5
- package/types/api/device/motion.d.ts +3 -3
- package/types/api/device/network.d.ts +56 -15
- package/types/api/device/nfc.d.ts +1089 -13
- package/types/api/device/phone.d.ts +1 -1
- package/types/api/device/scan.d.ts +1 -1
- package/types/api/device/screen.d.ts +42 -14
- package/types/api/device/vibrate.d.ts +6 -2
- package/types/api/device/wifi.d.ts +44 -9
- package/types/api/ext/index.d.ts +2 -2
- package/types/api/files/index.d.ts +392 -205
- package/types/api/framework/index.d.ts +5 -4
- package/types/api/location/index.d.ts +156 -53
- package/types/api/media/audio.d.ts +629 -38
- package/types/api/media/background-audio.d.ts +9 -9
- package/types/api/media/camera.d.ts +41 -22
- package/types/api/media/editor.d.ts +22 -2
- package/types/api/media/image.d.ts +64 -35
- package/types/api/media/live.d.ts +66 -6
- package/types/api/media/map.d.ts +474 -54
- package/types/api/media/media-recorder.d.ts +92 -0
- package/types/api/media/recorder.d.ts +21 -21
- package/types/api/media/video-decoder.d.ts +117 -0
- package/types/api/media/video-processing.d.ts +11 -7
- package/types/api/media/video.d.ts +47 -18
- package/types/api/media/voip.d.ts +290 -0
- package/types/api/{open-api/navigate.d.ts → navigate/index.d.ts} +65 -27
- package/types/api/network/download.d.ts +61 -19
- package/types/api/network/request.d.ts +129 -41
- package/types/api/network/tcp.d.ts +181 -0
- package/types/api/network/udp.d.ts +154 -83
- package/types/api/network/upload.d.ts +55 -28
- package/types/api/network/websocket.d.ts +20 -19
- package/types/api/open-api/address.d.ts +1 -1
- package/types/api/open-api/authorize.d.ts +42 -3
- package/types/api/open-api/channels.d.ts +178 -0
- package/types/api/open-api/facial.d.ts +3 -0
- package/types/api/open-api/favorites.d.ts +100 -0
- package/types/api/open-api/group.d.ts +59 -0
- package/types/api/open-api/invoice.d.ts +2 -2
- package/types/api/open-api/license-plate.d.ts +27 -0
- package/types/api/open-api/login.d.ts +21 -0
- package/types/api/open-api/redpackage.d.ts +24 -0
- package/types/api/open-api/settings.d.ts +82 -17
- package/types/api/open-api/soter.d.ts +2 -2
- package/types/api/open-api/subscribe-message.d.ts +89 -4
- package/types/api/open-api/user-info.d.ts +56 -19
- package/types/api/open-api/werun.d.ts +33 -6
- package/types/api/payment/index.d.ts +119 -0
- package/types/api/route/index.d.ts +18 -14
- package/types/api/share/index.d.ts +192 -9
- package/types/api/storage/index.d.ts +38 -92
- package/types/api/swan/index.d.ts +1 -1
- package/types/api/ui/animation.d.ts +105 -155
- package/types/api/ui/background.d.ts +4 -2
- package/types/api/ui/custom-component.d.ts +1 -1
- package/types/api/ui/fonts.d.ts +27 -31
- package/types/api/ui/interaction.d.ts +6 -6
- package/types/api/ui/menu.d.ts +1 -1
- package/types/api/ui/navigation-bar.d.ts +6 -5
- package/types/api/ui/pull-down-refresh.d.ts +2 -2
- package/types/api/ui/scroll.d.ts +75 -7
- package/types/api/ui/sticky.d.ts +4 -4
- package/types/api/ui/tab-bar.d.ts +8 -8
- package/types/api/ui/window.d.ts +22 -2
- package/types/api/worker/index.d.ts +9 -1
- package/types/api/wxml/index.d.ts +116 -112
- package/types/compile.d.ts +57 -6
- package/types/global.d.ts +142 -111
- package/types/taro.api.d.ts +79 -62
- package/types/taro.component.d.ts +21 -65
- package/types/taro.config.d.ts +31 -0
- package/types/taro.extend.d.ts +31 -18
- package/types/taro.hooks.d.ts +55 -3
- package/types/taro.lifecycle.d.ts +21 -14
- package/LICENSE +0 -21
- package/types/api/open-api/payment.d.ts +0 -61
|
@@ -3,12 +3,15 @@ import Taro from '../../index'
|
|
|
3
3
|
declare module '../../index' {
|
|
4
4
|
namespace createAnimation {
|
|
5
5
|
interface Option {
|
|
6
|
-
/** 动画延迟时间,单位 ms */
|
|
7
|
-
delay?: number
|
|
8
6
|
/** 动画持续时间,单位 ms */
|
|
9
7
|
duration?: number
|
|
10
8
|
/** 动画的效果 */
|
|
11
|
-
timingFunction?: keyof
|
|
9
|
+
timingFunction?: keyof TimingFunction
|
|
10
|
+
/** 动画延迟时间,单位 ms
|
|
11
|
+
* @default 0
|
|
12
|
+
*/
|
|
13
|
+
delay?: number
|
|
14
|
+
/** @default "50% 50% 0" */
|
|
12
15
|
transformOrigin?: string
|
|
13
16
|
/**
|
|
14
17
|
* 单位
|
|
@@ -16,7 +19,7 @@ declare module '../../index' {
|
|
|
16
19
|
*/
|
|
17
20
|
unit?: string
|
|
18
21
|
}
|
|
19
|
-
interface
|
|
22
|
+
interface TimingFunction {
|
|
20
23
|
/** 动画从头到尾的速度是相同的 */
|
|
21
24
|
linear
|
|
22
25
|
/** 动画以低速开始,然后加快,在结束前变慢 */
|
|
@@ -34,74 +37,35 @@ declare module '../../index' {
|
|
|
34
37
|
}
|
|
35
38
|
}
|
|
36
39
|
|
|
40
|
+
/** 动画对象
|
|
41
|
+
* @supported weapp, h5, tt
|
|
42
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html
|
|
43
|
+
*/
|
|
37
44
|
interface Animation {
|
|
38
|
-
/** 导出动画队列。**export
|
|
39
|
-
* @supported weapp, h5
|
|
45
|
+
/** 导出动画队列。**export 方法每次调用后会清掉之前的动画操作**。
|
|
46
|
+
* @supported weapp, h5, tt
|
|
40
47
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.export.html
|
|
41
48
|
*/
|
|
42
49
|
export(): {
|
|
43
50
|
actions: TaroGeneral.IAnyObject[]
|
|
44
51
|
}
|
|
45
|
-
/**
|
|
46
|
-
* @supported weapp, h5
|
|
47
|
-
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.
|
|
48
|
-
*/
|
|
49
|
-
backgroundColor(
|
|
50
|
-
/** 颜色值 */
|
|
51
|
-
value: string,
|
|
52
|
-
): Animation
|
|
53
|
-
/** 设置 bottom 值
|
|
54
|
-
* @supported weapp, h5
|
|
55
|
-
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.bottom.html
|
|
56
|
-
*/
|
|
57
|
-
bottom(
|
|
58
|
-
/** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */
|
|
59
|
-
value: number | string,
|
|
60
|
-
): Animation
|
|
61
|
-
/** 设置高度
|
|
62
|
-
* @supported weapp, h5
|
|
63
|
-
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.height.html
|
|
64
|
-
*/
|
|
65
|
-
height(
|
|
66
|
-
/** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */
|
|
67
|
-
value: number | string,
|
|
68
|
-
): Animation
|
|
69
|
-
/** 设置 left 值
|
|
70
|
-
* @supported weapp, h5
|
|
71
|
-
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.left.html
|
|
52
|
+
/** 表示一组动画完成。可以在一组动画中调用任意多个动画方法,一组动画中的所有动画会同时开始,一组动画完成后才会进行下一组动画。
|
|
53
|
+
* @supported weapp, h5, tt
|
|
54
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.step.html
|
|
72
55
|
*/
|
|
73
|
-
|
|
74
|
-
/** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */
|
|
75
|
-
value: number | string,
|
|
76
|
-
): Animation
|
|
56
|
+
step(option?: Animation.StepOption): Animation
|
|
77
57
|
/** 同 [transform-function matrix](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix)
|
|
78
|
-
* @supported weapp, h5
|
|
58
|
+
* @supported weapp, h5, tt
|
|
79
59
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.matrix.html
|
|
80
60
|
*/
|
|
81
61
|
matrix(a: number, b: number, c: number, d: number, tx: number, ty: number): Animation
|
|
82
62
|
/** 同 [transform-function matrix3d](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix3d)
|
|
83
|
-
* @supported weapp
|
|
63
|
+
* @supported weapp, h5, tt
|
|
84
64
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.matrix3d.html
|
|
85
65
|
*/
|
|
86
66
|
matrix3d(a1: number, b1: number, c1: number, d1: number, a2: number, b2: number, c2: number, d2: number, a3: number, b3: number, c3: number, d3: number, a4: number, b4: number, c4: number, d4: number): Animation
|
|
87
|
-
/** 设置透明度
|
|
88
|
-
* @supported weapp, h5
|
|
89
|
-
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.opacity.html
|
|
90
|
-
*/
|
|
91
|
-
opacity(
|
|
92
|
-
/** 透明度,范围 0-1 */
|
|
93
|
-
value: number,
|
|
94
|
-
): Animation
|
|
95
|
-
/** 设置 right 值
|
|
96
|
-
* @supported weapp, h5
|
|
97
|
-
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.right.html
|
|
98
|
-
*/
|
|
99
|
-
right(
|
|
100
|
-
/** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */
|
|
101
|
-
value: number | string,
|
|
102
|
-
): Animation
|
|
103
67
|
/** 从原点顺时针旋转一个角度
|
|
104
|
-
* @supported weapp, h5
|
|
68
|
+
* @supported weapp, h5, tt
|
|
105
69
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.rotate.html
|
|
106
70
|
*/
|
|
107
71
|
rotate(
|
|
@@ -109,7 +73,7 @@ declare module '../../index' {
|
|
|
109
73
|
angle: number,
|
|
110
74
|
): Animation
|
|
111
75
|
/** 从 固定 轴顺时针旋转一个角度
|
|
112
|
-
* @supported weapp, h5
|
|
76
|
+
* @supported weapp, h5, tt
|
|
113
77
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.rotate3d.html
|
|
114
78
|
*/
|
|
115
79
|
rotate3d(
|
|
@@ -123,7 +87,7 @@ declare module '../../index' {
|
|
|
123
87
|
angle?: number,
|
|
124
88
|
): Animation
|
|
125
89
|
/** 从 X 轴顺时针旋转一个角度
|
|
126
|
-
* @supported weapp, h5
|
|
90
|
+
* @supported weapp, h5, tt
|
|
127
91
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.rotateX.html
|
|
128
92
|
*/
|
|
129
93
|
rotateX(
|
|
@@ -131,7 +95,7 @@ declare module '../../index' {
|
|
|
131
95
|
angle: number,
|
|
132
96
|
): Animation
|
|
133
97
|
/** 从 Y 轴顺时针旋转一个角度
|
|
134
|
-
* @supported weapp, h5
|
|
98
|
+
* @supported weapp, h5, tt
|
|
135
99
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.rotateY.html
|
|
136
100
|
*/
|
|
137
101
|
rotateY(
|
|
@@ -139,7 +103,7 @@ declare module '../../index' {
|
|
|
139
103
|
angle: number,
|
|
140
104
|
): Animation
|
|
141
105
|
/** 从 Z 轴顺时针旋转一个角度
|
|
142
|
-
* @supported weapp, h5
|
|
106
|
+
* @supported weapp, h5, tt
|
|
143
107
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.rotateZ.html
|
|
144
108
|
*/
|
|
145
109
|
rotateZ(
|
|
@@ -147,7 +111,7 @@ declare module '../../index' {
|
|
|
147
111
|
angle: number,
|
|
148
112
|
): Animation
|
|
149
113
|
/** 缩放
|
|
150
|
-
* @supported weapp, h5
|
|
114
|
+
* @supported weapp, h5, tt
|
|
151
115
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.scale.html
|
|
152
116
|
*/
|
|
153
117
|
scale(
|
|
@@ -157,7 +121,7 @@ declare module '../../index' {
|
|
|
157
121
|
sy?: number,
|
|
158
122
|
): Animation
|
|
159
123
|
/** 缩放
|
|
160
|
-
* @supported weapp, h5
|
|
124
|
+
* @supported weapp, h5, tt
|
|
161
125
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.scale3d.html
|
|
162
126
|
*/
|
|
163
127
|
scale3d(
|
|
@@ -169,7 +133,7 @@ declare module '../../index' {
|
|
|
169
133
|
sz: number,
|
|
170
134
|
): Animation
|
|
171
135
|
/** 缩放 X 轴
|
|
172
|
-
* @supported weapp, h5
|
|
136
|
+
* @supported weapp, h5, tt
|
|
173
137
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.scaleX.html
|
|
174
138
|
*/
|
|
175
139
|
scaleX(
|
|
@@ -177,7 +141,7 @@ declare module '../../index' {
|
|
|
177
141
|
scale: number,
|
|
178
142
|
): Animation
|
|
179
143
|
/** 缩放 Y 轴
|
|
180
|
-
* @supported weapp, h5
|
|
144
|
+
* @supported weapp, h5, tt
|
|
181
145
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.scaleY.html
|
|
182
146
|
*/
|
|
183
147
|
scaleY(
|
|
@@ -185,7 +149,7 @@ declare module '../../index' {
|
|
|
185
149
|
scale: number,
|
|
186
150
|
): Animation
|
|
187
151
|
/** 缩放 Z 轴
|
|
188
|
-
* @supported weapp, h5
|
|
152
|
+
* @supported weapp, h5, tt
|
|
189
153
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.scaleZ.html
|
|
190
154
|
*/
|
|
191
155
|
scaleZ(
|
|
@@ -193,7 +157,7 @@ declare module '../../index' {
|
|
|
193
157
|
scale: number,
|
|
194
158
|
): Animation
|
|
195
159
|
/** 对 X、Y 轴坐标进行倾斜
|
|
196
|
-
* @supported weapp
|
|
160
|
+
* @supported weapp, h5, tt
|
|
197
161
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.skew.html
|
|
198
162
|
*/
|
|
199
163
|
skew(
|
|
@@ -203,7 +167,7 @@ declare module '../../index' {
|
|
|
203
167
|
ay: number,
|
|
204
168
|
): Animation
|
|
205
169
|
/** 对 X 轴坐标进行倾斜
|
|
206
|
-
* @supported weapp, h5
|
|
170
|
+
* @supported weapp, h5, tt
|
|
207
171
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.skewX.html
|
|
208
172
|
*/
|
|
209
173
|
skewX(
|
|
@@ -211,28 +175,15 @@ declare module '../../index' {
|
|
|
211
175
|
angle: number,
|
|
212
176
|
): Animation
|
|
213
177
|
/** 对 Y 轴坐标进行倾斜
|
|
214
|
-
* @supported weapp
|
|
178
|
+
* @supported weapp, h5, tt
|
|
215
179
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.skewY.html
|
|
216
180
|
*/
|
|
217
181
|
skewY(
|
|
218
182
|
/** 倾斜的角度,范围 [-180, 180] */
|
|
219
183
|
angle: number,
|
|
220
184
|
): Animation
|
|
221
|
-
/** 表示一组动画完成。可以在一组动画中调用任意多个动画方法,一组动画中的所有动画会同时开始,一组动画完成后才会进行下一组动画。
|
|
222
|
-
* @supported weapp, h5
|
|
223
|
-
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.step.html
|
|
224
|
-
*/
|
|
225
|
-
step(option?: Animation.StepOption): Animation
|
|
226
|
-
/** 设置 top 值
|
|
227
|
-
* @supported weapp, h5
|
|
228
|
-
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.top.html
|
|
229
|
-
*/
|
|
230
|
-
top(
|
|
231
|
-
/** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */
|
|
232
|
-
value: number | string,
|
|
233
|
-
): Animation
|
|
234
185
|
/** 平移变换
|
|
235
|
-
* @supported weapp, h5
|
|
186
|
+
* @supported weapp, h5, tt
|
|
236
187
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.translate.html
|
|
237
188
|
*/
|
|
238
189
|
translate(
|
|
@@ -242,7 +193,7 @@ declare module '../../index' {
|
|
|
242
193
|
ty?: number,
|
|
243
194
|
): Animation
|
|
244
195
|
/** 对 xyz 坐标进行平移变换
|
|
245
|
-
* @supported weapp, h5
|
|
196
|
+
* @supported weapp, h5, tt
|
|
246
197
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.translate3d.html
|
|
247
198
|
*/
|
|
248
199
|
translate3d(
|
|
@@ -254,7 +205,7 @@ declare module '../../index' {
|
|
|
254
205
|
tz?: number,
|
|
255
206
|
): Animation
|
|
256
207
|
/** 对 X 轴平移
|
|
257
|
-
* @supported weapp, h5
|
|
208
|
+
* @supported weapp, h5, tt
|
|
258
209
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.translateX.html
|
|
259
210
|
*/
|
|
260
211
|
translateX(
|
|
@@ -262,7 +213,7 @@ declare module '../../index' {
|
|
|
262
213
|
translation: number,
|
|
263
214
|
): Animation
|
|
264
215
|
/** 对 Y 轴平移
|
|
265
|
-
* @supported weapp, h5
|
|
216
|
+
* @supported weapp, h5, tt
|
|
266
217
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.translateY.html
|
|
267
218
|
*/
|
|
268
219
|
translateY(
|
|
@@ -270,21 +221,77 @@ declare module '../../index' {
|
|
|
270
221
|
translation: number,
|
|
271
222
|
): Animation
|
|
272
223
|
/** 对 Z 轴平移
|
|
273
|
-
* @supported weapp, h5
|
|
224
|
+
* @supported weapp, h5, tt
|
|
274
225
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.translateZ.html
|
|
275
226
|
*/
|
|
276
227
|
translateZ(
|
|
277
228
|
/** 在 Z 轴平移的距离,单位为 px */
|
|
278
229
|
translation: number,
|
|
279
230
|
): Animation
|
|
231
|
+
/** 设置透明度
|
|
232
|
+
* @supported weapp, h5, tt
|
|
233
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.opacity.html
|
|
234
|
+
*/
|
|
235
|
+
opacity(
|
|
236
|
+
/** 透明度,范围 0-1 */
|
|
237
|
+
value: number,
|
|
238
|
+
): Animation
|
|
239
|
+
/** 设置背景色
|
|
240
|
+
* @supported weapp, h5, tt
|
|
241
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.backgroundColor.html
|
|
242
|
+
*/
|
|
243
|
+
backgroundColor(
|
|
244
|
+
/** 颜色值 */
|
|
245
|
+
value: string,
|
|
246
|
+
): Animation
|
|
280
247
|
/** 设置宽度
|
|
281
|
-
* @supported weapp, h5
|
|
248
|
+
* @supported weapp, h5, tt
|
|
282
249
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.width.html
|
|
283
250
|
*/
|
|
284
251
|
width(
|
|
285
252
|
/** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */
|
|
286
253
|
value: number | string,
|
|
287
254
|
): Animation
|
|
255
|
+
/** 设置高度
|
|
256
|
+
* @supported weapp, h5, tt
|
|
257
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.height.html
|
|
258
|
+
*/
|
|
259
|
+
height(
|
|
260
|
+
/** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */
|
|
261
|
+
value: number | string,
|
|
262
|
+
): Animation
|
|
263
|
+
/** 设置 left 值
|
|
264
|
+
* @supported weapp, h5, tt
|
|
265
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.left.html
|
|
266
|
+
*/
|
|
267
|
+
left(
|
|
268
|
+
/** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */
|
|
269
|
+
value: number | string,
|
|
270
|
+
): Animation
|
|
271
|
+
/** 设置 right 值
|
|
272
|
+
* @supported weapp, h5, tt
|
|
273
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.right.html
|
|
274
|
+
*/
|
|
275
|
+
right(
|
|
276
|
+
/** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */
|
|
277
|
+
value: number | string,
|
|
278
|
+
): Animation
|
|
279
|
+
/** 设置 top 值
|
|
280
|
+
* @supported weapp, h5, tt
|
|
281
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.top.html
|
|
282
|
+
*/
|
|
283
|
+
top(
|
|
284
|
+
/** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */
|
|
285
|
+
value: number | string,
|
|
286
|
+
): Animation
|
|
287
|
+
/** 设置 bottom 值
|
|
288
|
+
* @supported weapp, h5, tt
|
|
289
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.bottom.html
|
|
290
|
+
*/
|
|
291
|
+
bottom(
|
|
292
|
+
/** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */
|
|
293
|
+
value: number | string,
|
|
294
|
+
): Animation
|
|
288
295
|
}
|
|
289
296
|
|
|
290
297
|
namespace Animation {
|
|
@@ -294,10 +301,10 @@ declare module '../../index' {
|
|
|
294
301
|
/** 动画持续时间,单位 ms */
|
|
295
302
|
duration?: number
|
|
296
303
|
/** 动画的效果 */
|
|
297
|
-
timingFunction?: keyof
|
|
304
|
+
timingFunction?: keyof TimingFunction
|
|
298
305
|
transformOrigin?: string
|
|
299
306
|
}
|
|
300
|
-
interface
|
|
307
|
+
interface TimingFunction {
|
|
301
308
|
/** 动画从头到尾的速度是相同的 */
|
|
302
309
|
linear
|
|
303
310
|
/** 动画以低速开始,然后加快,在结束前变慢 */
|
|
@@ -315,6 +322,7 @@ declare module '../../index' {
|
|
|
315
322
|
}
|
|
316
323
|
}
|
|
317
324
|
|
|
325
|
+
/** @ignore */
|
|
318
326
|
interface KeyFrame {
|
|
319
327
|
/** 关键帧的偏移,范围[0-1] */
|
|
320
328
|
offset?: number
|
|
@@ -378,73 +386,15 @@ declare module '../../index' {
|
|
|
378
386
|
translateY?: number | string
|
|
379
387
|
/** Z 方向位移,即 CSS transform translateZ */
|
|
380
388
|
translateZ?: number | string
|
|
381
|
-
}
|
|
382
|
-
interface ClearAnimationOptions {
|
|
383
|
-
/** 基点位置,即 CSS transform-origin */
|
|
384
|
-
transformOrigin?: boolean
|
|
385
|
-
/** 背景颜色,即 CSS background-color */
|
|
386
|
-
backgroundColor?: boolean
|
|
387
|
-
/** 底边位置,即 CSS bottom */
|
|
388
|
-
bottom?: boolean
|
|
389
|
-
/** 高度,即 CSS height */
|
|
390
|
-
height?: boolean
|
|
391
|
-
/** 左边位置,即 CSS left */
|
|
392
|
-
left?: boolean
|
|
393
|
-
/** 宽度,即 CSS width */
|
|
394
|
-
width?: boolean
|
|
395
|
-
/** 不透明度,即 CSS opacity */
|
|
396
|
-
opacity?: boolean
|
|
397
|
-
/** 右边位置,即 CSS right */
|
|
398
|
-
right?: boolean
|
|
399
|
-
/** 顶边位置,即 CSS top */
|
|
400
|
-
top?: boolean
|
|
401
|
-
/** 变换矩阵,即 CSS transform matrix */
|
|
402
|
-
matrix?: boolean
|
|
403
|
-
/** 三维变换矩阵,即 CSS transform matrix3d */
|
|
404
|
-
matrix3d?: boolean
|
|
405
|
-
/** 旋转,即 CSS transform rotate */
|
|
406
|
-
rotate?: boolean
|
|
407
|
-
/** 三维旋转,即 CSS transform rotate3d */
|
|
408
|
-
rotate3d?: boolean
|
|
409
|
-
/** X 方向旋转,即 CSS transform rotateX */
|
|
410
|
-
rotateX?: boolean
|
|
411
|
-
/** Y 方向旋转,即 CSS transform rotateY */
|
|
412
|
-
rotateY?: boolean
|
|
413
|
-
/** Z 方向旋转,即 CSS transform rotateZ */
|
|
414
|
-
rotateZ?: boolean
|
|
415
|
-
/** 缩放,即 CSS transform scale */
|
|
416
|
-
scale?: boolean
|
|
417
|
-
/** 三维缩放,即 CSS transform scale3d */
|
|
418
|
-
scale3d?: boolean
|
|
419
|
-
/** X 方向缩放,即 CSS transform scaleX */
|
|
420
|
-
scaleX?: boolean
|
|
421
|
-
/** Y 方向缩放,即 CSS transform scaleY */
|
|
422
|
-
scaleY?: boolean
|
|
423
|
-
/** Z 方向缩放,即 CSS transform scaleZ */
|
|
424
|
-
scaleZ?: boolean
|
|
425
|
-
/** 倾斜,即 CSS transform skew */
|
|
426
|
-
skew?: boolean
|
|
427
|
-
/** X 方向倾斜,即 CSS transform skewX */
|
|
428
|
-
skewX?: boolean
|
|
429
|
-
/** Y 方向倾斜,即 CSS transform skewY */
|
|
430
|
-
skewY?: boolean
|
|
431
|
-
/** 位移,即 CSS transform translate */
|
|
432
|
-
translate?: boolean
|
|
433
|
-
/** 三维位移,即 CSS transform translate3d */
|
|
434
|
-
translate3d?: boolean
|
|
435
|
-
/** X 方向位移,即 CSS transform translateX */
|
|
436
|
-
translateX?: boolean
|
|
437
|
-
/** Y 方向位移,即 CSS transform translateY */
|
|
438
|
-
translateY?: boolean
|
|
439
|
-
/** Z 方向位移,即 CSS transform translateZ */
|
|
440
|
-
translateZ?: boolean
|
|
441
|
-
}
|
|
442
|
-
interface ScrollTimelineKeyframe {
|
|
443
389
|
composite?: 'replace' | 'add' | 'accumulate' | 'auto'
|
|
444
390
|
easing?: string
|
|
445
|
-
|
|
446
|
-
[property: string]: string | number | null | undefined
|
|
391
|
+
[property: string]: any
|
|
447
392
|
}
|
|
393
|
+
|
|
394
|
+
/** @ignore */
|
|
395
|
+
type ClearAnimationOptions = Record<keyof KeyFrame, boolean>
|
|
396
|
+
|
|
397
|
+
/** @ignore */
|
|
448
398
|
interface ScrollTimelineOption {
|
|
449
399
|
/** 指定滚动元素的选择器(只支持 scroll-view),该元素滚动时会驱动动画的进度 */
|
|
450
400
|
scrollSource: string
|
|
@@ -459,8 +409,8 @@ declare module '../../index' {
|
|
|
459
409
|
}
|
|
460
410
|
|
|
461
411
|
interface TaroStatic {
|
|
462
|
-
/** 创建一个动画实例 animation。调用实例的方法来描述动画。最后通过动画实例的 export 方法导出动画数据传递给组件的 animation 属性。
|
|
463
|
-
* @supported weapp, h5
|
|
412
|
+
/** 创建一个动画实例 [animation](../Animation)。调用实例的方法来描述动画。最后通过动画实例的 export 方法导出动画数据传递给组件的 animation 属性。
|
|
413
|
+
* @supported weapp, h5, tt
|
|
464
414
|
* @example
|
|
465
415
|
* ```tsx
|
|
466
416
|
* var animation = Taro.createAnimation({
|
|
@@ -37,7 +37,8 @@ declare module '../../index' {
|
|
|
37
37
|
|
|
38
38
|
interface TaroStatic {
|
|
39
39
|
/** 动态设置下拉背景字体、loading 图的样式
|
|
40
|
-
* @supported weapp
|
|
40
|
+
* @supported weapp, rn
|
|
41
|
+
* @rn 仅 iOS
|
|
41
42
|
* @example
|
|
42
43
|
* ```tsx
|
|
43
44
|
* Taro.setBackgroundTextStyle({
|
|
@@ -49,7 +50,8 @@ declare module '../../index' {
|
|
|
49
50
|
setBackgroundTextStyle(option: setBackgroundTextStyle.Option): Promise<TaroGeneral.CallbackResult>
|
|
50
51
|
|
|
51
52
|
/** 动态设置窗口的背景色
|
|
52
|
-
* @supported weapp
|
|
53
|
+
* @supported weapp, rn
|
|
54
|
+
* @rn 仅 Android
|
|
53
55
|
* @example
|
|
54
56
|
* ```tsx
|
|
55
57
|
* Taro.setBackgroundColor({
|
|
@@ -7,7 +7,7 @@ declare module '../../index' {
|
|
|
7
7
|
* **说明**
|
|
8
8
|
* 因为自定义组件中的 setData 和 triggerEvent 等接口本身是同步的操作,当这几个接口被连续调用时,都是在一个同步流程中执行完的,因此若逻辑不当可能会导致出错。
|
|
9
9
|
* 一个极端的案例:当父组件的 setData 引发了子组件的 triggerEvent,进而使得父组件又进行了一次 setData,期间有通过 wx:if 语句对子组件进行卸载,就有可能引发奇怪的错误,所以对于不需要在一个同步流程内完成的逻辑,可以使用此接口延迟到下一个时间片再执行。
|
|
10
|
-
* @supported weapp
|
|
10
|
+
* @supported weapp, h5
|
|
11
11
|
* @example
|
|
12
12
|
* ```tsx
|
|
13
13
|
* this.setData({ number: 1 }) // 直接在当前同步流程中执行
|
package/types/api/ui/fonts.d.ts
CHANGED
|
@@ -11,48 +11,43 @@ declare module '../../index' {
|
|
|
11
11
|
family: string
|
|
12
12
|
/** 字体资源的地址。建议格式为 TTF 和 WOFF,WOFF2 在低版本的 iOS 上会不兼容。 */
|
|
13
13
|
source: string
|
|
14
|
-
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
15
|
-
complete?: CompleteCallback
|
|
16
14
|
/** 可选的字体描述符 */
|
|
17
15
|
desc?: DescOption
|
|
18
|
-
/** 接口调用失败的回调函数 */
|
|
19
|
-
fail?: FailCallback
|
|
20
16
|
/** 接口调用成功的回调函数 */
|
|
21
|
-
success?:
|
|
17
|
+
success?: (res: CallbackResult) => void
|
|
18
|
+
/** 接口调用失败的回调函数 */
|
|
19
|
+
fail?: (res: CallbackResult) => void
|
|
20
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
21
|
+
complete?: (res: CallbackResult) => void
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface CallbackResult extends TaroGeneral.CallbackResult {
|
|
25
|
+
/** 加载字体结果 */
|
|
26
|
+
status: string
|
|
22
27
|
}
|
|
23
28
|
/** 可选的字体描述符 */
|
|
24
29
|
interface DescOption {
|
|
30
|
+
/** @supported h5 */
|
|
31
|
+
ascentOverride?: string
|
|
32
|
+
/** @supported h5 */
|
|
33
|
+
descentOverride?: string
|
|
34
|
+
/** @supported h5 */
|
|
35
|
+
featureSettings?: string
|
|
36
|
+
/** @supported h5 */
|
|
37
|
+
lineGapOverride?: string
|
|
38
|
+
/** @supported h5 */
|
|
39
|
+
stretch?: string
|
|
25
40
|
/** 字体样式,可选值为 normal / italic / oblique */
|
|
26
41
|
style?: string
|
|
42
|
+
/** @supported h5 */
|
|
43
|
+
unicodeRange?: string
|
|
27
44
|
/** 设置小型大写字母的字体显示文本,可选值为 normal / small-caps / inherit */
|
|
28
45
|
variant?: string
|
|
46
|
+
/** @supported h5 */
|
|
47
|
+
variationSettings?: string
|
|
29
48
|
/** 字体粗细,可选值为 normal / bold / 100 / 200../ 900 */
|
|
30
49
|
weight?: string
|
|
31
50
|
}
|
|
32
|
-
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
33
|
-
type CompleteCallback = (
|
|
34
|
-
result: CompleteCallbackResult,
|
|
35
|
-
) => void
|
|
36
|
-
/** 接口调用失败的回调函数 */
|
|
37
|
-
type FailCallback = (
|
|
38
|
-
result: FailCallbackResult,
|
|
39
|
-
) => void
|
|
40
|
-
/** 接口调用成功的回调函数 */
|
|
41
|
-
type SuccessCallback = (
|
|
42
|
-
result: SuccessCallbackResult,
|
|
43
|
-
) => void
|
|
44
|
-
interface CompleteCallbackResult {
|
|
45
|
-
/** 加载字体结果 */
|
|
46
|
-
status: string
|
|
47
|
-
}
|
|
48
|
-
interface FailCallbackResult {
|
|
49
|
-
/** 加载字体结果 */
|
|
50
|
-
status: string
|
|
51
|
-
}
|
|
52
|
-
interface SuccessCallbackResult {
|
|
53
|
-
/** 加载字体结果 */
|
|
54
|
-
status: string
|
|
55
|
-
}
|
|
56
51
|
}
|
|
57
52
|
|
|
58
53
|
interface TaroStatic {
|
|
@@ -64,7 +59,8 @@ declare module '../../index' {
|
|
|
64
59
|
* 3. 字体链接必须是同源下的,或开启了cors支持,小程序的域名是`servicewechat.com`
|
|
65
60
|
* 4. canvas等原生组件不支持使用接口添加的字体
|
|
66
61
|
* 5. 工具里提示 Faild to load font可以忽略
|
|
67
|
-
* @supported weapp
|
|
62
|
+
* @supported weapp, h5
|
|
63
|
+
* @h5 不支持 global (默认全局加载)
|
|
68
64
|
* @example
|
|
69
65
|
* ```tsx
|
|
70
66
|
* Taro.loadFontFace({
|
|
@@ -75,6 +71,6 @@ declare module '../../index' {
|
|
|
75
71
|
* ```
|
|
76
72
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/font/wx.loadFontFace.html
|
|
77
73
|
*/
|
|
78
|
-
loadFontFace(option: loadFontFace.Option):
|
|
74
|
+
loadFontFace(option: loadFontFace.Option): Promise<loadFontFace.CallbackResult>
|
|
79
75
|
}
|
|
80
76
|
}
|
|
@@ -152,7 +152,7 @@ declare module '../../index' {
|
|
|
152
152
|
* **注意**
|
|
153
153
|
* - Taro.showLoading 和 Taro.showToast 同时只能显示一个
|
|
154
154
|
* - Taro.showToast 应与 Taro.hideToast 配对使用
|
|
155
|
-
* @supported weapp, h5, rn
|
|
155
|
+
* @supported weapp, h5, rn, tt
|
|
156
156
|
* @example
|
|
157
157
|
* ```tsx
|
|
158
158
|
* Taro.showToast({
|
|
@@ -169,7 +169,7 @@ declare module '../../index' {
|
|
|
169
169
|
* **注意**
|
|
170
170
|
* - Android 6.7.2 以下版本,点击取消或蒙层时,回调 fail, errMsg 为 "fail cancel";
|
|
171
171
|
* - Android 6.7.2 及以上版本 和 iOS 点击蒙层不会关闭模态弹窗,所以尽量避免使用「取消」分支中实现业务逻辑
|
|
172
|
-
* @supported weapp, h5, rn
|
|
172
|
+
* @supported weapp, h5, rn, tt
|
|
173
173
|
* @example
|
|
174
174
|
* ```tsx
|
|
175
175
|
* Taro.showModal({
|
|
@@ -193,7 +193,7 @@ declare module '../../index' {
|
|
|
193
193
|
* **注意**
|
|
194
194
|
* - Taro.showLoading 和 Taro.showToast 同时只能显示一个
|
|
195
195
|
* - Taro.showLoading 应与 Taro.hideLoading 配对使用
|
|
196
|
-
* @supported weapp, h5, rn
|
|
196
|
+
* @supported weapp, h5, rn, tt
|
|
197
197
|
* @example
|
|
198
198
|
* ```tsx
|
|
199
199
|
* Taro.showLoading({
|
|
@@ -212,7 +212,7 @@ declare module '../../index' {
|
|
|
212
212
|
* **注意**
|
|
213
213
|
* - Android 6.7.2 以下版本,点击取消或蒙层时,回调 fail, errMsg 为 "fail cancel";
|
|
214
214
|
* - Android 6.7.2 及以上版本 和 iOS 点击蒙层不会关闭模态弹窗,所以尽量避免使用「取消」分支中实现业务逻辑
|
|
215
|
-
* @supported weapp, h5, rn
|
|
215
|
+
* @supported weapp, h5, rn, tt
|
|
216
216
|
* @example
|
|
217
217
|
* ```tsx
|
|
218
218
|
* Taro.showActionSheet({
|
|
@@ -230,13 +230,13 @@ declare module '../../index' {
|
|
|
230
230
|
showActionSheet(option: showActionSheet.Option): Promise<showActionSheet.SuccessCallbackResult>
|
|
231
231
|
|
|
232
232
|
/** 隐藏消息提示框
|
|
233
|
-
* @supported weapp, h5, rn
|
|
233
|
+
* @supported weapp, h5, rn, tt
|
|
234
234
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.hideToast.html
|
|
235
235
|
*/
|
|
236
236
|
hideToast(option?: hideToast.Option): void
|
|
237
237
|
|
|
238
238
|
/** 隐藏 loading 提示框
|
|
239
|
-
* @supported weapp, h5, rn
|
|
239
|
+
* @supported weapp, h5, rn, tt
|
|
240
240
|
* @example
|
|
241
241
|
* ```tsx
|
|
242
242
|
* Taro.showLoading({
|
package/types/api/ui/menu.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ declare module '../../index' {
|
|
|
21
21
|
|
|
22
22
|
interface TaroStatic {
|
|
23
23
|
/** 获取菜单按钮(右上角胶囊按钮)的布局位置信息。坐标信息以屏幕左上角为原点。
|
|
24
|
-
* @supported weapp
|
|
24
|
+
* @supported weapp, tt
|
|
25
25
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/menu/wx.getMenuButtonBoundingClientRect.html
|
|
26
26
|
*/
|
|
27
27
|
getMenuButtonBoundingClientRect(): getMenuButtonBoundingClientRect.Rect
|
|
@@ -79,13 +79,13 @@ declare module '../../index' {
|
|
|
79
79
|
|
|
80
80
|
interface TaroStatic {
|
|
81
81
|
/** 在当前页面显示导航条加载动画
|
|
82
|
-
* @supported weapp, rn
|
|
82
|
+
* @supported weapp, rn, tt
|
|
83
83
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.showNavigationBarLoading.html
|
|
84
84
|
*/
|
|
85
85
|
showNavigationBarLoading(option?: showNavigationBarLoading.Option): void
|
|
86
86
|
|
|
87
87
|
/** 动态设置当前页面的标题
|
|
88
|
-
* @supported weapp, h5, rn
|
|
88
|
+
* @supported weapp, h5, rn, tt
|
|
89
89
|
* @example
|
|
90
90
|
* ```tsx
|
|
91
91
|
* Taro.setNavigationBarTitle({
|
|
@@ -97,7 +97,8 @@ declare module '../../index' {
|
|
|
97
97
|
setNavigationBarTitle(option: setNavigationBarTitle.Option): Promise<TaroGeneral.CallbackResult>
|
|
98
98
|
|
|
99
99
|
/** 设置页面导航条颜色
|
|
100
|
-
* @supported weapp, h5, rn
|
|
100
|
+
* @supported weapp, h5, rn, tt
|
|
101
|
+
* @h5 不支持 animation 参数
|
|
101
102
|
* @rn 不支持 animation 参数
|
|
102
103
|
* @example
|
|
103
104
|
* ```tsx
|
|
@@ -115,13 +116,13 @@ declare module '../../index' {
|
|
|
115
116
|
setNavigationBarColor(option: setNavigationBarColor.Option): Promise<TaroGeneral.CallbackResult>
|
|
116
117
|
|
|
117
118
|
/** 在当前页面隐藏导航条加载动画
|
|
118
|
-
* @supported weapp, rn
|
|
119
|
+
* @supported weapp, rn, tt
|
|
119
120
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.hideNavigationBarLoading.html
|
|
120
121
|
*/
|
|
121
122
|
hideNavigationBarLoading(option?: hideNavigationBarLoading.Option): void
|
|
122
123
|
|
|
123
124
|
/** 隐藏返回首页按钮。微信7.0.7版本起,当用户打开的小程序最底层页面是非首页时,默认展示“返回首页”按钮,开发者可在页面 onShow 中调用 hideHomeButton 进行隐藏。
|
|
124
|
-
* @supported weapp
|
|
125
|
+
* @supported weapp, tt
|
|
125
126
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.hideHomeButton.html
|
|
126
127
|
*/
|
|
127
128
|
hideHomeButton(option?: hideHomeButton.Option): Promise<TaroGeneral.CallbackResult>
|