@tarojs/taro 4.2.2-beta.4 → 4.2.3-beta.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": "4.2.2-beta.4",
3
+ "version": "4.2.3-beta.0",
4
4
  "description": "Taro framework",
5
5
  "author": "O2Team",
6
6
  "license": "MIT",
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@types/postcss-url": "^10.0.4",
27
- "@tarojs/api": "4.2.2-beta.4",
28
- "@tarojs/runtime": "4.2.2-beta.4"
27
+ "@tarojs/api": "4.2.3-beta.0",
28
+ "@tarojs/runtime": "4.2.3-beta.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "html-webpack-plugin": "^5.6.0",
@@ -33,9 +33,9 @@
33
33
  "webpack-chain": "^6.5.1",
34
34
  "webpack-dev-server": "^4.15.2",
35
35
  "rollup": "^3.29.4",
36
- "@tarojs/components": "4.2.2-beta.4",
37
- "@tarojs/helper": "4.2.2-beta.4",
38
- "@tarojs/shared": "4.2.2-beta.4"
36
+ "@tarojs/components": "4.2.3-beta.0",
37
+ "@tarojs/shared": "4.2.3-beta.0",
38
+ "@tarojs/helper": "4.2.3-beta.0"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@types/react": "^18",
@@ -46,9 +46,9 @@
46
46
  "webpack": "^5",
47
47
  "webpack-chain": "^6",
48
48
  "webpack-dev-server": "^4",
49
- "@tarojs/shared": "4.2.2-beta.4",
50
- "@tarojs/helper": "4.2.2-beta.4",
51
- "@tarojs/components": "4.2.2-beta.4"
49
+ "@tarojs/shared": "4.2.3-beta.0",
50
+ "@tarojs/helper": "4.2.3-beta.0",
51
+ "@tarojs/components": "4.2.3-beta.0"
52
52
  },
53
53
  "peerDependenciesMeta": {
54
54
  "@types/react": {
@@ -31,6 +31,37 @@ declare module '../../index' {
31
31
  }
32
32
  }
33
33
 
34
+ namespace requestCommonPayment {
35
+ interface Option {
36
+ /** 支付的类型 */
37
+ mode: Mode
38
+ /** 具体支付参数。该参数需要序列化为字符串传递 */
39
+ signData: string
40
+ /** 支付签名,详见微信官方文档《签名详解》 */
41
+ paySig: string
42
+ /** 用户态签名,详见微信官方文档《签名详解》 */
43
+ signature: string
44
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
45
+ complete?: (res: TaroGeneral.CallbackResult) => void
46
+ /** 接口调用失败的回调函数 */
47
+ fail?: (res: FailCallbackResult) => void
48
+ /** 接口调用成功的回调函数 */
49
+ success?: (res: SuccessCallbackResult) => void
50
+ }
51
+
52
+ /**
53
+ * 支付类型:B2b 支付、间接支付、合单支付或多渠道 B2b 支付
54
+ */
55
+ type Mode = 'retail_pay_goods' | 'retail_pay_indirect_goods' | 'retail_pay_combined_goods' | 'retail_pay_goods_new'
56
+
57
+ interface SuccessCallbackResult extends TaroGeneral.CallbackResult {}
58
+
59
+ interface FailCallbackResult extends TaroGeneral.CallbackResult {
60
+ /** 错误码 */
61
+ errno: number
62
+ }
63
+ }
64
+
34
65
  namespace requestOrderPayment {
35
66
  interface Option {
36
67
  /** 时间戳,从 1970 年 1 月 1 日 00:00:00 至今的秒数,即当前的时间 */
@@ -84,6 +115,33 @@ declare module '../../index' {
84
115
  */
85
116
  requestPayment(option: requestPayment.Option): Promise<TaroGeneral.CallbackResult>
86
117
 
118
+ /** 发起通用支付。目前仅支持 B2b 支付类型
119
+ * @supported weapp
120
+ * @since 2.19.2
121
+ * @example
122
+ * ```tsx
123
+ * Taro.requestCommonPayment({
124
+ * mode: 'retail_pay_goods',
125
+ * signData: JSON.stringify({
126
+ * mchid: '1234567890',
127
+ * out_trade_no: 'test1244',
128
+ * description: '测试订单',
129
+ * amount: {
130
+ * order_amount: 1,
131
+ * currency: 'CNY'
132
+ * },
133
+ * env: 0
134
+ * }),
135
+ * paySig: '',
136
+ * signature: '',
137
+ * success (res) { },
138
+ * fail (res) { }
139
+ * })
140
+ * ```
141
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/payment/wx.requestCommonPayment.html
142
+ */
143
+ requestCommonPayment(option: requestCommonPayment.Option): void
144
+
87
145
  /** 创建自定义版交易组件订单,并发起支付。 仅接入了[自定义版交易组件](https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent2/Introduction2)的小程序需要使用,普通小程序可直接使用 `Taro.requestPayment`。
88
146
  * @supported weapp
89
147
  * @example
@@ -23,6 +23,19 @@ interface IPrebundle {
23
23
 
24
24
  interface ICompiler<T> {
25
25
  type: T
26
+ /**
27
+ * 使用的自定义 runner 模块标识。未配置时根据 `type` 使用默认 runner。
28
+ * 该值必须是 Node.js 可解析的非空字符串,且不能包含首尾空白。
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * compiler: {
33
+ * type: 'webpack5',
34
+ * runner: '@tarojs/rspack-runner',
35
+ * }
36
+ * ```
37
+ */
38
+ runner?: string
26
39
  prebundle?: IPrebundle
27
40
  vitePlugins?: any
28
41
  /** 错误处理级别。可选值:0、1 */