@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.
Files changed (140) hide show
  1. package/README.md +12 -0
  2. package/dist/index.js +147 -0
  3. package/dist/index.js.map +1 -0
  4. package/index.js +9 -0
  5. package/package.json +86 -0
  6. package/types/api/ad/index.d.ts +197 -0
  7. package/types/api/ai/face.d.ts +133 -0
  8. package/types/api/ai/inference.d.ts +129 -0
  9. package/types/api/ai/visionkit.d.ts +874 -0
  10. package/types/api/alipay/index.d.ts +69 -0
  11. package/types/api/base/crypto.d.ts +104 -0
  12. package/types/api/base/debug.d.ts +329 -0
  13. package/types/api/base/env.d.ts +19 -0
  14. package/types/api/base/index.d.ts +102 -0
  15. package/types/api/base/performance.d.ts +258 -0
  16. package/types/api/base/system.d.ts +742 -0
  17. package/types/api/base/update.d.ts +130 -0
  18. package/types/api/base/weapp/app-event.d.ts +265 -0
  19. package/types/api/base/weapp/life-cycle.d.ts +155 -0
  20. package/types/api/canvas/index.d.ts +2162 -0
  21. package/types/api/cloud/index.d.ts +2622 -0
  22. package/types/api/data-analysis/index.d.ts +122 -0
  23. package/types/api/device/accelerometer.d.ts +102 -0
  24. package/types/api/device/accessibility.d.ts +26 -0
  25. package/types/api/device/battery.d.ts +46 -0
  26. package/types/api/device/bluetooth-ble.d.ts +601 -0
  27. package/types/api/device/bluetooth-peripheral.d.ts +430 -0
  28. package/types/api/device/bluetooth.d.ts +463 -0
  29. package/types/api/device/calendar.d.ts +98 -0
  30. package/types/api/device/clipboard.d.ts +81 -0
  31. package/types/api/device/compass.d.ts +105 -0
  32. package/types/api/device/contact.d.ts +110 -0
  33. package/types/api/device/gyroscope.d.ts +85 -0
  34. package/types/api/device/iBeacon.d.ts +168 -0
  35. package/types/api/device/keyboard.d.ts +97 -0
  36. package/types/api/device/memory.d.ts +52 -0
  37. package/types/api/device/motion.d.ts +88 -0
  38. package/types/api/device/network.d.ts +172 -0
  39. package/types/api/device/nfc.d.ts +1238 -0
  40. package/types/api/device/phone.d.ts +30 -0
  41. package/types/api/device/scan.d.ts +111 -0
  42. package/types/api/device/screen.d.ts +217 -0
  43. package/types/api/device/sms.d.ts +26 -0
  44. package/types/api/device/vibrate.d.ts +51 -0
  45. package/types/api/device/wifi.d.ts +301 -0
  46. package/types/api/ext/index.d.ts +64 -0
  47. package/types/api/files/index.d.ts +1472 -0
  48. package/types/api/framework/index.d.ts +51 -0
  49. package/types/api/location/index.d.ts +517 -0
  50. package/types/api/media/audio.d.ts +1013 -0
  51. package/types/api/media/background-audio.d.ts +291 -0
  52. package/types/api/media/camera.d.ts +207 -0
  53. package/types/api/media/editor.d.ts +239 -0
  54. package/types/api/media/image.d.ts +469 -0
  55. package/types/api/media/live.d.ts +461 -0
  56. package/types/api/media/map.d.ts +638 -0
  57. package/types/api/media/media-recorder.d.ts +117 -0
  58. package/types/api/media/recorder.d.ts +317 -0
  59. package/types/api/media/video-decoder.d.ts +117 -0
  60. package/types/api/media/video-processing.d.ts +84 -0
  61. package/types/api/media/video.d.ts +527 -0
  62. package/types/api/media/voip.d.ts +393 -0
  63. package/types/api/navigate/index.d.ts +327 -0
  64. package/types/api/network/download.d.ts +173 -0
  65. package/types/api/network/mdns.d.ts +191 -0
  66. package/types/api/network/request.d.ts +480 -0
  67. package/types/api/network/tcp.d.ts +181 -0
  68. package/types/api/network/udp.d.ts +218 -0
  69. package/types/api/network/upload.d.ts +201 -0
  70. package/types/api/network/websocket.d.ts +383 -0
  71. package/types/api/open-api/account.d.ts +51 -0
  72. package/types/api/open-api/address.d.ts +68 -0
  73. package/types/api/open-api/authorize.d.ts +80 -0
  74. package/types/api/open-api/card.d.ts +110 -0
  75. package/types/api/open-api/channels.d.ts +225 -0
  76. package/types/api/open-api/customer-service.d.ts +45 -0
  77. package/types/api/open-api/device-voip.d.ts +103 -0
  78. package/types/api/open-api/facial.d.ts +98 -0
  79. package/types/api/open-api/favorites.d.ts +101 -0
  80. package/types/api/open-api/group.d.ts +59 -0
  81. package/types/api/open-api/invoice.d.ts +87 -0
  82. package/types/api/open-api/license-plate.d.ts +27 -0
  83. package/types/api/open-api/login.d.ts +115 -0
  84. package/types/api/open-api/my-miniprogram.d.ts +28 -0
  85. package/types/api/open-api/privacy.d.ts +107 -0
  86. package/types/api/open-api/redpackage.d.ts +24 -0
  87. package/types/api/open-api/settings.d.ts +174 -0
  88. package/types/api/open-api/soter.d.ts +184 -0
  89. package/types/api/open-api/sticker.d.ts +83 -0
  90. package/types/api/open-api/subscribe-message.d.ts +305 -0
  91. package/types/api/open-api/user-info.d.ts +182 -0
  92. package/types/api/open-api/werun.d.ts +101 -0
  93. package/types/api/payment/index.d.ts +119 -0
  94. package/types/api/qq/index.d.ts +354 -0
  95. package/types/api/route/index.d.ts +324 -0
  96. package/types/api/share/index.d.ts +354 -0
  97. package/types/api/skyline/index.d.ts +345 -0
  98. package/types/api/storage/background-fetch.d.ts +131 -0
  99. package/types/api/storage/cache-manager.d.ts +249 -0
  100. package/types/api/storage/index.d.ts +405 -0
  101. package/types/api/swan/bookshelf.d.ts +307 -0
  102. package/types/api/swan/download-package.d.ts +80 -0
  103. package/types/api/swan/index.d.ts +251 -0
  104. package/types/api/swan/pay.d.ts +139 -0
  105. package/types/api/taro.extend.d.ts +233 -0
  106. package/types/api/taro.hooks.d.ts +148 -0
  107. package/types/api/ui/animation.d.ts +427 -0
  108. package/types/api/ui/background.d.ts +69 -0
  109. package/types/api/ui/custom-component.d.ts +23 -0
  110. package/types/api/ui/fonts.d.ts +77 -0
  111. package/types/api/ui/interaction.d.ts +281 -0
  112. package/types/api/ui/menu.d.ts +29 -0
  113. package/types/api/ui/navigation-bar.d.ts +130 -0
  114. package/types/api/ui/pull-down-refresh.d.ts +50 -0
  115. package/types/api/ui/scroll.d.ts +114 -0
  116. package/types/api/ui/sticky.d.ts +32 -0
  117. package/types/api/ui/tab-bar.d.ts +196 -0
  118. package/types/api/ui/window.d.ts +71 -0
  119. package/types/api/worker/index.d.ts +83 -0
  120. package/types/api/wxml/index.d.ts +540 -0
  121. package/types/compile/compiler.d.ts +32 -0
  122. package/types/compile/config/h5.d.ts +134 -0
  123. package/types/compile/config/harmony.d.ts +118 -0
  124. package/types/compile/config/index.d.ts +8 -0
  125. package/types/compile/config/manifest.d.ts +155 -0
  126. package/types/compile/config/mini.d.ts +118 -0
  127. package/types/compile/config/plugin.d.ts +34 -0
  128. package/types/compile/config/project.d.ts +338 -0
  129. package/types/compile/config/rn.d.ts +85 -0
  130. package/types/compile/config/util.d.ts +179 -0
  131. package/types/compile/hooks.d.ts +13 -0
  132. package/types/compile/index.d.ts +11 -0
  133. package/types/compile/viteCompilerContext.d.ts +167 -0
  134. package/types/global.d.ts +428 -0
  135. package/types/index.d.ts +190 -0
  136. package/types/taro.api.d.ts +130 -0
  137. package/types/taro.component.d.ts +168 -0
  138. package/types/taro.config.d.ts +712 -0
  139. package/types/taro.lifecycle.d.ts +220 -0
  140. package/types/taro.runtime.d.ts +9 -0
