@tarojs/taro 3.7.0-alpha.2 → 3.7.0-alpha.4

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.
@@ -18,11 +18,23 @@ declare module '../../index' {
18
18
  interface Option {
19
19
  /** 需要预览的图片链接列表。 */
20
20
  urls: string[]
21
- /** 当前显示图片的链接 */
22
- current?: string
23
- /** @support weapp 最低版本:2.13.0。是否显示长按菜单,默认值:true */
21
+ /**
22
+ * 微信端为当前显示图片的链接,支付宝端为当前显示图片的索引值
23
+ */
24
+ current?: string | number
25
+ /**
26
+ * 是否支持长按下载图片
27
+ * @supported alipay 基础库: 1.13.0
28
+ */
29
+ enablesavephoto?: boolean
30
+ /**
31
+ * 是否在右下角显示下载入口
32
+ * @supported alipay 基础库: 1.13.0
33
+ */
34
+ enableShowPhotoDownload?: boolean
35
+ /** @supported weapp 最低版本:2.13.0。是否显示长按菜单,默认值:true */
24
36
  showmenu?: boolean
25
- /** @support weapp 最低版本:2.13.0。origin: 发送完整的referrer; no-referrer: 不发送。格式固定为 https://servicewechat.com/{appid}/{version}/page-frame.html,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本;默认值:no-referrer */
37
+ /** @supported weapp 最低版本:2.13.0。origin: 发送完整的referrer; no-referrer: 不发送。格式固定为 https://servicewechat.com/{appid}/{version}/page-frame.html,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本;默认值:no-referrer */
26
38
  referrerPolicy?: string
27
39
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
28
40
  complete?: (res: TaroGeneral.CallbackResult) => void
@@ -46,7 +58,7 @@ declare module '../../index' {
46
58
  /** 需要预览的资源列表 */
47
59
  sources: Sources[]
48
60
  /** 当前显示的资源序号,默认值:0 */
49
- current?: number
61
+ current?: number
50
62
  /** 是否显示长按菜单 2.13.0,默认值:true */
51
63
  showmenu?: boolean
52
64
  /** origin: 发送完整的referrer; no-referrer: 不发送。格式固定为 https://servicewechat.com/{appid}/{version}/page-frame.html,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本;默认值:no-referrer */
@@ -127,19 +139,30 @@ declare module '../../index' {
127
139
 
128
140
  namespace chooseImage {
129
141
  interface Option {
142
+ /** 最多可以选择的图片张数
143
+ * @default 9
144
+ * @supported weapp, alipay, swan, tt, h5, rn
145
+ */
146
+ count?: number
147
+ /** 所选的图片的尺寸
148
+ * @default ['original', 'compressed']
149
+ * @supported weapp, alipay, swan, tt, rn
150
+ */
151
+ sizeType?: Array<keyof sizeType>
152
+ /** 选择图片的来源
153
+ * @default ['album', 'camera']
154
+ * @supported weapp, alipay, swan, tt, h5, rn
155
+ */
156
+ sourceType?: Array<keyof sourceType>
130
157
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
131
158
  complete?: (res: TaroGeneral.CallbackResult) => void
132
- /** 最多可以选择的图片张数 */
133
- count?: number
134
159
  /** 接口调用失败的回调函数 */
135
160
  fail?: (res: TaroGeneral.CallbackResult) => void
136
- /** 所选的图片的尺寸 */
137
- sizeType?: Array<keyof sizeType>
138
- /** 选择图片的来源 */
139
- sourceType?: Array<keyof sourceType>
140
161
  /** 接口调用成功的回调函数 */
141
162
  success?: (result: SuccessCallbackResult) => void
142
- /** 用来上传的input元素ID(仅h5端)@supported h5 */
163
+ /** 用来上传的input元素ID(仅h5
164
+ * @supported h5
165
+ */
143
166
  imageId?: string
144
167
  }
145
168
  /** 图片的尺寸 */
@@ -301,7 +324,7 @@ declare module '../../index' {
301
324
 
302
325
  interface TaroStatic {
303
326
  /** 保存图片到系统相册。需要[用户授权](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html) scope.writePhotosAlbum
304
- * @supported weapp, rn, alipay, swan, tt
327
+ * @supported weapp, alipay, swan, tt, h5, rn
305
328
  * @example
306
329
  * ```tsx
307
330
  * Taro.saveImageToPhotosAlbum({
@@ -325,7 +348,7 @@ declare module '../../index' {
325
348
  previewMedia(option: previewMedia.Option): Promise<TaroGeneral.CallbackResult>
326
349
 
327
350
  /** 在新页面中全屏预览图片。预览的过程中用户可以进行保存图片、发送给朋友等操作。
328
- * @supported weapp, h5, rn, alipay, swan, tt
351
+ * @supported weapp, alipay, swan, tt, h5, rn
329
352
  * @example
330
353
  * ```tsx
331
354
  * Taro.previewImage({
@@ -338,7 +361,7 @@ declare module '../../index' {
338
361
  previewImage(option: previewImage.Option): Promise<TaroGeneral.CallbackResult>
339
362
 
340
363
  /** 获取图片信息。网络图片需先配置download域名才能生效。
341
- * @supported weapp, h5, rn, alipay, swan, tt
364
+ * @supported weapp, alipay, swan, tt, h5, rn
342
365
  * @example
343
366
  * ```tsx
344
367
  * Taro.getImageInfo({
@@ -377,7 +400,7 @@ declare module '../../index' {
377
400
  editImage(option: editImage.Option): Promise<editImage.SuccessCallbackResult>
378
401
 
379
402
  /** 压缩图片接口,可选压缩质量
380
- * @supported weapp, rn, tt
403
+ * @supported weapp, tt, rn
381
404
  * @example
382
405
  * ```tsx
383
406
  * Taro.compressImage({
@@ -408,7 +431,7 @@ declare module '../../index' {
408
431
 
409
432
  /**
410
433
  * 从本地相册选择图片或使用相机拍照。
411
- * @supported weapp, h5, rn, alipay, swan, tt
434
+ * @supported weapp, alipay, swan, tt, h5, rn
412
435
  * @example
413
436
  * ```tsx
414
437
  * Taro.chooseImage({
@@ -227,6 +227,14 @@ declare module '../../index' {
227
227
  toggleTorch(option?: LivePusherContext.ToggleTorchOption): void
228
228
  }
229
229
  namespace LivePlayerContext {
230
+ interface ExitCastingOption {
231
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
232
+ complete?: (res: TaroGeneral.CallbackResult) => void
233
+ /** 接口调用失败的回调函数 */
234
+ fail?: (res: TaroGeneral.CallbackResult) => void
235
+ /** 接口调用成功的回调函数 */
236
+ success?: (res: TaroGeneral.CallbackResult) => void
237
+ }
230
238
  interface ExitFullScreenOption {
231
239
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
232
240
  complete?: (res: TaroGeneral.CallbackResult) => void
@@ -267,6 +275,14 @@ declare module '../../index' {
267
275
  /** 接口调用成功的回调函数 */
268
276
  success?: (res: TaroGeneral.CallbackResult) => void
269
277
  }
278
+ interface ReconnectCastingOption {
279
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
280
+ complete?: (res: TaroGeneral.CallbackResult) => void
281
+ /** 接口调用失败的回调函数 */
282
+ fail?: (res: TaroGeneral.CallbackResult) => void
283
+ /** 接口调用成功的回调函数 */
284
+ success?: (res: TaroGeneral.CallbackResult) => void
285
+ }
270
286
  interface RequestFullScreenOption {
271
287
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
272
288
  complete?: (res: TaroGeneral.CallbackResult) => void
@@ -316,6 +332,14 @@ declare module '../../index' {
316
332
  /** 调用结果 */
317
333
  errMsg: string
318
334
  }
335
+ interface StartCastingOption {
336
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
337
+ complete?: (res: TaroGeneral.CallbackResult) => void
338
+ /** 接口调用失败的回调函数 */
339
+ fail?: (res: TaroGeneral.CallbackResult) => void
340
+ /** 接口调用成功的回调函数 */
341
+ success?: (res: TaroGeneral.CallbackResult) => void
342
+ }
319
343
  interface StopOption {
320
344
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
321
345
  complete?: (res: TaroGeneral.CallbackResult) => void
@@ -324,6 +348,14 @@ declare module '../../index' {
324
348
  /** 接口调用成功的回调函数 */
325
349
  success?: (res: TaroGeneral.CallbackResult) => void
326
350
  }
351
+ interface SwitchCastingOption {
352
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
353
+ complete?: (res: TaroGeneral.CallbackResult) => void
354
+ /** 接口调用失败的回调函数 */
355
+ fail?: (res: TaroGeneral.CallbackResult) => void
356
+ /** 接口调用成功的回调函数 */
357
+ success?: (res: TaroGeneral.CallbackResult) => void
358
+ }
327
359
  }
328
360
 
329
361
  /** `LivePlayerContext` 实例,可通过 `Taro.createLivePlayerContext` 获取。
@@ -332,6 +364,11 @@ declare module '../../index' {
332
364
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.html
333
365
  */
334
366
  interface LivePlayerContext {
367
+ /** 退出投屏。仅支持在 tap 事件回调内调用。
368
+ * @supported weapp
369
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.exitCasting.html
370
+ */
371
+ exitCasting(option?: LivePlayerContext.ExitCastingOption): void
335
372
  /** 退出全屏
336
373
  * @supported weapp
337
374
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.exitFullScreen.html
@@ -357,6 +394,11 @@ declare module '../../index' {
357
394
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.play.html
358
395
  */
359
396
  play(option?: LivePlayerContext.PlayOption): void
397
+ /** 重连投屏设备。仅支持在 tap 事件回调内调用。
398
+ * @supported weapp
399
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.reconnectCasting.html
400
+ */
401
+ reconnectCasting(option?: LivePlayerContext.ReconnectCastingOption): void
360
402
  /** 进入全屏
361
403
  * @supported weapp
362
404
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.requestFullScreen.html
@@ -381,11 +423,21 @@ declare module '../../index' {
381
423
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.snapshot.html
382
424
  */
383
425
  snapshot(option?: LivePlayerContext.SnapshotOption): void
426
+ /** 开始投屏, 拉起半屏搜索设备。仅支持在 tap 事件回调内调用
427
+ * @supported weapp
428
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.startCasting.html
429
+ */
430
+ startCasting(option?: LivePlayerContext.StartCastingOption): void
384
431
  /** 停止
385
432
  * @supported weapp
386
433
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.stop.html
387
434
  */
388
435
  stop(option?: LivePlayerContext.StopOption): void
436
+ /** 切换投屏设备。仅支持在 tap 事件回调内调用。
437
+ * @supported weapp
438
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.switchCasting.html
439
+ */
440
+ switchCasting(option?: LivePlayerContext.SwitchCastingOption): void
389
441
  }
390
442
 
391
443
  interface TaroStatic {
@@ -233,30 +233,42 @@ declare module '../../index' {
233
233
 
234
234
  namespace chooseVideo {
235
235
  interface Option {
236
- /** 默认拉起的是前置或者后置摄像头。部分 Android 手机下由于系统 ROM 不支持无法生效 */
236
+ /** 默认拉起的是前置或者后置摄像头。部分 Android 手机下由于系统 ROM 不支持无法生效
237
+ * @default "back"
238
+ * @supported weapp, h5
239
+ */
237
240
  camera?: keyof Camera
241
+ /** 是否压缩所选择的视频文件
242
+ * @default true
243
+ * @supported weapp
244
+ */
245
+ compressed?: boolean
246
+ /** 拍摄视频最长拍摄时间,单位秒
247
+ * @default 60
248
+ * @supported weapp
249
+ */
250
+ maxDuration?: number
251
+ /** 视频选择的来源
252
+ * @default ['album', 'camera']
253
+ * @supported weapp, h5
254
+ */
255
+ sourceType?: Array<keyof sourceType>
238
256
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
239
257
  complete?: (res: TaroGeneral.CallbackResult) => void
240
- /** 是否压缩所选择的视频文件 */
241
- compressed?: boolean
242
258
  /** 接口调用失败的回调函数 */
243
259
  fail?: (res: TaroGeneral.CallbackResult) => void
244
- /** 拍摄视频最长拍摄时间,单位秒 */
245
- maxDuration?: number
246
- /** 视频选择的来源 */
247
- sourceType?: Array<keyof sourceType>
248
260
  /** 接口调用成功的回调函数 */
249
261
  success?: (result: SuccessCallbackResult) => void
250
262
  }
251
263
  interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
264
+ /** 选定视频的临时文件路径 */
265
+ tempFilePath: string
252
266
  /** 选定视频的时间长度 */
253
267
  duration: number
254
- /** 返回选定视频的高度 */
255
- height: number
256
268
  /** 选定视频的数据量大小 */
257
269
  size: number
258
- /** 选定视频的临时文件路径 */
259
- tempFilePath: string
270
+ /** 返回选定视频的高度 */
271
+ height: number
260
272
  /** 返回选定视频的宽度 */
261
273
  width: number
262
274
  /** 调用结果 */
@@ -276,30 +288,53 @@ declare module '../../index' {
276
288
  }
277
289
  }
278
290
 
279
-
280
291
  namespace chooseMedia {
281
292
  interface Option {
282
- /** 最多可以选择的文件个数 */
293
+ /** 最多可以选择的文件个数
294
+ * @default 9
295
+ * @supported weapp, h5
296
+ */
283
297
  count?: number
284
- /** 文件类型 */
298
+ /** 文件类型
299
+ * @default ['image', 'video']
300
+ * @supported weapp, h5
301
+ */
285
302
  mediaType?: Array<keyof mediaType>
286
- /** 图片和视频选择的来源 */
303
+ /** 图片和视频选择的来源
304
+ * @default ['album', 'camera']
305
+ * @supported weapp, h5
306
+ */
287
307
  sourceType?: Array<keyof sourceType>
288
- /** 拍摄视频最长拍摄时间,单位秒。时间范围为 3s 至 30s 之间 */
308
+ /** 拍摄视频最长拍摄时间,单位秒。时间范围为 3s 至 60s 之间
309
+ * @default 10
310
+ * @supported weapp
311
+ */
289
312
  maxDuration?: number
290
- /** 仅对 mediaType 为 image 时有效,是否压缩所选文件 */
313
+ /** 是否压缩所选文件
314
+ * @default ['original', 'compressed']
315
+ * @supported weapp
316
+ */
291
317
  sizeType?: Array<'original' | 'compressed'>
292
- /** 仅在 sourceType 为 camera 时生效,使用前置或后置摄像头 */
318
+ /** 仅在 sourceType 为 camera 时生效,使用前置或后置摄像头
319
+ * @default "back"
320
+ * @supported weapp, h5
321
+ */
293
322
  camera?: string
323
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
324
+ complete?: (res: TaroGeneral.CallbackResult) => void
294
325
  /** 接口调用失败的回调函数 */
295
326
  fail?: (res: TaroGeneral.CallbackResult) => void
296
327
  /** 接口调用成功的回调函数 */
297
328
  success?: (result: SuccessCallbackResult) => void
329
+ /** 用来上传的input元素ID
330
+ * @supported h5
331
+ */
332
+ mediaId?: string
298
333
  }
299
334
  interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
300
335
  /** 本地临时文件列表 */
301
336
  tempFiles: ChooseMedia[]
302
- /** 文件类型,有效值有 image 、video */
337
+ /** 文件类型,有效值有 image 、video、mix */
303
338
  type: string
304
339
  }
305
340
  /** 本地临时文件列表 */
@@ -316,6 +351,12 @@ declare module '../../index' {
316
351
  width: number
317
352
  /** 视频缩略图临时文件路径 */
318
353
  thumbTempFilePath: string
354
+ /** 选择的文件的类型 */
355
+ fileType: string
356
+ /** 原始的浏览器 File 对象
357
+ * @supported h5
358
+ */
359
+ originalFileObj?: File
319
360
  }
320
361
  interface mediaType {
321
362
  /** 只能拍摄视频或从相册选择视频 */
@@ -346,11 +387,11 @@ declare module '../../index' {
346
387
  * **Bug & Tip:**
347
388
  *
348
389
  * 1. `tip`: camera 参数在部分 Android 手机下由于系统 ROM 不支持无法生效
349
- * @supported weapp, rn
390
+ * @supported weapp, h5, rn
350
391
  * @example
351
392
  ```tsx
352
393
  * Taro.saveVideoToPhotosAlbum({
353
- * filePath: 'wxfile://xxx',
394
+ * filePath: 'file://xxx',
354
395
  * success: function (res) {
355
396
  * console.log(res.errMsg)
356
397
  * }
@@ -447,7 +488,7 @@ declare module '../../index' {
447
488
  compressVideo(option: compressVideo.Option): Promise<compressVideo.SuccessCallbackResult>
448
489
 
449
490
  /** 拍摄视频或从手机相册中选视频。
450
- * @supported weapp, rn
491
+ * @supported weapp, h5, rn
451
492
  * @example
452
493
  * ```tsx
453
494
  * Taro.chooseVideo({
@@ -464,7 +505,7 @@ declare module '../../index' {
464
505
  chooseVideo(option: chooseVideo.Option): Promise<chooseVideo.SuccessCallbackResult>
465
506
 
466
507
  /** 拍摄或从手机相册中选择图片或视频。
467
- * @supported weapp
508
+ * @supported weapp, h5
468
509
  * @example
469
510
  * ```tsx
470
511
  * Taro.chooseMedia({
@@ -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
@@ -60,58 +60,61 @@ declare module '../../index' {
60
60
  fail?: (res: TaroGeneral.CallbackResult) => void
61
61
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
62
62
  complete?: (res: TaroGeneral.CallbackResult) => void
63
- /** 设置 H5 端是否使用jsonp方式获取数据
63
+ /** 设置是否使用 jsonp 方式获取数据
64
64
  * @default false
65
65
  * @supported h5
66
66
  */
67
- jsonp?: boolean
68
- /** 设置 H5 端 jsonp 请求 url 是否需要被缓存
69
- * @default false
67
+ jsonp?: boolean | string
68
+ /** 设置 jsonp 请求 url 是否需要被缓存
70
69
  * @supported h5
71
70
  */
72
- jsonpCache?: boolean
73
- /** 设置 H5 端是否允许跨域请求
71
+ jsonpCache?: RequestCache
72
+ /** 设置是否允许跨域请求
74
73
  * @default "same-origin"
75
74
  * @supported h5
76
75
  */
77
76
  mode?: keyof CorsMode
78
- /** 设置 H5 端是否携带 Cookie
77
+ /** 设置是否携带 Cookie
79
78
  * @default "omit"
80
79
  * @supported h5
81
80
  */
82
81
  credentials?: keyof Credentials
83
- /** 设置 H5 端缓存模式
82
+ /** 设置缓存模式
84
83
  * @default "default"
85
84
  * @supported h5
86
85
  */
87
86
  cache?: keyof Cache
88
- /** 设置 H5 端请求重试次数
87
+ /** 设置请求重试次数
89
88
  * @default 2
90
89
  * @supported h5
91
90
  */
92
91
  retryTimes?: number
93
- /** 设置 H5 端请求的兜底接口
92
+ /** 设置请求的兜底接口
94
93
  * @supported h5
95
94
  */
96
95
  backup?: string | string[]
97
- /** 设置 H5 端请求响应的数据校验函数,若返回 false,则请求兜底接口,若无兜底接口,则报请求失败
96
+ /** 设置请求中止信号
97
+ * @supported h5
98
+ */
99
+ signal?: AbortSignal
100
+ /** 设置请求响应的数据校验函数,若返回 false,则请求兜底接口,若无兜底接口,则报请求失败
98
101
  * @supported h5
99
102
  */
100
103
  dataCheck?(): boolean
101
- /** 设置 H5 端请求是否使用缓存
104
+ /** 设置请求是否使用缓存
102
105
  * @default false
103
106
  * @supported h5
104
107
  */
105
108
  useStore?: boolean
106
- /** 设置 H5 端请求缓存校验的 key
109
+ /** 设置请求缓存校验的 key
107
110
  * @supported h5
108
111
  */
109
112
  storeCheckKey?: string
110
- /** 设置 H5 端请求缓存签名
113
+ /** 设置请求缓存签名
111
114
  * @supported h5
112
115
  */
113
116
  storeSign?: string
114
- /** 设置 H5 端请求校验函数,一般不需要设置
117
+ /** 设置请求校验函数,一般不需要设置
115
118
  * @supported h5
116
119
  */
117
120
  storeCheck?(): boolean
@@ -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