@tarojs/taro 3.6.6 → 3.6.7-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/taro",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.7-alpha.0",
|
|
4
4
|
"description": "Taro framework",
|
|
5
5
|
"homepage": "https://github.com/nervjs/taro/tree/master/packages/taro#readme",
|
|
6
6
|
"main": "index.js",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"author": "O2Team",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@tarojs/api": "3.6.
|
|
25
|
-
"@tarojs/runtime": "3.6.
|
|
24
|
+
"@tarojs/api": "3.6.7-alpha.0",
|
|
25
|
+
"@tarojs/runtime": "3.6.7-alpha.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@tarojs/helper": "3.6.
|
|
28
|
+
"@tarojs/helper": "3.6.7-alpha.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependenciesMeta": {
|
|
31
31
|
"@types/react": {
|
|
@@ -3,7 +3,7 @@ import Taro from '../../index'
|
|
|
3
3
|
declare module '../../index' {
|
|
4
4
|
interface TaroStatic {
|
|
5
5
|
/** 判断小程序的 API,回调,参数,组件等是否在当前版本可用。
|
|
6
|
-
* @supported weapp, tt
|
|
6
|
+
* @supported weapp, tt, h5
|
|
7
7
|
* @example
|
|
8
8
|
* ```tsx
|
|
9
9
|
* Taro.canIUse('openBluetoothAdapter')
|
|
@@ -36,7 +36,7 @@ declare module '../../index' {
|
|
|
36
36
|
): boolean
|
|
37
37
|
|
|
38
38
|
/** 判断能否使用 WebP 格式
|
|
39
|
-
*
|
|
39
|
+
*
|
|
40
40
|
* > 在小程序平台中仅在 android 和 devtools 设备时可用
|
|
41
41
|
* @supported global
|
|
42
42
|
*/
|
|
@@ -227,6 +227,14 @@ declare module '../../index' {
|
|
|
227
227
|
toggleTorch(option?: LivePusherContext.ToggleTorchOption): void
|
|
228
228
|
}
|
|
229
229
|
namespace LivePlayerContext {
|
|
230
|
+
interface ExitCastingOption {
|
|
231
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
232
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
233
|
+
/** 接口调用失败的回调函数 */
|
|
234
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
235
|
+
/** 接口调用成功的回调函数 */
|
|
236
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
237
|
+
}
|
|
230
238
|
interface ExitFullScreenOption {
|
|
231
239
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
232
240
|
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
@@ -267,6 +275,14 @@ declare module '../../index' {
|
|
|
267
275
|
/** 接口调用成功的回调函数 */
|
|
268
276
|
success?: (res: TaroGeneral.CallbackResult) => void
|
|
269
277
|
}
|
|
278
|
+
interface ReconnectCastingOption {
|
|
279
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
280
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
281
|
+
/** 接口调用失败的回调函数 */
|
|
282
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
283
|
+
/** 接口调用成功的回调函数 */
|
|
284
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
285
|
+
}
|
|
270
286
|
interface RequestFullScreenOption {
|
|
271
287
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
272
288
|
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
@@ -316,6 +332,14 @@ declare module '../../index' {
|
|
|
316
332
|
/** 调用结果 */
|
|
317
333
|
errMsg: string
|
|
318
334
|
}
|
|
335
|
+
interface StartCastingOption {
|
|
336
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
337
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
338
|
+
/** 接口调用失败的回调函数 */
|
|
339
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
340
|
+
/** 接口调用成功的回调函数 */
|
|
341
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
342
|
+
}
|
|
319
343
|
interface StopOption {
|
|
320
344
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
321
345
|
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
@@ -324,6 +348,14 @@ declare module '../../index' {
|
|
|
324
348
|
/** 接口调用成功的回调函数 */
|
|
325
349
|
success?: (res: TaroGeneral.CallbackResult) => void
|
|
326
350
|
}
|
|
351
|
+
interface SwitchCastingOption {
|
|
352
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
353
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
354
|
+
/** 接口调用失败的回调函数 */
|
|
355
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
356
|
+
/** 接口调用成功的回调函数 */
|
|
357
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
358
|
+
}
|
|
327
359
|
}
|
|
328
360
|
|
|
329
361
|
/** `LivePlayerContext` 实例,可通过 `Taro.createLivePlayerContext` 获取。
|
|
@@ -332,6 +364,11 @@ declare module '../../index' {
|
|
|
332
364
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.html
|
|
333
365
|
*/
|
|
334
366
|
interface LivePlayerContext {
|
|
367
|
+
/** 退出投屏。仅支持在 tap 事件回调内调用。
|
|
368
|
+
* @supported weapp
|
|
369
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.exitCasting.html
|
|
370
|
+
*/
|
|
371
|
+
exitCasting(option?: LivePlayerContext.ExitCastingOption): void
|
|
335
372
|
/** 退出全屏
|
|
336
373
|
* @supported weapp
|
|
337
374
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.exitFullScreen.html
|
|
@@ -357,6 +394,11 @@ declare module '../../index' {
|
|
|
357
394
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.play.html
|
|
358
395
|
*/
|
|
359
396
|
play(option?: LivePlayerContext.PlayOption): void
|
|
397
|
+
/** 重连投屏设备。仅支持在 tap 事件回调内调用。
|
|
398
|
+
* @supported weapp
|
|
399
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.reconnectCasting.html
|
|
400
|
+
*/
|
|
401
|
+
reconnectCasting(option?: LivePlayerContext.ReconnectCastingOption): void
|
|
360
402
|
/** 进入全屏
|
|
361
403
|
* @supported weapp
|
|
362
404
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.requestFullScreen.html
|
|
@@ -381,11 +423,21 @@ declare module '../../index' {
|
|
|
381
423
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.snapshot.html
|
|
382
424
|
*/
|
|
383
425
|
snapshot(option?: LivePlayerContext.SnapshotOption): void
|
|
426
|
+
/** 开始投屏, 拉起半屏搜索设备。仅支持在 tap 事件回调内调用
|
|
427
|
+
* @supported weapp
|
|
428
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.startCasting.html
|
|
429
|
+
*/
|
|
430
|
+
startCasting(option?: LivePlayerContext.StartCastingOption): void
|
|
384
431
|
/** 停止
|
|
385
432
|
* @supported weapp
|
|
386
433
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.stop.html
|
|
387
434
|
*/
|
|
388
435
|
stop(option?: LivePlayerContext.StopOption): void
|
|
436
|
+
/** 切换投屏设备。仅支持在 tap 事件回调内调用。
|
|
437
|
+
* @supported weapp
|
|
438
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.switchCasting.html
|
|
439
|
+
*/
|
|
440
|
+
switchCasting(option?: LivePlayerContext.SwitchCastingOption): void
|
|
389
441
|
}
|
|
390
442
|
|
|
391
443
|
interface TaroStatic {
|
|
@@ -60,58 +60,61 @@ declare module '../../index' {
|
|
|
60
60
|
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
61
61
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
62
62
|
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
63
|
-
/**
|
|
63
|
+
/** 设置是否使用 jsonp 方式获取数据
|
|
64
64
|
* @default false
|
|
65
65
|
* @supported h5
|
|
66
66
|
*/
|
|
67
|
-
jsonp?: boolean
|
|
68
|
-
/** 设置
|
|
69
|
-
* @default false
|
|
67
|
+
jsonp?: boolean | string
|
|
68
|
+
/** 设置 jsonp 请求 url 是否需要被缓存
|
|
70
69
|
* @supported h5
|
|
71
70
|
*/
|
|
72
|
-
jsonpCache?:
|
|
73
|
-
/**
|
|
71
|
+
jsonpCache?: RequestCache
|
|
72
|
+
/** 设置是否允许跨域请求
|
|
74
73
|
* @default "same-origin"
|
|
75
74
|
* @supported h5
|
|
76
75
|
*/
|
|
77
76
|
mode?: keyof CorsMode
|
|
78
|
-
/**
|
|
77
|
+
/** 设置是否携带 Cookie
|
|
79
78
|
* @default "omit"
|
|
80
79
|
* @supported h5
|
|
81
80
|
*/
|
|
82
81
|
credentials?: keyof Credentials
|
|
83
|
-
/**
|
|
82
|
+
/** 设置缓存模式
|
|
84
83
|
* @default "default"
|
|
85
84
|
* @supported h5
|
|
86
85
|
*/
|
|
87
86
|
cache?: keyof Cache
|
|
88
|
-
/**
|
|
87
|
+
/** 设置请求重试次数
|
|
89
88
|
* @default 2
|
|
90
89
|
* @supported h5
|
|
91
90
|
*/
|
|
92
91
|
retryTimes?: number
|
|
93
|
-
/**
|
|
92
|
+
/** 设置请求的兜底接口
|
|
94
93
|
* @supported h5
|
|
95
94
|
*/
|
|
96
95
|
backup?: string | string[]
|
|
97
|
-
/**
|
|
96
|
+
/** 设置请求中止信号
|
|
97
|
+
* @supported h5
|
|
98
|
+
*/
|
|
99
|
+
signal?: AbortSignal
|
|
100
|
+
/** 设置请求响应的数据校验函数,若返回 false,则请求兜底接口,若无兜底接口,则报请求失败
|
|
98
101
|
* @supported h5
|
|
99
102
|
*/
|
|
100
103
|
dataCheck?(): boolean
|
|
101
|
-
/**
|
|
104
|
+
/** 设置请求是否使用缓存
|
|
102
105
|
* @default false
|
|
103
106
|
* @supported h5
|
|
104
107
|
*/
|
|
105
108
|
useStore?: boolean
|
|
106
|
-
/**
|
|
109
|
+
/** 设置请求缓存校验的 key
|
|
107
110
|
* @supported h5
|
|
108
111
|
*/
|
|
109
112
|
storeCheckKey?: string
|
|
110
|
-
/**
|
|
113
|
+
/** 设置请求缓存签名
|
|
111
114
|
* @supported h5
|
|
112
115
|
*/
|
|
113
116
|
storeSign?: string
|
|
114
|
-
/**
|
|
117
|
+
/** 设置请求校验函数,一般不需要设置
|
|
115
118
|
* @supported h5
|
|
116
119
|
*/
|
|
117
120
|
storeCheck?(): boolean
|
package/types/global.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare namespace TaroGeneral {
|
|
|
6
6
|
type EventCallback = (
|
|
7
7
|
/** 触发事件参数 */
|
|
8
8
|
...args: any
|
|
9
|
-
|
|
9
|
+
) => void
|
|
10
10
|
/** 通用错误 */
|
|
11
11
|
interface CallbackResult {
|
|
12
12
|
/** 错误信息 */
|
|
@@ -35,7 +35,7 @@ declare namespace TaroGeneral {
|
|
|
35
35
|
/** 阻止事件冒泡到父元素,阻止任何父事件处理程序被执行 */
|
|
36
36
|
stopPropagation: () => void
|
|
37
37
|
}
|
|
38
|
-
interface currentTarget extends Target {}
|
|
38
|
+
interface currentTarget extends Target { }
|
|
39
39
|
interface Target {
|
|
40
40
|
/** 事件源组件的id */
|
|
41
41
|
id: string
|
|
@@ -378,33 +378,33 @@ declare namespace TaroGeneral {
|
|
|
378
378
|
*/
|
|
379
379
|
13024
|
|
380
380
|
}
|
|
381
|
-
|
|
381
|
+
type EventName = string | symbol
|
|
382
382
|
// Events
|
|
383
383
|
class Events {
|
|
384
384
|
/**
|
|
385
385
|
* 监听一个事件,接受参数
|
|
386
386
|
*/
|
|
387
|
-
on(eventName:
|
|
387
|
+
on (eventName: EventName, listener: (...args: any[]) => void): this
|
|
388
388
|
|
|
389
389
|
/**
|
|
390
390
|
* 添加一个事件监听,并在事件触发完成之后移除Callbacks链
|
|
391
391
|
*/
|
|
392
|
-
once(eventName:
|
|
392
|
+
once (eventName: EventName, listener: (...args: any[]) => void): this
|
|
393
393
|
|
|
394
394
|
/**
|
|
395
395
|
* 取消监听一个事件
|
|
396
396
|
*/
|
|
397
|
-
off(eventName:
|
|
397
|
+
off (eventName: EventName, listener?: (...args: any[]) => void): this
|
|
398
398
|
|
|
399
399
|
/**
|
|
400
400
|
* 取消监听的所有事件
|
|
401
401
|
*/
|
|
402
|
-
off(): this
|
|
402
|
+
off (): this
|
|
403
403
|
|
|
404
404
|
/**
|
|
405
405
|
* 触发一个事件,传参
|
|
406
406
|
*/
|
|
407
|
-
trigger(eventName:
|
|
407
|
+
trigger (eventName: EventName, ...args: any[]): this
|
|
408
408
|
}
|
|
409
409
|
|
|
410
410
|
// ENV_TYPE
|