@spcsn/taro 0.1.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.
Files changed (140) hide show
  1. package/README.md +12 -0
  2. package/dist/index.js +147 -0
  3. package/dist/index.js.map +1 -0
  4. package/index.js +9 -0
  5. package/package.json +86 -0
  6. package/types/api/ad/index.d.ts +197 -0
  7. package/types/api/ai/face.d.ts +133 -0
  8. package/types/api/ai/inference.d.ts +129 -0
  9. package/types/api/ai/visionkit.d.ts +874 -0
  10. package/types/api/alipay/index.d.ts +69 -0
  11. package/types/api/base/crypto.d.ts +104 -0
  12. package/types/api/base/debug.d.ts +329 -0
  13. package/types/api/base/env.d.ts +19 -0
  14. package/types/api/base/index.d.ts +102 -0
  15. package/types/api/base/performance.d.ts +258 -0
  16. package/types/api/base/system.d.ts +742 -0
  17. package/types/api/base/update.d.ts +130 -0
  18. package/types/api/base/weapp/app-event.d.ts +265 -0
  19. package/types/api/base/weapp/life-cycle.d.ts +155 -0
  20. package/types/api/canvas/index.d.ts +2162 -0
  21. package/types/api/cloud/index.d.ts +2622 -0
  22. package/types/api/data-analysis/index.d.ts +122 -0
  23. package/types/api/device/accelerometer.d.ts +102 -0
  24. package/types/api/device/accessibility.d.ts +26 -0
  25. package/types/api/device/battery.d.ts +46 -0
  26. package/types/api/device/bluetooth-ble.d.ts +601 -0
  27. package/types/api/device/bluetooth-peripheral.d.ts +430 -0
  28. package/types/api/device/bluetooth.d.ts +463 -0
  29. package/types/api/device/calendar.d.ts +98 -0
  30. package/types/api/device/clipboard.d.ts +81 -0
  31. package/types/api/device/compass.d.ts +105 -0
  32. package/types/api/device/contact.d.ts +110 -0
  33. package/types/api/device/gyroscope.d.ts +85 -0
  34. package/types/api/device/iBeacon.d.ts +168 -0
  35. package/types/api/device/keyboard.d.ts +97 -0
  36. package/types/api/device/memory.d.ts +52 -0
  37. package/types/api/device/motion.d.ts +88 -0
  38. package/types/api/device/network.d.ts +172 -0
  39. package/types/api/device/nfc.d.ts +1238 -0
  40. package/types/api/device/phone.d.ts +30 -0
  41. package/types/api/device/scan.d.ts +111 -0
  42. package/types/api/device/screen.d.ts +217 -0
  43. package/types/api/device/sms.d.ts +26 -0
  44. package/types/api/device/vibrate.d.ts +51 -0
  45. package/types/api/device/wifi.d.ts +301 -0
  46. package/types/api/ext/index.d.ts +64 -0
  47. package/types/api/files/index.d.ts +1472 -0
  48. package/types/api/framework/index.d.ts +51 -0
  49. package/types/api/location/index.d.ts +517 -0
  50. package/types/api/media/audio.d.ts +1013 -0
  51. package/types/api/media/background-audio.d.ts +291 -0
  52. package/types/api/media/camera.d.ts +207 -0
  53. package/types/api/media/editor.d.ts +239 -0
  54. package/types/api/media/image.d.ts +469 -0
  55. package/types/api/media/live.d.ts +461 -0
  56. package/types/api/media/map.d.ts +638 -0
  57. package/types/api/media/media-recorder.d.ts +117 -0
  58. package/types/api/media/recorder.d.ts +317 -0
  59. package/types/api/media/video-decoder.d.ts +117 -0
  60. package/types/api/media/video-processing.d.ts +84 -0
  61. package/types/api/media/video.d.ts +527 -0
  62. package/types/api/media/voip.d.ts +393 -0
  63. package/types/api/navigate/index.d.ts +327 -0
  64. package/types/api/network/download.d.ts +173 -0
  65. package/types/api/network/mdns.d.ts +191 -0
  66. package/types/api/network/request.d.ts +480 -0
  67. package/types/api/network/tcp.d.ts +181 -0
  68. package/types/api/network/udp.d.ts +218 -0
  69. package/types/api/network/upload.d.ts +201 -0
  70. package/types/api/network/websocket.d.ts +383 -0
  71. package/types/api/open-api/account.d.ts +51 -0
  72. package/types/api/open-api/address.d.ts +68 -0
  73. package/types/api/open-api/authorize.d.ts +80 -0
  74. package/types/api/open-api/card.d.ts +110 -0
  75. package/types/api/open-api/channels.d.ts +225 -0
  76. package/types/api/open-api/customer-service.d.ts +45 -0
  77. package/types/api/open-api/device-voip.d.ts +103 -0
  78. package/types/api/open-api/facial.d.ts +98 -0
  79. package/types/api/open-api/favorites.d.ts +101 -0
  80. package/types/api/open-api/group.d.ts +59 -0
  81. package/types/api/open-api/invoice.d.ts +87 -0
  82. package/types/api/open-api/license-plate.d.ts +27 -0
  83. package/types/api/open-api/login.d.ts +115 -0
  84. package/types/api/open-api/my-miniprogram.d.ts +28 -0
  85. package/types/api/open-api/privacy.d.ts +107 -0
  86. package/types/api/open-api/redpackage.d.ts +24 -0
  87. package/types/api/open-api/settings.d.ts +174 -0
  88. package/types/api/open-api/soter.d.ts +184 -0
  89. package/types/api/open-api/sticker.d.ts +83 -0
  90. package/types/api/open-api/subscribe-message.d.ts +305 -0
  91. package/types/api/open-api/user-info.d.ts +182 -0
  92. package/types/api/open-api/werun.d.ts +101 -0
  93. package/types/api/payment/index.d.ts +119 -0
  94. package/types/api/qq/index.d.ts +354 -0
  95. package/types/api/route/index.d.ts +324 -0
  96. package/types/api/share/index.d.ts +354 -0
  97. package/types/api/skyline/index.d.ts +345 -0
  98. package/types/api/storage/background-fetch.d.ts +131 -0
  99. package/types/api/storage/cache-manager.d.ts +249 -0
  100. package/types/api/storage/index.d.ts +405 -0
  101. package/types/api/swan/bookshelf.d.ts +307 -0
  102. package/types/api/swan/download-package.d.ts +80 -0
  103. package/types/api/swan/index.d.ts +251 -0
  104. package/types/api/swan/pay.d.ts +139 -0
  105. package/types/api/taro.extend.d.ts +233 -0
  106. package/types/api/taro.hooks.d.ts +148 -0
  107. package/types/api/ui/animation.d.ts +427 -0
  108. package/types/api/ui/background.d.ts +69 -0
  109. package/types/api/ui/custom-component.d.ts +23 -0
  110. package/types/api/ui/fonts.d.ts +77 -0
  111. package/types/api/ui/interaction.d.ts +281 -0
  112. package/types/api/ui/menu.d.ts +29 -0
  113. package/types/api/ui/navigation-bar.d.ts +130 -0
  114. package/types/api/ui/pull-down-refresh.d.ts +50 -0
  115. package/types/api/ui/scroll.d.ts +114 -0
  116. package/types/api/ui/sticky.d.ts +32 -0
  117. package/types/api/ui/tab-bar.d.ts +196 -0
  118. package/types/api/ui/window.d.ts +71 -0
  119. package/types/api/worker/index.d.ts +83 -0
  120. package/types/api/wxml/index.d.ts +540 -0
  121. package/types/compile/compiler.d.ts +32 -0
  122. package/types/compile/config/h5.d.ts +134 -0
  123. package/types/compile/config/harmony.d.ts +118 -0
  124. package/types/compile/config/index.d.ts +8 -0
  125. package/types/compile/config/manifest.d.ts +155 -0
  126. package/types/compile/config/mini.d.ts +118 -0
  127. package/types/compile/config/plugin.d.ts +34 -0
  128. package/types/compile/config/project.d.ts +338 -0
  129. package/types/compile/config/rn.d.ts +85 -0
  130. package/types/compile/config/util.d.ts +179 -0
  131. package/types/compile/hooks.d.ts +13 -0
  132. package/types/compile/index.d.ts +11 -0
  133. package/types/compile/viteCompilerContext.d.ts +167 -0
  134. package/types/global.d.ts +428 -0
  135. package/types/index.d.ts +190 -0
  136. package/types/taro.api.d.ts +130 -0
  137. package/types/taro.component.d.ts +168 -0
  138. package/types/taro.config.d.ts +712 -0
  139. package/types/taro.lifecycle.d.ts +220 -0
  140. package/types/taro.runtime.d.ts +9 -0
