@tarojs/taro 3.3.10 → 3.3.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.
Files changed (100) hide show
  1. package/html5.css +5 -5
  2. package/package.json +5 -5
  3. package/types/api/ad/index.d.ts +34 -28
  4. package/types/api/alipay/index.d.ts +11 -7
  5. package/types/api/base/debug.d.ts +60 -54
  6. package/types/api/base/env.d.ts +12 -8
  7. package/types/api/base/index.d.ts +87 -83
  8. package/types/api/base/system.d.ts +59 -54
  9. package/types/api/base/update.d.ts +37 -33
  10. package/types/api/base/weapp/app-event.d.ts +147 -131
  11. package/types/api/base/weapp/life-cycle.d.ts +14 -10
  12. package/types/api/canvas/index.d.ts +115 -110
  13. package/types/api/cloud/index.d.ts +99 -94
  14. package/types/api/data-analysis/index.d.ts +72 -0
  15. package/types/api/device/accelerometer.d.ts +57 -50
  16. package/types/api/device/battery.d.ts +19 -15
  17. package/types/api/device/ble.d.ts +241 -228
  18. package/types/api/device/bluetooth.d.ts +207 -194
  19. package/types/api/device/clipboard.d.ts +48 -43
  20. package/types/api/device/compass.d.ts +55 -48
  21. package/types/api/device/contact.d.ts +13 -9
  22. package/types/api/device/gyroscope.d.ts +41 -35
  23. package/types/api/device/iBeacon.d.ts +79 -73
  24. package/types/api/device/motion.d.ts +42 -37
  25. package/types/api/device/network.d.ts +48 -42
  26. package/types/api/device/nfc.d.ts +105 -96
  27. package/types/api/device/performance.d.ts +22 -18
  28. package/types/api/device/phone.d.ts +20 -15
  29. package/types/api/device/scan.d.ts +31 -26
  30. package/types/api/device/screen.d.ts +74 -67
  31. package/types/api/device/vibrate.d.ts +31 -25
  32. package/types/api/device/wifi.d.ts +151 -140
  33. package/types/api/ext/index.d.ts +44 -39
  34. package/types/api/files/index.d.ts +219 -209
  35. package/types/api/framework/index.d.ts +25 -20
  36. package/types/api/location/index.d.ts +140 -136
  37. package/types/api/media/audio.d.ts +139 -127
  38. package/types/api/media/background-audio.d.ts +135 -126
  39. package/types/api/media/camera.d.ts +30 -26
  40. package/types/api/media/editor.d.ts +35 -33
  41. package/types/api/media/image.d.ts +190 -137
  42. package/types/api/media/live.d.ts +88 -82
  43. package/types/api/media/map.d.ts +47 -43
  44. package/types/api/media/recorder.d.ts +90 -84
  45. package/types/api/media/video-processing.d.ts +10 -6
  46. package/types/api/media/video.d.ts +63 -58
  47. package/types/api/network/download.d.ts +34 -30
  48. package/types/api/network/mdns.d.ts +104 -91
  49. package/types/api/network/request.d.ts +83 -79
  50. package/types/api/network/udp.d.ts +20 -16
  51. package/types/api/network/upload.d.ts +60 -56
  52. package/types/api/network/websocket.d.ts +201 -194
  53. package/types/api/open-api/account.d.ts +18 -14
  54. package/types/api/open-api/address.d.ts +27 -23
  55. package/types/api/open-api/authorize.d.ts +30 -26
  56. package/types/api/open-api/card.d.ts +55 -51
  57. package/types/api/open-api/customer-service.d.ts +45 -0
  58. package/types/api/open-api/facial.d.ts +28 -24
  59. package/types/api/open-api/invoice.d.ts +38 -34
  60. package/types/api/open-api/login.d.ts +56 -52
  61. package/types/api/open-api/navigate.d.ts +79 -75
  62. package/types/api/open-api/payment.d.ts +34 -30
  63. package/types/api/open-api/settings.d.ts +54 -45
  64. package/types/api/open-api/soter.d.ts +92 -86
  65. package/types/api/open-api/subscribe-message.d.ts +24 -20
  66. package/types/api/open-api/user-info.d.ts +60 -57
  67. package/types/api/open-api/werun.d.ts +50 -46
  68. package/types/api/route/index.d.ts +122 -118
  69. package/types/api/share/index.d.ts +68 -64
  70. package/types/api/storage/background-fetch.d.ts +40 -35
  71. package/types/api/storage/index.d.ts +267 -262
  72. package/types/api/swan/index.d.ts +47 -42
  73. package/types/api/ui/animation.d.ts +21 -17
  74. package/types/api/ui/background.d.ts +38 -34
  75. package/types/api/ui/custom-component.d.ts +22 -18
  76. package/types/api/ui/fonts.d.ts +26 -21
  77. package/types/api/ui/interaction.d.ts +167 -121
  78. package/types/api/ui/keyboard.d.ts +59 -55
  79. package/types/api/ui/menu.d.ts +10 -6
  80. package/types/api/ui/navigation-bar.d.ts +67 -63
  81. package/types/api/ui/pull-down-refresh.d.ts +33 -29
  82. package/types/api/ui/scroll.d.ts +30 -26
  83. package/types/api/ui/sticky.d.ts +22 -19
  84. package/types/api/ui/tab-bar.d.ts +101 -97
  85. package/types/api/ui/window.d.ts +24 -18
  86. package/types/api/worker/index.d.ts +28 -24
  87. package/types/api/wxml/index.d.ts +42 -38
  88. package/types/global.d.ts +350 -0
  89. package/types/index.d.ts +14 -99
  90. package/types/taro.api.d.ts +94 -0
  91. package/types/taro.component.d.ts +10 -57
  92. package/types/taro.config.d.ts +24 -6
  93. package/types/taro.extend.d.ts +70 -67
  94. package/types/taro.hooks.d.ts +68 -67
  95. package/types/taro.lifecycle.d.ts +47 -28
  96. package/types/api/ad/index.ts +0 -6
  97. package/types/api/alipay/index.ts +0 -7
  98. package/types/api/index.d.ts +0 -352
  99. package/types/api/open-api/data-analysis.d.ts +0 -19
  100. package/types/api/open-api/report.d.ts +0 -19
