@tarojs/taro 3.5.0-alpha.8 → 3.5.0-beta.1
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/index.js +3 -4
- package/package.json +4 -5
- package/types/api/base/debug.d.ts +1 -1
- package/types/api/base/index.d.ts +3 -3
- package/types/api/base/performance.d.ts +5 -5
- package/types/api/base/system.d.ts +2 -2
- package/types/api/base/update.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/data-analysis/index.d.ts +1 -1
- package/types/api/device/accelerometer.d.ts +3 -3
- package/types/api/device/calendar.d.ts +1 -1
- package/types/api/device/clipboard.d.ts +2 -2
- package/types/api/device/compass.d.ts +3 -3
- package/types/api/device/gyroscope.d.ts +4 -4
- package/types/api/device/keyboard.d.ts +1 -1
- package/types/api/device/memory.d.ts +1 -1
- package/types/api/device/network.d.ts +2 -2
- 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 +5 -5
- package/types/api/device/vibrate.d.ts +2 -2
- package/types/api/device/wifi.d.ts +3 -3
- package/types/api/ext/index.d.ts +2 -2
- package/types/api/files/index.d.ts +32 -32
- package/types/api/framework/index.d.ts +1 -1
- package/types/api/location/index.d.ts +9 -9
- package/types/api/media/audio.d.ts +1 -1
- package/types/api/media/background-audio.d.ts +1 -1
- package/types/api/media/camera.d.ts +8 -8
- package/types/api/media/image.d.ts +5 -5
- package/types/api/media/map.d.ts +15 -15
- package/types/api/media/recorder.d.ts +9 -9
- package/types/api/media/video.d.ts +2 -2
- package/types/api/navigate/index.d.ts +2 -2
- package/types/api/network/download.d.ts +5 -5
- package/types/api/network/request.d.ts +3 -3
- package/types/api/network/upload.d.ts +5 -5
- package/types/api/network/websocket.d.ts +6 -6
- package/types/api/open-api/address.d.ts +1 -1
- package/types/api/open-api/authorize.d.ts +1 -1
- package/types/api/open-api/settings.d.ts +2 -2
- package/types/api/open-api/subscribe-message.d.ts +2 -2
- package/types/api/open-api/user-info.d.ts +2 -2
- package/types/api/route/index.d.ts +5 -5
- package/types/api/share/index.d.ts +2 -2
- package/types/api/storage/index.d.ts +10 -10
- package/types/api/ui/animation.d.ts +36 -100
- 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 +5 -5
- package/types/api/ui/pull-down-refresh.d.ts +2 -2
- package/types/api/ui/scroll.d.ts +4 -2
- package/types/api/ui/tab-bar.d.ts +8 -8
- package/types/api/wxml/index.d.ts +16 -16
- package/types/compile.d.ts +0 -4
- package/types/taro.component.d.ts +7 -0
|
@@ -18,12 +18,12 @@ declare module '../../index' {
|
|
|
18
18
|
*/
|
|
19
19
|
interface IntersectionObserver {
|
|
20
20
|
/** 停止监听。回调函数将不再触发
|
|
21
|
-
* @supported weapp
|
|
21
|
+
* @supported weapp, tt
|
|
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
|
|
26
|
+
* @supported weapp, tt
|
|
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
|
|
36
|
+
* @supported weapp, tt
|
|
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
|
|
46
|
+
* @supported weapp, tt
|
|
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
|
|
187
|
+
* @supported weapp, h5, tt
|
|
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
|
|
223
|
+
* @supported weapp, h5, tt
|
|
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
|
|
240
|
+
* @supported weapp, h5, tt
|
|
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
|
|
272
|
+
* @supported weapp, h5, tt
|
|
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
|
|
286
|
+
* @supported weapp, h5, tt
|
|
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
|
|
387
|
+
* @supported weapp, h5, tt
|
|
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
|
|
395
|
+
* @supported weapp, h5, tt
|
|
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
|
|
426
|
+
* @supported weapp, h5, tt
|
|
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
|
|
462
|
+
* @supported weapp, h5, tt
|
|
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
|
|
470
|
+
* @supported weapp, h5, tt
|
|
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
|
|
487
|
+
* @supported weapp, h5, tt
|
|
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
|
|
503
|
+
* @supported weapp, tt
|
|
504
504
|
* @example
|
|
505
505
|
* ```tsx
|
|
506
506
|
* const observer = Taro.createIntersectionObserver(this, { thresholds: [0], observeAll: true })
|
package/types/compile.d.ts
CHANGED
|
@@ -119,7 +119,6 @@ interface Runtime {
|
|
|
119
119
|
|
|
120
120
|
export interface IMiniAppConfig {
|
|
121
121
|
appOutput?: boolean
|
|
122
|
-
enableSourceMap?: boolean
|
|
123
122
|
sourceMapType?: string
|
|
124
123
|
debugReact?: boolean
|
|
125
124
|
minifyXML?: {
|
|
@@ -127,7 +126,6 @@ export interface IMiniAppConfig {
|
|
|
127
126
|
}
|
|
128
127
|
|
|
129
128
|
webpackChain?: (chain: any, webpack: any, PARSE_AST_TYPE: any) => void
|
|
130
|
-
entry?: webpack.EntryObject
|
|
131
129
|
output?: webpack.Output
|
|
132
130
|
postcss?: IPostcssOption
|
|
133
131
|
cssLoaderOption?: IOption
|
|
@@ -177,11 +175,9 @@ export interface IH5Config {
|
|
|
177
175
|
|
|
178
176
|
webpackChain?: (chain: any, webpack: any) => void
|
|
179
177
|
|
|
180
|
-
entry?: webpack.EntryObject
|
|
181
178
|
output?: webpack.Output
|
|
182
179
|
router?: IH5RouterConfig
|
|
183
180
|
devServer?: webpackDevServer.Configuration
|
|
184
|
-
enableSourceMap?: boolean
|
|
185
181
|
sourceMapType?: 'none' | 'eval' | 'cheap-eval-source-map' | 'cheap-module-eval-source-map' | 'eval-source-map' | 'cheap-source-map' | 'cheap-module-source-map' | 'inline-cheap-source-map' | 'inline-cheap-module-source-map' | 'source-map' | 'inline-source-map' | 'hidden-source-map' | 'nosources-source-map'
|
|
186
182
|
enableExtract?: boolean
|
|
187
183
|
transformOnly?: boolean
|
|
@@ -162,6 +162,10 @@ declare module './index' {
|
|
|
162
162
|
getPageId?(): string
|
|
163
163
|
/** 执行关键帧动画,详见[动画](https://developers.weixin.qq.com/miniprogram/dev/framework/view/animation.html) */
|
|
164
164
|
animate?(selector: string, keyFrames: KeyFrame[], duration: number, callback: () => void): void
|
|
165
|
+
/** 滚动驱动的动画,详见[动画](https://developers.weixin.qq.com/miniprogram/dev/framework/view/animation.html) */
|
|
166
|
+
animate?(selector: string, keyFrames: KeyFrame[], duration: number, scrollTimeline: ScrollTimelineOption): void
|
|
167
|
+
/** 清除关键帧动画,详见[动画](https://developers.weixin.qq.com/miniprogram/dev/framework/view/animation.html) */
|
|
168
|
+
clearAnimation?(selector: string, callback: () => void): void
|
|
165
169
|
/** 清除关键帧动画,详见[动画](https://developers.weixin.qq.com/miniprogram/dev/framework/view/animation.html) */
|
|
166
170
|
clearAnimation?(selector: string, options: ClearAnimationOptions, callback: () => void): void
|
|
167
171
|
/** 清除关键帧动画,详见[动画](https://developers.weixin.qq.com/miniprogram/dev/framework/view/animation.html) */
|
|
@@ -173,8 +177,11 @@ declare module './index' {
|
|
|
173
177
|
interface PageInstance extends PageLifeCycle, ComponentInstance {
|
|
174
178
|
/** 页面配置 */
|
|
175
179
|
config?: PageConfig
|
|
180
|
+
/** 页面的初始数据 */
|
|
176
181
|
data?: Record<string, unknown>
|
|
182
|
+
/** 页面路径 */
|
|
177
183
|
path?: string
|
|
184
|
+
/** 页面的组件选项 */
|
|
178
185
|
options?: Record<string, unknown>
|
|
179
186
|
}
|
|
180
187
|
interface TaroStatic {
|