@tarojs/taro 3.7.0-alpha.4 → 3.7.0-alpha.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/taro",
3
- "version": "3.7.0-alpha.4",
3
+ "version": "3.7.0-alpha.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,11 +21,11 @@
21
21
  "author": "O2Team",
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
- "@tarojs/api": "3.7.0-alpha.4",
25
- "@tarojs/runtime": "3.7.0-alpha.4"
24
+ "@tarojs/api": "3.7.0-alpha.6",
25
+ "@tarojs/runtime": "3.7.0-alpha.6"
26
26
  },
27
27
  "devDependencies": {
28
- "@tarojs/helper": "3.7.0-alpha.4"
28
+ "@tarojs/helper": "3.7.0-alpha.6"
29
29
  },
30
30
  "peerDependenciesMeta": {
31
31
  "@types/react": {
@@ -15,6 +15,42 @@ declare module '../../index' {
15
15
  response: string
16
16
  }
17
17
  }
18
+ namespace tradePay {
19
+ interface Option {
20
+ /** 接入小程序支付时传入此参数。此参数为支付宝交易号,注意参数有大小写区分(调用 小程序支付 时必填) */
21
+ tradeNO?: string
22
+ /** 完整的支付参数拼接成的字符串,从服务端获取(调用 支付宝预授权 时必填) */
23
+ orderStr?: string
24
+ /** 接口调用成功的回调函数 */
25
+ success?: (res: SuccessCallbackResult) => void
26
+ /** 接口调用失败的回调函数 */
27
+ fail?: (res: TaroGeneral.CallbackResult) => void
28
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
29
+ complete?:(res: TaroGeneral.CallbackResult) => void
30
+ }
31
+ interface ResultCode {
32
+ /** 无权限调用(N22104) */
33
+ 4
34
+ /** 订单处理成功 */
35
+ 9000
36
+ /** 正在处理中。支付结果未知(有可能已经支付成功) */
37
+ 8000
38
+ /** 订单处理失败 */
39
+ 4000
40
+ /** 用户中途取消 */
41
+ 6001
42
+ /** 网络连接出错 */
43
+ 6002
44
+ /** 处理结果未知(有可能已经成功) */
45
+ 6004
46
+ }
47
+ interface SuccessCallbackResult {
48
+ /** success 回调函数会携带一个 Object 类型的对象,其属性如下: */
49
+ response: {
50
+ resultCode: ResultCode
51
+ }
52
+ }
53
+ }
18
54
  interface TaroStatic {
19
55
  /**
20
56
  * 此接口可获取支付宝会员的基础信息(头像图片地址、昵称、性别、国家码、省份、所在市区),接入方法请参考 获取会员基础信息介绍。如需获取支付宝会员标识(user_id),请调用 my.getAuthCode 和 alipay.system.oauth.token 接口。
@@ -22,5 +58,12 @@ declare module '../../index' {
22
58
  * @see https://docs.alipay.com/mini/api/ch8chh
23
59
  */
24
60
  getOpenUserInfo(Option: getOpenUserInfo.Option): Promise<getOpenUserInfo.SuccessCallbackResult>
61
+
62
+ /**
63
+ * 此接口是用于发起支付的 API,此 API 暂仅支持企业支付宝小程序使用
64
+ * @supported alipay
65
+ * @see https://opendocs.alipay.com/mini/api/openapi-pay
66
+ */
67
+ tradePay(Option: tradePay.Option): Promise<tradePay.SuccessCallbackResult>
25
68
  }
26
69
  }
@@ -35,7 +35,20 @@ export interface IMiniAppConfig {
35
35
  webpackChain?: (chain: Chain, webpack: typeof Webpack, PARSE_AST_TYPE: any) => void
36
36
 
37
37
  /** 可用于修改、拓展 Webpack 的 [output](https://webpack.js.org/configuration/output/) 选项 */
38
- output?: Webpack.Configuration['output']
38
+ output?: Webpack.Configuration['output'] & {
39
+ /**
40
+ * 编译前清空输出目录
41
+ * @since Taro v3.6.9
42
+ * @description
43
+ * - 默认清空输出目录,可设置 clean: false 不清空
44
+ * - 可设置 clean: { keep: ['project.config.json'] } 保留指定文件
45
+ * - 注意 clean.keep 不支持函数
46
+ */
47
+ clean?: boolean | {
48
+ /** 保留指定文件不删除 */
49
+ keep?: Array<string | RegExp> | string | RegExp
50
+ }
51
+ }
39
52
 
40
53
  /** 配置 postcss 相关插件 */
41
54
  postcss?: IPostcssOption