@tarojs/taro 3.7.0-alpha.1 → 3.7.0-alpha.11
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 +9 -3
- package/types/api/ad/index.d.ts +6 -18
- package/types/api/ai/inference.d.ts +129 -0
- package/types/api/alipay/index.d.ts +43 -0
- package/types/api/base/crypto.d.ts +18 -4
- package/types/api/base/index.d.ts +2 -2
- package/types/api/base/performance.d.ts +63 -0
- package/types/api/base/system.d.ts +65 -0
- package/types/api/base/weapp/app-event.d.ts +18 -18
- package/types/api/device/calendar.d.ts +2 -2
- package/types/api/device/screen.d.ts +61 -0
- package/types/api/device/sms.d.ts +26 -0
- package/types/api/media/audio.d.ts +50 -30
- package/types/api/media/image.d.ts +40 -17
- package/types/api/media/live.d.ts +52 -0
- package/types/api/media/video.d.ts +64 -23
- package/types/api/media/voip.d.ts +103 -0
- package/types/api/network/download.d.ts +2 -10
- package/types/api/network/request.d.ts +84 -24
- package/types/api/network/upload.d.ts +2 -10
- package/types/api/open-api/address.d.ts +12 -10
- package/types/api/open-api/channels.d.ts +31 -0
- package/types/api/open-api/device-voip.d.ts +63 -0
- package/types/api/route/index.d.ts +2 -0
- package/types/api/share/index.d.ts +1 -1
- package/types/api/storage/cache-manager.d.ts +198 -0
- package/types/api/taro.extend.d.ts +223 -0
- package/types/{taro.hooks.d.ts → api/taro.hooks.d.ts} +4 -4
- package/types/api/ui/navigation-bar.d.ts +1 -1
- package/types/compile/compiler.d.ts +1 -1
- package/types/compile/config/h5.d.ts +63 -2
- package/types/compile/config/mini.d.ts +67 -5
- package/types/compile/config/project.d.ts +239 -17
- package/types/compile/config/rn.d.ts +64 -0
- package/types/compile/config/util.d.ts +62 -4
- package/types/compile/hooks.d.ts +1 -1
- package/types/global.d.ts +8 -8
- package/types/index.d.ts +7 -7
- package/types/taro.api.d.ts +8 -1
- package/types/taro.component.d.ts +2 -1
- package/types/taro.config.d.ts +91 -2
- package/types/taro.extend.d.ts +0 -112
|
@@ -202,6 +202,98 @@ declare module '../../index' {
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
namespace join1v1Chat {
|
|
206
|
+
interface Caller {
|
|
207
|
+
/** 昵称 */
|
|
208
|
+
nickname: string
|
|
209
|
+
/** 头像 */
|
|
210
|
+
headImage?: string
|
|
211
|
+
/** 小程序内 openid */
|
|
212
|
+
openid: string
|
|
213
|
+
}
|
|
214
|
+
interface Listener {
|
|
215
|
+
/** 昵称 */
|
|
216
|
+
nickname: string
|
|
217
|
+
/** 头像 */
|
|
218
|
+
headImage?: string
|
|
219
|
+
/** 小程序内 openid */
|
|
220
|
+
openid: string
|
|
221
|
+
}
|
|
222
|
+
interface RoomType {
|
|
223
|
+
/** 语音通话 */
|
|
224
|
+
voice
|
|
225
|
+
/** 视频通话 */
|
|
226
|
+
video
|
|
227
|
+
}
|
|
228
|
+
interface Option {
|
|
229
|
+
/** 呼叫方信息 */
|
|
230
|
+
caller: Caller
|
|
231
|
+
/** 接听方信息 */
|
|
232
|
+
listener: Listener
|
|
233
|
+
/** 窗口背景色
|
|
234
|
+
* @default 0
|
|
235
|
+
*/
|
|
236
|
+
backgroundType?: keyof setEnable1v1Chat.ColorType
|
|
237
|
+
/** 通话类型 */
|
|
238
|
+
roomType?: keyof RoomType
|
|
239
|
+
/** 小窗样式
|
|
240
|
+
* @default 1
|
|
241
|
+
*/
|
|
242
|
+
minWindowType?: keyof setEnable1v1Chat.ColorType
|
|
243
|
+
/** 不允许切换到语音通话
|
|
244
|
+
* @default false
|
|
245
|
+
*/
|
|
246
|
+
disableSwitchVoice?: boolean
|
|
247
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
248
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
249
|
+
/** 接口调用失败的回调函数 */
|
|
250
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
251
|
+
/** 接口调用成功的回调函数 */
|
|
252
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
253
|
+
}
|
|
254
|
+
interface ChatErrCode {
|
|
255
|
+
/** 未开通双人通话 */
|
|
256
|
+
[-20000]
|
|
257
|
+
/** 当前设备不支持 */
|
|
258
|
+
[-20001]
|
|
259
|
+
/** 正在通话中 */
|
|
260
|
+
[-20002]
|
|
261
|
+
/** 其它小程序正在通话中 */
|
|
262
|
+
[-20003]
|
|
263
|
+
/** 内部系统错误 */
|
|
264
|
+
[-30000]
|
|
265
|
+
/** 微信缺失相机权限 */
|
|
266
|
+
[-30001]
|
|
267
|
+
/** 微信缺失录音权限 */
|
|
268
|
+
[-30002]
|
|
269
|
+
/** 小程序缺失录音权限 */
|
|
270
|
+
[-30003]
|
|
271
|
+
/** 小程序缺失相机权限 */
|
|
272
|
+
[-30004]
|
|
273
|
+
/** 当前已在房间内 */
|
|
274
|
+
[-1]
|
|
275
|
+
/** 录音设备被占用,可能是当前正在使用微信内语音通话或系统通话 */
|
|
276
|
+
[-2]
|
|
277
|
+
/** 加入会话期间退出(可能是用户主动退出,或者退后台、来电等原因),因此加入失败 */
|
|
278
|
+
[-3]
|
|
279
|
+
/** 系统错误 */
|
|
280
|
+
[-1000]
|
|
281
|
+
}
|
|
282
|
+
interface FailCallbackResult extends TaroGeneral.CallbackResult {
|
|
283
|
+
/** 错误信息 */
|
|
284
|
+
errMsg: string
|
|
285
|
+
/** 错误码 */
|
|
286
|
+
errCode: keyof ChatErrCode
|
|
287
|
+
}
|
|
288
|
+
interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
|
|
289
|
+
/** 错误码 */
|
|
290
|
+
errCode: number
|
|
291
|
+
/** 调用结果 */
|
|
292
|
+
errMsg: string
|
|
293
|
+
}
|
|
294
|
+
type Promised = FailCallbackResult | SuccessCallbackResult
|
|
295
|
+
}
|
|
296
|
+
|
|
205
297
|
namespace exitVoIPChat {
|
|
206
298
|
interface Option {
|
|
207
299
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
@@ -264,6 +356,12 @@ declare module '../../index' {
|
|
|
264
356
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.offVoIPChatStateChanged.html
|
|
265
357
|
*/
|
|
266
358
|
offVoIPChatStateChanged(callback: onVoIPChatStateChanged.Callback): void
|
|
359
|
+
/**
|
|
360
|
+
* 取消监听实时语音通话成员通话状态变化事件
|
|
361
|
+
* @supported weapp
|
|
362
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.offVoIPChatSpeakersChanged.html
|
|
363
|
+
*/
|
|
364
|
+
offVoIPChatSpeakersChanged(callback: onVoIPChatSpeakersChanged.Callback): void
|
|
267
365
|
/** 取消监听实时语音通话成员在线状态变化事件
|
|
268
366
|
* @supported weapp
|
|
269
367
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.offVoIPChatMembersChanged.html
|
|
@@ -281,6 +379,11 @@ declare module '../../index' {
|
|
|
281
379
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.joinVoIPChat.html
|
|
282
380
|
*/
|
|
283
381
|
joinVoIPChat(option: joinVoIPChat.Option): Promise<joinVoIPChat.Promised>
|
|
382
|
+
/**加入(创建)双人通话
|
|
383
|
+
* @supported weapp
|
|
384
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.join1v1Chat.html
|
|
385
|
+
*/
|
|
386
|
+
join1v1Chat(option: join1v1Chat.Option): Promise<join1v1Chat.Promised>
|
|
284
387
|
/** 退出(销毁)实时语音通话
|
|
285
388
|
* @supported weapp
|
|
286
389
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.exitVoIPChat.html
|
|
@@ -57,14 +57,6 @@ declare module '../../index' {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
namespace DownloadTask {
|
|
60
|
-
/** HTTP Response Header 事件的回调函数 */
|
|
61
|
-
type OffHeadersReceivedCallback = (
|
|
62
|
-
res: TaroGeneral.CallbackResult,
|
|
63
|
-
) => void
|
|
64
|
-
/** 下载进度变化事件的回调函数 */
|
|
65
|
-
type OffProgressUpdateCallback = (
|
|
66
|
-
res: TaroGeneral.CallbackResult,
|
|
67
|
-
) => void
|
|
68
60
|
/** HTTP Response Header 事件的回调函数 */
|
|
69
61
|
type OnHeadersReceivedCallback = (
|
|
70
62
|
result: OnHeadersReceivedCallbackResult,
|
|
@@ -135,7 +127,7 @@ declare module '../../index' {
|
|
|
135
127
|
*/
|
|
136
128
|
offProgressUpdate(
|
|
137
129
|
/** 下载进度变化事件的回调函数 */
|
|
138
|
-
callback: DownloadTask.
|
|
130
|
+
callback: DownloadTask.OnProgressUpdateCallback,
|
|
139
131
|
): void
|
|
140
132
|
/** 监听 HTTP Response Header 事件。会比请求完成事件更早
|
|
141
133
|
* @supported weapp, h5
|
|
@@ -151,7 +143,7 @@ declare module '../../index' {
|
|
|
151
143
|
*/
|
|
152
144
|
offHeadersReceived(
|
|
153
145
|
/** HTTP Response Header 事件的回调函数 */
|
|
154
|
-
callback: DownloadTask.
|
|
146
|
+
callback: DownloadTask.OnHeadersReceivedCallback,
|
|
155
147
|
): void
|
|
156
148
|
}
|
|
157
149
|
|
|
@@ -2,7 +2,7 @@ import Taro from '../../index'
|
|
|
2
2
|
|
|
3
3
|
declare module '../../index' {
|
|
4
4
|
namespace request {
|
|
5
|
-
interface Option
|
|
5
|
+
interface Option<T = any, U extends string | TaroGeneral.IAnyObject | ArrayBuffer = any | any> {
|
|
6
6
|
/** 开发者服务器接口地址 */
|
|
7
7
|
url: string
|
|
8
8
|
/** 请求的参数 */
|
|
@@ -14,11 +14,11 @@ declare module '../../index' {
|
|
|
14
14
|
header?: TaroGeneral.IAnyObject
|
|
15
15
|
/** 超时时间,单位为毫秒
|
|
16
16
|
* @default 2000
|
|
17
|
-
* @supported weapp, h5, tt
|
|
17
|
+
* @supported weapp, h5, tt, alipay
|
|
18
18
|
*/
|
|
19
19
|
timeout?: number
|
|
20
20
|
/** HTTP 请求方法
|
|
21
|
-
* @default GET
|
|
21
|
+
* @default "GET"
|
|
22
22
|
*/
|
|
23
23
|
method?: keyof Method
|
|
24
24
|
/** 返回的数据格式 */
|
|
@@ -54,70 +54,99 @@ declare module '../../index' {
|
|
|
54
54
|
* @supported weapp
|
|
55
55
|
*/
|
|
56
56
|
enableChunked?: boolean
|
|
57
|
+
/**
|
|
58
|
+
* wifi下使用移动网络发送请求
|
|
59
|
+
* @default false
|
|
60
|
+
* @supported weapp
|
|
61
|
+
*/
|
|
62
|
+
forceCellularNetwork?: boolean
|
|
63
|
+
/**
|
|
64
|
+
* headers 中设置 cookie 字段是否生效。如果为 false,则 headers 中的 cookie 字段将被忽略,请求头中将包含服务端上一次返回的 cookie(如果有)。
|
|
65
|
+
* @default false
|
|
66
|
+
* @supported alipay 支付宝: 10.2.33+
|
|
67
|
+
*/
|
|
68
|
+
enableCookie?: boolean
|
|
69
|
+
/**
|
|
70
|
+
* referer 策略,用于控制当前请求 header 对象中 referer 字段格式。该参数默认值可通过 app.json 中的配置进行修改。
|
|
71
|
+
* @default "querystring"
|
|
72
|
+
* @supported alipay 支付宝: 10.3.50+ APPX: 2.8.7 开发者工具: 3.5.1
|
|
73
|
+
* @see https://opendocs.alipay.com/mini/api/owycmh#referrerStrategy%20%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E
|
|
74
|
+
*/
|
|
75
|
+
referrerStrategy?: keyof ReferrerStrategy
|
|
57
76
|
/** 接口调用成功的回调函数 */
|
|
58
77
|
success?: (result: SuccessCallbackResult<T>) => void
|
|
59
78
|
/** 接口调用失败的回调函数 */
|
|
60
79
|
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
61
80
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
62
81
|
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
63
|
-
/**
|
|
82
|
+
/** 设置是否使用 jsonp 方式获取数据
|
|
64
83
|
* @default false
|
|
65
84
|
* @supported h5
|
|
66
85
|
*/
|
|
67
|
-
jsonp?: boolean
|
|
68
|
-
/** 设置
|
|
69
|
-
* @default false
|
|
86
|
+
jsonp?: boolean | string
|
|
87
|
+
/** 设置 jsonp 请求 url 是否需要被缓存
|
|
70
88
|
* @supported h5
|
|
71
89
|
*/
|
|
72
|
-
jsonpCache?:
|
|
73
|
-
/**
|
|
90
|
+
jsonpCache?: RequestCache
|
|
91
|
+
/** 设置是否允许跨域请求
|
|
74
92
|
* @default "same-origin"
|
|
75
93
|
* @supported h5
|
|
76
94
|
*/
|
|
77
95
|
mode?: keyof CorsMode
|
|
78
|
-
/**
|
|
96
|
+
/** 设置是否携带 Cookie
|
|
79
97
|
* @default "omit"
|
|
80
98
|
* @supported h5
|
|
81
99
|
*/
|
|
82
100
|
credentials?: keyof Credentials
|
|
83
|
-
/**
|
|
101
|
+
/** 设置缓存模式
|
|
84
102
|
* @default "default"
|
|
85
103
|
* @supported h5
|
|
86
104
|
*/
|
|
87
105
|
cache?: keyof Cache
|
|
88
|
-
/**
|
|
106
|
+
/** 设置请求重试次数
|
|
89
107
|
* @default 2
|
|
90
108
|
* @supported h5
|
|
109
|
+
* @h5 仅在 jsonp 模式下生效
|
|
91
110
|
*/
|
|
92
111
|
retryTimes?: number
|
|
93
|
-
/**
|
|
112
|
+
/** 设置请求的兜底接口
|
|
94
113
|
* @supported h5
|
|
114
|
+
* @h5 仅在 jsonp 模式下生效
|
|
95
115
|
*/
|
|
96
116
|
backup?: string | string[]
|
|
97
|
-
/**
|
|
117
|
+
/** 设置请求中止信号
|
|
118
|
+
* @supported h5
|
|
119
|
+
*/
|
|
120
|
+
signal?: AbortSignal
|
|
121
|
+
/** 设置请求响应的数据校验函数,若返回 false,则请求兜底接口,若无兜底接口,则报请求失败
|
|
98
122
|
* @supported h5
|
|
123
|
+
* @h5 仅在 jsonp 模式下生效
|
|
99
124
|
*/
|
|
100
125
|
dataCheck?(): boolean
|
|
101
|
-
/**
|
|
126
|
+
/** 设置请求是否使用缓存
|
|
102
127
|
* @default false
|
|
103
128
|
* @supported h5
|
|
129
|
+
* @h5 仅在 jsonp 模式下生效
|
|
104
130
|
*/
|
|
105
131
|
useStore?: boolean
|
|
106
|
-
/**
|
|
132
|
+
/** 设置请求缓存校验的 key
|
|
107
133
|
* @supported h5
|
|
134
|
+
* @h5 仅在 jsonp 模式下生效
|
|
108
135
|
*/
|
|
109
136
|
storeCheckKey?: string
|
|
110
|
-
/**
|
|
137
|
+
/** 设置请求缓存签名
|
|
111
138
|
* @supported h5
|
|
139
|
+
* @h5 仅在 jsonp 模式下生效
|
|
112
140
|
*/
|
|
113
141
|
storeSign?: string
|
|
114
|
-
/**
|
|
142
|
+
/** 设置请求校验函数,一般不需要设置
|
|
115
143
|
* @supported h5
|
|
116
144
|
*/
|
|
117
145
|
storeCheck?(): boolean
|
|
118
146
|
}
|
|
119
147
|
|
|
120
|
-
interface SuccessCallbackResult
|
|
148
|
+
interface SuccessCallbackResult<T extends string | TaroGeneral.IAnyObject | ArrayBuffer = any | any>
|
|
149
|
+
extends TaroGeneral.CallbackResult {
|
|
121
150
|
/** 开发者服务器返回的数据 */
|
|
122
151
|
data: T
|
|
123
152
|
/** 开发者服务器返回的 HTTP Response Header */
|
|
@@ -132,10 +161,26 @@ declare module '../../index' {
|
|
|
132
161
|
|
|
133
162
|
/** 返回的数据格式 */
|
|
134
163
|
interface DataType {
|
|
135
|
-
/**
|
|
164
|
+
/**
|
|
165
|
+
* 返回的数据为 JSON,返回后会对返回的数据进行一次 JSON.parse
|
|
136
166
|
* 其他: 不对返回的内容进行 JSON.parse
|
|
137
167
|
*/
|
|
138
168
|
json
|
|
169
|
+
/**
|
|
170
|
+
* 返回的数据为文本字符串
|
|
171
|
+
* @supported alipay
|
|
172
|
+
*/
|
|
173
|
+
text
|
|
174
|
+
/**
|
|
175
|
+
* 返回的数据将转换为 base64 格式字符串
|
|
176
|
+
* @supported alipay
|
|
177
|
+
*/
|
|
178
|
+
base64
|
|
179
|
+
/**
|
|
180
|
+
* 返回的数据将保持 ArrayBuffer 数据
|
|
181
|
+
* @supported alipay 支付宝: 10.1.70+
|
|
182
|
+
*/
|
|
183
|
+
arraybuffer
|
|
139
184
|
}
|
|
140
185
|
|
|
141
186
|
/** HTTP 请求方法 */
|
|
@@ -199,6 +244,21 @@ declare module '../../index' {
|
|
|
199
244
|
/** 浏览器在其HTTP缓存中寻找匹配的请求 */
|
|
200
245
|
'only-if-cached'
|
|
201
246
|
}
|
|
247
|
+
/** referer 策略 */
|
|
248
|
+
interface ReferrerStrategy {
|
|
249
|
+
/**
|
|
250
|
+
* referer 值为 https://{appid}.hybrid.alipay-eco.com/{appid}/{version}/index.html
|
|
251
|
+
*/
|
|
252
|
+
index
|
|
253
|
+
/**
|
|
254
|
+
* 保留 page(pages/xxx/yyy),referer 值为 https://{appid}.hybrid.alipay-eco.com/{appid}/{version}/index.html#{page}
|
|
255
|
+
*/
|
|
256
|
+
page
|
|
257
|
+
/**
|
|
258
|
+
* 默认值。会将发起请求时所在页面的 URL 作为 referer 值,会保留 page(pages/xxx/yyy)和 querystring(x=1&y=2)并可能有框架添加的其他参数,referer 值为 https://{appid}.hybrid.alipay-eco.com/{appid}/{version}/index.html#{page}?{querysrtring}{框架其他参数}
|
|
259
|
+
*/
|
|
260
|
+
querystring
|
|
261
|
+
}
|
|
202
262
|
}
|
|
203
263
|
|
|
204
264
|
/** 网络请求任务对象
|
|
@@ -266,7 +326,7 @@ declare module '../../index' {
|
|
|
266
326
|
*/
|
|
267
327
|
onHeadersReceived(
|
|
268
328
|
/** HTTP Response Header 事件的回调函数 */
|
|
269
|
-
callback: RequestTask.onHeadersReceived.Callback
|
|
329
|
+
callback: RequestTask.onHeadersReceived.Callback
|
|
270
330
|
): void
|
|
271
331
|
/** 取消监听 HTTP Response Header 事件
|
|
272
332
|
* @supported weapp
|
|
@@ -274,7 +334,7 @@ declare module '../../index' {
|
|
|
274
334
|
*/
|
|
275
335
|
offHeadersReceived(
|
|
276
336
|
/** HTTP Response Header 事件的回调函数 */
|
|
277
|
-
callback: RequestTask.onHeadersReceived.Callback
|
|
337
|
+
callback: RequestTask.onHeadersReceived.Callback
|
|
278
338
|
): void
|
|
279
339
|
/** 监听 Transfer-Encoding Chunk Received 事件。当接收到新的chunk时触发。
|
|
280
340
|
* @supported weapp
|
|
@@ -282,7 +342,7 @@ declare module '../../index' {
|
|
|
282
342
|
*/
|
|
283
343
|
onChunkReceived(
|
|
284
344
|
/** Transfer-Encoding Chunk Received 事件的回调函数 */
|
|
285
|
-
callback: RequestTask.onChunkReceived.Callback
|
|
345
|
+
callback: RequestTask.onChunkReceived.Callback
|
|
286
346
|
): void
|
|
287
347
|
/** 移除 Transfer-Encoding Chunk Received 事件的监听函数
|
|
288
348
|
* @supported weapp
|
|
@@ -290,7 +350,7 @@ declare module '../../index' {
|
|
|
290
350
|
*/
|
|
291
351
|
offChunkReceived(
|
|
292
352
|
/** Transfer-Encoding Chunk Received 事件的回调函数 */
|
|
293
|
-
callback: RequestTask.onChunkReceived.Callback
|
|
353
|
+
callback: RequestTask.onChunkReceived.Callback
|
|
294
354
|
): void
|
|
295
355
|
}
|
|
296
356
|
|
|
@@ -56,14 +56,6 @@ declare module '../../index' {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
namespace UploadTask {
|
|
59
|
-
/** HTTP Response Header 事件的回调函数 */
|
|
60
|
-
type OffHeadersReceivedCallback = (
|
|
61
|
-
res: TaroGeneral.CallbackResult,
|
|
62
|
-
) => void
|
|
63
|
-
/** 上传进度变化事件的回调函数 */
|
|
64
|
-
type OffProgressUpdateCallback = (
|
|
65
|
-
res: TaroGeneral.CallbackResult,
|
|
66
|
-
) => void
|
|
67
59
|
/** HTTP Response Header 事件的回调函数 */
|
|
68
60
|
type OnHeadersReceivedCallback = (
|
|
69
61
|
result: OnHeadersReceivedCallbackResult,
|
|
@@ -138,7 +130,7 @@ declare module '../../index' {
|
|
|
138
130
|
*/
|
|
139
131
|
offProgressUpdate(
|
|
140
132
|
/** 上传进度变化事件的回调函数 */
|
|
141
|
-
callback: UploadTask.
|
|
133
|
+
callback: UploadTask.OnProgressUpdateCallback,
|
|
142
134
|
): void
|
|
143
135
|
/** 监听 HTTP Response Header 事件。会比请求完成事件更早
|
|
144
136
|
* @supported weapp, h5
|
|
@@ -154,7 +146,7 @@ declare module '../../index' {
|
|
|
154
146
|
*/
|
|
155
147
|
offHeadersReceived(
|
|
156
148
|
/** HTTP Response Header 事件的回调函数 */
|
|
157
|
-
callback: UploadTask.
|
|
149
|
+
callback: UploadTask.OnHeadersReceivedCallback,
|
|
158
150
|
): void
|
|
159
151
|
}
|
|
160
152
|
|
|
@@ -4,32 +4,34 @@ declare module '../../index' {
|
|
|
4
4
|
namespace chooseAddress {
|
|
5
5
|
interface Option {
|
|
6
6
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
7
|
-
complete?: (res:
|
|
7
|
+
complete?: (res: SuccessCallbackResult) => void
|
|
8
8
|
/** 接口调用失败的回调函数 */
|
|
9
9
|
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
10
10
|
/** 接口调用成功的回调函数 */
|
|
11
11
|
success?: (result: SuccessCallbackResult) => void
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
interface SuccessCallbackResult {
|
|
14
|
+
interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
|
|
15
|
+
/** 收货人姓名 */
|
|
16
|
+
userName: string
|
|
17
|
+
/** 邮编 */
|
|
18
|
+
postalCode: string
|
|
19
|
+
/** 国标收货地址第一级地址 */
|
|
20
|
+
provinceName: string
|
|
15
21
|
/** 国标收货地址第二级地址 */
|
|
16
22
|
cityName: string
|
|
17
23
|
/** 国标收货地址第三级地址 */
|
|
18
24
|
countyName: string
|
|
25
|
+
/** 国标收货地址第四级地址 */
|
|
26
|
+
streetName: string
|
|
19
27
|
/** 详细收货地址信息 */
|
|
20
28
|
detailInfo: string
|
|
21
|
-
/**
|
|
22
|
-
|
|
29
|
+
/** 新选择器详细收货地址信息 */
|
|
30
|
+
detailInfoNew: string
|
|
23
31
|
/** 收货地址国家码 */
|
|
24
32
|
nationalCode: string
|
|
25
|
-
/** 邮编 */
|
|
26
|
-
postalCode: string
|
|
27
|
-
/** 国标收货地址第一级地址 */
|
|
28
|
-
provinceName: string
|
|
29
33
|
/** 收货人手机号码 */
|
|
30
34
|
telNumber: string
|
|
31
|
-
/** 收货人姓名 */
|
|
32
|
-
userName: string
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -68,6 +68,31 @@ declare module '../../index' {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
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
|
+
|
|
71
96
|
namespace getChannelsLiveNoticeInfo {
|
|
72
97
|
interface Option {
|
|
73
98
|
/** 视频号 id,以“sph”开头的id,可在视频号助手获取 */
|
|
@@ -164,6 +189,12 @@ declare module '../../index' {
|
|
|
164
189
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/channels/wx.openChannelsActivity.html
|
|
165
190
|
*/
|
|
166
191
|
openChannelsActivity(option?: openChannelsActivity.Option): Promise<TaroGeneral.CallbackResult>
|
|
192
|
+
/** 获取视频号直播卡片/视频卡片的分享来源,
|
|
193
|
+
* 仅当卡片携带了分享信息、同时用户已授权该小程序获取视频号分享信息且启动场景值为 1177、1184、1195、1208 时可用
|
|
194
|
+
* @supported weapp
|
|
195
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/channels/wx.getChannelsShareKey.html
|
|
196
|
+
*/
|
|
197
|
+
getChannelsShareKey(option?: getChannelsShareKey.Option): Promise<getChannelsShareKey.SuccessCallbackResult>
|
|
167
198
|
/** 获取视频号直播预告信息
|
|
168
199
|
* @supported weapp
|
|
169
200
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/channels/wx.getChannelsLiveNoticeInfo.html
|
|
@@ -0,0 +1,63 @@
|
|
|
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: SuccessCallbackResult) => 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
|
+
* @supported weapp
|
|
54
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/device-voip/wx.requestDeviceVoIP.html
|
|
55
|
+
*/
|
|
56
|
+
requestDeviceVoIP(option: requestDeviceVoIP.Option): Promise<TaroGeneral.CallbackResult>
|
|
57
|
+
/** 查询当前用户授权的音视频通话设备(组)信息
|
|
58
|
+
* @supported weapp
|
|
59
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/device-voip/wx.getDeviceVoIPList.html
|
|
60
|
+
*/
|
|
61
|
+
getDeviceVoIPList(option: getDeviceVoIPList.Option): Promise<getDeviceVoIPList.SuccessCallbackResult>
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -156,6 +156,7 @@ declare module '../../index' {
|
|
|
156
156
|
|
|
157
157
|
/** 关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。
|
|
158
158
|
* @supported weapp, h5, rn, tt
|
|
159
|
+
* @h5 未针对 tabbar 页面做限制处理
|
|
159
160
|
* @example
|
|
160
161
|
* ```tsx
|
|
161
162
|
* Taro.redirectTo({
|
|
@@ -168,6 +169,7 @@ declare module '../../index' {
|
|
|
168
169
|
|
|
169
170
|
/** 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。使用 Taro.navigateBack 可以返回到原页面。小程序中页面栈最多十层。
|
|
170
171
|
* @supported weapp, h5, rn, tt
|
|
172
|
+
* @h5 未针对 tabbar 页面做限制处理
|
|
171
173
|
* @example
|
|
172
174
|
* ```tsx
|
|
173
175
|
* Taro.navigateTo({
|
|
@@ -200,7 +200,7 @@ declare module '../../index' {
|
|
|
200
200
|
* Taro.downloadFile({
|
|
201
201
|
* url: 'https://res.wx.qq.com/wxdoc/dist/assets/img/demo.ef5c5bef.jpg',
|
|
202
202
|
* success: (res) => {
|
|
203
|
-
*
|
|
203
|
+
* Taro.showShareImageMenu({
|
|
204
204
|
* path: res.tempFilePath
|
|
205
205
|
* })
|
|
206
206
|
* }
|