@tarojs/taro 3.5.5-alpha.1 → 3.5.6
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
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/taro",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.6",
|
|
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.
|
|
25
|
-
"@tarojs/runtime": "3.5.
|
|
24
|
+
"@tarojs/api": "3.5.6",
|
|
25
|
+
"@tarojs/runtime": "3.5.6"
|
|
26
26
|
},
|
|
27
27
|
"peerDependenciesMeta": {
|
|
28
28
|
"@types/react": {
|
|
@@ -215,7 +215,7 @@ declare module '../../index' {
|
|
|
215
215
|
*/
|
|
216
216
|
stopLocationUpdate(option?: stopLocationUpdate.Option): void
|
|
217
217
|
|
|
218
|
-
/** 开启小程序进入前后台时均接收位置消息,需引导用户开启[授权](
|
|
218
|
+
/** 开启小程序进入前后台时均接收位置消息,需引导用户开启[授权](../open-api/authorize/authorize.md#后台定位)。授权以后,小程序在运行中或进入后台均可接受位置消息变化。
|
|
219
219
|
*
|
|
220
220
|
* **注意**
|
|
221
221
|
* - 安卓微信7.0.6版本,iOS 7.0.5版本起支持该接口
|
|
@@ -260,6 +260,41 @@ declare module '../../index' {
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
+
namespace cropImage {
|
|
264
|
+
interface Option {
|
|
265
|
+
/** 图片路径,图片的路径,支持本地路径、代码包路径 */
|
|
266
|
+
src: string
|
|
267
|
+
/** 裁剪比例 */
|
|
268
|
+
cropScale: keyof CropScale
|
|
269
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
270
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
271
|
+
/** 接口调用失败的回调函数 */
|
|
272
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
273
|
+
/** 接口调用成功的回调函数 */
|
|
274
|
+
success?: (result: SuccessCallbackResult) => void
|
|
275
|
+
}
|
|
276
|
+
interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
|
|
277
|
+
/** 剪裁后图片的临时文件路径 (本地路径) */
|
|
278
|
+
tempFilePath: string
|
|
279
|
+
}
|
|
280
|
+
interface CropScale {
|
|
281
|
+
/** 宽高比为1比1 */
|
|
282
|
+
'1:1'
|
|
283
|
+
/** 宽高比为3比4 */
|
|
284
|
+
'3:4'
|
|
285
|
+
/** 宽高比为4比3 */
|
|
286
|
+
'4:3'
|
|
287
|
+
/** 宽高比为4比5 */
|
|
288
|
+
'4:5'
|
|
289
|
+
/** 宽高比为5比4 */
|
|
290
|
+
'5:4'
|
|
291
|
+
/** 宽高比为6比19 */
|
|
292
|
+
'6:19'
|
|
293
|
+
/** 宽高比为19比6 */
|
|
294
|
+
'19:6'
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
263
298
|
interface TaroStatic {
|
|
264
299
|
/** 保存图片到系统相册。需要[用户授权](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html) scope.writePhotosAlbum
|
|
265
300
|
* @supported weapp, rn, alipay, swan, tt
|
|
@@ -385,5 +420,23 @@ declare module '../../index' {
|
|
|
385
420
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.chooseImage.html
|
|
386
421
|
*/
|
|
387
422
|
chooseImage(option: chooseImage.Option): Promise<chooseImage.SuccessCallbackResult>
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* 裁剪图片接口
|
|
426
|
+
* @supported weapp
|
|
427
|
+
* @example
|
|
428
|
+
* ```tsx
|
|
429
|
+
* Taro.cropImage({
|
|
430
|
+
* src: '', // 图片路径
|
|
431
|
+
* cropScale: '1:1', // 裁剪比例
|
|
432
|
+
* success: function (res) {
|
|
433
|
+
* // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
|
|
434
|
+
* var tempFilePaths = res.tempFilePaths
|
|
435
|
+
* }
|
|
436
|
+
* })
|
|
437
|
+
* ```
|
|
438
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.cropImage.html
|
|
439
|
+
*/
|
|
440
|
+
cropImage(option: cropImage.Option): Promise<cropImage.SuccessCallbackResult>
|
|
388
441
|
}
|
|
389
442
|
}
|
|
@@ -44,10 +44,10 @@ 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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
* @supported weapp, qq
|
|
48
|
+
* @qq QQ支持的值: ['qq', 'qzone', 'wechatFriends', 'wechatMoment']
|
|
49
|
+
* @weapp 微信支持:['wechatFriends', 'wechatMoment'] / ['shareAppMessage', 'shareTimeline']
|
|
50
|
+
*/
|
|
51
51
|
showShareItems?: string[]
|
|
52
52
|
}
|
|
53
53
|
}
|