@tarojs/taro 3.5.4 → 3.5.5-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.5.4",
3
+ "version": "3.5.5-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,8 +21,8 @@
21
21
  "author": "O2Team",
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
- "@tarojs/api": "3.5.4",
25
- "@tarojs/runtime": "3.5.4"
24
+ "@tarojs/api": "3.5.5-alpha.0",
25
+ "@tarojs/runtime": "3.5.5-alpha.0"
26
26
  },
27
27
  "peerDependenciesMeta": {
28
28
  "@types/react": {
@@ -126,6 +126,21 @@ declare module '../../index' {
126
126
  }
127
127
  }
128
128
 
129
+ namespace createOffscreenCanvas {
130
+ interface Option {
131
+ /** 创建的离屏 canvas 类型
132
+ * @default: 'webgl'
133
+ */
134
+ type?: 'webgl' | '2d'
135
+ /** 画布高度 */
136
+ height?: number
137
+ /** 画布宽度 */
138
+ width?: number
139
+ /** 在自定义组件下,当前组件实例的 this,以操作组件内 [canvas](/docs/components/canvas) 组件 */
140
+ component?: TaroGeneral.IAnyObject,
141
+ }
142
+ }
143
+
129
144
  /** Canvas 实例,可通过 SelectorQuery 获取。
130
145
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Canvas.html
131
146
  */
@@ -1705,8 +1720,13 @@ declare module '../../index' {
1705
1720
  /** 创建离屏 canvas 实例
1706
1721
  * @supported weapp
1707
1722
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.createOffscreenCanvas.html
1723
+ *
1724
+ * 有两个版本的写法:
1725
+ *
1726
+ * - createOffscreenCanvas(options) 从 2.16.1 起支持
1727
+ * - createOffscreenCanvas(width, height, this) 从 2.7.0 起支持
1708
1728
  */
1709
- createOffscreenCanvas(): OffscreenCanvas
1729
+ createOffscreenCanvas(options: createOffscreenCanvas.Option): OffscreenCanvas
1710
1730
 
1711
1731
  /** 创建 canvas 的绘图上下文 [CanvasContext](/docs/apis/canvas/CanvasContext) 对象
1712
1732
  *
@@ -79,9 +79,9 @@ declare module '../../index' {
79
79
  /** 详细地址 */
80
80
  address: string
81
81
  /** 纬度,浮点数,范围为-90~90,负数表示南纬。使用 gcj02 国测局坐标系 */
82
- latitude: string
82
+ latitude: number
83
83
  /** 经度,浮点数,范围为-180~180,负数表示西经。使用 gcj02 国测局坐标系 */
84
- longitude: string
84
+ longitude: number
85
85
  }
86
86
  }
87
87
 
@@ -109,9 +109,9 @@ declare module '../../index' {
109
109
  /** 详细地址 */
110
110
  address: string
111
111
  /** 纬度,浮点数,范围为-90~90,负数表示南纬。使用 gcj02 国测局坐标系 */
112
- latitude: string
112
+ latitude: number
113
113
  /** 经度,浮点数,范围为-180~180,负数表示西经。使用 gcj02 国测局坐标系 */
114
- longitude: string
114
+ longitude: number
115
115
  /** 位置名称 */
116
116
  name: string
117
117
  /** 调用结果 */
@@ -202,9 +202,9 @@ declare module '../../index' {
202
202
 
203
203
  interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
204
204
  /** 纬度,范围为 -90~90,负数表示南纬 */
205
- latitude: string
205
+ latitude: number
206
206
  /** 经度,范围为 -180~180,负数表示西经 */
207
- longitude: string
207
+ longitude: number
208
208
  }
209
209
  }
210
210
 
@@ -85,6 +85,81 @@ declare module '../../index' {
85
85
  }
86
86
  }
87
87
 
