@spcsn/taro 0.1.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/README.md +12 -0
- package/dist/index.js +147 -0
- package/dist/index.js.map +1 -0
- package/index.js +9 -0
- package/package.json +86 -0
- package/types/api/ad/index.d.ts +197 -0
- package/types/api/ai/face.d.ts +133 -0
- package/types/api/ai/inference.d.ts +129 -0
- package/types/api/ai/visionkit.d.ts +874 -0
- package/types/api/alipay/index.d.ts +69 -0
- package/types/api/base/crypto.d.ts +104 -0
- package/types/api/base/debug.d.ts +329 -0
- package/types/api/base/env.d.ts +19 -0
- package/types/api/base/index.d.ts +102 -0
- package/types/api/base/performance.d.ts +258 -0
- package/types/api/base/system.d.ts +742 -0
- package/types/api/base/update.d.ts +130 -0
- package/types/api/base/weapp/app-event.d.ts +265 -0
- package/types/api/base/weapp/life-cycle.d.ts +155 -0
- package/types/api/canvas/index.d.ts +2162 -0
- package/types/api/cloud/index.d.ts +2622 -0
- package/types/api/data-analysis/index.d.ts +122 -0
- package/types/api/device/accelerometer.d.ts +102 -0
- package/types/api/device/accessibility.d.ts +26 -0
- package/types/api/device/battery.d.ts +46 -0
- package/types/api/device/bluetooth-ble.d.ts +601 -0
- package/types/api/device/bluetooth-peripheral.d.ts +430 -0
- package/types/api/device/bluetooth.d.ts +463 -0
- package/types/api/device/calendar.d.ts +98 -0
- package/types/api/device/clipboard.d.ts +81 -0
- package/types/api/device/compass.d.ts +105 -0
- package/types/api/device/contact.d.ts +110 -0
- package/types/api/device/gyroscope.d.ts +85 -0
- package/types/api/device/iBeacon.d.ts +168 -0
- package/types/api/device/keyboard.d.ts +97 -0
- package/types/api/device/memory.d.ts +52 -0
- package/types/api/device/motion.d.ts +88 -0
- package/types/api/device/network.d.ts +172 -0
- package/types/api/device/nfc.d.ts +1238 -0
- package/types/api/device/phone.d.ts +30 -0
- package/types/api/device/scan.d.ts +111 -0
- package/types/api/device/screen.d.ts +217 -0
- package/types/api/device/sms.d.ts +26 -0
- package/types/api/device/vibrate.d.ts +51 -0
- package/types/api/device/wifi.d.ts +301 -0
- package/types/api/ext/index.d.ts +64 -0
- package/types/api/files/index.d.ts +1472 -0
- package/types/api/framework/index.d.ts +51 -0
- package/types/api/location/index.d.ts +517 -0
- package/types/api/media/audio.d.ts +1013 -0
- package/types/api/media/background-audio.d.ts +291 -0
- package/types/api/media/camera.d.ts +207 -0
- package/types/api/media/editor.d.ts +239 -0
- package/types/api/media/image.d.ts +469 -0
- package/types/api/media/live.d.ts +461 -0
- package/types/api/media/map.d.ts +638 -0
- package/types/api/media/media-recorder.d.ts +117 -0
- package/types/api/media/recorder.d.ts +317 -0
- package/types/api/media/video-decoder.d.ts +117 -0
- package/types/api/media/video-processing.d.ts +84 -0
- package/types/api/media/video.d.ts +527 -0
- package/types/api/media/voip.d.ts +393 -0
- package/types/api/navigate/index.d.ts +327 -0
- package/types/api/network/download.d.ts +173 -0
- package/types/api/network/mdns.d.ts +191 -0
- package/types/api/network/request.d.ts +480 -0
- package/types/api/network/tcp.d.ts +181 -0
- package/types/api/network/udp.d.ts +218 -0
- package/types/api/network/upload.d.ts +201 -0
- package/types/api/network/websocket.d.ts +383 -0
- package/types/api/open-api/account.d.ts +51 -0
- package/types/api/open-api/address.d.ts +68 -0
- package/types/api/open-api/authorize.d.ts +80 -0
- package/types/api/open-api/card.d.ts +110 -0
- package/types/api/open-api/channels.d.ts +225 -0
- package/types/api/open-api/customer-service.d.ts +45 -0
- package/types/api/open-api/device-voip.d.ts +103 -0
- package/types/api/open-api/facial.d.ts +98 -0
- package/types/api/open-api/favorites.d.ts +101 -0
- package/types/api/open-api/group.d.ts +59 -0
- package/types/api/open-api/invoice.d.ts +87 -0
- package/types/api/open-api/license-plate.d.ts +27 -0
- package/types/api/open-api/login.d.ts +115 -0
- package/types/api/open-api/my-miniprogram.d.ts +28 -0
- package/types/api/open-api/privacy.d.ts +107 -0
- package/types/api/open-api/redpackage.d.ts +24 -0
- package/types/api/open-api/settings.d.ts +174 -0
- package/types/api/open-api/soter.d.ts +184 -0
- package/types/api/open-api/sticker.d.ts +83 -0
- package/types/api/open-api/subscribe-message.d.ts +305 -0
- package/types/api/open-api/user-info.d.ts +182 -0
- package/types/api/open-api/werun.d.ts +101 -0
- package/types/api/payment/index.d.ts +119 -0
- package/types/api/qq/index.d.ts +354 -0
- package/types/api/route/index.d.ts +324 -0
- package/types/api/share/index.d.ts +354 -0
- package/types/api/skyline/index.d.ts +345 -0
- package/types/api/storage/background-fetch.d.ts +131 -0
- package/types/api/storage/cache-manager.d.ts +249 -0
- package/types/api/storage/index.d.ts +405 -0
- package/types/api/swan/bookshelf.d.ts +307 -0
- package/types/api/swan/download-package.d.ts +80 -0
- package/types/api/swan/index.d.ts +251 -0
- package/types/api/swan/pay.d.ts +139 -0
- package/types/api/taro.extend.d.ts +233 -0
- package/types/api/taro.hooks.d.ts +148 -0
- package/types/api/ui/animation.d.ts +427 -0
- package/types/api/ui/background.d.ts +69 -0
- package/types/api/ui/custom-component.d.ts +23 -0
- package/types/api/ui/fonts.d.ts +77 -0
- package/types/api/ui/interaction.d.ts +281 -0
- package/types/api/ui/menu.d.ts +29 -0
- package/types/api/ui/navigation-bar.d.ts +130 -0
- package/types/api/ui/pull-down-refresh.d.ts +50 -0
- package/types/api/ui/scroll.d.ts +114 -0
- package/types/api/ui/sticky.d.ts +32 -0
- package/types/api/ui/tab-bar.d.ts +196 -0
- package/types/api/ui/window.d.ts +71 -0
- package/types/api/worker/index.d.ts +83 -0
- package/types/api/wxml/index.d.ts +540 -0
- package/types/compile/compiler.d.ts +32 -0
- package/types/compile/config/h5.d.ts +134 -0
- package/types/compile/config/harmony.d.ts +118 -0
- package/types/compile/config/index.d.ts +8 -0
- package/types/compile/config/manifest.d.ts +155 -0
- package/types/compile/config/mini.d.ts +118 -0
- package/types/compile/config/plugin.d.ts +34 -0
- package/types/compile/config/project.d.ts +338 -0
- package/types/compile/config/rn.d.ts +85 -0
- package/types/compile/config/util.d.ts +179 -0
- package/types/compile/hooks.d.ts +13 -0
- package/types/compile/index.d.ts +11 -0
- package/types/compile/viteCompilerContext.d.ts +167 -0
- package/types/global.d.ts +428 -0
- package/types/index.d.ts +190 -0
- package/types/taro.api.d.ts +130 -0
- package/types/taro.component.d.ts +168 -0
- package/types/taro.config.d.ts +712 -0
- package/types/taro.lifecycle.d.ts +220 -0
- package/types/taro.runtime.d.ts +9 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import Taro from '../../index'
|
|
2
|
+
|
|
3
|
+
declare module '../../index' {
|
|
4
|
+
namespace reserveChannelsLive {
|
|
5
|
+
interface Option {
|
|
6
|
+
/** 预告 id,通过 [getChannelsLiveNoticeInfo](./getChannelsLiveNoticeInfo) 接口获取 */
|
|
7
|
+
noticeId: string
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
namespace openChannelsUserProfile {
|
|
12
|
+
interface Option {
|
|
13
|
+
/** 视频号 id */
|
|
14
|
+
finderUserName: string
|
|
15
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
16
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
17
|
+
/** 接口调用失败的回调函数 */
|
|
18
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
19
|
+
/** 接口调用成功的回调函数 */
|
|
20
|
+
success?: (result: TaroGeneral.CallbackResult) => void
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
namespace openChannelsLive {
|
|
25
|
+
interface Option {
|
|
26
|
+
/** 视频号 id,以“sph”开头的id,可在视频号助手获取 */
|
|
27
|
+
finderUserName: string
|
|
28
|
+
/** 直播 feedId,通过 getChannelsLiveInfo 接口获取 */
|
|
29
|
+
feedId?: string
|
|
30
|
+
/** 直播 nonceId,通过 getChannelsLiveInfo 接口获取 */
|
|
31
|
+
nonceId?: string
|
|
32
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
33
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
34
|
+
/** 接口调用失败的回调函数 */
|
|
35
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
36
|
+
/** 接口调用成功的回调函数 */
|
|
37
|
+
success?: (result: TaroGeneral.CallbackResult) => void
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
namespace openChannelsEvent {
|
|
42
|
+
interface Option {
|
|
43
|
+
/** 视频号 id,以“sph”开头的id,可在视频号助手获取 */
|
|
44
|
+
finderUserName: string
|
|
45
|
+
/** 活动 id */
|
|
46
|
+
eventId: string
|
|
47
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
48
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
49
|
+
/** 接口调用失败的回调函数 */
|
|
50
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
51
|
+
/** 接口调用成功的回调函数 */
|
|
52
|
+
success?: (result: TaroGeneral.CallbackResult) => void
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
namespace openChannelsActivity {
|
|
57
|
+
interface Option {
|
|
58
|
+
/** 视频号 id,以“sph”开头的id,可在视频号助手获取 */
|
|
59
|
+
finderUserName: string
|
|
60
|
+
/** 视频 feedId */
|
|
61
|
+
feedId: string
|
|
62
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
63
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
64
|
+
/** 接口调用失败的回调函数 */
|
|
65
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
66
|
+
/** 接口调用成功的回调函数 */
|
|
67
|
+
success?: (result: TaroGeneral.CallbackResult) => void
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
namespace getChannelsShareKey {
|
|
72
|
+
interface Option {
|
|
73
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
74
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
75
|
+
/** 接口调用失败的回调函数 */
|
|
76
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
77
|
+
/** 接口调用成功的回调函数 */
|
|
78
|
+
success?: (result: SuccessCallbackResult) => void
|
|
79
|
+
}
|
|
80
|
+
interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
|
|
81
|
+
/** 分享者 openid */
|
|
82
|
+
sharerOpenId: string
|
|
83
|
+
/** 推广员 */
|
|
84
|
+
promoter: Promoter
|
|
85
|
+
}
|
|
86
|
+
interface Promoter {
|
|
87
|
+
/** 推广员昵称 */
|
|
88
|
+
finderNickname: string
|
|
89
|
+
/** 推广员id */
|
|
90
|
+
promoterId: string
|
|
91
|
+
/** 推广员openid */
|
|
92
|
+
promoterOpenId: string
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
namespace getChannelsLiveNoticeInfo {
|
|
97
|
+
interface Option {
|
|
98
|
+
/** 视频号 id,以“sph”开头的id,可在视频号助手获取 */
|
|
99
|
+
finderUserName: string
|
|
100
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
101
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
102
|
+
/** 接口调用失败的回调函数 */
|
|
103
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
104
|
+
/** 接口调用成功的回调函数 */
|
|
105
|
+
success?: (result: SuccessCallbackResult) => void
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
|
|
109
|
+
/** 预告 nonceId */
|
|
110
|
+
nonceId: string
|
|
111
|
+
/** 预告状态:0可用 1取消 2已用 */
|
|
112
|
+
status: keyof Status | number
|
|
113
|
+
/** 开始时间 */
|
|
114
|
+
startTime: string
|
|
115
|
+
/** 直播封面 */
|
|
116
|
+
headUrl: string
|
|
117
|
+
/** 视频号昵称 */
|
|
118
|
+
nickname: string
|
|
119
|
+
/** 是否可预约 */
|
|
120
|
+
reservable: boolean
|
|
121
|
+
/** 除最近的一条预告信息外,其他的预告信息列表(注意:每次最多返回按时间戳增序排列的15个预告信息,其中时间最近的那个预告信息会在接口其他的返回参数中展示,其余的预告信息会在该字段中展示)。 */
|
|
122
|
+
otherInfos?: string[]
|
|
123
|
+
}
|
|
124
|
+
interface Status {
|
|
125
|
+
/** 可用 */
|
|
126
|
+
0
|
|
127
|
+
/** 取消 */
|
|
128
|
+
1
|
|
129
|
+
/** 已用 */
|
|
130
|
+
2
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
namespace getChannelsLiveInfo {
|
|
135
|
+
interface Option {
|
|
136
|
+
/** 视频号 id,以“sph”开头的id,可在视频号助手获取 */
|
|
137
|
+
finderUserName: string
|
|
138
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
139
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
140
|
+
/** 接口调用失败的回调函数 */
|
|
141
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
142
|
+
/** 接口调用成功的回调函数 */
|
|
143
|
+
success?: (result: SuccessCallbackResult) => void
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
|
|
147
|
+
/** 直播 feedId */
|
|
148
|
+
feedId: string
|
|
149
|
+
/** 直播 nonceId */
|
|
150
|
+
nonceId: string
|
|
151
|
+
/** 直播主题 */
|
|
152
|
+
description: string
|
|
153
|
+
/** 直播状态,2直播中,3直播结束 */
|
|
154
|
+
status: keyof Status | number
|
|
155
|
+
/** 视频号头像 */
|
|
156
|
+
headUrl: string
|
|
157
|
+
/** 视频号昵称 */
|
|
158
|
+
nickname: string
|
|
159
|
+
/** 直播回放状态 */
|
|
160
|
+
replayStatus: keyof ReplayStatus | number
|
|
161
|
+
/** 除最近的一条直播外,其他的直播列表(注意:每次最多返回按时间戳增序排列的15个直播信息,其中时间最近的那个直播会在接口其他的返回参数中展示,其余的直播会在该字段中展示)。 */
|
|
162
|
+
otherInfos?: string[]
|
|
163
|
+
}
|
|
164
|
+
interface Status {
|
|
165
|
+
/** 直播中 */
|
|
166
|
+
2
|
|
167
|
+
/** 直播结束 */
|
|
168
|
+
3
|
|
169
|
+
}
|
|
170
|
+
interface ReplayStatus {
|
|
171
|
+
/** 未生成 */
|
|
172
|
+
0
|
|
173
|
+
/** 已生成 */
|
|
174
|
+
1
|
|
175
|
+
/** 生成中 */
|
|
176
|
+
3
|
|
177
|
+
/** 已过期 */
|
|
178
|
+
6
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
interface TaroStatic {
|
|
183
|
+
/** 预约视频号直播
|
|
184
|
+
* @supported weapp
|
|
185
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/channels/wx.reserveChannelsLive.html
|
|
186
|
+
*/
|
|
187
|
+
reserveChannelsLive(option?: reserveChannelsLive.Option): void
|
|
188
|
+
/** 打开视频号主页
|
|
189
|
+
* @supported weapp
|
|
190
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/channels/wx.openChannelsUserProfile.html
|
|
191
|
+
*/
|
|
192
|
+
openChannelsUserProfile(option?: openChannelsUserProfile.Option): Promise<TaroGeneral.CallbackResult>
|
|
193
|
+
/** 打开视频号直播
|
|
194
|
+
* @supported weapp
|
|
195
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/channels/wx.openChannelsLive.html
|
|
196
|
+
*/
|
|
197
|
+
openChannelsLive(option?: openChannelsLive.Option): Promise<TaroGeneral.CallbackResult>
|
|
198
|
+
/** 打开视频号活动页
|
|
199
|
+
* @supported weapp
|
|
200
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/channels/wx.openChannelsEvent.html
|
|
201
|
+
*/
|
|
202
|
+
openChannelsEvent(option?: openChannelsEvent.Option): Promise<TaroGeneral.CallbackResult>
|
|
203
|
+
/** 打开视频号视频
|
|
204
|
+
* @supported weapp
|
|
205
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/channels/wx.openChannelsActivity.html
|
|
206
|
+
*/
|
|
207
|
+
openChannelsActivity(option?: openChannelsActivity.Option): Promise<TaroGeneral.CallbackResult>
|
|
208
|
+
/** 获取视频号直播卡片/视频卡片的分享来源,
|
|
209
|
+
* 仅当卡片携带了分享信息、同时用户已授权该小程序获取视频号分享信息且启动场景值为 1177、1184、1195、1208 时可用
|
|
210
|
+
* @supported weapp
|
|
211
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/channels/wx.getChannelsShareKey.html
|
|
212
|
+
*/
|
|
213
|
+
getChannelsShareKey(option?: getChannelsShareKey.Option): Promise<getChannelsShareKey.SuccessCallbackResult>
|
|
214
|
+
/** 获取视频号直播预告信息
|
|
215
|
+
* @supported weapp
|
|
216
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/channels/wx.getChannelsLiveNoticeInfo.html
|
|
217
|
+
*/
|
|
218
|
+
getChannelsLiveNoticeInfo(option?: getChannelsLiveNoticeInfo.Option): Promise<getChannelsLiveNoticeInfo.SuccessCallbackResult>
|
|
219
|
+
/** 获取视频号直播信息
|
|
220
|
+
* @supported weapp
|
|
221
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/channels/wx.getChannelsLiveInfo.html
|
|
222
|
+
*/
|
|
223
|
+
getChannelsLiveInfo(option?: getChannelsLiveInfo.Option): Promise<getChannelsLiveInfo.SuccessCallbackResult>
|
|
224
|
+
}
|
|
225
|
+
}
|
|
@@ -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
|
|
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
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import Taro from '../../index'
|
|
2
|
+
|
|
3
|
+
declare module '../../index' {
|
|
4
|
+
namespace requestDeviceVoIP {
|
|
5
|
+
interface Option {
|
|
6
|
+
/** 设备唯一序列号。由厂商分配,长度不能超过128字节。字符只接受数字,大小写字母,下划线(_)和连字符(-) */
|
|
7
|
+
sn: string
|
|
8
|
+
/** 设备票据,5分钟内有效 */
|
|
9
|
+
snTicket: string
|
|
10
|
+
/** 设备型号 id。通过微信公众平台注册设备获得。 */
|
|
11
|
+
modelId: string
|
|
12
|
+
/** 设备名称,将显示在授权弹窗内(长度不超过13)。授权框中「设备名字」= 「deviceName」 + 「modelId 对应设备型号」 */
|
|
13
|
+
deviceName: string
|
|
14
|
+
/** 是否为授权设备组,默认 false */
|
|
15
|
+
isGroup?: boolean
|
|
16
|
+
/** 设备组的唯一标识 id 。isGroup 为 true 时只需要传该参数,isGroup 为 false 时不需要传该参数,但需要传 sn、snTicket、modelId、deviceName 。 */
|
|
17
|
+
groupId: string
|
|
18
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
19
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
20
|
+
/** 接口调用失败的回调函数 */
|
|
21
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
22
|
+
/** 接口调用成功的回调函数 */
|
|
23
|
+
success?: (result: TaroGeneral.CallbackResult) => void
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
namespace getDeviceVoIPList {
|
|
28
|
+
interface Option {
|
|
29
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
30
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
31
|
+
/** 接口调用失败的回调函数 */
|
|
32
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
33
|
+
/** 接口调用成功的回调函数 */
|
|
34
|
+
success?: (result: SuccessCallbackResult) => void
|
|
35
|
+
}
|
|
36
|
+
interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
|
|
37
|
+
list: DeviceVoIP[]
|
|
38
|
+
}
|
|
39
|
+
interface DeviceVoIP {
|
|
40
|
+
/** 设备唯一序列号。(仅单台设备时) */
|
|
41
|
+
sn: string
|
|
42
|
+
/** 设备型号 id。通过微信公众平台注册设备获得。(仅单台设备时) */
|
|
43
|
+
model_id: string
|
|
44
|
+
/** 设备组的唯一标识 id(仅设备组时) */
|
|
45
|
+
group_id: string
|
|
46
|
+
/** 设备(组)授权状态。0:未授权;1:已授权 */
|
|
47
|
+
status: number
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface TaroStatic {
|
|
52
|
+
/** 请求用户授权与设备(组)间进行音视频通话
|
|
53
|
+
* @example
|
|
54
|
+
* ```tsx
|
|
55
|
+
* // 授权单台设备
|
|
56
|
+
* Taro.requestDeviceVoIP({
|
|
57
|
+
* sn: 'xxxx',
|
|
58
|
+
* snTicket: 'xxxxx',
|
|
59
|
+
* modelId: 'xxx',
|
|
60
|
+
* deviceName: 'xxx',
|
|
61
|
+
* success(res) {
|
|
62
|
+
* console.log(res)
|
|
63
|
+
* },
|
|
64
|
+
* fail(res) {
|
|
65
|
+
* console.log(res)
|
|
66
|
+
* }
|
|
67
|
+
* })
|
|
68
|
+
*
|
|
69
|
+
* // 批量授权(授权设备组)
|
|
70
|
+
* Taro.requestDeviceVoIP({
|
|
71
|
+
* isGroup: true,
|
|
72
|
+
* groupId: '设备组 ID',
|
|
73
|
+
* success(res) {
|
|
74
|
+
* console.log(res)
|
|
75
|
+
* },
|
|
76
|
+
* fail(res) {
|
|
77
|
+
* console.log(res)
|
|
78
|
+
* }
|
|
79
|
+
* })
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @supported weapp
|
|
83
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/device-voip/wx.requestDeviceVoIP.html
|
|
84
|
+
*/
|
|
85
|
+
requestDeviceVoIP(option: requestDeviceVoIP.Option): Promise<TaroGeneral.CallbackResult>
|
|
86
|
+
/** 查询当前用户授权的音视频通话设备(组)信息
|
|
87
|
+
* @supported weapp
|
|
88
|
+
* @example
|
|
89
|
+
* ```tsx
|
|
90
|
+
* Taro.getDeviceVoIPList({
|
|
91
|
+
* success(res) {
|
|
92
|
+
* console.log(res)
|
|
93
|
+
* },
|
|
94
|
+
* fail(res) {
|
|
95
|
+
* console.log(res)
|
|
96
|
+
* }
|
|
97
|
+
* })
|
|
98
|
+
* ```
|
|
99
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/device-voip/wx.getDeviceVoIPList.html
|
|
100
|
+
*/
|
|
101
|
+
getDeviceVoIPList(option: getDeviceVoIPList.Option): Promise<getDeviceVoIPList.SuccessCallbackResult>
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import Taro from '../../index'
|
|
2
|
+
|
|
3
|
+
declare module '../../index' {
|
|
4
|
+
namespace checkIsSupportFacialRecognition {
|
|
5
|
+
interface Option {
|
|
6
|
+
/** 交互方式 */
|
|
7
|
+
checkAliveType?: number
|
|
8
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
9
|
+
complete?: (res: CallbackResult) => void
|
|
10
|
+
/** 接口调用失败的回调函数 */
|
|
11
|
+
fail?: (res: CallbackResult) => void
|
|
12
|
+
/** 接口调用成功的回调函数 */
|
|
13
|
+
success?: (result: CallbackResult) => void
|
|
14
|
+
}
|
|
15
|
+
interface CallbackResult extends TaroGeneral.CallbackResult {
|
|
16
|
+
/** 错误信息 */
|
|
17
|
+
errMsg: string
|
|
18
|
+
/** 错误码 */
|
|
19
|
+
errCode: number
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
namespace startFacialRecognitionVerify {
|
|
24
|
+
interface Option {
|
|
25
|
+
/** 身份证名称 */
|
|
26
|
+
name: string
|
|
27
|
+
/** 身份证名称 */
|
|
28
|
+
idCardNumber: string
|
|
29
|
+
/** 交互方式 */
|
|
30
|
+
checkAliveType?: number
|
|
31
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
32
|
+
complete?: (res: CallbackResult) => void
|
|
33
|
+
/** 接口调用失败的回调函数 */
|
|
34
|
+
fail?: (res: CallbackResult) => void
|
|
35
|
+
/** 接口调用成功的回调函数 */
|
|
36
|
+
success?: (result: CallbackResult) => void
|
|
37
|
+
}
|
|
38
|
+
interface CallbackResult extends TaroGeneral.CallbackResult {
|
|
39
|
+
/** 错误信息 */
|
|
40
|
+
errMsg: string
|
|
41
|
+
/** 错误码 */
|
|
42
|
+
errCode: number
|
|
43
|
+
/** 认证结果 */
|
|
44
|
+
verifyResult: string
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
namespace startFacialRecognitionVerifyAndUploadVideo {
|
|
49
|
+
interface Option {
|
|
50
|
+
/** 身份证名称 */
|
|
51
|
+
name: string
|
|
52
|
+
/** 身份证名称 */
|
|
53
|
+
idCardNumber: string
|
|
54
|
+
/** 交互方式 */
|
|
55
|
+
checkAliveType?: number
|
|
56
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
57
|
+
complete?: (res: CallbackResult) => void
|
|
58
|
+
/** 接口调用失败的回调函数 */
|
|
59
|
+
fail?: (res: CallbackResult) => void
|
|
60
|
+
/** 接口调用成功的回调函数 */
|
|
61
|
+
success?: (result: CallbackResult) => void
|
|
62
|
+
}
|
|
63
|
+
interface CallbackResult extends TaroGeneral.CallbackResult {
|
|
64
|
+
/** 错误信息 */
|
|
65
|
+
errMsg: string
|
|
66
|
+
/** 错误码 */
|
|
67
|
+
errCode: number
|
|
68
|
+
/** 认证结果 */
|
|
69
|
+
verifyResult: string
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
interface TaroStatic {
|
|
74
|
+
/** 检查是否支持面部识别
|
|
75
|
+
* @deprecated
|
|
76
|
+
* @supported weapp
|
|
77
|
+
*/
|
|
78
|
+
checkIsSupportFacialRecognition(
|
|
79
|
+
option?: checkIsSupportFacialRecognition.Option
|
|
80
|
+
): Promise<checkIsSupportFacialRecognition.CallbackResult>
|
|
81
|
+
|
|
82
|
+
/** 开始人脸识别认证
|
|
83
|
+
* @deprecated
|
|
84
|
+
* @supported weapp
|
|
85
|
+
*/
|
|
86
|
+
startFacialRecognitionVerify(
|
|
87
|
+
option?: startFacialRecognitionVerify.Option
|
|
88
|
+
): Promise<startFacialRecognitionVerify.CallbackResult>
|
|
89
|
+
|
|
90
|
+
/** 开始人脸识别认证并上传认证视频
|
|
91
|
+
* @deprecated
|
|
92
|
+
* @supported weapp
|
|
93
|
+
*/
|
|
94
|
+
startFacialRecognitionVerifyAndUploadVideo(
|
|
95
|
+
option?: startFacialRecognitionVerifyAndUploadVideo.Option
|
|
96
|
+
): Promise<startFacialRecognitionVerifyAndUploadVideo.CallbackResult>
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import Taro from '../../index'
|
|
2
|
+
|
|
3
|
+
declare module '../../index' {
|
|
4
|
+
namespace addVideoToFavorites {
|
|
5
|
+
interface Option {
|
|
6
|
+
/** 要收藏的视频地址,必须为本地路径或临时路径 */
|
|
7
|
+
videoPath: string
|
|
8
|
+
/** 缩略图路径,若留空则使用视频首帧 */
|
|
9
|
+
thumbPath?: string
|
|
10
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
11
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
12
|
+
/** 接口调用失败的回调函数 */
|
|
13
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
14
|
+
/** 接口调用成功的回调函数 */
|
|
15
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
namespace addFileToFavorites {
|
|
20
|
+
interface Option {
|
|
21
|
+
/** 要收藏的文件地址,必须为本地路径或临时路径 */
|
|
22
|
+
filePath: string
|
|
23
|
+
/** 自定义文件名,若留空则使用filePath中的文件名 */
|
|
24
|
+
fileName?: string
|
|
25
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
26
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
27
|
+
/** 接口调用失败的回调函数 */
|
|
28
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
29
|
+
/** 接口调用成功的回调函数 */
|
|
30
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface TaroStatic {
|
|
35
|
+
/** 收藏视频
|
|
36
|
+
* @supported weapp
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* // callback 写法
|
|
40
|
+
* Taro.downloadFile({
|
|
41
|
+
* url: URL, // 下载url
|
|
42
|
+
* success (res) {
|
|
43
|
+
* // 下载完成后收藏
|
|
44
|
+
* Taro.addVideoToFavorites({
|
|
45
|
+
* videoPath: res.tempFilePath,
|
|
46
|
+
* success() {},
|
|
47
|
+
* fail: console.error,
|
|
48
|
+
* })
|
|
49
|
+
* },
|
|
50
|
+
* fail: console.error,
|
|
51
|
+
* })
|
|
52
|
+
* ```
|
|
53
|
+
* @example
|
|
54
|
+
* ```tsx
|
|
55
|
+
* // async await 写法
|
|
56
|
+
* const { tempFilePath } = await Taro.downloadFile({
|
|
57
|
+
* url: URL, // 下载url
|
|
58
|
+
* })
|
|
59
|
+
* // 下载完成后收藏
|
|
60
|
+
* await Taro.addVideoToFavorites({
|
|
61
|
+
* videoPath: res.tempFilePath,
|
|
62
|
+
* })
|
|
63
|
+
* ```
|
|
64
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/favorites/wx.addVideoToFavorites.html
|
|
65
|
+
*/
|
|
66
|
+
addVideoToFavorites(option?: addVideoToFavorites.Option): Promise<TaroGeneral.CallbackResult>
|
|
67
|
+
|
|
68
|
+
/** 收藏文件
|
|
69
|
+
* @supported weapp
|
|
70
|
+
* @example
|
|
71
|
+
* ```tsx
|
|
72
|
+
* // callback 写法
|
|
73
|
+
* Taro.downloadFile({
|
|
74
|
+
* url: URL, // 下载url
|
|
75
|
+
* success (res) {
|
|
76
|
+
* // 下载完成后收藏
|
|
77
|
+
* Taro.addFileToFavorites({
|
|
78
|
+
* filePath: res.tempFilePath,
|
|
79
|
+
* success() {},
|
|
80
|
+
* fail: console.error,
|
|
81
|
+
* })
|
|
82
|
+
* },
|
|
83
|
+
* fail: console.error,
|
|
84
|
+
* })
|
|
85
|
+
* ```
|
|
86
|
+
* @example
|
|
87
|
+
* ```tsx
|
|
88
|
+
* // async await 写法
|
|
89
|
+
* const { tempFilePath } = await Taro.downloadFile({
|
|
90
|
+
* url: URL, // 下载url
|
|
91
|
+
* })
|
|
92
|
+
* // 下载完成后收藏
|
|
93
|
+
* await Taro.addFileToFavorites({
|
|
94
|
+
* filePath: res.tempFilePath,
|
|
95
|
+
* })
|
|
96
|
+
* ```
|
|
97
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/favorites/wx.addFileToFavorites.html
|
|
98
|
+
*/
|
|
99
|
+
addFileToFavorites(option?: addFileToFavorites.Option): Promise<TaroGeneral.CallbackResult>
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import Taro from '../../index'
|
|
2
|
+
|
|
3
|
+
declare module '../../index' {
|
|
4
|
+
namespace getGroupEnterInfo {
|
|
5
|
+
interface Option {
|
|
6
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
7
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
8
|
+
/** 接口调用失败的回调函数 */
|
|
9
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
10
|
+
/** 接口调用成功的回调函数 */
|
|
11
|
+
success?: (result: SuccessCallbackResult) => void
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
|
|
15
|
+
/** 错误信息 */
|
|
16
|
+
errMsg: string
|
|
17
|
+
/** 包括敏感数据在内的完整转发信息的加密数据,详细见[加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */
|
|
18
|
+
encryptedData: string
|
|
19
|
+
/** 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */
|
|
20
|
+
iv: string
|
|
21
|
+
/** 敏感数据对应的云 ID,开通[云开发](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html)的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#method-cloud) */
|
|
22
|
+
cloudID?: string
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface TaroStatic {
|
|
27
|
+
/** 获取微信群聊场景下的小程序启动信息。群聊场景包括群聊小程序消息卡片、群待办、群工具。可用于获取当前群的 opengid。
|
|
28
|
+
*
|
|
29
|
+
* **Tips**
|
|
30
|
+
* - 如需要展示群名称,小程序可以使用[开放数据组件](/docs/components/open/open-data)
|
|
31
|
+
* - 小游戏可以通过 `Taro.getGroupInfo` 接口获取群名称
|
|
32
|
+
* @supported weapp
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* Taro.getGroupEnterInfo({
|
|
36
|
+
* success(res) {
|
|
37
|
+
* // res
|
|
38
|
+
* {
|
|
39
|
+
* errMsg: 'getGroupEnterInfo:ok',
|
|
40
|
+
* encryptedData: '',
|
|
41
|
+
* iv: ''
|
|
42
|
+
* }
|
|
43
|
+
* },
|
|
44
|
+
* fail() { }
|
|
45
|
+
* })
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* 敏感数据有两种获取方式,一是使用 [加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#%E5%8A%A0%E5%AF%86%E6%95%B0%E6%8D%AE%E8%A7%A3%E5%AF%86%E7%AE%97%E6%B3%95) 。 获取得到的开放数据为以下 json 结构(其中 opengid 为当前群的唯一标识):
|
|
49
|
+
*
|
|
50
|
+
* ```json
|
|
51
|
+
* {
|
|
52
|
+
* "opengid": "OPENGID"
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/group/wx.getGroupEnterInfo.html
|
|
56
|
+
*/
|
|
57
|
+
getGroupEnterInfo(option?: getGroupEnterInfo.Option): Promise<TaroGeneral.CallbackResult>
|
|
58
|
+
}
|
|
59
|
+
}
|