@@ -0,0 +1,427 @@
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
4
+ namespace createAnimation {
5
+ interface Option {
6
+ /** 动画持续时间,单位 ms */
7
+ duration?: number
8
+ /** 动画的效果 */
9
+ timingFunction?: keyof TimingFunction
10
+ /** 动画延迟时间,单位 ms
11
+ * @default 0
12
+ */
13
+ delay?: number
14
+ /** @default "50% 50% 0" */
15
+ transformOrigin?: string
16
+ /**
17
+ * 单位
18
+ * @supported h5
19
+ */
20
+ unit?: string
21
+ }
22
+ interface TimingFunction {
23
+ /** 动画从头到尾的速度是相同的 */
24
+ linear
25
+ /** 动画以低速开始,然后加快,在结束前变慢 */
26
+ ease
27
+ /** 动画以低速开始 */
28
+ 'ease-in'
29
+ /** 动画以低速开始和结束 */
30
+ 'ease-in-out'
31
+ /** 动画以低速结束 */
32
+ 'ease-out'
33
+ /** 动画第一帧就跳至结束状态直到结束 */
34
+ 'step-start'
35
+ /** 动画一直保持开始状态,最后一帧跳到结束状态 */
36
+ 'step-end'
37
+ }
38
+ }
39
+
40
+ /** 动画对象
41
+ * @supported weapp, h5, tt, harmony_hybrid
42
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html
43
+ */
44
+ interface Animation {
45
+ /** 导出动画队列。**export 方法每次调用后会清掉之前的动画操作**。
46
+ * @supported weapp, h5, tt, harmony_hybrid
47
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.export.html
48
+ */
49
+ export(): {
50
+ actions: TaroGeneral.IAnyObject[]
51
+ }
52
+ /** 表示一组动画完成。可以在一组动画中调用任意多个动画方法,一组动画中的所有动画会同时开始,一组动画完成后才会进行下一组动画。
53
+ * @supported weapp, h5, tt, harmony_hybrid
54
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.step.html
55
+ */
56
+ step(option?: Animation.StepOption): Animation
57
+ /** 同 [transform-function matrix](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix)
58
+ * @supported weapp, h5, tt, harmony_hybrid
59
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.matrix.html
60
+ */
61
+ matrix(a: number, b: number, c: number, d: number, tx: number, ty: number): Animation
62
+ /** 同 [transform-function matrix3d](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix3d)
63
+ * @supported weapp, h5, tt, harmony_hybrid
64
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.matrix3d.html
65
+ */
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
+ /** 从原点顺时针旋转一个角度
68
+ * @supported weapp, h5, tt, harmony_hybrid
69
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.rotate.html
70
+ */
71
+ rotate(
72
+ /** 旋转的角度。范围 [-180, 180] */
73
+ angle: number,
74
+ ): Animation
75
+ /** 从 固定 轴顺时针旋转一个角度
76
+ * @supported weapp, h5, tt, harmony_hybrid
77
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.rotate3d.html
78
+ */
79
+ rotate3d(
80
+ /** 旋转轴的 x 坐标 */
81
+ x: number,
82
+ /** 旋转轴的 y 坐标 */
83
+ y?: number,
84
+ /** 旋转轴的 z 坐标 */
85
+ z?: number,
86
+ /** 旋转的角度。范围 [-180, 180] */
87
+ angle?: number,
88
+ ): Animation
89
+ /** 从 X 轴顺时针旋转一个角度
90
+ * @supported weapp, h5, tt, harmony_hybrid
91
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.rotateX.html
92
+ */
93
+ rotateX(
94
+ /** 旋转的角度。范围 [-180, 180] */
95
+ angle: number,
96
+ ): Animation
97
+ /** 从 Y 轴顺时针旋转一个角度
98
+ * @supported weapp, h5, tt, harmony_hybrid
99
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.rotateY.html
100
+ */
101
+ rotateY(
102
+ /** 旋转的角度。范围 [-180, 180] */
103
+ angle: number,
104
+ ): Animation
105
+ /** 从 Z 轴顺时针旋转一个角度
106
+ * @supported weapp, h5, tt, harmony_hybrid
107
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.rotateZ.html
108
+ */
109
+ rotateZ(
110
+ /** 旋转的角度。范围 [-180, 180] */
111
+ angle: number,
112
+ ): Animation
113
+ /** 缩放
114
+ * @supported weapp, h5, tt, harmony_hybrid
115
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.scale.html
116
+ */
117
+ scale(
118
+ /** 当仅有 sx 参数时,表示在 X 轴、Y 轴同时缩放sx倍数 */
119
+ sx: number,
120
+ /** 在 Y 轴缩放 sy 倍数 */
121
+ sy?: number,
122
+ ): Animation
123
+ /** 缩放
124
+ * @supported weapp, h5, tt, harmony_hybrid
125
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.scale3d.html
126
+ */
127
+ scale3d(
128
+ /** x 轴的缩放倍数 */
129
+ sx: number,
130
+ /** y 轴的缩放倍数 */
131
+ sy: number,
132
+ /** z 轴的缩放倍数 */
133
+ sz: number,
134
+ ): Animation
135
+ /** 缩放 X 轴
136
+ * @supported weapp, h5, tt, harmony_hybrid
137
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.scaleX.html
138
+ */
139
+ scaleX(
140
+ /** X 轴的缩放倍数 */
141
+ scale: number,
142
+ ): Animation
143
+ /** 缩放 Y 轴
144
+ * @supported weapp, h5, tt, harmony_hybrid
145
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.scaleY.html
146
+ */
147
+ scaleY(
148
+ /** Y 轴的缩放倍数 */
149
+ scale: number,
150
+ ): Animation
151
+ /** 缩放 Z 轴
152
+ * @supported weapp, h5, tt, harmony_hybrid
153
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.scaleZ.html
154
+ */
155
+ scaleZ(
156
+ /** Z 轴的缩放倍数 */
157
+ scale: number,
158
+ ): Animation
159
+ /** 对 X、Y 轴坐标进行倾斜
160
+ * @supported weapp, h5, tt, harmony_hybrid
161
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.skew.html
162
+ */
163
+ skew(
164
+ /** 对 X 轴坐标倾斜的角度,范围 [-180, 180] */
165
+ ax: number,
166
+ /** 对 Y 轴坐标倾斜的角度,范围 [-180, 180] */
167
+ ay: number,
168
+ ): Animation
169
+ /** 对 X 轴坐标进行倾斜
170
+ * @supported weapp, h5, tt, harmony_hybrid
171
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.skewX.html
172
+ */
173
+ skewX(
174
+ /** 倾斜的角度,范围 [-180, 180] */
175
+ angle: number,
176
+ ): Animation
177
+ /** 对 Y 轴坐标进行倾斜
178
+ * @supported weapp, h5, tt, harmony_hybrid
179
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.skewY.html
180
+ */
181
+ skewY(
182
+ /** 倾斜的角度,范围 [-180, 180] */
183
+ angle: number,
184
+ ): Animation
185
+ /** 平移变换
186
+ * @supported weapp, h5, tt, harmony_hybrid
187
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.translate.html
188
+ */
189
+ translate(
190
+ /** 当仅有该参数时表示在 X 轴偏移 tx,单位 px */
191
+ tx?: number,
192
+ /** 在 Y 轴平移的距离,单位为 px */
193
+ ty?: number,
194
+ ): Animation
195
+ /** 对 xyz 坐标进行平移变换
196
+ * @supported weapp, h5, tt, harmony_hybrid
197
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.translate3d.html
198
+ */
199
+ translate3d(
200
+ /** 在 X 轴平移的距离,单位为 px */
201
+ tx?: number,
202
+ /** 在 Y 轴平移的距离,单位为 px */
203
+ ty?: number,
204
+ /** 在 Z 轴平移的距离,单位为 px */
205
+ tz?: number,
206
+ ): Animation
207
+ /** 对 X 轴平移
208
+ * @supported weapp, h5, tt, harmony_hybrid
209
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.translateX.html
210
+ */
211
+ translateX(
212
+ /** 在 X 轴平移的距离,单位为 px */
213
+ translation: number,
214
+ ): Animation
215
+ /** 对 Y 轴平移
216
+ * @supported weapp, h5, tt, harmony_hybrid
217
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.translateY.html
218
+ */
219
+ translateY(
220
+ /** 在 Y 轴平移的距离,单位为 px */
221
+ translation: number,
222
+ ): Animation
223
+ /** 对 Z 轴平移
224
+ * @supported weapp, h5, tt, harmony_hybrid
225
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.translateZ.html
226
+ */
227
+ translateZ(
228
+ /** 在 Z 轴平移的距离,单位为 px */
229
+ translation: number,
230
+ ): Animation
231
+ /** 设置透明度
232
+ * @supported weapp, h5, tt, harmony_hybrid
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, harmony_hybrid
241
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.backgroundColor.html
242
+ */
243
+ backgroundColor(
244
+ /** 颜色值 */
245
+ value: string,
246
+ ): Animation
247
+ /** 设置宽度
248
+ * @supported weapp, h5, tt, harmony_hybrid
249
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.width.html
250
+ */
251
+ width(
252
+ /** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */
253
+ value: number | string,
254
+ ): Animation
255
+ /** 设置高度
256
+ * @supported weapp, h5, tt, harmony_hybrid
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, harmony_hybrid
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, harmony_hybrid
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, harmony_hybrid
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, harmony_hybrid
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
295
+ }
296
+
297
+ namespace Animation {
298
+ interface StepOption {
299
+ /** 动画延迟时间,单位 ms */
300
+ delay?: number
301
+ /** 动画持续时间,单位 ms */
302
+ duration?: number
303
+ /** 动画的效果 */
304
+ timingFunction?: keyof TimingFunction
305
+ transformOrigin?: string
306
+ }
307
+ interface TimingFunction {
308
+ /** 动画从头到尾的速度是相同的 */
309
+ linear
310
+ /** 动画以低速开始,然后加快,在结束前变慢 */
311
+ ease
312
+ /** 动画以低速开始 */
313
+ 'ease-in'
314
+ /** 动画以低速开始和结束 */
315
+ 'ease-in-out'
316
+ /** 动画以低速结束 */
317
+ 'ease-out'
318
+ /** 动画第一帧就跳至结束状态直到结束 */
319
+ 'step-start'
320
+ /** 动画一直保持开始状态,最后一帧跳到结束状态 */
321
+ 'step-end'
322
+ }
323
+ }
324
+
325
+ /** @ignore */
326
+ interface KeyFrame {
327
+ /** 关键帧的偏移,范围[0-1] */
328
+ offset?: number
329
+ /** 动画缓动函数 */
330
+ ease?: string
331
+ /** 基点位置,即 CSS transform-origin */
332
+ transformOrigin?: string
333
+ /** 背景颜色,即 CSS background-color */
334
+ backgroundColor?: string
335
+ /** 底边位置,即 CSS bottom */
336
+ bottom?: number | string
337
+ /** 高度,即 CSS height */
338
+ height?: number | string
339
+ /** 左边位置,即 CSS left */
340
+ left?: number | string
341
+ /** 宽度,即 CSS width */
342
+ width?: number | string
343
+ /** 不透明度,即 CSS opacity */
344
+ opacity?: number | string
345
+ /** 右边位置,即 CSS right */
346
+ right?: number | string
347
+ /** 顶边位置,即 CSS top */
348
+ top?: number | string
349
+ /** 变换矩阵,即 CSS transform matrix */
350
+ matrix?: number[]
351
+ /** 三维变换矩阵,即 CSS transform matrix3d */
352
+ matrix3d?: number[]
353
+ /** 旋转,即 CSS transform rotate */
354
+ rotate?: number
355
+ /** 三维旋转,即 CSS transform rotate3d */
356
+ rotate3d?: number[]
357
+ /** X 方向旋转,即 CSS transform rotateX */
358
+ rotateX?: number
359
+ /** Y 方向旋转,即 CSS transform rotateY */
360
+ rotateY?: number
361
+ /** Z 方向旋转,即 CSS transform rotateZ */
362
+ rotateZ?: number
363
+ /** 缩放,即 CSS transform scale */
364
+ scale?: number[]
365
+ /** 三维缩放,即 CSS transform scale3d */
366
+ scale3d?: number[]
367
+ /** X 方向缩放,即 CSS transform scaleX */
368
+ scaleX?: number
369
+ /** Y 方向缩放,即 CSS transform scaleY */
370
+ scaleY?: number
371
+ /** Z 方向缩放,即 CSS transform scaleZ */
372
+ scaleZ?: number
373
+ /** 倾斜,即 CSS transform skew */
374
+ skew?: number[]
375
+ /** X 方向倾斜,即 CSS transform skewX */
376
+ skewX?: number
377
+ /** Y 方向倾斜,即 CSS transform skewY */
378
+ skewY?: number
379
+ /** 位移,即 CSS transform translate */
380
+ translate?: Array<number | string>
381
+ /** 三维位移,即 CSS transform translate3d */
382
+ translate3d?: Array<number | string>
383
+ /** X 方向位移,即 CSS transform translateX */
384
+ translateX?: number | string
385
+ /** Y 方向位移,即 CSS transform translateY */
386
+ translateY?: number | string
387
+ /** Z 方向位移,即 CSS transform translateZ */
388
+ translateZ?: number | string
389
+ composite?: 'replace' | 'add' | 'accumulate' | 'auto'
390
+ easing?: string
391
+ [property: string]: any
392
+ }
393
+
394
+ /** @ignore */
395
+ type ClearAnimationOptions = Record<keyof KeyFrame, boolean>
396
+
397
+ /** @ignore */
398
+ interface ScrollTimelineOption {
399
+ /** 指定滚动元素的选择器(只支持 scroll-view),该元素滚动时会驱动动画的进度 */
400
+ scrollSource: string
401
+ /** 指定滚动的方向。有效值为 horizontal 或 vertical */
402
+ orientation?: string
403
+ /** 指定开始驱动动画进度的滚动偏移量,单位 px */
404
+ startScrollOffset: number
405
+ /** 指定停止驱动动画进度的滚动偏移量,单位 px */
406
+ endScrollOffset: number
407
+ /** 起始和结束的滚动范围映射的时间长度,该时间可用于与关键帧动画里的时间 (duration) 相匹配,单位 ms */
408
+ timeRange: number
409
+ }
410
+
411
+ interface TaroStatic {
412
+ /** 创建一个动画实例 [animation](../Animation)。调用实例的方法来描述动画。最后通过动画实例的 export 方法导出动画数据传递给组件的 animation 属性。
413
+ * @supported weapp, tt, h5, harmony, harmony_hybrid
414
+ * @example
415
+ * ```tsx
416
+ * var animation = Taro.createAnimation({
417
+ * transformOrigin: "50% 50%",
418
+ * duration: 1000,
419
+ * timingFunction: "ease",
420
+ * delay: 0
421
+ * })
422
+ * ```
423
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/wx.createAnimation.html
424
+ */
425
+ createAnimation(option: createAnimation.Option): Animation
426
+ }
427
+ }
@@ -0,0 +1,69 @@
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
4
+ namespace setBackgroundTextStyle {
5
+ interface Option {
6
+ /** 下拉背景字体、loading 图的样式。
7
+ *
8
+ * 可选值:
9
+ * - 'dark': dark 样式;
10
+ * - 'light': light 样式; */
11
+ textStyle: 'dark' | 'light'
12
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
13
+ complete?: (res: TaroGeneral.CallbackResult) => void
14
+ /** 接口调用失败的回调函数 */
15
+ fail?: (res: TaroGeneral.CallbackResult) => void
16
+ /** 接口调用成功的回调函数 */
17
+ success?: (res: TaroGeneral.CallbackResult) => void
18
+ }
19
+ }
20
+
21
+ namespace setBackgroundColor {
22
+ interface Option {
23
+ /** 窗口的背景色,必须为十六进制颜色值 */
24
+ backgroundColor?: string
25
+ /** 底部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持 */
26
+ backgroundColorBottom?: string
27
+ /** 顶部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持 */
28
+ backgroundColorTop?: string
29
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
30
+ complete?: (res: TaroGeneral.CallbackResult) => void
31
+ /** 接口调用失败的回调函数 */
32
+ fail?: (res: TaroGeneral.CallbackResult) => void
33
+ /** 接口调用成功的回调函数 */
34
+ success?: (res: TaroGeneral.CallbackResult) => void
35
+ }
36
+ }
37
+
38
+ interface TaroStatic {
39
+ /** 动态设置下拉背景字体、loading 图的样式
40
+ * @supported weapp, rn
41
+ * @rn 仅 iOS
42
+ * @example
43
+ * ```tsx
44
+ * Taro.setBackgroundTextStyle({
45
+ * textStyle: 'dark' // 下拉背景字体、loading 图的样式为dark
46
+ * })
47
+ * ```
48
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/background/wx.setBackgroundTextStyle.html
49
+ */
50
+ setBackgroundTextStyle(option: setBackgroundTextStyle.Option): Promise<TaroGeneral.CallbackResult>
51
+
52
+ /** 动态设置窗口的背景色
53
+ * @supported weapp, rn
54
+ * @rn 仅 Android
55
+ * @example
56
+ * ```tsx
57
+ * Taro.setBackgroundColor({
58
+ * backgroundColor: '#ffffff', // 窗口的背景色为白色
59
+ * })
60
+ * Taro.setBackgroundColor({
61
+ * backgroundColorTop: '#ffffff', // 顶部窗口的背景色为白色
62
+ * backgroundColorBottom: '#ffffff', // 底部窗口的背景色为白色
63
+ * })
64
+ * ```
65
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/background/wx.setBackgroundColor.html
66
+ */
67
+ setBackgroundColor(option: setBackgroundColor.Option): Promise<TaroGeneral.CallbackResult>
68
+ }
69
+ }
@@ -0,0 +1,23 @@
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
4
+ interface TaroStatic {
5
+ /** 延迟一部分操作到下一个时间片再执行。(类似于 setTimeout)
6
+ *
7
+ * **说明**
8
+ * 因为自定义组件中的 setData 和 triggerEvent 等接口本身是同步的操作,当这几个接口被连续调用时,都是在一个同步流程中执行完的,因此若逻辑不当可能会导致出错。
9
+ * 一个极端的案例:当父组件的 setData 引发了子组件的 triggerEvent,进而使得父组件又进行了一次 setData,期间有通过 wx:if 语句对子组件进行卸载,就有可能引发奇怪的错误,所以对于不需要在一个同步流程内完成的逻辑,可以使用此接口延迟到下一个时间片再执行。
10
+ * @supported weapp, h5, harmony_hybrid
11
+ * @example
12
+ * ```tsx
13
+ * this.setData({ number: 1 }) // 直接在当前同步流程中执行
14
+ * Taro.nextTick(() => {
15
+ * this.setData({ number: 3 }) // 在当前同步流程结束后,下一个时间片执行
16
+ * })
17
+ * this.setData({ number: 2 }) // 直接在当前同步流程中执行
18
+ * ```
19
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/custom-component/wx.nextTick.html
20
+ */
21
+ nextTick(callback: (...args: any[]) => any): void
22
+ }
23
+ }
@@ -0,0 +1,77 @@
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
4
+ namespace loadFontFace {
5
+ interface Option {
6
+ /** 是否全局生效
7
+ * @default false
8
+ */
9
+ global?: boolean,
10
+ /** 定义的字体名称 */
11
+ family: string
12
+ /** 字体资源的地址。建议格式为 TTF 和 WOFF,WOFF2 在低版本的 iOS 上会不兼容。 */
13
+ source: string
14
+ /** 可选的字体描述符 */
15
+ desc?: DescOption
16
+ /** 接口调用成功的回调函数 */
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
27
+ }
28
+ /** 可选的字体描述符 */
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
40
+ /** 字体样式,可选值为 normal / italic / oblique */
41
+ style?: string
42
+ /** @supported h5 */
43
+ unicodeRange?: string
44
+ /** 设置小型大写字母的字体显示文本,可选值为 normal / small-caps / inherit */
45
+ variant?: string
46
+ /** @supported h5 */
47
+ variationSettings?: string
48
+ /** 字体粗细,可选值为 normal / bold / 100 / 200../ 900 */
49
+ weight?: string
50
+ }
51
+ }
52
+
53
+ interface TaroStatic {
54
+ /** 动态加载网络字体。文件地址需为下载类型。iOS 仅支持 https 格式文件地址。
55
+ *
56
+ * 注意:
57
+ * 1. 字体文件返回的 context-type 参考 [font](https://www.iana.org/assignments/media-types/media-types.xhtml#font),格式不正确时会解析失败。
58
+ * 2. 字体链接必须是https(ios不支持http)
59
+ * 3. 字体链接必须是同源下的,或开启了cors支持,小程序的域名是`servicewechat.com`
60
+ * 4. canvas等原生组件不支持使用接口添加的字体
61
+ * 5. 工具里提示 Failed to load font 可以忽略
62
+ * @supported weapp, alipay, h5, harmony_hybrid
63
+ * @h5 不支持 global (默认全局加载)
64
+ * @alipay source 地址格式为 `url('https://...')`,而不是单纯 URL 地址
65
+ * @example
66
+ * ```tsx
67
+ * Taro.loadFontFace({
68
+ * family: 'Bitstream Vera Serif Bold',
69
+ * source: 'url("https://sungd.github.io/Pacifico.ttf")',
70
+ * success: console.log
71
+ * })
72
+ * ```
73
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/font/wx.loadFontFace.html
74
+ */
75
+ loadFontFace(option: loadFontFace.Option): Promise<loadFontFace.CallbackResult>
76
+ }
77
+ }