88
+ namespace openBusinessView {
89
+ /**
90
+ * 业务参数:需要传递给支付分的业务数据
91
+ * @interface ExtraData
92
+ */
93
+ interface ExtraData {
94
+ /**
95
+ * 商户号:微信支付分配的商户号。
96
+ * 示例值:1230000109
97
+ * @type {string[1,32]}
98
+ * @memberof ExtraData
99
+ */
100
+ mch_id: string
101
+ /**
102
+ * 服务ID
103
+ * 示例值:88888888000011
104
+ * @type {string[1,32]}
105
+ * @memberof ExtraData
106
+ */
107
+ service_id: string
108
+ /**
109
+ * 商户服务订单号:商户系统内部服务订单号(不是交易单号)。
110
+ * 示例值:234323JKHDFE1243252
111
+ * @type {string[1,32]}
112
+ * @memberof ExtraData
113
+ */
114
+ out_order_no: string
115
+ /**
116
+ * 时间戳:生成签名时间戳,单位秒。
117
+ * 示例值:1530097563
118
+ * @type {string[1,32]}
119
+ * @memberof ExtraData
120
+ */
121
+ timestamp: string
122
+ /**
123
+ * 随机字符串:生成签名随机串。由数字、大小写字母组成,长度不超过32位。
124
+ * 示例值:zyx53Nkey8o4bHpxTQvd8m7e92nG5mG2
125
+ * @type {string[1,32]}
126
+ * @memberof ExtraData
127
+ */
128
+ nonce_str: string
129
+ /**
130
+ * 签名方式:签名类型,仅支持HMAC-SHA256。
131
+ * 示例值:HMAC-SHA256
132
+ * @type {string[1,32]}
133
+ * @memberof ExtraData
134
+ */
135
+ sign_type: string
136
+ /**
137
+ * 签名:使用字段mch_id、service_id、out_order_no、timestamp、nonce_str、sign_type按照签名生成算法计算得出的签名值。
138
+ * 示例值:029B52F67573D7E3BE74904BF9AEA
139
+ * @type {string[1,64]}
140
+ * @memberof ExtraData
141
+ */
142
+ sign: string
143
+ }
144
+
145
+ interface Option {
146
+ /**
147
+ * 跳转类型:固定配置:wxpayScoreDetail
148
+ * 示例值:wxpayScoreDetail
149
+ * @type {string[1,16]}
150
+ * @memberof Option
151
+ */
152
+ businessType: string
153
+ extraData: ExtraData
154
+ /** 接口调用成功的回调函数 */
155
+ success?: (res: TaroGeneral.CallbackResult) => void
156
+ /** 接口调用失败的回调函数 */
157
+ fail?: (res: TaroGeneral.CallbackResult) => void
158
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
159
+ complete?: (res: TaroGeneral.CallbackResult) => void
160
+ }
161
+ }
162
+
88
163
  interface TaroStatic {
89
164
  /** 打开半屏小程序。接入指引请参考 [半屏小程序能力](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/openEmbeddedMiniProgram.html)。
90
165
  * @supported weapp
@@ -153,5 +228,40 @@ declare module '../../index' {
153
228
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/navigate/wx.exitMiniProgram.html
154
229
  */
155
230
  exitMiniProgram(option?: exitMiniProgram.Option): Promise<TaroGeneral.CallbackResult>
231
+
232
+ /** 商户通过调用订单详情接口打开微信支付分小程序,引导用户查看订单详情(小程序端)
233
+ * @supported weapp
234
+ * @example
235
+ * ```tsx
236
+ * if (Taro.openBusinessView) {
237
+ * Taro.openBusinessView({
238
+ * businessType: 'wxpayScoreDetail',
239
+ * extraData: {
240
+ * mch_id: '1230000109',
241
+ * service_id: '88888888000011',
242
+ * out_order_no: '1234323JKHDFE1243252',
243
+ * timestamp: '1530097563',
244
+ * nonce_str: 'zyx53Nkey8o4bHpxTQvd8m7e92nG5mG2',
245
+ * sign_type: 'HMAC-SHA256',
246
+ * sign: '029B52F67573D7E3BE74904BF9AEA'
247
+ * },
248
+ * success() {
249
+ * //dosomething
250
+ * },
251
+ * fail() {
252
+ * //dosomething
253
+ * },
254
+ * complete() {
255
+ * //dosomething
256
+ * }
257
+ * });
258
+ * } else {
259
+ * //引导用户升级微信版本
260
+ * }
261
+ * ```
262
+ *
263
+ * @see https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter6_1_25.shtml
264
+ */
265
+ openBusinessView(option: openBusinessView.Option): Promise<TaroGeneral.CallbackResult>
156
266
  }
157
267
  }
@@ -44,8 +44,9 @@ declare module '../../index' {
44
44
  /** 是否使用带 shareTicket 的转发[详情](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) */
45
45
  withShareTicket?: boolean
46
46
  /** QQ小程序分享功能,支持分享到QQ、QQ空间、微信好友、微信朋友圈
47
- * 支持的值: ['qq', 'qzone', 'wechatFriends', 'wechatMoment']
48
- * @supported qq
47
+ * QQ支持的值: ['qq', 'qzone', 'wechatFriends', 'wechatMoment']
48
+ * 微信支持:['wechatFriends', 'wechatMoment'] / ['shareAppMessage', 'shareTimeline']
49
+ * @supported qq/weapp
49
50
  */
50
51
  showShareItems?: string[]
51
52
  }
