@tarojs/taro 3.3.8 → 3.3.12
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/html5.css +5 -5
- package/package.json +5 -5
- package/types/api/data-analysis/index.d.ts +68 -0
- package/types/api/files/index.d.ts +2 -2
- package/types/api/media/audio.d.ts +6 -2
- package/types/api/media/image.d.ts +44 -2
- package/types/api/open-api/customer-service.d.ts +41 -0
- package/types/api/open-api/settings.d.ts +5 -0
- package/types/index.d.ts +4 -3
- package/types/api/open-api/data-analysis.d.ts +0 -19
- package/types/api/open-api/report.d.ts +0 -19
package/html5.css
CHANGED
|
@@ -109,27 +109,27 @@
|
|
|
109
109
|
margin-inline-end: 0;
|
|
110
110
|
font-weight: bold;
|
|
111
111
|
}
|
|
112
|
-
:-webkit-any(.h5-article
|
|
112
|
+
:-webkit-any(.h5-article) .h5-h1 {
|
|
113
113
|
font-size: 1.5em;
|
|
114
114
|
margin-block-start: 0.83em;
|
|
115
115
|
margin-block-end: 0.83em;
|
|
116
116
|
}
|
|
117
|
-
:-webkit-any(.h5-article
|
|
117
|
+
:-webkit-any(.h5-article) :-webkit-any(.h5-article) .h5-h1 {
|
|
118
118
|
font-size: 1.17em;
|
|
119
119
|
margin-block-start: 1em;
|
|
120
120
|
margin-block-end: 1em;
|
|
121
121
|
}
|
|
122
|
-
:-webkit-any(.h5-article
|
|
122
|
+
:-webkit-any(.h5-article) :-webkit-any(.h5-article) :-webkit-any(.h5-article) .h5-h1 {
|
|
123
123
|
font-size: 1em;
|
|
124
124
|
margin-block-start: 1.33em;
|
|
125
125
|
margin-block-end: 1.33em;
|
|
126
126
|
}
|
|
127
|
-
:-webkit-any(.h5-article
|
|
127
|
+
:-webkit-any(.h5-article) :-webkit-any(.h5-article) :-webkit-any(.h5-article) :-webkit-any(.h5-article) .h5-h1 {
|
|
128
128
|
font-size: 0.83em;
|
|
129
129
|
margin-block-start: 1.67em;
|
|
130
130
|
margin-block-end: 1.67em;
|
|
131
131
|
}
|
|
132
|
-
:-webkit-any(.h5-article
|
|
132
|
+
:-webkit-any(.h5-article) :-webkit-any(.h5-article) :-webkit-any(.h5-article) :-webkit-any(.h5-article) :-webkit-any(.h5-article) .h5-h1 {
|
|
133
133
|
font-size: 0.67em;
|
|
134
134
|
margin-block-start: 2.33em;
|
|
135
135
|
margin-block-end: 2.33em;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/taro",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.12",
|
|
4
4
|
"description": "Taro framework",
|
|
5
5
|
"homepage": "https://github.com/nervjs/taro/tree/master/packages/taro#readme",
|
|
6
6
|
"main": "index.js",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"author": "O2Team",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@tarojs/api": "3.3.
|
|
30
|
-
"@tarojs/runtime": "3.3.
|
|
31
|
-
"@tarojs/taro-h5": "3.3.
|
|
29
|
+
"@tarojs/api": "3.3.12",
|
|
30
|
+
"@tarojs/runtime": "3.3.12",
|
|
31
|
+
"@tarojs/taro-h5": "3.3.12"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "0d7650ee4263efafacd87b9c8b69bb29b2a852c0"
|
|
34
34
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
declare namespace Taro {
|
|
2
|
+
/** 自定义业务数据监控上报接口。
|
|
3
|
+
*
|
|
4
|
+
* **使用说明**
|
|
5
|
+
* 使用前,需要在「小程序管理后台-运维中心-性能监控-业务数据监控」中新建监控事件,配置监控描述与告警类型。每一个监控事件对应唯一的监控ID,开发者最多可以创建128个监控事件。
|
|
6
|
+
* @supported weapp
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* Taro.reportMonitor('1', 1)
|
|
10
|
+
* ```
|
|
11
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/data-analysis/wx.reportMonitor.html
|
|
12
|
+
*/
|
|
13
|
+
function reportMonitor(
|
|
14
|
+
/** 监控ID,在「小程序管理后台」新建数据指标后获得 */
|
|
15
|
+
name: string,
|
|
16
|
+
/** 上报数值,经处理后会在「小程序管理后台」上展示每分钟的上报总量 */
|
|
17
|
+
value: number,
|
|
18
|
+
): void
|
|
19
|
+
|
|
20
|
+
/** 自定义分析数据上报接口。使用前,需要在小程序管理后台自定义分析中新建事件,配置好事件名与字段。
|
|
21
|
+
* @supported weapp
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* Taro.reportAnalytics('purchase', {
|
|
25
|
+
* price: 120,
|
|
26
|
+
* color: 'red'
|
|
27
|
+
* })
|
|
28
|
+
* ```
|
|
29
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/data-analysis/wx.reportAnalytics.html
|
|
30
|
+
*/
|
|
31
|
+
function reportAnalytics(
|
|
32
|
+
/** 事件名 */
|
|
33
|
+
eventName: string,
|
|
34
|
+
/** 上报的自定义数据,key 为配置中的字段名,value 为上报的数据。 */
|
|
35
|
+
data: General.IAnyObject,
|
|
36
|
+
): void
|
|
37
|
+
|
|
38
|
+
/** 事件上报
|
|
39
|
+
* @supported weapp
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* Taro.reportEvent('purchase', {
|
|
43
|
+
* price: 120,
|
|
44
|
+
* color: 'red'
|
|
45
|
+
* })
|
|
46
|
+
* ```
|
|
47
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/data-analysis/wx.reportEvent.html
|
|
48
|
+
*/
|
|
49
|
+
function reportEvent(
|
|
50
|
+
/** 事件名 */
|
|
51
|
+
eventId: string,
|
|
52
|
+
/** 上报的自定义数据,key 为配置中的字段名,value 为上报的数据。 */
|
|
53
|
+
data: General.IAnyObject,
|
|
54
|
+
): void
|
|
55
|
+
|
|
56
|
+
/** 给定实验参数数组,获取对应的实验参数值
|
|
57
|
+
* @supported weapp
|
|
58
|
+
* @example
|
|
59
|
+
* ```tsx
|
|
60
|
+
* Taro.getExptInfoSync(['color'])
|
|
61
|
+
* ```
|
|
62
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/data-analysis/wx.getExptInfoSync.html
|
|
63
|
+
*/
|
|
64
|
+
function getExptInfoSync(
|
|
65
|
+
/** 实验参数数组,不填则获取所有实验参数 */
|
|
66
|
+
keys?: Array<string>
|
|
67
|
+
): General.IAnyObject
|
|
68
|
+
}
|
|
@@ -469,12 +469,12 @@ declare namespace Taro {
|
|
|
469
469
|
readFileSync(
|
|
470
470
|
/** 要读取的文件的路径 */
|
|
471
471
|
filePath: string,
|
|
472
|
+
/** 指定读取文件的字符编码,如果不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 */
|
|
473
|
+
encoding?: keyof FileSystemManager.encoding,
|
|
472
474
|
/**从文件指定位置开始读,如果不指定,则从文件头开始读。读取的范围应该是左闭右开区间 [position, position+length)。有效范围:[0, fileLength - 1]。单位:byte */
|
|
473
475
|
position?: number,
|
|
474
476
|
/**指定文件的长度,如果不指定,则读到文件末尾。有效范围:[1, fileLength]。单位:byte */
|
|
475
477
|
length?: number,
|
|
476
|
-
/** 指定读取文件的字符编码,如果不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 */
|
|
477
|
-
encoding?: keyof FileSystemManager.encoding,
|
|
478
478
|
): string | ArrayBuffer
|
|
479
479
|
/** 获取文件的状态信息
|
|
480
480
|
* @supported weapp
|
|
@@ -18,7 +18,7 @@ declare namespace Taro {
|
|
|
18
18
|
* success: function (res) {
|
|
19
19
|
* const filePath = res.tempFilePath
|
|
20
20
|
* Taro.playVoice({ filePath })
|
|
21
|
-
*
|
|
21
|
+
*
|
|
22
22
|
* setTimeout(Taro.stopVoice, 5000)
|
|
23
23
|
* }
|
|
24
24
|
* })
|
|
@@ -28,7 +28,7 @@ declare namespace Taro {
|
|
|
28
28
|
* Taro.startRecord(params).then(res => {
|
|
29
29
|
* const filePath = res.tempFilePath
|
|
30
30
|
* Taro.playVoice({ filePath })
|
|
31
|
-
*
|
|
31
|
+
*
|
|
32
32
|
* setTimeout(Taro.stopVoice, 5000)
|
|
33
33
|
* })
|
|
34
34
|
* ```
|
|
@@ -299,6 +299,10 @@ declare namespace Taro {
|
|
|
299
299
|
* @default 1
|
|
300
300
|
*/
|
|
301
301
|
volume: number
|
|
302
|
+
/** 播放速度。范围 0.5-2.0。
|
|
303
|
+
* @default 1
|
|
304
|
+
*/
|
|
305
|
+
playbackRate: number
|
|
302
306
|
/** 播放 */
|
|
303
307
|
play(): void
|
|
304
308
|
/** 暂停 */
|
|
@@ -27,10 +27,14 @@ declare namespace Taro {
|
|
|
27
27
|
interface Option {
|
|
28
28
|
/** 需要预览的图片链接列表。 */
|
|
29
29
|
urls: string[]
|
|
30
|
-
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
31
|
-
complete?: (res: General.CallbackResult) => void
|
|
32
30
|
/** 当前显示图片的链接 */
|
|
33
31
|
current?: string
|
|
32
|
+
/** @support weapp 最低版本:2.13.0。是否显示长按菜单,默认值:true */
|
|
33
|
+
showmenu?: boolean
|
|
34
|
+
/** @support weapp 最低版本:2.13.0。origin: 发送完整的referrer; no-referrer: 不发送。格式固定为 https://servicewechat.com/{appid}/{version}/page-frame.html,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本;默认值:no-referrer */
|
|
35
|
+
referrerPolicy?: string
|
|
36
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
37
|
+
complete?: (res: General.CallbackResult) => void
|
|
34
38
|
/** 接口调用失败的回调函数 */
|
|
35
39
|
fail?: (res: General.CallbackResult) => void
|
|
36
40
|
/** 接口调用成功的回调函数 */
|
|
@@ -50,6 +54,44 @@ declare namespace Taro {
|
|
|
50
54
|
*/
|
|
51
55
|
function previewImage(option: previewImage.Option): Promise<General.CallbackResult>
|
|
52
56
|
|
|
57
|
+
namespace previewMedia {
|
|
58
|
+
interface Sources {
|
|
59
|
+
/** 图片或视频的地址 */
|
|
60
|
+
url: string
|
|
61
|
+
/** 资源的类型(图片或视频),默认值:image */
|
|
62
|
+
type?: 'image' | 'video'
|
|
63
|
+
/** 视频的封面图片 */
|
|
64
|
+
poster?: string
|
|
65
|
+
}
|
|
66
|
+
interface Option {
|
|
67
|
+
/** 需要预览的资源列表 */
|
|
68
|
+
sources: Sources[]
|
|
69
|
+
/** 当前显示的资源序号,默认值:0 */
|
|
70
|
+
current?: number
|
|
71
|
+
/** 是否显示长按菜单 2.13.0,默认值:true */
|
|
72
|
+
showmenu?: boolean
|
|
73
|
+
/** origin: 发送完整的referrer; no-referrer: 不发送。格式固定为 https://servicewechat.com/{appid}/{version}/page-frame.html,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本;默认值:no-referrer */
|
|
74
|
+
referrerPolicy?: string
|
|
75
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
76
|
+
complete?: (res: General.CallbackResult) => void
|
|
77
|
+
/** 接口调用失败的回调函数 */
|
|
78
|
+
fail?: (res: General.CallbackResult) => void
|
|
79
|
+
/** 接口调用成功的回调函数 */
|
|
80
|
+
success?: (res: General.CallbackResult) => void
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/** 预览图片和视频。
|
|
84
|
+
* @supported weapp 基础库 2.12.0 开始支持,低版本需做兼容处理。
|
|
85
|
+
* @example
|
|
86
|
+
* ```tsx
|
|
87
|
+
* Taro.previewMedia({
|
|
88
|
+
* sources: []
|
|
89
|
+
* })
|
|
90
|
+
* ```
|
|
91
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.previewMedia.html
|
|
92
|
+
*/
|
|
93
|
+
function previewMedia(option: previewMedia.Option): Promise<General.CallbackResult>
|
|
94
|
+
|
|
53
95
|
namespace getImageInfo {
|
|
54
96
|
interface Option {
|
|
55
97
|
/** 图片的路径,可以是相对路径、临时文件路径、存储文件路径、网络图片路径 */
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
declare namespace Taro {
|
|
2
|
+
namespace openCustomerServiceChat {
|
|
3
|
+
interface ExtInfo {
|
|
4
|
+
url: string
|
|
5
|
+
}
|
|
6
|
+
interface Option {
|
|
7
|
+
/** 客服信息 */
|
|
8
|
+
extInfo: ExtInfo
|
|
9
|
+
/** 企业ID */
|
|
10
|
+
corpId: string
|
|
11
|
+
/** 是否发送小程序气泡消息,默认值:false */
|
|
12
|
+
showMessageCard?: boolean
|
|
13
|
+
/** 气泡消息标题 */
|
|
14
|
+
sendMessageTitle?: string
|
|
15
|
+
/** 气泡消息小程序路径 */
|
|
16
|
+
sendMessagePath?: string
|
|
17
|
+
/** 气泡消息图片 */
|
|
18
|
+
sendMessageImg?: string
|
|
19
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
20
|
+
complete?: (res: General.CallbackResult) => void
|
|
21
|
+
/** 接口调用失败的回调函数 */
|
|
22
|
+
fail?: (res: General.CallbackResult) => void
|
|
23
|
+
/** 接口调用成功的回调函数 */
|
|
24
|
+
success?: (result: General.CallbackResult) => void
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** 打开微信客服。了解更多信息,可以参考微信客服介绍:https://work.weixin.qq.com/kf/。
|
|
29
|
+
* @supported weapp 基础库 2.19.0 开始支持,低版本需做兼容处理。
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* Taro.openCustomerServiceChat({
|
|
33
|
+
* extInfo: {url: ''},
|
|
34
|
+
* corpId: '',
|
|
35
|
+
* success: function (res) { }
|
|
36
|
+
* })
|
|
37
|
+
* ```
|
|
38
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/service-chat/wx.openCustomerServiceChat.html
|
|
39
|
+
*/
|
|
40
|
+
function openCustomerServiceChat(option?: openCustomerServiceChat.Option): Promise<General.CallbackResult>
|
|
41
|
+
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
declare namespace Taro {
|
|
2
2
|
namespace openSetting {
|
|
3
3
|
interface Option {
|
|
4
|
+
/**
|
|
5
|
+
* 是否同时获取用户订阅消息的订阅状态,默认不获取。注意:withSubscriptions 只返回用户勾选过订阅面板中的“总是保持以上选择,不再询问”的订阅消息。
|
|
6
|
+
* 最低版本:2.10.3
|
|
7
|
+
*/
|
|
8
|
+
withSubscriptions?: boolean
|
|
4
9
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
5
10
|
complete?: (res: General.CallbackResult) => void
|
|
6
11
|
/** 接口调用失败的回调函数 */
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Taro 类型定义文件
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* 目录结构
|
|
5
5
|
* ├── api 小程序端能力 API
|
|
6
6
|
* │ ├── ad
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
* │ │ ├── soter.d.ts 开放接口 -> 生物认证 API
|
|
82
82
|
* | | ├── subscribe-message.d.ts 开放接口 -> 订阅消息 API
|
|
83
83
|
* │ │ ├── user-info.d.ts 开放接口 -> 用户信息 API
|
|
84
|
+
* │ │ ├── customer-service.d.ts 开放接口 -> 微信客服 API
|
|
84
85
|
* │ │ └── werun.d.ts 开放接口 -> 微信运动 API
|
|
85
86
|
* │ ├── route
|
|
86
87
|
* │ │ └── index.d.ts 路由 API
|
|
@@ -143,6 +144,7 @@
|
|
|
143
144
|
/// <reference path="api/base/env.d.ts" />
|
|
144
145
|
/// <reference path="api/canvas/index.d.ts" />
|
|
145
146
|
/// <reference path="api/cloud/index.d.ts" />
|
|
147
|
+
/// <reference path="api/data-analysis/index.d.ts" />
|
|
146
148
|
/// <reference path="api/device/accelerometer.d.ts" />
|
|
147
149
|
/// <reference path="api/device/battery.d.ts" />
|
|
148
150
|
/// <reference path="api/device/ble.d.ts" />
|
|
@@ -185,18 +187,17 @@
|
|
|
185
187
|
/// <reference path="api/open-api/address.d.ts" />
|
|
186
188
|
/// <reference path="api/open-api/authorize.d.ts" />
|
|
187
189
|
/// <reference path="api/open-api/card.d.ts" />
|
|
188
|
-
/// <reference path="api/open-api/data-analysis.d.ts" />
|
|
189
190
|
/// <reference path="api/open-api/facial.d.ts" />
|
|
190
191
|
/// <reference path="api/open-api/invoice.d.ts" />
|
|
191
192
|
/// <reference path="api/open-api/login.d.ts" />
|
|
192
193
|
/// <reference path="api/open-api/navigate.d.ts" />
|
|
193
194
|
/// <reference path="api/open-api/payment.d.ts" />
|
|
194
|
-
/// <reference path="api/open-api/report.d.ts" />
|
|
195
195
|
/// <reference path="api/open-api/settings.d.ts" />
|
|
196
196
|
/// <reference path="api/open-api/soter.d.ts" />
|
|
197
197
|
/// <reference path="api/open-api/subscribe-message.d.ts" />
|
|
198
198
|
/// <reference path="api/open-api/user-info.d.ts" />
|
|
199
199
|
/// <reference path="api/open-api/werun.d.ts" />
|
|
200
|
+
/// <reference path="api/open-api/customer-service.d.ts" />
|
|
200
201
|
/// <reference path="api/route/index.d.ts" />
|
|
201
202
|
/// <reference path="api/share/index.d.ts" />
|
|
202
203
|
/// <reference path="api/storage/background-fetch.d.ts" />
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
declare namespace Taro {
|
|
2
|
-
/** 自定义分析数据上报接口。使用前,需要在小程序管理后台自定义分析中新建事件,配置好事件名与字段。
|
|
3
|
-
* @supported weapp
|
|
4
|
-
* @example
|
|
5
|
-
* ```tsx
|
|
6
|
-
* Taro.reportAnalytics('purchase', {
|
|
7
|
-
* price: 120,
|
|
8
|
-
* color: 'red'
|
|
9
|
-
* })
|
|
10
|
-
* ```
|
|
11
|
-
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/data-analysis/wx.reportAnalytics.html
|
|
12
|
-
*/
|
|
13
|
-
function reportAnalytics(
|
|
14
|
-
/** 事件名 */
|
|
15
|
-
eventName: string,
|
|
16
|
-
/** 上报的自定义数据,key 为配置中的字段名,value 为上报的数据。 */
|
|
17
|
-
data: General.IAnyObject,
|
|
18
|
-
): void
|
|
19
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
declare namespace Taro {
|
|
2
|
-
/** 自定义业务数据监控上报接口。
|
|
3
|
-
*
|
|
4
|
-
* **使用说明**
|
|
5
|
-
* 使用前,需要在「小程序管理后台-运维中心-性能监控-业务数据监控」中新建监控事件,配置监控描述与告警类型。每一个监控事件对应唯一的监控ID,开发者最多可以创建128个监控事件。
|
|
6
|
-
* @supported weapp
|
|
7
|
-
* @example
|
|
8
|
-
* ```tsx
|
|
9
|
-
* Taro.reportMonitor('1', 1)
|
|
10
|
-
* ```
|
|
11
|
-
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/report/wx.reportMonitor.html
|
|
12
|
-
*/
|
|
13
|
-
function reportMonitor(
|
|
14
|
-
/** 监控ID,在「小程序管理后台」新建数据指标后获得 */
|
|
15
|
-
name: string,
|
|
16
|
-
/** 上报数值,经处理后会在「小程序管理后台」上展示每分钟的上报总量 */
|
|
17
|
-
value: number,
|
|
18
|
-
): void
|
|
19
|
-
}
|