@tarojs/taro 3.4.2 → 3.4.3

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.2",
3
+ "version": "3.4.3",
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.2",
28
- "@tarojs/runtime": "3.4.2",
29
- "@tarojs/taro-h5": "3.4.2"
27
+ "@tarojs/api": "3.4.3",
28
+ "@tarojs/runtime": "3.4.3",
29
+ "@tarojs/taro-h5": "3.4.3"
30
30
  },
31
- "gitHead": "26b329326c6a7da652e8d712ee33df01ab8d2d0e"
31
+ "gitHead": "de55da7a845e9c09ba65528e74c7310e5082c2d5"
32
32
  }
@@ -690,6 +690,21 @@ declare module '../../index' {
690
690
  * @see https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-sdk-api/Cloud.database.html
691
691
  */
692
692
  database(config?: cloud.IConfig): DB.Database
693
+
694
+ /** 调用云托管服务
695
+ * @supported weapp
696
+ * @example
697
+ * 假设已经初始化了一个叫c1的云开发实例,并发起云托管调用
698
+ *
699
+ * ``` tsx
700
+ * const r = await c1.callContainer({
701
+ * path: '/path/to/container', // 填入容器的访问路径
702
+ * method: 'POST',
703
+ * })
704
+ * ```
705
+ * @see https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-sdk-api/container/Cloud.callContainer.html
706
+ */
707
+ callContainer < R = any, P = any >(params: cloud.CallContainerParam<P>): Promise<cloud.CallContainerResult<R>>
693
708
  }
694
709
 
695
710
  namespace DB {
@@ -2,7 +2,7 @@ import Taro from '../../index'
2
2
 
3
3
  declare module '../../index' {
4
4
  namespace request {
5
- interface Option < U extends string | TaroGeneral.IAnyObject | ArrayBuffer = any | any > {
5
+ interface Option <T = any, U extends string | TaroGeneral.IAnyObject | ArrayBuffer = any | any > {
6
6
  /** 开发者服务器接口地址 */
7
7
  url: string
8
8
  /** 请求的参数 */
@@ -55,7 +55,7 @@ declare module '../../index' {
55
55
  */
56
56
  enableChunked?: boolean
57
57
  /** 接口调用成功的回调函数 */
58
- success?: (result: SuccessCallbackResult) => void
58
+ success?: (result: SuccessCallbackResult<T>) => void
59
59
  /** 接口调用失败的回调函数 */
60
60
  fail?: (res: TaroGeneral.CallbackResult) => void
61
61
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
@@ -367,7 +367,7 @@ declare module '../../index' {
367
367
  * ```
368
368
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/network/request/wx.request.html
369
369
  */
370
- request<T = any, U = any>(option: request.Option<U>): RequestTask<T>
370
+ request<T = any, U = any>(option: request.Option<T,U>): RequestTask<T>
371
371
 
372
372
  /** 可以使用拦截器在请求发出前或发出后做一些额外操作。
373
373
  *
@@ -5,7 +5,6 @@ declare module '../../index' {
5
5
  interface Option {
6
6
  /**
7
7
  * 是否同时获取用户订阅消息的订阅状态,默认不获取。注意:withSubscriptions 只返回用户勾选过订阅面板中的“总是保持以上选择,不再询问”的订阅消息。
8
- * 最低版本:2.10.3
9
8
  */
10
9
  withSubscriptions?: boolean
11
10
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
@@ -28,6 +27,10 @@ declare module '../../index' {
28
27
 
29
28
  namespace getSetting {
30
29
  interface Option {
30
+ /**
31
+ * 是否同时获取用户订阅消息的订阅状态,默认不获取。注意:withSubscriptions 只返回用户勾选过订阅面板中的“总是保持以上选择,不再询问”的订阅消息。
32
+ */
33
+ withSubscriptions?: boolean
31
34
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
32
35
  complete?: (res: TaroGeneral.CallbackResult) => void
33
36
  /** 接口调用失败的回调函数 */
@@ -9,7 +9,7 @@ declare module './index' {
9
9
  duration?: number
10
10
  }
11
11
 
12
- interface RequestParams extends request.Option<any> {
12
+ interface RequestParams<T> extends request.Option<T,any> {
13
13
  [propName: string]: any
14
14
  }
15
15
 
@@ -89,5 +89,12 @@ declare module './index' {
89
89
  * ```
90
90
  */
91
91
  setGlobalDataPlugin: SetGlobalDataPlugin
92
+
93
+ /**
94
+ * @supported weapp
95
+ * @desc 获取自定义 TabBar 对应的 React 或 Vue 组件实例
96
+ * @param page 小程序页面对象,可以通过 Taro.getCurrentInstance().page 获取
97
+ */
98
+ getTabBar<T>(page: Current['page']): T | undefined
92
99
  }
93
100
  }