@tarojs/taro 4.0.0-beta.1 → 4.0.0-beta.2
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/package.json +10 -5
- package/types/api/base/debug.d.ts +8 -8
- package/types/api/base/env.d.ts +1 -1
- package/types/api/base/index.d.ts +3 -3
- package/types/api/base/system.d.ts +6 -6
- package/types/api/base/weapp/app-event.d.ts +10 -10
- package/types/api/base/weapp/life-cycle.d.ts +1 -1
- package/types/api/canvas/index.d.ts +367 -63
- package/types/api/device/battery.d.ts +1 -1
- package/types/api/device/clipboard.d.ts +2 -2
- package/types/api/device/keyboard.d.ts +1 -1
- package/types/api/device/network.d.ts +3 -3
- package/types/api/device/phone.d.ts +1 -1
- package/types/api/device/screen.d.ts +2 -2
- package/types/api/files/index.d.ts +7 -7
- package/types/api/framework/index.d.ts +2 -2
- package/types/api/location/index.d.ts +4 -4
- package/types/api/media/audio.d.ts +11 -11
- package/types/api/media/background-audio.d.ts +1 -1
- package/types/api/media/image.d.ts +5 -5
- package/types/api/media/video.d.ts +11 -11
- package/types/api/navigate/index.d.ts +1 -1
- package/types/api/network/download.d.ts +5 -5
- package/types/api/network/request.d.ts +5 -5
- package/types/api/network/upload.d.ts +7 -7
- package/types/api/network/websocket.d.ts +8 -8
- package/types/api/open-api/account.d.ts +1 -1
- package/types/api/open-api/address.d.ts +13 -5
- package/types/api/open-api/authorize.d.ts +1 -1
- package/types/api/open-api/bookshelf.d.ts +307 -0
- package/types/api/open-api/channels.d.ts +16 -0
- package/types/api/open-api/device-voip.d.ts +40 -0
- package/types/api/open-api/invoice.d.ts +1 -1
- package/types/api/open-api/login.d.ts +15 -2
- package/types/api/open-api/privacy.d.ts +8 -0
- package/types/api/open-api/settings.d.ts +3 -2
- package/types/api/open-api/sticker.d.ts +83 -0
- package/types/api/open-api/subscribe-message.d.ts +148 -6
- package/types/api/open-api/user-info.d.ts +6 -1
- package/types/api/qq/index.d.ts +306 -1
- package/types/api/route/index.d.ts +5 -5
- package/types/api/storage/index.d.ts +10 -10
- package/types/api/swan/download-package.d.ts +80 -0
- package/types/api/swan/index.d.ts +151 -0
- package/types/api/swan/pay.d.ts +139 -0
- package/types/api/taro.extend.d.ts +6 -3
- package/types/api/taro.hooks.d.ts +9 -9
- package/types/api/ui/animation.d.ts +32 -32
- package/types/api/ui/custom-component.d.ts +1 -1
- package/types/api/ui/fonts.d.ts +1 -1
- 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 +2 -2
- package/types/api/ui/pull-down-refresh.d.ts +2 -2
- package/types/api/ui/scroll.d.ts +1 -1
- package/types/api/ui/tab-bar.d.ts +8 -8
- package/types/api/ui/window.d.ts +2 -2
- package/types/api/wxml/index.d.ts +17 -17
- package/types/compile/compiler.d.ts +2 -0
- package/types/compile/config/harmony.d.ts +5 -0
- package/types/compile/config/mini.d.ts +1 -1
- package/types/compile/viteCompilerContext.d.ts +6 -0
- package/types/global.d.ts +2 -1
- package/types/index.d.ts +13 -4
- package/types/taro.api.d.ts +22 -14
- package/types/taro.config.d.ts +6 -2
|
@@ -38,34 +38,34 @@ declare module '../../index' {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/** 动画对象
|
|
41
|
-
* @supported weapp, h5, tt
|
|
41
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
42
42
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html
|
|
43
43
|
*/
|
|
44
44
|
interface Animation {
|
|
45
45
|
/** 导出动画队列。**export 方法每次调用后会清掉之前的动画操作**。
|
|
46
|
-
* @supported weapp, h5, tt
|
|
46
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
47
47
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.export.html
|
|
48
48
|
*/
|
|
49
49
|
export(): {
|
|
50
50
|
actions: TaroGeneral.IAnyObject[]
|
|
51
51
|
}
|
|
52
52
|
/** 表示一组动画完成。可以在一组动画中调用任意多个动画方法,一组动画中的所有动画会同时开始,一组动画完成后才会进行下一组动画。
|
|
53
|
-
* @supported weapp, h5, tt
|
|
53
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
54
54
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.step.html
|
|
55
55
|
*/
|
|
56
56
|
step(option?: Animation.StepOption): Animation
|
|
57
57
|
/** 同 [transform-function matrix](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix)
|
|
58
|
-
* @supported weapp, h5, tt
|
|
58
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
59
59
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.matrix.html
|
|
60
60
|
*/
|
|
61
61
|
matrix(a: number, b: number, c: number, d: number, tx: number, ty: number): Animation
|
|
62
62
|
/** 同 [transform-function matrix3d](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix3d)
|
|
63
|
-
* @supported weapp, h5, tt
|
|
63
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
64
64
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.matrix3d.html
|
|
65
65
|
*/
|
|
66
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
|
|
67
67
|
/** 从原点顺时针旋转一个角度
|
|
68
|
-
* @supported weapp, h5, tt
|
|
68
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
69
69
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.rotate.html
|
|
70
70
|
*/
|
|
71
71
|
rotate(
|
|
@@ -73,7 +73,7 @@ declare module '../../index' {
|
|
|
73
73
|
angle: number,
|
|
74
74
|
): Animation
|
|
75
75
|
/** 从 固定 轴顺时针旋转一个角度
|
|
76
|
-
* @supported weapp, h5, tt
|
|
76
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
77
77
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.rotate3d.html
|
|
78
78
|
*/
|
|
79
79
|
rotate3d(
|
|
@@ -87,7 +87,7 @@ declare module '../../index' {
|
|
|
87
87
|
angle?: number,
|
|
88
88
|
): Animation
|
|
89
89
|
/** 从 X 轴顺时针旋转一个角度
|
|
90
|
-
* @supported weapp, h5, tt
|
|
90
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
91
91
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.rotateX.html
|
|
92
92
|
*/
|
|
93
93
|
rotateX(
|
|
@@ -95,7 +95,7 @@ declare module '../../index' {
|
|
|
95
95
|
angle: number,
|
|
96
96
|
): Animation
|
|
97
97
|
/** 从 Y 轴顺时针旋转一个角度
|
|
98
|
-
* @supported weapp, h5, tt
|
|
98
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
99
99
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.rotateY.html
|
|
100
100
|
*/
|
|
101
101
|
rotateY(
|
|
@@ -103,7 +103,7 @@ declare module '../../index' {
|
|
|
103
103
|
angle: number,
|
|
104
104
|
): Animation
|
|
105
105
|
/** 从 Z 轴顺时针旋转一个角度
|
|
106
|
-
* @supported weapp, h5, tt
|
|
106
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
107
107
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.rotateZ.html
|
|
108
108
|
*/
|
|
109
109
|
rotateZ(
|
|
@@ -111,7 +111,7 @@ declare module '../../index' {
|
|
|
111
111
|
angle: number,
|
|
112
112
|
): Animation
|
|
113
113
|
/** 缩放
|
|
114
|
-
* @supported weapp, h5, tt
|
|
114
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
115
115
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.scale.html
|
|
116
116
|
*/
|
|
117
117
|
scale(
|
|
@@ -121,7 +121,7 @@ declare module '../../index' {
|
|
|
121
121
|
sy?: number,
|
|
122
122
|
): Animation
|
|
123
123
|
/** 缩放
|
|
124
|
-
* @supported weapp, h5, tt
|
|
124
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
125
125
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.scale3d.html
|
|
126
126
|
*/
|
|
127
127
|
scale3d(
|
|
@@ -133,7 +133,7 @@ declare module '../../index' {
|
|
|
133
133
|
sz: number,
|
|
134
134
|
): Animation
|
|
135
135
|
/** 缩放 X 轴
|
|
136
|
-
* @supported weapp, h5, tt
|
|
136
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
137
137
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.scaleX.html
|
|
138
138
|
*/
|
|
139
139
|
scaleX(
|
|
@@ -141,7 +141,7 @@ declare module '../../index' {
|
|
|
141
141
|
scale: number,
|
|
142
142
|
): Animation
|
|
143
143
|
/** 缩放 Y 轴
|
|
144
|
-
* @supported weapp, h5, tt
|
|
144
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
145
145
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.scaleY.html
|
|
146
146
|
*/
|
|
147
147
|
scaleY(
|
|
@@ -149,7 +149,7 @@ declare module '../../index' {
|
|
|
149
149
|
scale: number,
|
|
150
150
|
): Animation
|
|
151
151
|
/** 缩放 Z 轴
|
|
152
|
-
* @supported weapp, h5, tt
|
|
152
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
153
153
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.scaleZ.html
|
|
154
154
|
*/
|
|
155
155
|
scaleZ(
|
|
@@ -157,7 +157,7 @@ declare module '../../index' {
|
|
|
157
157
|
scale: number,
|
|
158
158
|
): Animation
|
|
159
159
|
/** 对 X、Y 轴坐标进行倾斜
|
|
160
|
-
* @supported weapp, h5, tt
|
|
160
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
161
161
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.skew.html
|
|
162
162
|
*/
|
|
163
163
|
skew(
|
|
@@ -167,7 +167,7 @@ declare module '../../index' {
|
|
|
167
167
|
ay: number,
|
|
168
168
|
): Animation
|
|
169
169
|
/** 对 X 轴坐标进行倾斜
|
|
170
|
-
* @supported weapp, h5, tt
|
|
170
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
171
171
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.skewX.html
|
|
172
172
|
*/
|
|
173
173
|
skewX(
|
|
@@ -175,7 +175,7 @@ declare module '../../index' {
|
|
|
175
175
|
angle: number,
|
|
176
176
|
): Animation
|
|
177
177
|
/** 对 Y 轴坐标进行倾斜
|
|
178
|
-
* @supported weapp, h5, tt
|
|
178
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
179
179
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.skewY.html
|
|
180
180
|
*/
|
|
181
181
|
skewY(
|
|
@@ -183,7 +183,7 @@ declare module '../../index' {
|
|
|
183
183
|
angle: number,
|
|
184
184
|
): Animation
|
|
185
185
|
/** 平移变换
|
|
186
|
-
* @supported weapp, h5, tt
|
|
186
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
187
187
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.translate.html
|
|
188
188
|
*/
|
|
189
189
|
translate(
|
|
@@ -193,7 +193,7 @@ declare module '../../index' {
|
|
|
193
193
|
ty?: number,
|
|
194
194
|
): Animation
|
|
195
195
|
/** 对 xyz 坐标进行平移变换
|
|
196
|
-
* @supported weapp, h5, tt
|
|
196
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
197
197
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.translate3d.html
|
|
198
198
|
*/
|
|
199
199
|
translate3d(
|
|
@@ -205,7 +205,7 @@ declare module '../../index' {
|
|
|
205
205
|
tz?: number,
|
|
206
206
|
): Animation
|
|
207
207
|
/** 对 X 轴平移
|
|
208
|
-
* @supported weapp, h5, tt
|
|
208
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
209
209
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.translateX.html
|
|
210
210
|
*/
|
|
211
211
|
translateX(
|
|
@@ -213,7 +213,7 @@ declare module '../../index' {
|
|
|
213
213
|
translation: number,
|
|
214
214
|
): Animation
|
|
215
215
|
/** 对 Y 轴平移
|
|
216
|
-
* @supported weapp, h5, tt
|
|
216
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
217
217
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.translateY.html
|
|
218
218
|
*/
|
|
219
219
|
translateY(
|
|
@@ -221,7 +221,7 @@ declare module '../../index' {
|
|
|
221
221
|
translation: number,
|
|
222
222
|
): Animation
|
|
223
223
|
/** 对 Z 轴平移
|
|
224
|
-
* @supported weapp, h5, tt
|
|
224
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
225
225
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.translateZ.html
|
|
226
226
|
*/
|
|
227
227
|
translateZ(
|
|
@@ -229,7 +229,7 @@ declare module '../../index' {
|
|
|
229
229
|
translation: number,
|
|
230
230
|
): Animation
|
|
231
231
|
/** 设置透明度
|
|
232
|
-
* @supported weapp, h5, tt
|
|
232
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
233
233
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.opacity.html
|
|
234
234
|
*/
|
|
235
235
|
opacity(
|
|
@@ -237,7 +237,7 @@ declare module '../../index' {
|
|
|
237
237
|
value: number,
|
|
238
238
|
): Animation
|
|
239
239
|
/** 设置背景色
|
|
240
|
-
* @supported weapp, h5, tt
|
|
240
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
241
241
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.backgroundColor.html
|
|
242
242
|
*/
|
|
243
243
|
backgroundColor(
|
|
@@ -245,7 +245,7 @@ declare module '../../index' {
|
|
|
245
245
|
value: string,
|
|
246
246
|
): Animation
|
|
247
247
|
/** 设置宽度
|
|
248
|
-
* @supported weapp, h5, tt
|
|
248
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
249
249
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.width.html
|
|
250
250
|
*/
|
|
251
251
|
width(
|
|
@@ -253,7 +253,7 @@ declare module '../../index' {
|
|
|
253
253
|
value: number | string,
|
|
254
254
|
): Animation
|
|
255
255
|
/** 设置高度
|
|
256
|
-
* @supported weapp, h5, tt
|
|
256
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
257
257
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.height.html
|
|
258
258
|
*/
|
|
259
259
|
height(
|
|
@@ -261,7 +261,7 @@ declare module '../../index' {
|
|
|
261
261
|
value: number | string,
|
|
262
262
|
): Animation
|
|
263
263
|
/** 设置 left 值
|
|
264
|
-
* @supported weapp, h5, tt
|
|
264
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
265
265
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.left.html
|
|
266
266
|
*/
|
|
267
267
|
left(
|
|
@@ -269,7 +269,7 @@ declare module '../../index' {
|
|
|
269
269
|
value: number | string,
|
|
270
270
|
): Animation
|
|
271
271
|
/** 设置 right 值
|
|
272
|
-
* @supported weapp, h5, tt
|
|
272
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
273
273
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.right.html
|
|
274
274
|
*/
|
|
275
275
|
right(
|
|
@@ -277,7 +277,7 @@ declare module '../../index' {
|
|
|
277
277
|
value: number | string,
|
|
278
278
|
): Animation
|
|
279
279
|
/** 设置 top 值
|
|
280
|
-
* @supported weapp, h5, tt
|
|
280
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
281
281
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.top.html
|
|
282
282
|
*/
|
|
283
283
|
top(
|
|
@@ -285,7 +285,7 @@ declare module '../../index' {
|
|
|
285
285
|
value: number | string,
|
|
286
286
|
): Animation
|
|
287
287
|
/** 设置 bottom 值
|
|
288
|
-
* @supported weapp, h5, tt
|
|
288
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
289
289
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.bottom.html
|
|
290
290
|
*/
|
|
291
291
|
bottom(
|
|
@@ -410,7 +410,7 @@ declare module '../../index' {
|
|
|
410
410
|
|
|
411
411
|
interface TaroStatic {
|
|
412
412
|
/** 创建一个动画实例 [animation](../Animation)。调用实例的方法来描述动画。最后通过动画实例的 export 方法导出动画数据传递给组件的 animation 属性。
|
|
413
|
-
* @supported weapp, tt, h5, harmony
|
|
413
|
+
* @supported weapp, tt, h5, harmony, harmony_hybrid
|
|
414
414
|
* @example
|
|
415
415
|
* ```tsx
|
|
416
416
|
* var animation = Taro.createAnimation({
|
|
@@ -7,7 +7,7 @@ declare module '../../index' {
|
|
|
7
7
|
* **说明**
|
|
8
8
|
* 因为自定义组件中的 setData 和 triggerEvent 等接口本身是同步的操作,当这几个接口被连续调用时,都是在一个同步流程中执行完的,因此若逻辑不当可能会导致出错。
|
|
9
9
|
* 一个极端的案例:当父组件的 setData 引发了子组件的 triggerEvent,进而使得父组件又进行了一次 setData,期间有通过 wx:if 语句对子组件进行卸载,就有可能引发奇怪的错误,所以对于不需要在一个同步流程内完成的逻辑,可以使用此接口延迟到下一个时间片再执行。
|
|
10
|
-
* @supported weapp, h5
|
|
10
|
+
* @supported weapp, h5, harmony_hybrid
|
|
11
11
|
* @example
|
|
12
12
|
* ```tsx
|
|
13
13
|
* this.setData({ number: 1 }) // 直接在当前同步流程中执行
|
package/types/api/ui/fonts.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ declare module '../../index' {
|
|
|
59
59
|
* 3. 字体链接必须是同源下的,或开启了cors支持,小程序的域名是`servicewechat.com`
|
|
60
60
|
* 4. canvas等原生组件不支持使用接口添加的字体
|
|
61
61
|
* 5. 工具里提示 Failed to load font 可以忽略
|
|
62
|
-
* @supported weapp, alipay, h5
|
|
62
|
+
* @supported weapp, alipay, h5, harmony_hybrid
|
|
63
63
|
* @h5 不支持 global (默认全局加载)
|
|
64
64
|
* @alipay source 地址格式为 `url('https://...')`,而不是单纯 URL 地址
|
|
65
65
|
* @example
|
|
@@ -160,7 +160,7 @@ declare module '../../index' {
|
|
|
160
160
|
* **注意**
|
|
161
161
|
* - Taro.showLoading 和 Taro.showToast 同时只能显示一个
|
|
162
162
|
* - Taro.showToast 应与 Taro.hideToast 配对使用
|
|
163
|
-
* @supported weapp, h5, rn, tt, harmony
|
|
163
|
+
* @supported weapp, h5, rn, tt, harmony, harmony_hybrid
|
|
164
164
|
* @example
|
|
165
165
|
* ```tsx
|
|
166
166
|
* Taro.showToast({
|
|
@@ -177,7 +177,7 @@ declare module '../../index' {
|
|
|
177
177
|
* **注意**
|
|
178
178
|
* - Android 6.7.2 以下版本,点击取消或蒙层时,回调 fail, errMsg 为 "fail cancel";
|
|
179
179
|
* - Android 6.7.2 及以上版本 和 iOS 点击蒙层不会关闭模态弹窗,所以尽量避免使用「取消」分支中实现业务逻辑
|
|
180
|
-
* @supported weapp, h5, rn, tt, harmony
|
|
180
|
+
* @supported weapp, swan, h5, rn, tt, harmony, harmony_hybrid
|
|
181
181
|
* @example
|
|
182
182
|
* ```tsx
|
|
183
183
|
* Taro.showModal({
|
|
@@ -201,7 +201,7 @@ declare module '../../index' {
|
|
|
201
201
|
* **注意**
|
|
202
202
|
* - Taro.showLoading 和 Taro.showToast 同时只能显示一个
|
|
203
203
|
* - Taro.showLoading 应与 Taro.hideLoading 配对使用
|
|
204
|
-
* @supported weapp, h5, rn, tt
|
|
204
|
+
* @supported weapp, h5, rn, tt, harmony_hybrid
|
|
205
205
|
* @example
|
|
206
206
|
* ```tsx
|
|
207
207
|
* Taro.showLoading({
|
|
@@ -220,7 +220,7 @@ declare module '../../index' {
|
|
|
220
220
|
* **注意**
|
|
221
221
|
* - Android 6.7.2 以下版本,点击取消或蒙层时,回调 fail, errMsg 为 "fail cancel";
|
|
222
222
|
* - Android 6.7.2 及以上版本 和 iOS 点击蒙层不会关闭模态弹窗,所以尽量避免使用「取消」分支中实现业务逻辑
|
|
223
|
-
* @supported weapp, h5, rn, tt, harmony
|
|
223
|
+
* @supported weapp, h5, rn, tt, harmony, harmony_hybrid
|
|
224
224
|
* @example
|
|
225
225
|
* ```tsx
|
|
226
226
|
* Taro.showActionSheet({
|
|
@@ -238,13 +238,13 @@ declare module '../../index' {
|
|
|
238
238
|
showActionSheet(option: showActionSheet.Option): Promise<showActionSheet.SuccessCallbackResult>
|
|
239
239
|
|
|
240
240
|
/** 隐藏消息提示框
|
|
241
|
-
* @supported weapp, h5, rn, tt, harmony
|
|
241
|
+
* @supported weapp, h5, rn, tt, harmony, harmony_hybrid
|
|
242
242
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.hideToast.html
|
|
243
243
|
*/
|
|
244
244
|
hideToast(option?: hideToast.Option): void
|
|
245
245
|
|
|
246
246
|
/** 隐藏 loading 提示框
|
|
247
|
-
* @supported weapp, h5, rn, tt
|
|
247
|
+
* @supported weapp, h5, rn, tt, harmony_hybrid
|
|
248
248
|
* @example
|
|
249
249
|
* ```tsx
|
|
250
250
|
* 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, tt
|
|
24
|
+
* @supported weapp, tt, harmony_hybrid
|
|
25
25
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/menu/wx.getMenuButtonBoundingClientRect.html
|
|
26
26
|
*/
|
|
27
27
|
getMenuButtonBoundingClientRect(): getMenuButtonBoundingClientRect.Rect
|
|
@@ -85,7 +85,7 @@ declare module '../../index' {
|
|
|
85
85
|
showNavigationBarLoading(option?: showNavigationBarLoading.Option): void
|
|
86
86
|
|
|
87
87
|
/** 动态设置当前页面的标题
|
|
88
|
-
* @supported weapp, alipay, tt, h5, rn, harmony
|
|
88
|
+
* @supported weapp, alipay, tt, h5, rn, harmony, harmony_hybrid
|
|
89
89
|
* @example
|
|
90
90
|
* ```tsx
|
|
91
91
|
* Taro.setNavigationBarTitle({
|
|
@@ -97,7 +97,7 @@ declare module '../../index' {
|
|
|
97
97
|
setNavigationBarTitle(option: setNavigationBarTitle.Option): Promise<TaroGeneral.CallbackResult>
|
|
98
98
|
|
|
99
99
|
/** 设置页面导航条颜色
|
|
100
|
-
* @supported weapp, tt, h5, rn, harmony
|
|
100
|
+
* @supported weapp, tt, h5, rn, harmony, harmony_hybrid
|
|
101
101
|
* @h5 不支持 animation 参数
|
|
102
102
|
* @rn 不支持 animation 参数
|
|
103
103
|
* @example
|
|
@@ -25,7 +25,7 @@ declare module '../../index' {
|
|
|
25
25
|
|
|
26
26
|
interface TaroStatic {
|
|
27
27
|
/** 停止当前页面下拉刷新。
|
|
28
|
-
* @supported weapp, h5, rn, tt, harmony
|
|
28
|
+
* @supported weapp, h5, rn, tt, harmony, harmony_hybrid
|
|
29
29
|
* @example
|
|
30
30
|
* ```tsx
|
|
31
31
|
* onPullDownRefresh: function (){
|
|
@@ -37,7 +37,7 @@ declare module '../../index' {
|
|
|
37
37
|
stopPullDownRefresh(option?: stopPullDownRefresh.Option): void
|
|
38
38
|
|
|
39
39
|
/** 开始下拉刷新。调用后触发下拉刷新动画,效果与用户手动下拉刷新一致。
|
|
40
|
-
* @supported weapp, h5, rn, tt, harmony
|
|
40
|
+
* @supported weapp, h5, rn, tt, harmony, harmony_hybrid
|
|
41
41
|
* @rn 无动画效果
|
|
42
42
|
* @example
|
|
43
43
|
* ```tsx
|
package/types/api/ui/scroll.d.ts
CHANGED
|
@@ -99,7 +99,7 @@ declare module '../../index' {
|
|
|
99
99
|
* - 后代选择器:.the-ancestor .the-descendant
|
|
100
100
|
* - 跨自定义组件的后代选择器:.the-ancestor >>> .the-descendant
|
|
101
101
|
* - 多选择器的并集:#a-node, .some-other-nodes
|
|
102
|
-
* @supported weapp, h5, rn, tt, harmony
|
|
102
|
+
* @supported weapp, h5, rn, tt, harmony, harmony_hybrid
|
|
103
103
|
* @example
|
|
104
104
|
* ```tsx
|
|
105
105
|
* Taro.pageScrollTo({
|
|
@@ -121,19 +121,19 @@ declare module '../../index' {
|
|
|
121
121
|
|
|
122
122
|
interface TaroStatic {
|
|
123
123
|
/** 显示 tabBar 某一项的右上角的红点
|
|
124
|
-
* @supported weapp, h5, rn, tt, harmony
|
|
124
|
+
* @supported weapp, h5, rn, tt, harmony, harmony_hybrid
|
|
125
125
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.showTabBarRedDot.html
|
|
126
126
|
*/
|
|
127
127
|
showTabBarRedDot(option: showTabBarRedDot.Option): Promise<TaroGeneral.CallbackResult>
|
|
128
128
|
|
|
129
129
|
/** 显示 tabBar
|
|
130
|
-
* @supported weapp, h5, rn, tt, harmony
|
|
130
|
+
* @supported weapp, h5, rn, tt, harmony, harmony_hybrid
|
|
131
131
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.showTabBar.html
|
|
132
132
|
*/
|
|
133
133
|
showTabBar(option?: showTabBar.Option): Promise<TaroGeneral.CallbackResult>
|
|
134
134
|
|
|
135
135
|
/** 动态设置 tabBar 的整体样式
|
|
136
|
-
* @supported weapp, h5, rn, tt
|
|
136
|
+
* @supported weapp, h5, rn, tt, harmony_hybrid
|
|
137
137
|
* @example
|
|
138
138
|
* ```tsx
|
|
139
139
|
* Taro.setTabBarStyle({
|
|
@@ -148,7 +148,7 @@ declare module '../../index' {
|
|
|
148
148
|
setTabBarStyle(option?: setTabBarStyle.Option): Promise<TaroGeneral.CallbackResult>
|
|
149
149
|
|
|
150
150
|
/** 动态设置 tabBar 某一项的内容,`2.7.0` 起图片支持临时文件和网络文件。
|
|
151
|
-
* @supported weapp, h5, rn, tt, harmony
|
|
151
|
+
* @supported weapp, h5, rn, tt, harmony, harmony_hybrid
|
|
152
152
|
* @example
|
|
153
153
|
* ```tsx
|
|
154
154
|
* Taro.setTabBarItem({
|
|
@@ -163,7 +163,7 @@ declare module '../../index' {
|
|
|
163
163
|
setTabBarItem(option: setTabBarItem.Option): Promise<TaroGeneral.CallbackResult>
|
|
164
164
|
|
|
165
165
|
/** 为 tabBar 某一项的右上角添加文本
|
|
166
|
-
* @supported weapp, h5, rn, tt, harmony
|
|
166
|
+
* @supported weapp, h5, rn, tt, harmony, harmony_hybrid
|
|
167
167
|
* @example
|
|
168
168
|
* ```tsx
|
|
169
169
|
* Taro.setTabBarBadge({
|
|
@@ -176,19 +176,19 @@ declare module '../../index' {
|
|
|
176
176
|
setTabBarBadge(option: setTabBarBadge.Option): Promise<TaroGeneral.CallbackResult>
|
|
177
177
|
|
|
178
178
|
/** 移除 tabBar 某一项右上角的文本
|
|
179
|
-
* @supported weapp, h5, rn, tt, harmony
|
|
179
|
+
* @supported weapp, h5, rn, tt, harmony, harmony_hybrid
|
|
180
180
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.removeTabBarBadge.html
|
|
181
181
|
*/
|
|
182
182
|
removeTabBarBadge(option: removeTabBarBadge.Option): Promise<TaroGeneral.CallbackResult>
|
|
183
183
|
|
|
184
184
|
/** 隐藏 tabBar 某一项的右上角的红点
|
|
185
|
-
* @supported weapp, h5, rn, tt, harmony
|
|
185
|
+
* @supported weapp, h5, rn, tt, harmony, harmony_hybrid
|
|
186
186
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.hideTabBarRedDot.html
|
|
187
187
|
*/
|
|
188
188
|
hideTabBarRedDot(option: hideTabBarRedDot.Option): Promise<TaroGeneral.CallbackResult>
|
|
189
189
|
|
|
190
190
|
/** 隐藏 tabBar
|
|
191
|
-
* @supported weapp, h5, rn, tt, harmony
|
|
191
|
+
* @supported weapp, h5, rn, tt, harmony, harmony_hybrid
|
|
192
192
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.hideTabBar.html
|
|
193
193
|
*/
|
|
194
194
|
hideTabBar(option?: hideTabBar.Option): Promise<TaroGeneral.CallbackResult>
|
package/types/api/ui/window.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ declare module '../../index' {
|
|
|
44
44
|
setWindowSize(option: setWindowSize.Option): Promise<TaroGeneral.CallbackResult>
|
|
45
45
|
|
|
46
46
|
/** 监听窗口尺寸变化事件
|
|
47
|
-
* @supported weapp, h5, rn
|
|
47
|
+
* @supported weapp, h5, rn, harmony_hybrid
|
|
48
48
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/window/wx.onWindowResize.html
|
|
49
49
|
*/
|
|
50
50
|
onWindowResize(
|
|
@@ -53,7 +53,7 @@ declare module '../../index' {
|
|
|
53
53
|
): void
|
|
54
54
|
|
|
55
55
|
/** 取消监听窗口尺寸变化事件
|
|
56
|
-
* @supported weapp, h5, rn
|
|
56
|
+
* @supported weapp, h5, rn, harmony_hybrid
|
|
57
57
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/window/wx.offWindowResize.html
|
|
58
58
|
*/
|
|
59
59
|
offWindowResize(
|
|
@@ -18,12 +18,12 @@ declare module '../../index' {
|
|
|
18
18
|
*/
|
|
19
19
|
interface IntersectionObserver {
|
|
20
20
|
/** 停止监听。回调函数将不再触发
|
|
21
|
-
* @supported weapp, tt, h5
|
|
21
|
+
* @supported weapp, tt, h5, harmony_hybrid
|
|
22
22
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/IntersectionObserver.disconnect.html
|
|
23
23
|
*/
|
|
24
24
|
disconnect(): void
|
|
25
25
|
/** 指定目标节点并开始监听相交状态变化情况
|
|
26
|
-
* @supported weapp, tt, h5
|
|
26
|
+
* @supported weapp, tt, h5, harmony_hybrid
|
|
27
27
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/IntersectionObserver.observe.html
|
|
28
28
|
*/
|
|
29
29
|
observe(
|
|
@@ -33,7 +33,7 @@ declare module '../../index' {
|
|
|
33
33
|
callback: IntersectionObserver.ObserveCallback,
|
|
34
34
|
): void
|
|
35
35
|
/** 使用选择器指定一个节点,作为参照区域之一。
|
|
36
|
-
* @supported weapp, tt, h5
|
|
36
|
+
* @supported weapp, tt, h5, harmony_hybrid
|
|
37
37
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/IntersectionObserver.relativeTo.html
|
|
38
38
|
*/
|
|
39
39
|
relativeTo(
|
|
@@ -43,7 +43,7 @@ declare module '../../index' {
|
|
|
43
43
|
margins?: IntersectionObserver.RelativeToMargins,
|
|
44
44
|
): IntersectionObserver
|
|
45
45
|
/** 指定页面显示区域作为参照区域之一
|
|
46
|
-
* @supported weapp, tt, h5
|
|
46
|
+
* @supported weapp, tt, h5, harmony_hybrid
|
|
47
47
|
* @example
|
|
48
48
|
* 下面的示例代码中,如果目标节点(用选择器 .target-class 指定)进入显示区域以下 100px 时,就会触发回调函数。
|
|
49
49
|
*
|
|
@@ -184,7 +184,7 @@ declare module '../../index' {
|
|
|
184
184
|
*/
|
|
185
185
|
interface NodesRef {
|
|
186
186
|
/** 添加节点的布局位置的查询请求。相对于显示区域,以像素为单位。其功能类似于 DOM 的 `getBoundingClientRect`。返回 `NodesRef` 对应的 `SelectorQuery`。
|
|
187
|
-
* @supported weapp, h5, tt
|
|
187
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
188
188
|
* @example
|
|
189
189
|
* ```tsx
|
|
190
190
|
* Taro.createSelectorQuery().select('#the-id').boundingClientRect(function(rect){
|
|
@@ -220,7 +220,7 @@ declare module '../../index' {
|
|
|
220
220
|
callback?: NodesRef.BoundingClientRectCallback,
|
|
221
221
|
): SelectorQuery
|
|
222
222
|
/** 添加节点的 Context 对象查询请求。目前支持 [VideoContext](/docs/apis/media/video/VideoContext)、[CanvasContext](/docs/apis/canvas/CanvasContext)、[LivePlayerContext](/docs/apis/media/live/LivePlayerContext)、[EditorContext](/docs/apis/media/editor/EditorContext)和 [MapContext](/docs/apis/media/map/MapContext) 的获取。
|
|
223
|
-
* @supported weapp, h5, tt
|
|
223
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
224
224
|
* @example
|
|
225
225
|
* ```tsx
|
|
226
226
|
* Taro.createSelectorQuery().select('.the-video-class').context(function (res) {
|
|
@@ -237,7 +237,7 @@ declare module '../../index' {
|
|
|
237
237
|
*
|
|
238
238
|
* **注意**
|
|
239
239
|
* computedStyle 的优先级高于 size,当同时在 computedStyle 里指定了 width/height 和传入了 size: true,则优先返回 computedStyle 获取到的 width/height。
|
|
240
|
-
* @supported weapp, h5, tt
|
|
240
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
241
241
|
* @example
|
|
242
242
|
* ```tsx
|
|
243
243
|
* Taro.createSelectorQuery().select('#the-id').fields({
|
|
@@ -269,7 +269,7 @@ declare module '../../index' {
|
|
|
269
269
|
callback?: NodesRef.FieldsCallback,
|
|
270
270
|
): SelectorQuery
|
|
271
271
|
/** 获取 Node 节点实例。目前支持 [Canvas](/docs/components/canvas) 的获取。
|
|
272
|
-
* @supported weapp, h5, tt
|
|
272
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
273
273
|
* @example
|
|
274
274
|
* ```tsx
|
|
275
275
|
* Taro.createSelectorQuery().select('.canvas').node(function(res){
|
|
@@ -283,7 +283,7 @@ declare module '../../index' {
|
|
|
283
283
|
callback?: NodesRef.NodeCallback,
|
|
284
284
|
): SelectorQuery
|
|
285
285
|
/** 添加节点的滚动位置查询请求。以像素为单位。节点必须是 `scroll-view` 或者 `viewport`,返回 `NodesRef` 对应的 `SelectorQuery`。
|
|
286
|
-
* @supported weapp, h5, tt
|
|
286
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
287
287
|
* @example
|
|
288
288
|
* ```tsx
|
|
289
289
|
* Taro.createSelectorQuery().selectViewport().scrollOffset(function(res){
|
|
@@ -384,7 +384,7 @@ declare module '../../index' {
|
|
|
384
384
|
*/
|
|
385
385
|
interface SelectorQuery {
|
|
386
386
|
/** 执行所有的请求。请求结果按请求次序构成数组,在callback的第一个参数中返回。
|
|
387
|
-
* @supported weapp, h5, tt
|
|
387
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
388
388
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.exec.html
|
|
389
389
|
*/
|
|
390
390
|
exec(
|
|
@@ -392,7 +392,7 @@ declare module '../../index' {
|
|
|
392
392
|
callback?: (...args: any[]) => any,
|
|
393
393
|
): NodesRef
|
|
394
394
|
/** 将选择器的选取范围更改为自定义组件 `component` 内。(初始时,选择器仅选取页面范围的节点,不会选取任何自定义组件中的节点)。
|
|
395
|
-
* @supported weapp, h5, tt
|
|
395
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
396
396
|
* @example
|
|
397
397
|
* ```tsx
|
|
398
398
|
* Component({
|
|
@@ -423,7 +423,7 @@ declare module '../../index' {
|
|
|
423
423
|
* - 后代选择器:.the-ancestor .the-descendant
|
|
424
424
|
* - 跨自定义组件的后代选择器:.the-ancestor >>> .the-descendant
|
|
425
425
|
* - 多选择器的并集:#a-node, .some-other-nodes
|
|
426
|
-
* @supported weapp, h5, tt
|
|
426
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
427
427
|
* @example
|
|
428
428
|
* ```tsx
|
|
429
429
|
* Taro.createSelectorQuery().select('#the-id').fields({
|
|
@@ -459,7 +459,7 @@ declare module '../../index' {
|
|
|
459
459
|
* - 后代选择器:.the-ancestor .the-descendant
|
|
460
460
|
* - 跨自定义组件的后代选择器:.the-ancestor >>> .the-descendant
|
|
461
461
|
* - 多选择器的并集:#a-node, .some-other-nodes
|
|
462
|
-
* @supported weapp, h5, tt
|
|
462
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
463
463
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.selectAll.html
|
|
464
464
|
*/
|
|
465
465
|
selectAll(
|
|
@@ -467,7 +467,7 @@ declare module '../../index' {
|
|
|
467
467
|
selector: string,
|
|
468
468
|
): NodesRef
|
|
469
469
|
/** 选择显示区域。可用于获取显示区域的尺寸、滚动位置等信息。
|
|
470
|
-
* @supported weapp, h5, tt
|
|
470
|
+
* @supported weapp, h5, tt, harmony_hybrid
|
|
471
471
|
* @example
|
|
472
472
|
* ```tsx
|
|
473
473
|
* Taro.createSelectorQuery().selectViewport().scrollOffset(function (res) {
|
|
@@ -484,7 +484,7 @@ declare module '../../index' {
|
|
|
484
484
|
|
|
485
485
|
interface TaroStatic {
|
|
486
486
|
/** 返回一个 SelectorQuery 对象实例。在自定义组件或包含自定义组件的页面中,应使用 `this.createSelectorQuery()` 来代替。
|
|
487
|
-
* @supported weapp, h5, tt, harmony
|
|
487
|
+
* @supported weapp, h5, tt, harmony, harmony_hybrid
|
|
488
488
|
* @example
|
|
489
489
|
* ```tsx
|
|
490
490
|
* const query = Taro.createSelectorQuery()
|
|
@@ -500,7 +500,7 @@ declare module '../../index' {
|
|
|
500
500
|
createSelectorQuery(): SelectorQuery
|
|
501
501
|
|
|
502
502
|
/** 创建并返回一个 IntersectionObserver 对象实例。在自定义组件或包含自定义组件的页面中,应使用 `this.createIntersectionObserver([options])` 来代替。
|
|
503
|
-
* @supported weapp, h5, tt, harmony
|
|
503
|
+
* @supported weapp, h5, tt, harmony, harmony_hybrid
|
|
504
504
|
* @example
|
|
505
505
|
* ```tsx
|
|
506
506
|
* const observer = Taro.createIntersectionObserver(this, { thresholds: [0], observeAll: true })
|
|
@@ -515,7 +515,7 @@ declare module '../../index' {
|
|
|
515
515
|
): IntersectionObserver
|
|
516
516
|
|
|
517
517
|
/** 创建并返回一个 MediaQueryObserver 对象实例。在自定义组件或包含自定义组件的页面中,应使用 `this.createMediaQueryObserver()` 来代替。
|
|
518
|
-
* @supported h5
|
|
518
|
+
* @supported h5, harmony_hybrid
|
|
519
519
|
* @example
|
|
520
520
|
* ```tsx
|
|
521
521
|
* let createMediaQueryObserver
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type Chain from 'webpack-chain'
|
|
2
|
+
|
|
2
3
|
import type { IOption, IPostcssOption, IUrlLoaderOption } from './util'
|
|
4
|
+
import type { Compiler, CompilerTypes, CompilerWebpackTypes } from '../compiler'
|
|
3
5
|
|
|
4
6
|
export interface IHarmonyConfig<T extends CompilerTypes = CompilerWebpackTypes> {
|
|
7
|
+
/** Harmony 编译方式 */
|
|
8
|
+
compiler?: Compiler
|
|
9
|
+
|
|
5
10
|
/** Harmony 项目地址 */
|
|
6
11
|
projectPath: string
|
|
7
12
|
|