@@ -1,4 +1,6 @@
1
- declare namespace Taro {
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
2
4
  namespace getAccountInfoSync {
3
5
  /** 帐号信息 */
4
6
  interface AccountInfo {
@@ -31,17 +33,19 @@ declare namespace Taro {
31
33
  }
32
34
  }
33
35
 
34
- /** 获取当前帐号信息
35
- * @supported weapp
36
- * @example
37
- * ```tsx
38
- * const accountInfo = Taro.getAccountInfoSync();
39
- *
40
- * console.log(accountInfo.miniProgram.appId) // 小程序 appId
41
- * console.log(accountInfo.plugin.appId) // 插件 appId
42
- * console.log(accountInfo.plugin.version) // 插件版本号, 'a.b.c' 这样的形式
43
- * ```
44
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/account-info/wx.getAccountInfoSync.html
45
- */
46
- function getAccountInfoSync(): getAccountInfoSync.AccountInfo
36
+ interface TaroStatic {
37
+ /** 获取当前帐号信息
38
+ * @supported weapp
39
+ * @example
40
+ * ```tsx
41
+ * const accountInfo = Taro.getAccountInfoSync();
42
+ *
43
+ * console.log(accountInfo.miniProgram.appId) // 小程序 appId
44
+ * console.log(accountInfo.plugin.appId) // 插件 appId
45
+ * console.log(accountInfo.plugin.version) // 插件版本号, 'a.b.c' 这样的形式
46
+ * ```
47
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/account-info/wx.getAccountInfoSync.html
48
+ */
49
+ getAccountInfoSync(): getAccountInfoSync.AccountInfo
50
+ }
47
51
  }
@@ -1,10 +1,12 @@
1
- declare namespace Taro {
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
2
4
  namespace chooseAddress {
3
5
  interface Option {
4
6
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
5
- complete?: (res: General.CallbackResult) => void
7
+ complete?: (res: TaroGeneral.CallbackResult) => void
6
8
  /** 接口调用失败的回调函数 */
7
- fail?: (res: General.CallbackResult) => void
9
+ fail?: (res: TaroGeneral.CallbackResult) => void
8
10
  /** 接口调用成功的回调函数 */
9
11
  success?: (result: SuccessCallbackResult) => void
10
12
  }
@@ -31,24 +33,26 @@ declare namespace Taro {
31
33
  }
32
34
  }
33
35
 
34
- /** 获取用户收货地址。调起用户编辑收货地址原生界面,并在编辑完成后返回用户选择的地址。
35
- * @supported weapp
36
- * @example
37
- * ```tsx
38
- * Taro.chooseAddress({
39
- * success: function (res) {
40
- * console.log(res.userName)
41
- * console.log(res.postalCode)
42
- * console.log(res.provinceName)
43
- * console.log(res.cityName)
44
- * console.log(res.countyName)
45
- * console.log(res.detailInfo)
46
- * console.log(res.nationalCode)
47
- * console.log(res.telNumber)
48
- * }
49
- * })
50
- * ```
51
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/address/wx.chooseAddress.html
52
- */
53
- function chooseAddress(option?: chooseAddress.Option): Promise<chooseAddress.SuccessCallbackResult>
36
+ interface TaroStatic {
37
+ /** 获取用户收货地址。调起用户编辑收货地址原生界面,并在编辑完成后返回用户选择的地址。
38
+ * @supported weapp
39
+ * @example
40
+ * ```tsx
41
+ * Taro.chooseAddress({
42
+ * success: function (res) {
43
+ * console.log(res.userName)
44
+ * console.log(res.postalCode)
45
+ * console.log(res.provinceName)
46
+ * console.log(res.cityName)
47
+ * console.log(res.countyName)
48
+ * console.log(res.detailInfo)
49
+ * console.log(res.nationalCode)
50
+ * console.log(res.telNumber)
51
+ * }
52
+ * })
53
+ * ```
54
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/address/wx.chooseAddress.html
55
+ */
56
+ chooseAddress(option?: chooseAddress.Option): Promise<chooseAddress.SuccessCallbackResult>
57
+ }
54
58
  }
@@ -1,37 +1,41 @@
1
- declare namespace Taro {
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
2
4
  namespace authorize {
3
5
  interface Option {
4
6
  /** 需要获取权限的 scope,详见 [scope 列表]((authorize#scope-列表)) */
5
7
  scope: string
6
8
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
7
- complete?: (res: General.CallbackResult) => void
9
+ complete?: (res: TaroGeneral.CallbackResult) => void
8
10
  /** 接口调用失败的回调函数 */
9
- fail?: (res: General.CallbackResult) => void
11
+ fail?: (res: TaroGeneral.CallbackResult) => void
10
12
  /** 接口调用成功的回调函数 */
11
- success?: (res: General.CallbackResult) => void
13
+ success?: (res: TaroGeneral.CallbackResult) => void
12
14
  }
13
15
  }
14
16
 
15
- /** 提前向用户发起授权请求。调用后会立刻弹窗询问用户是否同意授权小程序使用某项功能或获取用户的某些数据,但不会实际调用对应接口。如果用户之前已经同意授权,则不会出现弹窗,直接返回成功。更多用法详见 [用户授权](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html)。
16
- * @supported weapp
17
- * @example
18
- * ```tsx
19
- * // 可以通过 Taro.getSetting 先查询一下用户是否授权了 "scope.record" 这个 scope
20
- * Taro.getSetting({
21
- * success: function (res) {
22
- * if (!res.authSetting['scope.record']) {
23
- * Taro.authorize({
24
- * scope: 'scope.record',
25
- * success: function () {
26
- * // 用户已经同意小程序使用录音功能,后续调用 Taro.startRecord 接口不会弹窗询问
27
- * Taro.startRecord()
28
- * }
29
- * })
30
- * }
31
- * }
32
- * })
33
- * ```
34
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/authorize/wx.authorize.html
35
- */
36
- function authorize(option: authorize.Option): Promise<General.CallbackResult>
17
+ interface TaroStatic {
18
+ /** 提前向用户发起授权请求。调用后会立刻弹窗询问用户是否同意授权小程序使用某项功能或获取用户的某些数据,但不会实际调用对应接口。如果用户之前已经同意授权,则不会出现弹窗,直接返回成功。更多用法详见 [用户授权](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html)。
19
+ * @supported weapp
20
+ * @example
21
+ * ```tsx
22
+ * // 可以通过 Taro.getSetting 先查询一下用户是否授权了 "scope.record" 这个 scope
23
+ * Taro.getSetting({
24
+ * success: function (res) {
25
+ * if (!res.authSetting['scope.record']) {
26
+ * Taro.authorize({
27
+ * scope: 'scope.record',
28
+ * success: function () {
29
+ * // 用户已经同意小程序使用录音功能,后续调用 Taro.startRecord 接口不会弹窗询问
30
+ * Taro.startRecord()
31
+ * }
32
+ * })
33
+ * }
34
+ * }
35
+ * })
36
+ * ```
37
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/authorize/wx.authorize.html
38
+ */
39
+ authorize(option: authorize.Option): Promise<TaroGeneral.CallbackResult>
40
+ }
37
41
  }
@@ -1,14 +1,16 @@
1
- declare namespace Taro {
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
2
4
  namespace openCard {
3
5
  interface Option {
4
6
  /** 需要打开的卡券列表 */
5
7
  cardList: RequestInfo[]
6
8
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
7
- complete?: (res: General.CallbackResult) => void
9
+ complete?: (res: TaroGeneral.CallbackResult) => void
8
10
  /** 接口调用失败的回调函数 */
9
- fail?: (res: General.CallbackResult) => void
11
+ fail?: (res: TaroGeneral.CallbackResult) => void
10
12
  /** 接口调用成功的回调函数 */
11
- success?: (res: General.CallbackResult) => void
13
+ success?: (res: TaroGeneral.CallbackResult) => void
12
14
  }
13
15
 
14
16
  /** 需要打开的卡券列表 */
@@ -20,33 +22,14 @@ declare namespace Taro {
20
22
  }
21
23
  }
22
24
 
23
- /** 查看微信卡包中的卡券。只有通过 [认证](https://developers.weixin.qq.com/miniprogram/product/renzheng.html) 的小程序或文化互动类目的小游戏才能使用。更多文档请参考 [微信卡券接口文档](https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncement&key=1490190158&version=1&lang=zh_CN&platform=2)。
24
- * @supported weapp
25
- * @example
26
- * ```tsx
27
- * Taro.openCard({
28
- * cardList: [{
29
- * cardId: '',
30
- * code: ''
31
- * }, {
32
- * cardId: '',
33
- * code: ''
34
- * }],
35
- * success: function (res) { }
36
- * })
37
- * ```
38
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/card/wx.openCard.html
39
- */
40
- function openCard(option: openCard.Option): Promise<General.CallbackResult>
41
-
42
25
  namespace addCard {
43
26
  interface Option {
44
27
  /** 需要添加的卡券列表 */
45
28
  cardList: RequestInfo[]
46
29
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
47
- complete?: (res: General.CallbackResult) => void
30
+ complete?: (res: TaroGeneral.CallbackResult) => void
48
31
  /** 接口调用失败的回调函数 */
49
- fail?: (res: General.CallbackResult) => void
32
+ fail?: (res: TaroGeneral.CallbackResult) => void
50
33
  /** 接口调用成功的回调函数 */
51
34
  success?: (result: SuccessCallbackResult) => void
52
35
  }
@@ -59,7 +42,7 @@ declare namespace Taro {
59
42
  cardId: string
60
43
  }
61
44
 
62
- interface SuccessCallbackResult extends General.CallbackResult {
45
+ interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
63
46
  /** 卡券添加结果列表 */
64
47
  cardList: AddCardResponseInfo[]
65
48
  /** 调用结果 */
@@ -78,29 +61,50 @@ declare namespace Taro {
78
61
  }
79
62
  }
80
63
 
81
- /** 批量添加卡券。只有通过 [认证](https://developers.weixin.qq.com/miniprogram/product/renzheng.html) 的小程序或文化互动类目的小游戏才能使用。更多文档请参考 [微信卡券接口文档](https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncement&key=1490190158&version=1&lang=zh_CN&platform=2)。
82
- *
83
- * **cardExt 说明**
84
- * cardExt 是卡券的扩展参数,其值是一个 JSON 字符串。
85
- * @supported weapp
86
- * @example
87
- * ```tsx
88
- * Taro.addCard({
89
- * cardList: [
90
- * {
91
- * cardId: '',
92
- * cardExt: '{"code": "", "openid": "", "timestamp": "", "signature":""}'
93
- * }, {
94
- * cardId: '',
95
- * cardExt: '{"code": "", "openid": "", "timestamp": "", "signature":""}'
96
- * }
97
- * ],
98
- * success: function (res) {
99
- * console.log(res.cardList) // 卡券添加结果
100
- * }
101
- * })
102
- * ```
103
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/card/wx.addCard.html
104
- */
105
- function addCard(option: addCard.Option): Promise<addCard.SuccessCallbackResult>
64
+ interface TaroStatic {
65
+ /** 查看微信卡包中的卡券。只有通过 [认证](https://developers.weixin.qq.com/miniprogram/product/renzheng.html) 的小程序或文化互动类目的小游戏才能使用。更多文档请参考 [微信卡券接口文档](https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncement&key=1490190158&version=1&lang=zh_CN&platform=2)。
66
+ * @supported weapp
67
+ * @example
68
+ * ```tsx
69
+ * Taro.openCard({
70
+ * cardList: [{
71
+ * cardId: '',
72
+ * code: ''
73
+ * }, {
74
+ * cardId: '',
75
+ * code: ''
76
+ * }],
77
+ * success: function (res) { }
78
+ * })
79
+ * ```
80
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/card/wx.openCard.html
81
+ */
82
+ openCard(option: openCard.Option): Promise<TaroGeneral.CallbackResult>
83
+
84
+ /** 批量添加卡券。只有通过 [认证](https://developers.weixin.qq.com/miniprogram/product/renzheng.html) 的小程序或文化互动类目的小游戏才能使用。更多文档请参考 [微信卡券接口文档](https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncement&key=1490190158&version=1&lang=zh_CN&platform=2)。
85
+ *
86
+ * **cardExt 说明**
87
+ * cardExt 是卡券的扩展参数,其值是一个 JSON 字符串。
88
+ * @supported weapp
89
+ * @example
90
+ * ```tsx
91
+ * Taro.addCard({
92
+ * cardList: [
93
+ * {
94
+ * cardId: '',
95
+ * cardExt: '{"code": "", "openid": "", "timestamp": "", "signature":""}'
96
+ * }, {
97
+ * cardId: '',
98
+ * cardExt: '{"code": "", "openid": "", "timestamp": "", "signature":""}'
99
+ * }
100
+ * ],
101
+ * success: function (res) {
102
+ * console.log(res.cardList) // 卡券添加结果
103
+ * }
104
+ * })
105
+ * ```
106
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/card/wx.addCard.html
107
+ */
108
+ addCard(option: addCard.Option): Promise<addCard.SuccessCallbackResult>
109
+ }
106
110
  }
@@ -0,0 +1,45 @@
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
4
+ namespace openCustomerServiceChat {
5
+ interface ExtInfo {
6
+ url: string
7
+ }
8
+ interface Option {
9
+ /** 客服信息 */
10
+ extInfo: ExtInfo
11
+ /** 企业ID */
12
+ corpId: string
13
+ /** 是否发送小程序气泡消息,默认值:false */
14
+ showMessageCard?: boolean
15
+ /** 气泡消息标题 */
16
+ sendMessageTitle?: string
17
+ /** 气泡消息小程序路径 */
18
+ sendMessagePath?: string
19
+ /** 气泡消息图片 */
20
+ sendMessageImg?: string
21
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
22
+ complete?: (res: TaroGeneral.CallbackResult) => void
23
+ /** 接口调用失败的回调函数 */
24
+ fail?: (res: TaroGeneral.CallbackResult) => void
25
+ /** 接口调用成功的回调函数 */
26
+ success?: (result: TaroGeneral.CallbackResult) => void
27
+ }
28
+ }
29
+
30
+ interface TaroStatic {
31
+ /** 打开微信客服。了解更多信息,可以参考微信客服介绍:https://work.weixin.qq.com/kf/。
32
+ * @supported weapp 基础库 2.19.0 开始支持,低版本需做兼容处理。
33
+ * @example
34
+ * ```tsx
35
+ * Taro.openCustomerServiceChat({
36
+ * extInfo: {url: ''},
37
+ * corpId: '',
38
+ * success: function (res) { }
39
+ * })
40
+ * ```
41
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/service-chat/wx.openCustomerServiceChat.html
42
+ */
43
+ openCustomerServiceChat(option?: openCustomerServiceChat.Option): Promise<TaroGeneral.CallbackResult>
44
+ }
45
+ }
@@ -1,4 +1,6 @@
1
- declare namespace Taro {
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
2
4
  namespace checkIsSupportFacialRecognition {
3
5
  interface Option {
4
6
  /** 交互方式 */
@@ -10,7 +12,7 @@ declare namespace Taro {
10
12
  /** 接口调用成功的回调函数 */
11
13
  success?: (result: CallbackResult) => void
12
14
  }
13
- interface CallbackResult extends General.CallbackResult {
15
+ interface CallbackResult extends TaroGeneral.CallbackResult {
14
16
  /** 错误信息 */
15
17
  errMsg: string
16
18
  /** 错误码 */
@@ -18,13 +20,6 @@ declare namespace Taro {
18
20
  }
19
21
  }
20
22
 
21
- /** 检查是否支持面部识别
22
- * @supported weapp
23
- */
24
- function checkIsSupportFacialRecognition(
25
- option?: checkIsSupportFacialRecognition.Option
26
- ): Promise<checkIsSupportFacialRecognition.CallbackResult>
27
-
28
23
  namespace startFacialRecognitionVerify {
29
24
  interface Option {
30
25
  /** 身份证名称 */
@@ -40,7 +35,7 @@ declare namespace Taro {
40
35
  /** 接口调用成功的回调函数 */
41
36
  success?: (result: CallbackResult) => void
42
37
  }
43
- interface CallbackResult extends General.CallbackResult {
38
+ interface CallbackResult extends TaroGeneral.CallbackResult {
44
39
  /** 错误信息 */
45
40
  errMsg: string
46
41
  /** 错误码 */
@@ -50,13 +45,6 @@ declare namespace Taro {
50
45
  }
51
46
  }
52
47
 
53
- /** 开始人脸识别认证
54
- * @supported weapp
55
- */
56
- function startFacialRecognitionVerify(
57
- option?: startFacialRecognitionVerify.Option
58
- ): Promise<startFacialRecognitionVerify.CallbackResult>
59
-
60
48
  namespace startFacialRecognitionVerifyAndUploadVideo {
61
49
  interface Option {
62
50
  /** 身份证名称 */
@@ -72,7 +60,7 @@ declare namespace Taro {
72
60
  /** 接口调用成功的回调函数 */
73
61
  success?: (result: CallbackResult) => void
74
62
  }
75
- interface CallbackResult extends General.CallbackResult {
63
+ interface CallbackResult extends TaroGeneral.CallbackResult {
76
64
  /** 错误信息 */
77
65
  errMsg: string
78
66
  /** 错误码 */
@@ -82,10 +70,26 @@ declare namespace Taro {
82
70
  }
83
71
  }
84
72
 
85
- /** 开始人脸识别认证并上传认证视频
86
- * @supported weapp
87
- */
88
- function startFacialRecognitionVerifyAndUploadVideo(
89
- option?: startFacialRecognitionVerifyAndUploadVideo.Option
90
- ): Promise<startFacialRecognitionVerifyAndUploadVideo.CallbackResult>
73
+ interface TaroStatic {
74
+ /** 检查是否支持面部识别
75
+ * @supported weapp
76
+ */
77
+ checkIsSupportFacialRecognition(
78
+ option?: checkIsSupportFacialRecognition.Option
79
+ ): Promise<checkIsSupportFacialRecognition.CallbackResult>
80
+
81
+ /** 开始人脸识别认证
82
+ * @supported weapp
83
+ */
84
+ startFacialRecognitionVerify(
85
+ option?: startFacialRecognitionVerify.Option
86
+ ): Promise<startFacialRecognitionVerify.CallbackResult>
87
+
88
+ /** 开始人脸识别认证并上传认证视频
89
+ * @supported weapp
90
+ */
91
+ startFacialRecognitionVerifyAndUploadVideo(
92
+ option?: startFacialRecognitionVerifyAndUploadVideo.Option
93
+ ): Promise<startFacialRecognitionVerifyAndUploadVideo.CallbackResult>
94
+ }
91
95
  }
@@ -1,15 +1,17 @@
1
- declare namespace Taro {
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
2
4
  namespace chooseInvoiceTitle {
3
5
  interface Option {
4
6
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
5
- complete?: (res: General.CallbackResult) => void
7
+ complete?: (res: TaroGeneral.CallbackResult) => void
6
8
  /** 接口调用失败的回调函数 */
7
- fail?: (res: General.CallbackResult) => void
9
+ fail?: (res: TaroGeneral.CallbackResult) => void
8
10
  /** 接口调用成功的回调函数 */
9
11
  success?: (result: SuccessCallbackResult) => void
10
12
  }
11
13
 
12
- interface SuccessCallbackResult extends General.CallbackResult {
14
+ interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
13
15
  /** 银行账号 */
14
16
  bankAccount: string
15
17
  /** 银行名称 */
@@ -35,29 +37,17 @@ declare namespace Taro {
35
37
  }
36
38
  }
37
39
 
38
- /** 选择用户的发票抬头。当前小程序必须关联一个公众号,且这个公众号是完成了[微信认证](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1496554031_RD4xe)的,才能调用 chooseInvoiceTitle。
39
- * @supported weapp
40
- * @example
41
- * ```tsx
42
- * Taro.chooseInvoiceTitle({
43
- * success: function(res) {}
44
- * })
45
- * ```
46
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/invoice/wx.chooseInvoiceTitle.html
47
- */
48
- function chooseInvoiceTitle(option?: chooseInvoiceTitle.Option): Promise<chooseInvoiceTitle.SuccessCallbackResult>
49
-
50
40
  namespace chooseInvoice {
51
41
  interface Option {
52
42
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
53
- complete?: (res: General.CallbackResult) => void
43
+ complete?: (res: TaroGeneral.CallbackResult) => void
54
44
  /** 接口调用失败的回调函数 */
55
- fail?: (res: General.CallbackResult) => void
45
+ fail?: (res: TaroGeneral.CallbackResult) => void
56
46
  /** 接口调用成功的回调函数 */
57
47
  success?: (result: SuccessCallbackResult) => void
58
48
  }
59
49
 
60
- interface SuccessCallbackResult extends General.CallbackResult {
50
+ interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
61
51
  /** 用户选中的发票信息,格式为一个 JSON 字符串,包含三个字段: card_id:所选发票卡券的 cardId,encrypt_code:所选发票卡券的加密 code,报销方可以通过 cardId 和 encryptCode 获得报销发票的信息,app_id: 发票方的 appId。 */
62
52
  invoiceInfo: string
63
53
  /** 调用结果 */
@@ -65,19 +55,33 @@ declare namespace Taro {
65
55
  }
66
56
  }
67
57
 
68
- /** 选择用户已有的发票。
69
- *
70
- * **通过 cardId 和 encryptCode 获得报销发票的信息**
71
- * 请参考[微信电子发票文档](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=21517918939oae3U)中,「查询报销发票信息」部分。
72
- * 其中 `access_token` 的获取请参考[auth.getAccessToken](https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/access-token/auth.getAccessToken.html)文档
73
- * @supported weapp
74
- * @example
75
- ```tsx
76
- * Taro.chooseInvoice({
77
- * success: function (res) {}
78
- * })
79
- * ```
80
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/invoice/wx.chooseInvoice.html
81
- */
82
- function chooseInvoice(option?: chooseInvoice.Option): Promise<chooseInvoice.SuccessCallbackResult>
58
+ interface TaroStatic {
59
+ /** 选择用户的发票抬头。当前小程序必须关联一个公众号,且这个公众号是完成了[微信认证](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1496554031_RD4xe)的,才能调用 chooseInvoiceTitle。
60
+ * @supported weapp
61
+ * @example
62
+ * ```tsx
63
+ * Taro.chooseInvoiceTitle({
64
+ * success: function(res) {}
65
+ * })
66
+ * ```
67
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/invoice/wx.chooseInvoiceTitle.html
68
+ */
69
+ chooseInvoiceTitle(option?: chooseInvoiceTitle.Option): Promise<chooseInvoiceTitle.SuccessCallbackResult>
70
+
71
+ /** 选择用户已有的发票。
72
+ *
73
+ * **通过 cardId 和 encryptCode 获得报销发票的信息**
74
+ * 请参考[微信电子发票文档](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=21517918939oae3U)中,「查询报销发票信息」部分。
75
+ * 其中 `access_token` 的获取请参考[auth.getAccessToken](https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/access-token/auth.getAccessToken.html)文档
76
+ * @supported weapp
77
+ * @example
78
+ ```tsx
79
+ * Taro.chooseInvoice({
80
+ * success: function (res) {}
81
+ * })
82
+ * ```
83
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/invoice/wx.chooseInvoice.html
84
+ */
85
+ chooseInvoice(option?: chooseInvoice.Option): Promise<chooseInvoice.SuccessCallbackResult>
86
+ }
83
87
  }