@tarojs/taro 3.4.13 → 3.4.14

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.4.13",
3
+ "version": "3.4.14",
4
4
  "description": "Taro framework",
5
5
  "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro#readme",
6
6
  "main": "index.js",
@@ -24,9 +24,9 @@
24
24
  "author": "O2Team",
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
- "@tarojs/api": "3.4.13",
28
- "@tarojs/runtime": "3.4.13",
29
- "@tarojs/taro-h5": "3.4.13"
27
+ "@tarojs/api": "3.4.14",
28
+ "@tarojs/runtime": "3.4.14",
29
+ "@tarojs/taro-h5": "3.4.14"
30
30
  },
31
- "gitHead": "60b897aad8c59e3912499de68d32ed768d9ba60c"
31
+ "gitHead": "19fa8893aafe1e4ea736d071209a86fcfbacc5fe"
32
32
  }
@@ -4,7 +4,7 @@ declare module '../../index' {
4
4
  namespace canvasToTempFilePath {
5
5
  interface Option {
6
6
  /** 画布标识,传入 [canvas](/docs/components/canvas) 组件实例 (canvas type="2d" 时使用该属性)。 */
7
- canvas?: CanvasProps
7
+ canvas?: Canvas
8
8
  /** 画布标识,传入 [canvas](/docs/components/canvas) 组件的 canvas-id */
9
9
  canvasId?: string
10
10
  /** 图片的质量,目前仅对 jpg 有效。取值范围为 (0, 1],不在范围内时当作 1.0 处理。 */
@@ -3,6 +3,8 @@ import Taro from '../../index'
3
3
  declare module '../../index' {
4
4
  namespace vibrateShort {
5
5
  interface Option {
6
+ /** 震动强度类型,有效值为:heavy、medium、light */
7
+ type: 'heavy' | 'medium' | 'light'
6
8
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
7
9
  complete?: (res: TaroGeneral.CallbackResult) => void
8
10
  /** 接口调用失败的回调函数 */
@@ -25,6 +27,8 @@ declare module '../../index' {
25
27
 
26
28
  interface TaroStatic {
27
29
  /** 使手机发生较短时间的振动(15 ms)。仅在 iPhone `7 / 7 Plus` 以上及 Android 机型生效
30
+ * @h5 不支持 type 参数
31
+ * @rn 不支持 type 参数
28
32
  * @supported weapp, h5, rn, tt
29
33
  * @example
30
34
  * ```tsx
@@ -188,6 +188,26 @@ declare module '../../index' {
188
188
  }
189
189
  }
190
190
 
191
+ namespace getFuzzyLocation {
192
+ interface Option {
193
+ /** wgs84 返回 gps 坐标,gcj02 返回可用于 Taro.openLocation 的坐标 */
194
+ type?: 'wgs84' | 'gcj02'
195
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
196
+ complete?: (res: TaroGeneral.CallbackResult) => void
197
+ /** 接口调用失败的回调函数 */
198
+ fail?: (res: TaroGeneral.CallbackResult) => void
199
+ /** 接口调用成功的回调函数 */
200
+ success?: (result: SuccessCallbackResult) => void
201
+ }
202
+
203
+ interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
204
+ /** 纬度,范围为 -90~90,负数表示南纬 */
205
+ latitude: string
206
+ /** 经度,范围为 -180~180,负数表示西经 */
207
+ longitude: string
208
+ }
209
+ }
210
+
191
211
  interface TaroStatic {
192
212
  /** 关闭监听实时位置变化,前后台都停止消息接收
193
213
  * @supported weapp, rn, tt
@@ -329,5 +349,21 @@ declare module '../../index' {
329
349
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.chooseLocation.html
330
350
  */
331
351
  chooseLocation(option: chooseLocation.Option): Promise<chooseLocation.SuccessCallbackResult>
352
+
353
+ /** 获取当前的模糊地理位置
354
+ * @supported weapp
355
+ * @example
356
+ * ```tsx
357
+ * Taro.getFuzzyLocation({
358
+ * type: 'wgs84',
359
+ * success (res) {
360
+ * const latitude = res.latitude
361
+ * const longitude = res.longitude
362
+ * },
363
+ * })
364
+ * ```
365
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.getFuzzyLocation.html
366
+ */
367
+ getFuzzyLocation(option: getFuzzyLocation.Option): Promise<getFuzzyLocation.SuccessCallbackResult>
332
368
  }
333
369
  }
@@ -26,6 +26,26 @@ declare module '../../index' {
26
26
  tempFilePath: string
27
27
  /** 调用结果 */
28
28
  errMsg: string
29
+ /**
30
+ * 开发者服务器返回的 HTTP Response Header
31
+ * @supported weapp
32
+ * @weapp 非官方文档标注属性
33
+ */
34
+ header?: TaroGeneral.IAnyObject
35
+ /**
36
+ * 数据长度,单位 Byte
37
+ * @supported weapp
38
+ * @weapp 非官方文档标注属性
39
+ */
40
+ dataLength?: number
41
+ /**
42
+ * cookies
43
+ * @supported weapp
44
+ * @weapp 非官方文档标注属性
45
+ */
46
+ cookies?: string[]
47
+ /** 网络请求过程中一些调试信息 */
48
+ profile?: TaroGeneral.IAnyObject
29
49
  }
30
50
  }
31
51
 
@@ -59,10 +79,9 @@ declare module '../../index' {
59
79
  totalBytesWritten: number
60
80
  }
61
81
 
62
- type DownloadTaskPromise = Promise<DownloadTask> & {
82
+ type DownloadTaskPromise = Promise<downloadFile.FileSuccessCallbackResult> & DownloadTask & {
63
83
  headersReceive: DownloadTask['onHeadersReceived'],
64
- progress: DownloadTask['onProgressUpdate'],
65
- abort: DownloadTask['abort']
84
+ progress: DownloadTask['onProgressUpdate']
66
85
  }
67
86
  }
68
87
 
@@ -35,6 +35,18 @@ declare module '../../index' {
35
35
  statusCode: number
36
36
  /** 调用结果 */
37
37
  errMsg: string
38
+ /**
39
+ * 开发者服务器返回的 HTTP Response Header
40
+ * @supported weapp
41
+ * @weapp 非官方文档标注属性
42
+ */
43
+ header?: TaroGeneral.IAnyObject
44
+ /**
45
+ * cookies
46
+ * @supported weapp
47
+ * @weapp 非官方文档标注属性
48
+ */
49
+ cookies?: string[]
38
50
  }
39
51
  }
40
52
 
@@ -68,10 +80,9 @@ declare module '../../index' {
68
80
  totalBytesSent: number
69
81
  }
70
82
 
71
- type UploadTaskPromise = Promise<UploadTask> & {
83
+ type UploadTaskPromise = Promise<uploadFile.SuccessCallbackResult> & UploadTask & {
72
84
  headersReceive: UploadTask['onHeadersReceived'],
73
- progress: UploadTask['onProgressUpdate'],
74
- abort: UploadTask['abort']
85
+ progress: UploadTask['onProgressUpdate']
75
86
  }
76
87
  }
77
88
 
@@ -9,7 +9,7 @@ declare module './index' {
9
9
  duration?: number
10
10
  }
11
11
 
12
- interface RequestParams<T> extends request.Option<T, any> {
12
+ interface RequestParams<T=any> extends request.Option<T, any> {
13
13
  [propName: string]: any
14
14
  }
15
15