@@ -178,7 +179,7 @@ declare module '../../index' {
178
179
  * ```
179
180
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.updateShareMenu.html
180
181
  */
181
- updateShareMenu(option: updateShareMenu.Option): Promise<TaroGeneral.CallbackResult>
182
+ updateShareMenu (option: updateShareMenu.Option): Promise<TaroGeneral.CallbackResult>
182
183
 
183
184
  /** 显示当前页面的转发按钮
184
185
  * @supported weapp, qq, tt
@@ -190,7 +191,7 @@ declare module '../../index' {
190
191
  * ```
191
192
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.showShareMenu.html
192
193
  */
193
- showShareMenu(option: showShareMenu.Option): Promise<TaroGeneral.CallbackResult>
194
+ showShareMenu (option: showShareMenu.Option): Promise<TaroGeneral.CallbackResult>
194
195
 
195
196
  /** 打开分享图片弹窗,可以将图片发送给朋友、收藏或下载
196
197
  * @supported weapp
@@ -207,7 +208,7 @@ declare module '../../index' {
207
208
  * ```
208
209
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.showShareImageMenu.html
209
210
  */
210
- showShareImageMenu(option: showShareImageMenu.Option): Promise<TaroGeneral.CallbackResult>
211
+ showShareImageMenu (option: showShareImageMenu.Option): Promise<TaroGeneral.CallbackResult>
211
212
 
212
213
  /** 转发视频到聊天
213
214
  * @supported weapp
@@ -242,13 +243,13 @@ declare module '../../index' {
242
243
  * ```
243
244
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.shareVideoMessage.html
244
245
  */
245
- shareVideoMessage(option: shareVideoMessage.Option): Promise<TaroGeneral.CallbackResult>
246
+ shareVideoMessage (option: shareVideoMessage.Option): Promise<TaroGeneral.CallbackResult>
246
247
 
247
248
  /** 转发文件到聊天
248
249
  * @supported weapp
249
250
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.shareFileMessage.html
250
251
  */
251
- shareFileMessage(option: shareFileMessage.Option): Promise<TaroGeneral.CallbackResult>
252
+ shareFileMessage (option: shareFileMessage.Option): Promise<TaroGeneral.CallbackResult>
252
253
 
253
254
  /** 监听用户点击右上角菜单的「复制链接」按钮时触发的事件
254
255
  *
@@ -256,7 +257,7 @@ declare module '../../index' {
256
257
  * @supported weapp
257
258
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.onCopyUrl.html
258
259
  */
259
- onCopyUrl(
260
+ onCopyUrl (
260
261
  /** 用户点击右上角菜单的「复制链接」按钮时触发的事件的回调函数 */
261
262
  callback: onCopyUrl.Callback,
262
263
  ): void
@@ -267,7 +268,7 @@ declare module '../../index' {
267
268
  * @supported weapp
268
269
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.offCopyUrl.html
269
270
  */
270
- offCopyUrl(
271
+ offCopyUrl (
271
272
  /** 用户点击右上角菜单的「复制链接」按钮时触发的事件的回调函数 */
272
273
  callback: onCopyUrl.Callback,
273
274
  ): void
@@ -280,7 +281,7 @@ declare module '../../index' {
280
281
  * ```
281
282
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.hideShareMenu.html
282
283
  */
283
- hideShareMenu(option?: hideShareMenu.Option): Promise<TaroGeneral.CallbackResult>
284
+ hideShareMenu (option?: hideShareMenu.Option): Promise<TaroGeneral.CallbackResult>
284
285
 
285
286
  /** 获取转发详细信息
286
287
  *
@@ -297,7 +298,7 @@ declare module '../../index' {
297
298
  * ```
298
299
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.getShareInfo.html
299
300
  */
300
- getShareInfo(option: getShareInfo.Option): Promise<getShareInfo.SuccessCallbackResult>
301
+ getShareInfo (option: getShareInfo.Option): Promise<getShareInfo.SuccessCallbackResult>
301
302
 
302
303
  /** 验证私密消息
303
304
  * @supported weapp
@@ -322,6 +323,6 @@ declare module '../../index' {
322
323
  * ```
323
324
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.authPrivateMessage.html
324
325
  */
325
- authPrivateMessage(option: authPrivateMessage.Option): Promise<authPrivateMessage.SuccessCallbackResult>
326
+ authPrivateMessage (option: authPrivateMessage.Option): Promise<authPrivateMessage.SuccessCallbackResult>
326
327
  }
327
328
  }