@spcsn/taro 0.1.1 → 1.0.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 +13 -6
- package/dist/index.js +223 -1
- package/dist/index.js.map +1 -1
- package/package.json +25 -56
- package/types/api/ad/index.d.ts +3 -6
- package/types/api/base/debug.d.ts +8 -8
- package/types/api/base/env.d.ts +3 -3
- package/types/api/base/index.d.ts +3 -3
- package/types/api/base/performance.d.ts +5 -5
- package/types/api/base/system.d.ts +8 -16
- package/types/api/base/update.d.ts +6 -6
- package/types/api/base/weapp/app-event.d.ts +12 -12
- package/types/api/base/weapp/life-cycle.d.ts +1 -1
- package/types/api/canvas/index.d.ts +71 -72
- package/types/api/data-analysis/index.d.ts +1 -1
- package/types/api/device/accelerometer.d.ts +4 -4
- package/types/api/device/accessibility.d.ts +1 -1
- package/types/api/device/battery.d.ts +2 -2
- package/types/api/device/bluetooth-ble.d.ts +14 -14
- package/types/api/device/bluetooth-peripheral.d.ts +15 -15
- package/types/api/device/bluetooth.d.ts +11 -11
- package/types/api/device/calendar.d.ts +2 -2
- package/types/api/device/clipboard.d.ts +2 -4
- package/types/api/device/compass.d.ts +4 -4
- package/types/api/device/gyroscope.d.ts +4 -4
- package/types/api/device/iBeacon.d.ts +7 -7
- package/types/api/device/keyboard.d.ts +3 -3
- package/types/api/device/memory.d.ts +2 -2
- package/types/api/device/motion.d.ts +4 -4
- package/types/api/device/network.d.ts +5 -20
- package/types/api/device/nfc.d.ts +17 -17
- package/types/api/device/phone.d.ts +1 -1
- package/types/api/device/scan.d.ts +1 -1
- package/types/api/device/screen.d.ts +6 -6
- package/types/api/device/sms.d.ts +1 -1
- package/types/api/device/vibrate.d.ts +2 -2
- package/types/api/device/wifi.d.ts +10 -10
- package/types/api/ext/index.d.ts +2 -2
- package/types/api/files/index.d.ts +46 -46
- package/types/api/framework/index.d.ts +2 -2
- package/types/api/location/index.d.ts +38 -45
- package/types/api/media/audio.d.ts +30 -30
- package/types/api/media/background-audio.d.ts +1 -1
- package/types/api/media/camera.d.ts +12 -25
- package/types/api/media/image.d.ts +8 -13
- package/types/api/media/map.d.ts +15 -15
- package/types/api/media/recorder.d.ts +11 -11
- package/types/api/media/video.d.ts +19 -21
- package/types/api/navigate/index.d.ts +2 -2
- package/types/api/network/download.d.ts +7 -8
- package/types/api/network/request.d.ts +14 -33
- package/types/api/network/upload.d.ts +7 -9
- package/types/api/network/websocket.d.ts +14 -14
- package/types/api/open-api/account.d.ts +1 -1
- package/types/api/open-api/address.d.ts +5 -5
- package/types/api/open-api/authorize.d.ts +1 -1
- package/types/api/open-api/login.d.ts +5 -5
- package/types/api/open-api/settings.d.ts +2 -2
- package/types/api/open-api/subscribe-message.d.ts +15 -15
- package/types/api/open-api/user-info.d.ts +2 -3
- package/types/api/payment/index.d.ts +1 -1
- package/types/api/route/index.d.ts +5 -8
- package/types/api/share/index.d.ts +3 -3
- package/types/api/storage/background-fetch.d.ts +6 -9
- package/types/api/storage/index.d.ts +11 -11
- package/types/api/taro.extend.d.ts +7 -24
- package/types/api/taro.hooks.d.ts +8 -33
- package/types/api/ui/animation.d.ts +33 -36
- package/types/api/ui/background.d.ts +2 -4
- package/types/api/ui/custom-component.d.ts +1 -1
- package/types/api/ui/fonts.d.ts +1 -10
- package/types/api/ui/interaction.d.ts +6 -6
- package/types/api/ui/menu.d.ts +1 -1
- package/types/api/ui/navigation-bar.d.ts +5 -7
- package/types/api/ui/pull-down-refresh.d.ts +2 -3
- package/types/api/ui/scroll.d.ts +3 -4
- package/types/api/ui/tab-bar.d.ts +8 -8
- package/types/api/ui/window.d.ts +2 -2
- package/types/api/wxml/index.d.ts +19 -23
- package/types/compile/compiler.d.ts +4 -10
- package/types/compile/config/index.d.ts +0 -3
- package/types/compile/config/mini.d.ts +17 -39
- package/types/compile/config/plugin.d.ts +14 -4
- package/types/compile/config/project.d.ts +23 -61
- package/types/compile/config/util.d.ts +18 -73
- package/types/compile/index.d.ts +16 -1
- package/types/compile/viteCompilerContext.d.ts +18 -52
- package/types/global.d.ts +1 -12
- package/types/index.d.ts +0 -11
- package/types/taro.api.d.ts +0 -9
- package/types/taro.component.d.ts +0 -2
- package/types/taro.config.d.ts +0 -120
- package/types/taro.runtime.d.ts +7 -3
- package/types/api/alipay/index.d.ts +0 -69
- package/types/api/qq/index.d.ts +0 -354
- package/types/api/swan/bookshelf.d.ts +0 -307
- package/types/api/swan/download-package.d.ts +0 -80
- package/types/api/swan/index.d.ts +0 -251
- package/types/api/swan/pay.d.ts +0 -139
- package/types/compile/config/h5.d.ts +0 -134
- package/types/compile/config/harmony.d.ts +0 -118
- package/types/compile/config/rn.d.ts +0 -85
|
@@ -160,17 +160,17 @@ declare module '../../index' {
|
|
|
160
160
|
/** `AudioContext` 实例,可通过 `Taro.createAudioContext` 获取。
|
|
161
161
|
*
|
|
162
162
|
* `AudioContext` 通过 `id` 跟一个 `audio` 组件绑定,操作对应的 audio 组件。
|
|
163
|
-
* @supported weapp
|
|
163
|
+
* @supported weapp
|
|
164
164
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioContext.html
|
|
165
165
|
*/
|
|
166
166
|
interface AudioContext {
|
|
167
167
|
/** 暂停音频。
|
|
168
|
-
* @supported weapp
|
|
168
|
+
* @supported weapp
|
|
169
169
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioContext.pause.html
|
|
170
170
|
*/
|
|
171
171
|
pause(): void
|
|
172
172
|
/** 播放音频。
|
|
173
|
-
* @supported weapp
|
|
173
|
+
* @supported weapp
|
|
174
174
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioContext.play.html
|
|
175
175
|
*/
|
|
176
176
|
play(): void
|
|
@@ -270,103 +270,103 @@ declare module '../../index' {
|
|
|
270
270
|
/** origin: 发送完整的 referrer; no-referrer: 不发送 */
|
|
271
271
|
referrerPolicy?: 'origin' | 'no-referrer' | string
|
|
272
272
|
/** 播放
|
|
273
|
-
* @supported weapp
|
|
273
|
+
* @supported weapp
|
|
274
274
|
*/
|
|
275
275
|
play(): void
|
|
276
276
|
/** 暂停
|
|
277
|
-
* @supported weapp
|
|
277
|
+
* @supported weapp
|
|
278
278
|
*/
|
|
279
279
|
pause(): void
|
|
280
280
|
/** 停止
|
|
281
|
-
* @supported weapp
|
|
281
|
+
* @supported weapp
|
|
282
282
|
*/
|
|
283
283
|
stop(): void
|
|
284
284
|
/** 跳转到指定位置,单位 s
|
|
285
|
-
* @supported weapp
|
|
285
|
+
* @supported weapp
|
|
286
286
|
*/
|
|
287
287
|
seek(position: number): void
|
|
288
288
|
/** 销毁当前实例
|
|
289
|
-
* @supported weapp
|
|
289
|
+
* @supported weapp
|
|
290
290
|
*/
|
|
291
291
|
destroy(): void
|
|
292
292
|
/** 音频进入可以播放状态,但不保证后面可以流畅播放
|
|
293
|
-
* @supported weapp
|
|
293
|
+
* @supported weapp
|
|
294
294
|
*/
|
|
295
295
|
onCanplay(callback?: InnerAudioContext.OnCanplayCallback): void
|
|
296
296
|
/** 音频播放事件
|
|
297
|
-
* @supported weapp
|
|
297
|
+
* @supported weapp
|
|
298
298
|
*/
|
|
299
299
|
onPlay(callback?: InnerAudioContext.OnPlayCallback): void
|
|
300
300
|
/** 音频暂停事件
|
|
301
|
-
* @supported weapp
|
|
301
|
+
* @supported weapp
|
|
302
302
|
*/
|
|
303
303
|
onPause(callback?: InnerAudioContext.OnPauseCallback): void
|
|
304
304
|
/** 音频停止事件
|
|
305
|
-
* @supported weapp
|
|
305
|
+
* @supported weapp
|
|
306
306
|
*/
|
|
307
307
|
onStop(callback?: InnerAudioContext.OnStopCallback): void
|
|
308
308
|
/** 音频自然播放结束事件
|
|
309
|
-
* @supported weapp
|
|
309
|
+
* @supported weapp
|
|
310
310
|
*/
|
|
311
311
|
onEnded(callback?: InnerAudioContext.OnEndedCallback): void
|
|
312
312
|
/** 音频播放进度更新事件
|
|
313
|
-
* @supported weapp
|
|
313
|
+
* @supported weapp
|
|
314
314
|
*/
|
|
315
315
|
onTimeUpdate(callback?: InnerAudioContext.OnTimeUpdateCallback): void
|
|
316
316
|
/** 音频播放错误事件
|
|
317
|
-
* @supported weapp
|
|
317
|
+
* @supported weapp
|
|
318
318
|
*/
|
|
319
319
|
onError(callback?: InnerAudioContext.OnErrorCallback): void
|
|
320
320
|
/** 音频加载中事件,当音频因为数据不足,需要停下来加载时会触发
|
|
321
|
-
* @supported weapp
|
|
321
|
+
* @supported weapp
|
|
322
322
|
*/
|
|
323
323
|
onWaiting(callback?: InnerAudioContext.OnWaitingCallback): void
|
|
324
324
|
/** 音频进行 seek 操作事件
|
|
325
|
-
* @supported weapp
|
|
325
|
+
* @supported weapp
|
|
326
326
|
*/
|
|
327
327
|
onSeeking(callback?: InnerAudioContext.OnSeekingCallback): void
|
|
328
328
|
/** 音频完成 seek 操作事件
|
|
329
|
-
* @supported weapp
|
|
329
|
+
* @supported weapp
|
|
330
330
|
*/
|
|
331
331
|
onSeeked(callback?: InnerAudioContext.OnSeekedCallback): void
|
|
332
332
|
/** 取消监听 canplay 事件
|
|
333
|
-
* @supported weapp
|
|
333
|
+
* @supported weapp
|
|
334
334
|
*/
|
|
335
335
|
offCanplay(callback?: InnerAudioContext.OnCanplayCallback): void
|
|
336
336
|
/** 取消监听 play 事件
|
|
337
|
-
* @supported weapp
|
|
337
|
+
* @supported weapp
|
|
338
338
|
*/
|
|
339
339
|
offPlay(callback?: InnerAudioContext.OnPlayCallback): void
|
|
340
340
|
/** 取消监听 pause 事件
|
|
341
|
-
* @supported weapp
|
|
341
|
+
* @supported weapp
|
|
342
342
|
*/
|
|
343
343
|
offPause(callback?: InnerAudioContext.OnPauseCallback): void
|
|
344
344
|
/** 取消监听 stop 事件
|
|
345
|
-
* @supported weapp
|
|
345
|
+
* @supported weapp
|
|
346
346
|
*/
|
|
347
347
|
offStop(callback?: InnerAudioContext.OnStopCallback): void
|
|
348
348
|
/** 取消监听 ended 事件
|
|
349
|
-
* @supported weapp
|
|
349
|
+
* @supported weapp
|
|
350
350
|
*/
|
|
351
351
|
offEnded(callback?: InnerAudioContext.OnEndedCallback): void
|
|
352
352
|
/** 取消监听 timeUpdate 事件
|
|
353
|
-
* @supported weapp
|
|
353
|
+
* @supported weapp
|
|
354
354
|
*/
|
|
355
355
|
offTimeUpdate(callback?: InnerAudioContext.OnTimeUpdateCallback): void
|
|
356
356
|
/** 取消监听 error 事件
|
|
357
|
-
* @supported weapp
|
|
357
|
+
* @supported weapp
|
|
358
358
|
*/
|
|
359
359
|
offError(callback?: InnerAudioContext.OnErrorCallback): void
|
|
360
360
|
/** 取消监听 waiting 事件
|
|
361
|
-
* @supported weapp
|
|
361
|
+
* @supported weapp
|
|
362
362
|
*/
|
|
363
363
|
offWaiting(callback?: InnerAudioContext.OnWaitingCallback): void
|
|
364
364
|
/** 取消监听 seeking 事件
|
|
365
|
-
* @supported weapp
|
|
365
|
+
* @supported weapp
|
|
366
366
|
*/
|
|
367
367
|
offSeeking(callback?: InnerAudioContext.OnSeekingCallback): void
|
|
368
368
|
/** 取消监听 seeked 事件
|
|
369
|
-
* @supported weapp
|
|
369
|
+
* @supported weapp
|
|
370
370
|
*/
|
|
371
371
|
offSeeked(callback?: InnerAudioContext.OnSeekedCallback): void
|
|
372
372
|
}
|
|
@@ -976,7 +976,7 @@ declare module '../../index' {
|
|
|
976
976
|
createMediaAudioPlayer(): MediaAudioPlayer
|
|
977
977
|
|
|
978
978
|
/** 创建内部 audio 上下文 InnerAudioContext 对象。
|
|
979
|
-
* @supported weapp
|
|
979
|
+
* @supported weapp
|
|
980
980
|
* @example
|
|
981
981
|
* ```tsx
|
|
982
982
|
* const innerAudioContext = Taro.createInnerAudioContext()
|
|
@@ -996,7 +996,7 @@ declare module '../../index' {
|
|
|
996
996
|
|
|
997
997
|
/** 创建 audio 上下文 AudioContext 对象。
|
|
998
998
|
* **注意:1.6.0 版本开始,本接口不再维护。建议使用能力更强的 [Taro.createInnerAudioContext](./createInnerAudioContext) 接口**
|
|
999
|
-
* @supported weapp
|
|
999
|
+
* @supported weapp
|
|
1000
1000
|
* @example
|
|
1001
1001
|
* ```tsx
|
|
1002
1002
|
* const audioCtx = Taro.createAudioContext('myAudio')
|
|
@@ -274,7 +274,7 @@ declare module '../../index' {
|
|
|
274
274
|
* 小程序切入后台,如果音频处于播放状态,可以继续播放。但是后台状态不能通过调用API操纵音频的播放状态。
|
|
275
275
|
*
|
|
276
276
|
* 从微信客户端6.7.2版本开始,若需要在小程序切后台后继续播放音频,需要在 [app.json](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html) 中配置 `requiredBackgroundModes` 属性。开发版和体验版上可以直接生效,正式版还需通过审核。
|
|
277
|
-
* @supported weapp
|
|
277
|
+
* @supported weapp
|
|
278
278
|
* @example
|
|
279
279
|
* ```tsx
|
|
280
280
|
* const backgroundAudioManager = Taro.getBackgroundAudioManager()
|
|
@@ -10,7 +10,7 @@ declare module '../../index' {
|
|
|
10
10
|
* ****
|
|
11
11
|
*
|
|
12
12
|
* 注: 使用该接口需同时在 [camera](/docs/components/media/camera) 组件属性中指定 frame-size。
|
|
13
|
-
* @supported weapp
|
|
13
|
+
* @supported weapp
|
|
14
14
|
* @example
|
|
15
15
|
* ```tsx
|
|
16
16
|
* const context = wx.createCameraContext()
|
|
@@ -26,22 +26,22 @@ declare module '../../index' {
|
|
|
26
26
|
callback: CameraContext.OnCameraFrameCallback,
|
|
27
27
|
): CameraFrameListener
|
|
28
28
|
/** 设置缩放级别
|
|
29
|
-
* @supported weapp
|
|
29
|
+
* @supported weapp
|
|
30
30
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraContext.setZoom.html
|
|
31
31
|
*/
|
|
32
32
|
setZoom(option: CameraContext.SetZoomOption): void
|
|
33
33
|
/** 开始录像
|
|
34
|
-
* @supported weapp
|
|
34
|
+
* @supported weapp
|
|
35
35
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraContext.startRecord.html
|
|
36
36
|
*/
|
|
37
37
|
startRecord(option: CameraContext.StartRecordOption): void
|
|
38
38
|
/** 结束录像
|
|
39
|
-
* @supported weapp
|
|
39
|
+
* @supported weapp
|
|
40
40
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraContext.stopRecord.html
|
|
41
41
|
*/
|
|
42
42
|
stopRecord(option?: CameraContext.StopRecordOption): void
|
|
43
43
|
/** 拍摄照片
|
|
44
|
-
* @supported weapp
|
|
44
|
+
* @supported weapp
|
|
45
45
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraContext.takePhoto.html
|
|
46
46
|
*/
|
|
47
47
|
takePhoto(option: CameraContext.TakePhotoOption): void
|
|
@@ -61,10 +61,6 @@ declare module '../../index' {
|
|
|
61
61
|
interface StartRecordSuccessCallbackResult extends TaroGeneral.CallbackResult {
|
|
62
62
|
/** 实际设置的缩放级别。由于系统限制,某些机型可能无法设置成指定值,会改用最接近的可设值。 */
|
|
63
63
|
zoom: number
|
|
64
|
-
/**
|
|
65
|
-
* @supported alipay
|
|
66
|
-
* @alipay on android
|
|
67
|
-
*/
|
|
68
64
|
setZoom:number
|
|
69
65
|
}
|
|
70
66
|
interface StartRecordOption {
|
|
@@ -86,21 +82,13 @@ declare module '../../index' {
|
|
|
86
82
|
tempThumbPath: string
|
|
87
83
|
/** 视频的文件的临时路径 */
|
|
88
84
|
tempVideoPath: string
|
|
89
|
-
/** 视频文件的高度。
|
|
90
|
-
* @supported alipay
|
|
91
|
-
*/
|
|
85
|
+
/** 视频文件的高度。 */
|
|
92
86
|
height: string
|
|
93
|
-
/** 视频文件的宽度。
|
|
94
|
-
* @supported alipay
|
|
95
|
-
*/
|
|
87
|
+
/** 视频文件的宽度。 */
|
|
96
88
|
width: string
|
|
97
|
-
/** 视频文件的尺寸。
|
|
98
|
-
* @supported alipay
|
|
99
|
-
*/
|
|
89
|
+
/** 视频文件的尺寸。 */
|
|
100
90
|
size: string
|
|
101
|
-
/** 录制的持续时间。
|
|
102
|
-
* @supported alipay
|
|
103
|
-
*/
|
|
91
|
+
/** 录制的持续时间。 */
|
|
104
92
|
duration: string
|
|
105
93
|
}
|
|
106
94
|
interface StopRecordOption {
|
|
@@ -162,12 +150,12 @@ declare module '../../index' {
|
|
|
162
150
|
*/
|
|
163
151
|
interface CameraFrameListener {
|
|
164
152
|
/** 开始监听帧数据
|
|
165
|
-
* @supported weapp
|
|
153
|
+
* @supported weapp
|
|
166
154
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraFrameListener.start.html
|
|
167
155
|
*/
|
|
168
156
|
start(option?: CameraFrameListener.StartOption): void
|
|
169
157
|
/** 停止监听帧数据
|
|
170
|
-
* @supported weapp
|
|
158
|
+
* @supported weapp
|
|
171
159
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraFrameListener.stop.html
|
|
172
160
|
*/
|
|
173
161
|
stop(option?: CameraFrameListener.StopOption): void
|
|
@@ -194,8 +182,7 @@ declare module '../../index' {
|
|
|
194
182
|
|
|
195
183
|
interface TaroStatic {
|
|
196
184
|
/** 创建 camera 上下文 CameraContext 对象。
|
|
197
|
-
* @
|
|
198
|
-
* @supported weapp, rn, tt, alipay
|
|
185
|
+
* @supported weapp
|
|
199
186
|
* @example
|
|
200
187
|
* ```tsx
|
|
201
188
|
* const cameraContext = Taro.createCameraContext()
|
|
@@ -24,12 +24,10 @@ declare module '../../index' {
|
|
|
24
24
|
current?: string | number
|
|
25
25
|
/**
|
|
26
26
|
* 是否支持长按下载图片
|
|
27
|
-
* @supported alipay 基础库: 1.13.0
|
|
28
27
|
*/
|
|
29
28
|
enablesavephoto?: boolean
|
|
30
29
|
/**
|
|
31
30
|
* 是否在右下角显示下载入口
|
|
32
|
-
* @supported alipay 基础库: 1.13.0
|
|
33
31
|
*/
|
|
34
32
|
enableShowPhotoDownload?: boolean
|
|
35
33
|
/** @supported weapp 最低版本:2.13.0。是否显示长按菜单,默认值:true */
|
|
@@ -141,17 +139,17 @@ declare module '../../index' {
|
|
|
141
139
|
interface Option {
|
|
142
140
|
/** 最多可以选择的图片张数
|
|
143
141
|
* @default 9
|
|
144
|
-
* @supported weapp
|
|
142
|
+
* @supported weapp
|
|
145
143
|
*/
|
|
146
144
|
count?: number
|
|
147
145
|
/** 所选的图片的尺寸
|
|
148
146
|
* @default ['original', 'compressed']
|
|
149
|
-
* @supported weapp
|
|
147
|
+
* @supported weapp
|
|
150
148
|
*/
|
|
151
149
|
sizeType?: Array<keyof sizeType>
|
|
152
150
|
/** 选择图片的来源
|
|
153
151
|
* @default ['album', 'camera']
|
|
154
|
-
* @supported weapp
|
|
152
|
+
* @supported weapp
|
|
155
153
|
*/
|
|
156
154
|
sourceType?: Array<keyof sourceType>
|
|
157
155
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
@@ -161,7 +159,6 @@ declare module '../../index' {
|
|
|
161
159
|
/** 接口调用成功的回调函数 */
|
|
162
160
|
success?: (result: SuccessCallbackResult) => void
|
|
163
161
|
/** 用来上传的input元素ID(仅h5端
|
|
164
|
-
* @supported h5
|
|
165
162
|
*/
|
|
166
163
|
imageId?: string
|
|
167
164
|
}
|
|
@@ -198,11 +195,9 @@ declare module '../../index' {
|
|
|
198
195
|
/** 本地临时文件大小,单位 B */
|
|
199
196
|
size: number
|
|
200
197
|
/** 文件的 MIME 类型
|
|
201
|
-
* @supported h5
|
|
202
198
|
*/
|
|
203
199
|
type?: string
|
|
204
200
|
/** 原始的浏览器 File 对象
|
|
205
|
-
* @supported h5
|
|
206
201
|
*/
|
|
207
202
|
originalFileObj?: File
|
|
208
203
|
}
|
|
@@ -324,7 +319,7 @@ declare module '../../index' {
|
|
|
324
319
|
|
|
325
320
|
interface TaroStatic {
|
|
326
321
|
/** 保存图片到系统相册。需要[用户授权](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html) scope.writePhotosAlbum
|
|
327
|
-
* @supported weapp
|
|
322
|
+
* @supported weapp
|
|
328
323
|
* @example
|
|
329
324
|
* ```tsx
|
|
330
325
|
* Taro.saveImageToPhotosAlbum({
|
|
@@ -348,7 +343,7 @@ declare module '../../index' {
|
|
|
348
343
|
previewMedia(option: previewMedia.Option): Promise<TaroGeneral.CallbackResult>
|
|
349
344
|
|
|
350
345
|
/** 在新页面中全屏预览图片。预览的过程中用户可以进行保存图片、发送给朋友等操作。
|
|
351
|
-
* @supported weapp
|
|
346
|
+
* @supported weapp
|
|
352
347
|
* @example
|
|
353
348
|
* ```tsx
|
|
354
349
|
* Taro.previewImage({
|
|
@@ -361,7 +356,7 @@ declare module '../../index' {
|
|
|
361
356
|
previewImage(option: previewImage.Option): Promise<TaroGeneral.CallbackResult>
|
|
362
357
|
|
|
363
358
|
/** 获取图片信息。网络图片需先配置download域名才能生效。
|
|
364
|
-
* @supported weapp
|
|
359
|
+
* @supported weapp
|
|
365
360
|
* @example
|
|
366
361
|
* ```tsx
|
|
367
362
|
* Taro.getImageInfo({
|
|
@@ -400,7 +395,7 @@ declare module '../../index' {
|
|
|
400
395
|
editImage(option: editImage.Option): Promise<editImage.SuccessCallbackResult>
|
|
401
396
|
|
|
402
397
|
/** 压缩图片接口,可选压缩质量
|
|
403
|
-
* @supported weapp
|
|
398
|
+
* @supported weapp
|
|
404
399
|
* @example
|
|
405
400
|
* ```tsx
|
|
406
401
|
* Taro.compressImage({
|
|
@@ -431,7 +426,7 @@ declare module '../../index' {
|
|
|
431
426
|
|
|
432
427
|
/**
|
|
433
428
|
* 从本地相册选择图片或使用相机拍照。
|
|
434
|
-
* @supported weapp
|
|
429
|
+
* @supported weapp
|
|
435
430
|
* @example
|
|
436
431
|
* ```tsx
|
|
437
432
|
* Taro.chooseImage({
|
package/types/api/media/map.d.ts
CHANGED
|
@@ -4,30 +4,30 @@ import Taro from '../../index'
|
|
|
4
4
|
declare module '../../index' {
|
|
5
5
|
/** `MapContext` 实例,可通过 [Taro.createMapContext](./createMapContext) 获取。
|
|
6
6
|
* `MapContext` 通过 id 跟一个 map 组件绑定,操作对应的 map 组件。
|
|
7
|
-
* @supported weapp
|
|
7
|
+
* @supported weapp
|
|
8
8
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.html
|
|
9
9
|
*/
|
|
10
10
|
interface MapContext {
|
|
11
11
|
/** 获取当前地图中心的经纬度。返回的是 gcj02 坐标系,可以用于 [Taro.openLocation()](/docs/apis/location/openLocation)
|
|
12
|
-
* @supported weapp
|
|
12
|
+
* @supported weapp
|
|
13
13
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.getCenterLocation.html
|
|
14
14
|
*/
|
|
15
15
|
getCenterLocation(option?: MapContext.GetCenterLocationOption): Promise<MapContext.GetCenterLocationSuccessCallbackResult>
|
|
16
16
|
|
|
17
17
|
/** 设置定位点图标,支持网络路径、本地路径、代码包路径
|
|
18
|
-
* @supported weapp
|
|
18
|
+
* @supported weapp
|
|
19
19
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.setLocMarkerIcon.html
|
|
20
20
|
*/
|
|
21
21
|
setLocMarkerIcon(option?: MapContext.SetLocMarkerIconOption): Promise<TaroGeneral.CallbackResult>
|
|
22
22
|
|
|
23
23
|
/** 将地图中心移置当前定位点,此时需设置地图组件 show-location 为true。
|
|
24
|
-
* @supported weapp
|
|
24
|
+
* @supported weapp
|
|
25
25
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.moveToLocation.html
|
|
26
26
|
*/
|
|
27
27
|
moveToLocation(option: MapContext.MoveToLocationOption): Promise<TaroGeneral.CallbackResult>
|
|
28
28
|
|
|
29
29
|
/** 平移marker,带动画
|
|
30
|
-
* @supported weapp
|
|
30
|
+
* @supported weapp
|
|
31
31
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.translateMarker.html
|
|
32
32
|
*/
|
|
33
33
|
translateMarker(option: MapContext.TranslateMarkerOption): Promise<TaroGeneral.CallbackResult>
|
|
@@ -36,37 +36,37 @@ declare module '../../index' {
|
|
|
36
36
|
moveAlong(object)
|
|
37
37
|
|
|
38
38
|
/** 缩放视野展示所有经纬度
|
|
39
|
-
* @supported weapp
|
|
39
|
+
* @supported weapp
|
|
40
40
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.includePoints.html
|
|
41
41
|
*/
|
|
42
42
|
includePoints(option: MapContext.IncludePointsOption): Promise<TaroGeneral.CallbackResult>
|
|
43
43
|
|
|
44
44
|
/** 获取当前地图的视野范围
|
|
45
|
-
* @supported weapp
|
|
45
|
+
* @supported weapp
|
|
46
46
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.getRegion.html
|
|
47
47
|
*/
|
|
48
48
|
getRegion(option?: MapContext.GetRegionOption): Promise<MapContext.GetRegionSuccessCallbackResult>
|
|
49
49
|
|
|
50
50
|
/** 获取当前地图的旋转角
|
|
51
|
-
* @supported weapp
|
|
51
|
+
* @supported weapp
|
|
52
52
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.getRotate.html
|
|
53
53
|
*/
|
|
54
54
|
getRotate(option?: MapContext.GetRotateOption): Promise<MapContext.GetRotateSuccessCallbackResult>
|
|
55
55
|
|
|
56
56
|
/** 获取当前地图的倾斜角
|
|
57
|
-
* @supported weapp
|
|
57
|
+
* @supported weapp
|
|
58
58
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.getSkew.html
|
|
59
59
|
*/
|
|
60
60
|
getSkew(option?: MapContext.GetSkewOption): Promise<MapContext.GetSkewSuccessCallbackResult>
|
|
61
61
|
|
|
62
62
|
/** 获取当前地图的缩放级别
|
|
63
|
-
* @supported weapp
|
|
63
|
+
* @supported weapp
|
|
64
64
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.getScale.html
|
|
65
65
|
*/
|
|
66
66
|
getScale(option?: MapContext.GetScaleOption): Promise<MapContext.GetScaleSuccessCallbackResult>
|
|
67
67
|
|
|
68
68
|
/** 设置地图中心点偏移,向后向下为增长,屏幕比例范围(0.25~0.75),默认偏移为[0.5, 0.5]
|
|
69
|
-
* @supported weapp
|
|
69
|
+
* @supported weapp
|
|
70
70
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.setCenterOffset.html
|
|
71
71
|
*/
|
|
72
72
|
setCenterOffset(option: MapContext.SetCenterOffsetOption): Promise<TaroGeneral.CallbackResult>
|
|
@@ -84,7 +84,7 @@ declare module '../../index' {
|
|
|
84
84
|
addCustomLayer(option: MapContext.AddCustomLayerOption): Promise<TaroGeneral.CallbackResult>
|
|
85
85
|
|
|
86
86
|
/** 创建自定义图片图层,图片会随着地图缩放而缩放。
|
|
87
|
-
* @supported weapp
|
|
87
|
+
* @supported weapp
|
|
88
88
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.addGroundOverlay.html
|
|
89
89
|
*/
|
|
90
90
|
addGroundOverlay(option: MapContext.AddGroundLayerOption): Promise<TaroGeneral.CallbackResult>
|
|
@@ -120,13 +120,13 @@ declare module '../../index' {
|
|
|
120
120
|
setBoundary(option: MapContext.SetBoundaryOption): Promise<TaroGeneral.CallbackResult>
|
|
121
121
|
|
|
122
122
|
/** 更新自定义图片图层。
|
|
123
|
-
* @supported weapp
|
|
123
|
+
* @supported weapp
|
|
124
124
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.updateGroundOverlay.html
|
|
125
125
|
*/
|
|
126
126
|
updateGroundOverlay(option: MapContext.UpdateGroundOverlayOption): Promise<TaroGeneral.CallbackResult>
|
|
127
127
|
|
|
128
128
|
/** 移除自定义图片图层。
|
|
129
|
-
* @supported weapp
|
|
129
|
+
* @supported weapp
|
|
130
130
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.removeGroundOverlay.html
|
|
131
131
|
*/
|
|
132
132
|
removeGroundOverlay(option: MapContext.RemoveGroundOverlayOption): Promise<TaroGeneral.CallbackResult>
|
|
@@ -621,7 +621,7 @@ declare module '../../index' {
|
|
|
621
621
|
|
|
622
622
|
interface TaroStatic {
|
|
623
623
|
/** 创建 [map](/docs/components/maps/map) 上下文 [MapContext](/docs/apis/media/map/MapContext) 对象。
|
|
624
|
-
* @supported weapp
|
|
624
|
+
* @supported weapp
|
|
625
625
|
* @example
|
|
626
626
|
* ```tsx
|
|
627
627
|
* const mapCtx = Taro.createMapContext('myMap')
|
|
@@ -155,7 +155,7 @@ declare module '../../index' {
|
|
|
155
155
|
*/
|
|
156
156
|
interface RecorderManager {
|
|
157
157
|
/** 监听录音错误事件
|
|
158
|
-
* @supported weapp
|
|
158
|
+
* @supported weapp
|
|
159
159
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onError.html
|
|
160
160
|
*/
|
|
161
161
|
onError(
|
|
@@ -163,7 +163,7 @@ declare module '../../index' {
|
|
|
163
163
|
callback: RecorderManager.OnErrorCallback,
|
|
164
164
|
): void
|
|
165
165
|
/** 监听已录制完指定帧大小的文件事件。如果设置了 frameSize,则会回调此事件。
|
|
166
|
-
* @supported weapp
|
|
166
|
+
* @supported weapp
|
|
167
167
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onFrameRecorded.html
|
|
168
168
|
*/
|
|
169
169
|
onFrameRecorded(
|
|
@@ -187,7 +187,7 @@ declare module '../../index' {
|
|
|
187
187
|
callback: (res: TaroGeneral.CallbackResult) => void,
|
|
188
188
|
): void
|
|
189
189
|
/** 监听录音暂停事件
|
|
190
|
-
* @supported weapp
|
|
190
|
+
* @supported weapp
|
|
191
191
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onPause.html
|
|
192
192
|
*/
|
|
193
193
|
onPause(
|
|
@@ -195,7 +195,7 @@ declare module '../../index' {
|
|
|
195
195
|
callback: (res: TaroGeneral.CallbackResult) => void,
|
|
196
196
|
): void
|
|
197
197
|
/** 监听录音继续事件
|
|
198
|
-
* @supported weapp
|
|
198
|
+
* @supported weapp
|
|
199
199
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onResume.html
|
|
200
200
|
*/
|
|
201
201
|
onResume(
|
|
@@ -203,7 +203,7 @@ declare module '../../index' {
|
|
|
203
203
|
callback: (res: TaroGeneral.CallbackResult) => void,
|
|
204
204
|
): void
|
|
205
205
|
/** 监听录音开始事件
|
|
206
|
-
* @supported weapp
|
|
206
|
+
* @supported weapp
|
|
207
207
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onStart.html
|
|
208
208
|
*/
|
|
209
209
|
onStart(
|
|
@@ -211,7 +211,7 @@ declare module '../../index' {
|
|
|
211
211
|
callback: (res: TaroGeneral.CallbackResult) => void,
|
|
212
212
|
): void
|
|
213
213
|
/** 监听录音结束事件
|
|
214
|
-
* @supported weapp
|
|
214
|
+
* @supported weapp
|
|
215
215
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onStop.html
|
|
216
216
|
*/
|
|
217
217
|
onStop(
|
|
@@ -219,22 +219,22 @@ declare module '../../index' {
|
|
|
219
219
|
callback: RecorderManager.OnStopCallback,
|
|
220
220
|
): void
|
|
221
221
|
/** 暂停录音
|
|
222
|
-
* @supported weapp
|
|
222
|
+
* @supported weapp
|
|
223
223
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.pause.html
|
|
224
224
|
*/
|
|
225
225
|
pause(): void
|
|
226
226
|
/** 继续录音
|
|
227
|
-
* @supported weapp
|
|
227
|
+
* @supported weapp
|
|
228
228
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.resume.html
|
|
229
229
|
*/
|
|
230
230
|
resume(): void
|
|
231
231
|
/** 开始录音
|
|
232
|
-
* @supported weapp
|
|
232
|
+
* @supported weapp
|
|
233
233
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.start.html
|
|
234
234
|
*/
|
|
235
235
|
start(option: RecorderManager.StartOption): void
|
|
236
236
|
/** 停止录音
|
|
237
|
-
* @supported weapp
|
|
237
|
+
* @supported weapp
|
|
238
238
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.stop.html
|
|
239
239
|
*/
|
|
240
240
|
stop(): void
|
|
@@ -282,7 +282,7 @@ declare module '../../index' {
|
|
|
282
282
|
startRecord(option: startRecord.Option): Promise<startRecord.SuccessCallbackResult>
|
|
283
283
|
|
|
284
284
|
/** 获取**全局唯一**的录音管理器 RecorderManager
|
|
285
|
-
* @supported weapp
|
|
285
|
+
* @supported weapp
|
|
286
286
|
* @example
|
|
287
287
|
* ```tsx
|
|
288
288
|
* const recorderManager = Taro.getRecorderManager()
|