@@ -0,0 +1,461 @@
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
4
+ namespace LivePusherContext {
5
+ interface PauseOption {
6
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
7
+ complete?: (res: TaroGeneral.CallbackResult) => void
8
+ /** 接口调用失败的回调函数 */
9
+ fail?: (res: TaroGeneral.CallbackResult) => void
10
+ /** 接口调用成功的回调函数 */
11
+ success?: (res: TaroGeneral.CallbackResult) => void
12
+ }
13
+ interface PauseBGMOption {
14
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
15
+ complete?: (res: TaroGeneral.CallbackResult) => void
16
+ /** 接口调用失败的回调函数 */
17
+ fail?: (res: TaroGeneral.CallbackResult) => void
18
+ /** 接口调用成功的回调函数 */
19
+ success?: (res: TaroGeneral.CallbackResult) => void
20
+ }
21
+ interface PlayBGMOption {
22
+ /** 加入背景混音的资源地址 */
23
+ url: string
24
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
25
+ complete?: (res: TaroGeneral.CallbackResult) => void
26
+ /** 接口调用失败的回调函数 */
27
+ fail?: (res: TaroGeneral.CallbackResult) => void
28
+ /** 接口调用成功的回调函数 */
29
+ success?: (res: TaroGeneral.CallbackResult) => void
30
+ }
31
+ interface ResumeOption {
32
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
33
+ complete?: (res: TaroGeneral.CallbackResult) => void
34
+ /** 接口调用失败的回调函数 */
35
+ fail?: (res: TaroGeneral.CallbackResult) => void
36
+ /** 接口调用成功的回调函数 */
37
+ success?: (res: TaroGeneral.CallbackResult) => void
38
+ }
39
+ interface ResumeBGMOption {
40
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
41
+ complete?: (res: TaroGeneral.CallbackResult) => void
42
+ /** 接口调用失败的回调函数 */
43
+ fail?: (res: TaroGeneral.CallbackResult) => void
44
+ /** 接口调用成功的回调函数 */
45
+ success?: (res: TaroGeneral.CallbackResult) => void
46
+ }
47
+ interface SendMessageOption {
48
+ /** SEI消息 */
49
+ msg: string
50
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
51
+ complete?: (res: TaroGeneral.CallbackResult) => void
52
+ /** 接口调用失败的回调函数 */
53
+ fail?: (res: TaroGeneral.CallbackResult) => void
54
+ /** 接口调用成功的回调函数 */
55
+ success?: (res: TaroGeneral.CallbackResult) => void
56
+ }
57
+ interface SetBGMVolumeOption {
58
+ /** 音量大小,范围是 0-1 */
59
+ volume: number
60
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
61
+ complete?: (res: TaroGeneral.CallbackResult) => void
62
+ /** 接口调用失败的回调函数 */
63
+ fail?: (res: TaroGeneral.CallbackResult) => void
64
+ /** 接口调用成功的回调函数 */
65
+ success?: (res: TaroGeneral.CallbackResult) => void
66
+ }
67
+ interface SetMICVolumeOption {
68
+ /** 音量大小,范围是 0-1 */
69
+ volume: number
70
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
71
+ complete?: (res: TaroGeneral.CallbackResult) => void
72
+ /** 接口调用失败的回调函数 */
73
+ fail?: (res: TaroGeneral.CallbackResult) => void
74
+ /** 接口调用成功的回调函数 */
75
+ success?: (res: TaroGeneral.CallbackResult) => void
76
+ }
77
+ interface SnapshotOption {
78
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
79
+ complete?: (res: TaroGeneral.CallbackResult) => void
80
+ /** 接口调用失败的回调函数 */
81
+ fail?: (res: TaroGeneral.CallbackResult) => void
82
+ /** 接口调用成功的回调函数 */
83
+ success?: (res: TaroGeneral.CallbackResult) => void
84
+ }
85
+ interface StartOption {
86
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
87
+ complete?: (res: TaroGeneral.CallbackResult) => void
88
+ /** 接口调用失败的回调函数 */
89
+ fail?: (res: TaroGeneral.CallbackResult) => void
90
+ /** 接口调用成功的回调函数 */
91
+ success?: (res: TaroGeneral.CallbackResult) => void
92
+ }
93
+ interface StartPreviewOption {
94
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
95
+ complete?: (res: TaroGeneral.CallbackResult) => void
96
+ /** 接口调用失败的回调函数 */
97
+ fail?: (res: TaroGeneral.CallbackResult) => void
98
+ /** 接口调用成功的回调函数 */
99
+ success?: (res: TaroGeneral.CallbackResult) => void
100
+ }
101
+ interface StopOption {
102
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
103
+ complete?: (res: TaroGeneral.CallbackResult) => void
104
+ /** 接口调用失败的回调函数 */
105
+ fail?: (res: TaroGeneral.CallbackResult) => void
106
+ /** 接口调用成功的回调函数 */
107
+ success?: (res: TaroGeneral.CallbackResult) => void
108
+ }
109
+ interface StopBGMOption {
110
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
111
+ complete?: (res: TaroGeneral.CallbackResult) => void
112
+ /** 接口调用失败的回调函数 */
113
+ fail?: (res: TaroGeneral.CallbackResult) => void
114
+ /** 接口调用成功的回调函数 */
115
+ success?: (res: TaroGeneral.CallbackResult) => void
116
+ }
117
+ interface StopPreviewOption {
118
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
119
+ complete?: (res: TaroGeneral.CallbackResult) => void
120
+ /** 接口调用失败的回调函数 */
121
+ fail?: (res: TaroGeneral.CallbackResult) => void
122
+ /** 接口调用成功的回调函数 */
123
+ success?: (res: TaroGeneral.CallbackResult) => void
124
+ }
125
+ interface SwitchCameraOption {
126
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
127
+ complete?: (res: TaroGeneral.CallbackResult) => void
128
+ /** 接口调用失败的回调函数 */
129
+ fail?: (res: TaroGeneral.CallbackResult) => void
130
+ /** 接口调用成功的回调函数 */
131
+ success?: (res: TaroGeneral.CallbackResult) => void
132
+ }
133
+ interface ToggleTorchOption {
134
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
135
+ complete?: (res: TaroGeneral.CallbackResult) => void
136
+ /** 接口调用失败的回调函数 */
137
+ fail?: (res: TaroGeneral.CallbackResult) => void
138
+ /** 接口调用成功的回调函数 */
139
+ success?: (res: TaroGeneral.CallbackResult) => void
140
+ }
141
+ }
142
+ /** `LivePusherContext` 实例,可通过 `Taro.createLivePusherContext` 获取。
143
+ * `LivePusherContext` 与页面内唯一的 `live-pusher` 组件绑定,操作对应的 `live-pusher` 组件。
144
+ * @supported weapp
145
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.html
146
+ */
147
+ interface LivePusherContext {
148
+ /** 暂停推流
149
+ * @supported weapp
150
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.pause.html
151
+ */
152
+ pause(option?: LivePusherContext.PauseOption): void
153
+ /** 暂停背景音
154
+ * @supported weapp
155
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.pauseBGM.html
156
+ */
157
+ pauseBGM(option?: LivePusherContext.PauseBGMOption): void
158
+ /** 播放背景音
159
+ * @supported weapp
160
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.playBGM.html
161
+ */
162
+ playBGM(option: LivePusherContext.PlayBGMOption): void
163
+ /** 恢复推流
164
+ * @supported weapp
165
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.resume.html
166
+ */
167
+ resume(option?: LivePusherContext.ResumeOption): void
168
+ /** 恢复背景音
169
+ * @supported weapp
170
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.resumeBGM.html
171
+ */
172
+ resumeBGM(option?: LivePusherContext.ResumeBGMOption): void
173
+ /** 发送SEI消息
174
+ * @supported weapp
175
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.sendMessage.html
176
+ */
177
+ sendMessage(option?: LivePusherContext.SendMessageOption): void
178
+ /** 设置背景音音量
179
+ * @supported weapp
180
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.setBGMVolume.html
181
+ */
182
+ setBGMVolume(option: LivePusherContext.SetBGMVolumeOption): void
183
+ /** 设置麦克风音量
184
+ * @supported weapp
185
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.setMICVolume.html
186
+ */
187
+ setMICVolume(option: LivePusherContext.SetMICVolumeOption): void
188
+ /** 快照
189
+ * @supported weapp
190
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.snapshot.html
191
+ */
192
+ snapshot(option?: LivePusherContext.SnapshotOption): void
193
+ /** 开始推流,同时开启摄像头预览
194
+ * @supported weapp
195
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.start.html
196
+ */
197
+ start(option?: LivePusherContext.StartOption): void
198
+ /** 开启摄像头预览
199
+ * @supported weapp
200
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.startPreview.html
201
+ */
202
+ startPreview(option?: LivePusherContext.StartPreviewOption): void
203
+ /** 停止推流,同时停止摄像头预览
204
+ * @supported weapp
205
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.stop.html
206
+ */
207
+ stop(option?: LivePusherContext.StopOption): void
208
+ /** 停止背景音
209
+ * @supported weapp
210
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.stopBGM.html
211
+ */
212
+ stopBGM(option?: LivePusherContext.StopBGMOption): void
213
+ /** 关闭摄像头预览
214
+ * @supported weapp
215
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.stopPreview.html
216
+ */
217
+ stopPreview(option?: LivePusherContext.StopPreviewOption): void
218
+ /** 切换前后摄像头
219
+ * @supported weapp
220
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.switchCamera.html
221
+ */
222
+ switchCamera(option?: LivePusherContext.SwitchCameraOption): void
223
+ /** 切换手电筒
224
+ * @supported weapp
225
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.toggleTorch.html
226
+ */
227
+ toggleTorch(option?: LivePusherContext.ToggleTorchOption): void
228
+ }
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
+ }
238
+ interface ExitFullScreenOption {
239
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
240
+ complete?: (res: TaroGeneral.CallbackResult) => void
241
+ /** 接口调用失败的回调函数 */
242
+ fail?: (res: TaroGeneral.CallbackResult) => void
243
+ /** 接口调用成功的回调函数 */
244
+ success?: (res: TaroGeneral.CallbackResult) => void
245
+ }
246
+ interface ExitPictureInPictureOption {
247
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
248
+ complete?: (res: TaroGeneral.CallbackResult) => void
249
+ /** 接口调用失败的回调函数 */
250
+ fail?: (res: TaroGeneral.CallbackResult) => void
251
+ /** 接口调用成功的回调函数 */
252
+ success?: (res: TaroGeneral.CallbackResult) => void
253
+ }
254
+ interface MuteOption {
255
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
256
+ complete?: (res: TaroGeneral.CallbackResult) => void
257
+ /** 接口调用失败的回调函数 */
258
+ fail?: (res: TaroGeneral.CallbackResult) => void
259
+ /** 接口调用成功的回调函数 */
260
+ success?: (res: TaroGeneral.CallbackResult) => void
261
+ }
262
+ interface PauseOption {
263
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
264
+ complete?: (res: TaroGeneral.CallbackResult) => void
265
+ /** 接口调用失败的回调函数 */
266
+ fail?: (res: TaroGeneral.CallbackResult) => void
267
+ /** 接口调用成功的回调函数 */
268
+ success?: (res: TaroGeneral.CallbackResult) => void
269
+ }
270
+ interface PlayOption {
271
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
272
+ complete?: (res: TaroGeneral.CallbackResult) => void
273
+ /** 接口调用失败的回调函数 */
274
+ fail?: (res: TaroGeneral.CallbackResult) => void
275
+ /** 接口调用成功的回调函数 */
276
+ success?: (res: TaroGeneral.CallbackResult) => void
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
+ }
286
+ interface RequestFullScreenOption {
287
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
288
+ complete?: (res: TaroGeneral.CallbackResult) => void
289
+ /** 设置全屏时的方向
290
+ *
291
+ * 可选值:
292
+ * - 0: 正常竖向;
293
+ * - 90: 屏幕逆时针90度;
294
+ * - -90: 屏幕顺时针90度; */
295
+ direction?: 0 | 90 | -90
296
+ /** 接口调用失败的回调函数 */
297
+ fail?: (res: TaroGeneral.CallbackResult) => void
298
+ /** 接口调用成功的回调函数 */
299
+ success?: (res: TaroGeneral.CallbackResult) => void
300
+ }
301
+ interface RequestPictureInPictureOption {
302
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
303
+ complete?: (res: TaroGeneral.CallbackResult) => void
304
+ /** 接口调用失败的回调函数 */
305
+ fail?: (res: TaroGeneral.CallbackResult) => void
306
+ /** 接口调用成功的回调函数 */
307
+ success?: (res: TaroGeneral.CallbackResult) => void
308
+ }
309
+ interface ResumeOption {
310
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
311
+ complete?: (res: TaroGeneral.CallbackResult) => void
312
+ /** 接口调用失败的回调函数 */
313
+ fail?: (res: TaroGeneral.CallbackResult) => void
314
+ /** 接口调用成功的回调函数 */
315
+ success?: (res: TaroGeneral.CallbackResult) => void
316
+ }
317
+ interface SnapshotOption {
318
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
319
+ complete?: (res: TaroGeneral.CallbackResult) => void
320
+ /** 接口调用失败的回调函数 */
321
+ fail?: (res: TaroGeneral.CallbackResult) => void
322
+ /** 接口调用成功的回调函数 */
323
+ success?: (result: SnapshotSuccessCallbackResult) => void
324
+ }
325
+ interface SnapshotSuccessCallbackResult extends TaroGeneral.CallbackResult {
326
+ /** 图片的高度 */
327
+ height: string
328
+ /** 图片文件的临时路径 */
329
+ tempImagePath: string
330
+ /** 图片的宽度 */
331
+ width: string
332
+ /** 调用结果 */
333
+ errMsg: string
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
+ }
343
+ interface StopOption {
344
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
345
+ complete?: (res: TaroGeneral.CallbackResult) => void
346
+ /** 接口调用失败的回调函数 */
347
+ fail?: (res: TaroGeneral.CallbackResult) => void
348
+ /** 接口调用成功的回调函数 */
349
+ success?: (res: TaroGeneral.CallbackResult) => void
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
+ }
359
+ }
360
+
361
+ /** `LivePlayerContext` 实例,可通过 `Taro.createLivePlayerContext` 获取。
362
+ * `LivePlayerContext` 通过 `id` 跟一个 `live-player` 组件绑定,操作对应的 `live-player` 组件。
363
+ * @supported weapp
364
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.html
365
+ */
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
372
+ /** 退出全屏
373
+ * @supported weapp
374
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.exitFullScreen.html
375
+ */
376
+ exitFullScreen(option?: LivePlayerContext.ExitFullScreenOption): void
377
+ /** 退出小窗,该方法可在任意页面调用
378
+ * @supported weapp
379
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.exitPictureInPicture.html
380
+ */
381
+ exitPictureInPicture(option?: LivePlayerContext.ExitPictureInPictureOption): void
382
+ /** 静音
383
+ * @supported weapp
384
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.mute.html
385
+ */
386
+ mute(option?: LivePlayerContext.MuteOption): void
387
+ /** 暂停
388
+ * @supported weapp
389
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.pause.html
390
+ */
391
+ pause(option?: LivePlayerContext.PauseOption): void
392
+ /** 播放
393
+ * @supported weapp
394
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.play.html
395
+ */
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
402
+ /** 进入全屏
403
+ * @supported weapp
404
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.requestFullScreen.html
405
+ */
406
+ requestFullScreen(
407
+ option: LivePlayerContext.RequestFullScreenOption,
408
+ ): void
409
+ /** 进入全屏
410
+ * @supported weapp
411
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.requestPictureInPicture.html
412
+ */
413
+ requestPictureInPicture(
414
+ option: LivePlayerContext.RequestPictureInPictureOption,
415
+ ): void
416
+ /** 恢复
417
+ * @supported weapp
418
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.resume.html
419
+ */
420
+ resume(option?: LivePlayerContext.ResumeOption): void
421
+ /** 截图
422
+ * @supported weapp
423
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.snapshot.html
424
+ */
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
431
+ /** 停止
432
+ * @supported weapp
433
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.stop.html
434
+ */
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
441
+ }
442
+
443
+ interface TaroStatic {
444
+ /** 创建 [live-pusher](/docs/components/media/live-pusher) 上下文 [LivePusherContext](/docs/apis/media/live/LivePusherContext) 对象。
445
+ * @supported weapp
446
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/wx.createLivePusherContext.html
447
+ */
448
+ createLivePusherContext(): LivePusherContext
449
+
450
+ /** 创建 [live-player](/docs/components/media/live-player) 上下文 [LivePlayerContext](/docs/apis/media/live/LivePlayerContext) 对象。
451
+ * @supported weapp
452
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/live/wx.createLivePlayerContext.html
453
+ */
454
+ createLivePlayerContext(
455
+ /** [live-player](/docs/components/media/live-player) 组件的 id */
456
+ id: string,
457
+ /** 在自定义组件下,当前组件实例的this,以操作组件内 [live-player](/docs/components/media/live-player) 组件 */
458
+ component?: TaroGeneral.IAnyObject,
459
+ ): LivePlayerContext
460
+ }
461
+ }