@tarojs/taro 3.5.0-alpha.14 → 3.5.0-alpha.17

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 (64) hide show
  1. package/index.js +3 -4
  2. package/package.json +7 -8
  3. package/types/api/base/debug.d.ts +1 -1
  4. package/types/api/base/index.d.ts +3 -3
  5. package/types/api/base/performance.d.ts +5 -5
  6. package/types/api/base/system.d.ts +2 -2
  7. package/types/api/base/update.d.ts +6 -6
  8. package/types/api/base/weapp/app-event.d.ts +56 -17
  9. package/types/api/base/weapp/life-cycle.d.ts +7 -7
  10. package/types/api/canvas/index.d.ts +1 -1
  11. package/types/api/data-analysis/index.d.ts +1 -1
  12. package/types/api/device/accelerometer.d.ts +3 -3
  13. package/types/api/device/calendar.d.ts +1 -1
  14. package/types/api/device/clipboard.d.ts +2 -2
  15. package/types/api/device/compass.d.ts +3 -3
  16. package/types/api/device/gyroscope.d.ts +4 -4
  17. package/types/api/device/keyboard.d.ts +1 -1
  18. package/types/api/device/memory.d.ts +1 -1
  19. package/types/api/device/network.d.ts +2 -2
  20. package/types/api/device/phone.d.ts +1 -1
  21. package/types/api/device/scan.d.ts +1 -1
  22. package/types/api/device/screen.d.ts +5 -5
  23. package/types/api/device/vibrate.d.ts +6 -2
  24. package/types/api/device/wifi.d.ts +3 -3
  25. package/types/api/ext/index.d.ts +2 -2
  26. package/types/api/files/index.d.ts +32 -32
  27. package/types/api/framework/index.d.ts +5 -4
  28. package/types/api/location/index.d.ts +45 -9
  29. package/types/api/media/audio.d.ts +1 -1
  30. package/types/api/media/background-audio.d.ts +1 -1
  31. package/types/api/media/camera.d.ts +8 -8
  32. package/types/api/media/image.d.ts +5 -5
  33. package/types/api/media/map.d.ts +15 -15
  34. package/types/api/media/recorder.d.ts +9 -9
  35. package/types/api/media/video.d.ts +2 -2
  36. package/types/api/navigate/index.d.ts +2 -2
  37. package/types/api/network/download.d.ts +27 -8
  38. package/types/api/network/request.d.ts +3 -3
  39. package/types/api/network/upload.d.ts +19 -8
  40. package/types/api/network/websocket.d.ts +6 -6
  41. package/types/api/open-api/address.d.ts +1 -1
  42. package/types/api/open-api/authorize.d.ts +1 -1
  43. package/types/api/open-api/settings.d.ts +2 -2
  44. package/types/api/open-api/subscribe-message.d.ts +2 -2
  45. package/types/api/open-api/user-info.d.ts +2 -2
  46. package/types/api/route/index.d.ts +5 -5
  47. package/types/api/share/index.d.ts +2 -2
  48. package/types/api/storage/index.d.ts +10 -10
  49. package/types/api/ui/animation.d.ts +34 -36
  50. package/types/api/ui/interaction.d.ts +6 -6
  51. package/types/api/ui/menu.d.ts +1 -1
  52. package/types/api/ui/navigation-bar.d.ts +5 -5
  53. package/types/api/ui/pull-down-refresh.d.ts +2 -2
  54. package/types/api/ui/scroll.d.ts +4 -2
  55. package/types/api/ui/tab-bar.d.ts +8 -8
  56. package/types/api/wxml/index.d.ts +16 -16
  57. package/types/compile.d.ts +18 -4
  58. package/types/global.d.ts +1 -1
  59. package/types/taro.component.d.ts +12 -63
  60. package/types/taro.config.d.ts +29 -0
  61. package/types/taro.extend.d.ts +24 -20
  62. package/types/taro.hooks.d.ts +55 -3
  63. package/types/taro.lifecycle.d.ts +21 -14
  64. package/LICENSE +0 -21
@@ -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, tt
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, tt
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, tt
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, tt
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, tt
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, tt
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, tt
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, tt
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, tt
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, tt
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, tt
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, tt
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, tt
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, tt
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, tt
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, rn
158
+ * @supported weapp, rn, tt
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, tt
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, rn
190
+ * @supported weapp, rn, tt
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, rn
198
+ * @supported weapp, rn, tt
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, rn
206
+ * @supported weapp, rn, tt
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, rn
214
+ * @supported weapp, rn, tt
215
215
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onStop.html
216
216
  */
217
217
  onStop(
@@ -224,17 +224,17 @@ declare module '../../index' {
224
224
  */
225
225
  pause(): void
226
226
  /** 继续录音
227
- * @supported weapp, rn
227
+ * @supported weapp, rn, tt
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, rn
232
+ * @supported weapp, rn, tt
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, rn
237
+ * @supported weapp, rn, tt
238
238
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.stop.html
239
239
  */
240
240
  stop(): void
@@ -348,7 +348,7 @@ declare module '../../index' {
348
348
  * @example
349
349
  ```tsx
350
350
  * Taro.saveVideoToPhotosAlbum({
351
- * filePath: 'wxfile://xxx'
351
+ * filePath: 'wxfile://xxx',
352
352
  * success: function (res) {
353
353
  * console.log(res.errMsg)
354
354
  * }
@@ -462,7 +462,7 @@ declare module '../../index' {
462
462
  chooseVideo(option: chooseVideo.Option): Promise<chooseVideo.SuccessCallbackResult>
463
463
 
464
464
  /** 拍摄或从手机相册中选择图片或视频。
465
- * @supported weapp, rn
465
+ * @supported weapp
466
466
  * @example
467
467
  * ```tsx
468
468
  * Taro.chooseMedia({
@@ -105,7 +105,7 @@ declare module '../../index' {
105
105
  * **关于调试**
106
106
  * - 在开发者工具上调用此 API 并不会真实的跳转到另外的小程序,但是开发者工具会校验本次调用跳转是否成功。[详情](https://developers.weixin.qq.com/miniprogram/dev/devtools/different.html#跳转小程序调试支持)
107
107
  * - 开发者工具上支持被跳转的小程序处理接收参数的调试。[详情](https://developers.weixin.qq.com/miniprogram/dev/devtools/different.html#跳转小程序调试支持)
108
- * @supported weapp
108
+ * @supported weapp, tt
109
109
  * @example
110
110
  * ```tsx
111
111
  * Taro.navigateToMiniProgram({
@@ -127,7 +127,7 @@ declare module '../../index' {
127
127
  /** 返回到上一个小程序。只有在当前小程序是被其他小程序打开时可以调用成功
128
128
  *
129
129
  * 注意:**微信客户端 iOS 6.5.9,Android 6.5.10 及以上版本支持**
130
- * @supported weapp
130
+ * @supported weapp, tt
131
131
  * @example
132
132
  * ```tsx
133
133
  * Taro.navigateBackMiniProgram({
@@ -26,6 +26,26 @@ declare module '../../index' {
26
26
  tempFilePath: string
27
27
  /** 调用结果 */
28
28
  errMsg: string
29
+ /**
30
+ * 开发者服务器返回的 HTTP Response Header
31
+ * @supported weapp
32
+ * @weapp 非官方文档标注属性
33
+ */
34
+ header?: TaroGeneral.IAnyObject
35
+ /**
36
+ * 数据长度,单位 Byte
37
+ * @supported weapp
38
+ * @weapp 非官方文档标注属性
39
+ */
40
+ dataLength?: number
41
+ /**
42
+ * cookies
43
+ * @supported weapp
44
+ * @weapp 非官方文档标注属性
45
+ */
46
+ cookies?: string[]
47
+ /** 网络请求过程中一些调试信息 */
48
+ profile?: TaroGeneral.IAnyObject
29
49
  }
30
50
  }
31
51
 
@@ -59,15 +79,14 @@ declare module '../../index' {
59
79
  totalBytesWritten: number
60
80
  }
61
81
 
62
- type DownloadTaskPromise = Promise<DownloadTask> & {
82
+ type DownloadTaskPromise = Promise<downloadFile.FileSuccessCallbackResult> & DownloadTask & {
63
83
  headersReceive: DownloadTask['onHeadersReceived'],
64
- progress: DownloadTask['onProgressUpdate'],
65
- abort: DownloadTask['abort']
84
+ progress: DownloadTask['onProgressUpdate']
66
85
  }
67
86
  }
68
87
 
69
88
  /** 一个可以监听下载进度变化事件,以及取消下载任务的对象
70
- * @supported weapp, swan, alipay, h5, rn
89
+ * @supported weapp, swan, alipay, h5, rn, tt
71
90
  * @example
72
91
  * ```tsx
73
92
  * const downloadTask = Taro.downloadFile({
@@ -91,12 +110,12 @@ declare module '../../index' {
91
110
  */
92
111
  interface DownloadTask {
93
112
  /** 中断下载任务
94
- * @supported weapp, h5, rn
113
+ * @supported weapp, h5, tt
95
114
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/network/download/DownloadTask.abort.html
96
115
  */
97
116
  abort(): void
98
117
  /** 监听下载进度变化事件
99
- * @supported weapp, h5, rn
118
+ * @supported weapp, h5, tt
100
119
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/network/download/DownloadTask.onProgressUpdate.html
101
120
  */
102
121
  onProgressUpdate(
@@ -104,7 +123,7 @@ declare module '../../index' {
104
123
  callback: DownloadTask.OnProgressUpdateCallback,
105
124
  ): void
106
125
  /** 取消监听下载进度变化事件
107
- * @supported weapp, h5, rn
126
+ * @supported weapp, h5, tt
108
127
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/network/download/DownloadTask.offProgressUpdate.html
109
128
  */
110
129
  offProgressUpdate(
@@ -133,7 +152,7 @@ declare module '../../index' {
133
152
  /** 下载文件资源到本地。客户端直接发起一个 HTTPS GET 请求,返回文件的本地临时路径,单次下载允许的最大文件为 50MB。使用前请注意阅读[相关说明](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html)。
134
153
  *
135
154
  * 注意:请在服务端响应的 header 中指定合理的 `Content-Type` 字段,以保证客户端正确处理文件类型。
136
- * @supported weapp, h5, alipay, swan, rn
155
+ * @supported weapp, h5, alipay, swan, rn, tt
137
156
  * @example
138
157
  * ```tsx
139
158
  * Taro.downloadFile({
@@ -14,7 +14,7 @@ declare module '../../index' {
14
14
  header?: TaroGeneral.IAnyObject
15
15
  /** 超时时间,单位为毫秒
16
16
  * @default 2000
17
- * @supported weapp, h5
17
+ * @supported weapp, h5, tt
18
18
  */
19
19
  timeout?: number
20
20
  /** HTTP 请求方法
@@ -37,7 +37,7 @@ declare module '../../index' {
37
37
  enableQuic?: boolean
38
38
  /** 开启 cache
39
39
  * @default false
40
- * @supported weapp
40
+ * @supported weapp, tt
41
41
  */
42
42
  enableCache?: boolean
43
43
  /** 是否开启 HttpDNS 服务。如开启,需要同时填入 httpDNSServiceId 。 HttpDNS 用法详见 移动解析HttpDNS
@@ -254,7 +254,7 @@ declare module '../../index' {
254
254
  */
255
255
  interface RequestTask<T> extends Promise<request.SuccessCallbackResult<T>> {
256
256
  /** 中断请求任务
257
- * @supported weapp
257
+ * @supported weapp, tt
258
258
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/network/request/RequestTask.abort.html
259
259
  */
260
260
  abort(): void
@@ -35,6 +35,18 @@ declare module '../../index' {
35
35
  statusCode: number
36
36
  /** 调用结果 */
37
37
  errMsg: string
38
+ /**
39
+ * 开发者服务器返回的 HTTP Response Header
40
+ * @supported weapp
41
+ * @weapp 非官方文档标注属性
42
+ */
43
+ header?: TaroGeneral.IAnyObject
44
+ /**
45
+ * cookies
46
+ * @supported weapp
47
+ * @weapp 非官方文档标注属性
48
+ */
49
+ cookies?: string[]
38
50
  }
39
51
  }
40
52
 
@@ -68,15 +80,14 @@ declare module '../../index' {
68
80
  totalBytesSent: number
69
81
  }
70
82
 
71
- type UploadTaskPromise = Promise<UploadTask> & {
83
+ type UploadTaskPromise = Promise<uploadFile.SuccessCallbackResult> & UploadTask & {
72
84
  headersReceive: UploadTask['onHeadersReceived'],
73
- progress: UploadTask['onProgressUpdate'],
74
- abort: UploadTask['abort']
85
+ progress: UploadTask['onProgressUpdate']
75
86
  }
76
87
  }
77
88
 
78
89
  /** 一个可以监听上传进度变化事件,以及取消上传任务的对象
79
- * @supported weapp, swan, alipay, h5, rn
90
+ * @supported weapp, swan, alipay, h5, rn, tt
80
91
  * @example
81
92
  * ```tsx
82
93
  * const uploadTask = Taro.uploadFile({
@@ -104,12 +115,12 @@ declare module '../../index' {
104
115
  */
105
116
  interface UploadTask {
106
117
  /** 中断上传任务
107
- * @supported weapp, h5
118
+ * @supported weapp, h5, tt
108
119
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/network/upload/UploadTask.abort.html
109
120
  */
110
121
  abort(): void
111
122
  /** 监听上传进度变化事件
112
- * @supported weapp, h5
123
+ * @supported weapp, h5, tt
113
124
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/network/upload/UploadTask.onProgressUpdate.html
114
125
  */
115
126
  onProgressUpdate(
@@ -117,7 +128,7 @@ declare module '../../index' {
117
128
  callback: UploadTask.OnProgressUpdateCallback,
118
129
  ): void
119
130
  /** 取消监听上传进度变化事件
120
- * @supported weapp, h5
131
+ * @supported weapp, h5, tt
121
132
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/network/upload/UploadTask.offProgressUpdate.html
122
133
  */
123
134
  offProgressUpdate(
@@ -144,7 +155,7 @@ declare module '../../index' {
144
155
 
145
156
  interface TaroStatic {
146
157
  /** 将本地资源上传到服务器。客户端发起一个 HTTPS POST 请求,其中 `content-type` 为 `multipart/form-data`。使用前请注意阅读[相关说明](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html)。
147
- * @supported weapp, swan, alipay, h5, rn
158
+ * @supported weapp, swan, alipay, h5, rn, tt
148
159
  * @example
149
160
  * ```tsx
150
161
  * Taro.chooseImage({
@@ -143,17 +143,17 @@ declare module '../../index' {
143
143
  */
144
144
  interface SocketTask {
145
145
  /** 通过 WebSocket 连接发送数据
146
- * @supported weapp, h5, rn, alipay, swan
146
+ * @supported weapp, h5, rn, alipay, swan, tt
147
147
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.send.html
148
148
  */
149
149
  send(option: SocketTask.SendOption): void
150
150
  /** 关闭 WebSocket 连接
151
- * @supported weapp, h5, rn, alipay, swan
151
+ * @supported weapp, h5, rn, alipay, swan, tt
152
152
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.close.html
153
153
  */
154
154
  close(option: SocketTask.CloseOption): void
155
155
  /** 监听 WebSocket 连接打开事件
156
- * @supported weapp, h5, rn, alipay, swan
156
+ * @supported weapp, h5, rn, alipay, swan, tt
157
157
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.onOpen.html
158
158
  */
159
159
  onOpen(
@@ -161,7 +161,7 @@ declare module '../../index' {
161
161
  callback: SocketTask.OnOpenCallback
162
162
  ): void
163
163
  /** 监听 WebSocket 连接关闭事件
164
- * @supported weapp, h5, rn, alipay, swan
164
+ * @supported weapp, h5, rn, alipay, swan, tt
165
165
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.onClose.html
166
166
  */
167
167
  onClose(
@@ -169,7 +169,7 @@ declare module '../../index' {
169
169
  callback: SocketTask.OnCloseCallback
170
170
  ): void
171
171
  /** 监听 WebSocket 错误事件
172
- * @supported weapp, h5, rn, alipay, swan
172
+ * @supported weapp, h5, rn, alipay, swan, tt
173
173
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.onError.html
174
174
  */
175
175
  onError(
@@ -177,7 +177,7 @@ declare module '../../index' {
177
177
  callback: SocketTask.OnErrorCallback
178
178
  ): void
179
179
  /** 监听 WebSocket 接受到服务器的消息事件
180
- * @supported weapp, h5, rn, alipay, swan
180
+ * @supported weapp, h5, rn, alipay, swan, tt
181
181
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.onMessage.html
182
182
  */
183
183
  onMessage<T = any>(
@@ -35,7 +35,7 @@ declare module '../../index' {
35
35
 
36
36
  interface TaroStatic {
37
37
  /** 获取用户收货地址。调起用户编辑收货地址原生界面,并在编辑完成后返回用户选择的地址。
38
- * @supported weapp
38
+ * @supported weapp, tt
39
39
  * @example
40
40
  * ```tsx
41
41
  * Taro.chooseAddress({
@@ -55,7 +55,7 @@ declare module '../../index' {
55
55
  authorizeForMiniProgram(option: authorizeForMiniProgram.Option): Promise<TaroGeneral.CallbackResult>
56
56
 
57
57
  /** 提前向用户发起授权请求。调用后会立刻弹窗询问用户是否同意授权小程序使用某项功能或获取用户的某些数据,但不会实际调用对应接口。如果用户之前已经同意授权,则不会出现弹窗,直接返回成功。更多用法详见 [用户授权](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html)。
58
- * @supported weapp
58
+ * @supported weapp, rn, tt
59
59
  * @example
60
60
  * ```tsx
61
61
  * // 可以通过 Taro.getSetting 先查询一下用户是否授权了 "scope.record" 这个 scope
@@ -135,7 +135,7 @@ declare module '../../index' {
135
135
  /** 调起客户端小程序设置界面,返回用户设置的操作结果。**设置界面只会出现小程序已经向用户请求过的[权限](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html)**。
136
136
  *
137
137
  * 注意:[2.3.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 版本开始,用户发生点击行为后,才可以跳转打开设置页,管理授权信息。[详情](https://developers.weixin.qq.com/community/develop/doc/000cea2305cc5047af5733de751008)
138
- * @supported weapp
138
+ * @supported weapp, rn, tt
139
139
  * @example
140
140
  * ```tsx
141
141
  * Taro.openSetting({
@@ -153,7 +153,7 @@ declare module '../../index' {
153
153
  openSetting(option?: openSetting.Option): Promise<openSetting.SuccessCallbackResult>
154
154
 
155
155
  /** 获取用户的当前设置。**返回值中只会出现小程序已经向用户请求过的[权限](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html)**。
156
- * @supported weapp
156
+ * @supported weapp, rn, tt
157
157
  * @example
158
158
  * ```tsx
159
159
  * Taro.getSetting({
@@ -118,7 +118,7 @@ declare module '../../index' {
118
118
  /** 请求订阅消息
119
119
  *
120
120
  * 注意:[2.8.2](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 版本开始,用户发生点击行为或者发起支付回调后,才可以调起订阅消息界面。
121
- * @supported weapp
121
+ * @supported weapp, tt
122
122
  * @example
123
123
  * ```tsx
124
124
  * Taro.requestSubscribeMessage({
@@ -133,7 +133,7 @@ declare module '../../index' {
133
133
  ): Promise<requestSubscribeMessage.SuccessCallbackResult | requestSubscribeMessage.FailCallbackResult>
134
134
 
135
135
  /** 订阅设备消息接口,调用后弹出授权框,用户同意后会允许开发者给用户发送订阅模版消息。当用户点击“允许”按钮时,模板消息会被添加到用户的小程序设置页,通过 wx.getSetting 接口可获取用户对相关模板消息的订阅状态。
136
- * @supported weapp
136
+ * @supported weapp, tt
137
137
  * @example
138
138
  * ```tsx
139
139
  * Taro.requestSubscribeDeviceMessage({
@@ -102,7 +102,7 @@ declare module '../../index' {
102
102
  *
103
103
  * **接口调整说明**
104
104
  * 在用户未授权过的情况下调用此接口,将不再出现授权弹窗,会直接进入 fail 回调(详见[《公告》](https://developers.weixin.qq.com/community/develop/doc/0000a26e1aca6012e896a517556c01))。在用户已授权的情况下调用此接口,可成功获取用户信息。
105
- * @supported weapp
105
+ * @supported weapp, tt
106
106
  * @example
107
107
  * ```tsx
108
108
  * // 必须是在用户已经授权的情况下调用
@@ -153,7 +153,7 @@ declare module '../../index' {
153
153
  * 开发者每次通过该接口获取用户个人信息均需用户确认,请开发者妥善保管用户快速填写的头像昵称,避免重复弹窗。
154
154
  *
155
155
  * [微信端调整背景和说明,请参考文档](https://developers.weixin.qq.com/community/develop/doc/000cacfa20ce88df04cb468bc52801)
156
- * @supported weapp
156
+ * @supported weapp, tt
157
157
  * @example
158
158
  * 推荐使用 Taro.getUserProfile 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
159
159
  *
@@ -117,7 +117,7 @@ declare module '../../index' {
117
117
 
118
118
  interface TaroStatic {
119
119
  /** 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面
120
- * @supported weapp, h5, rn
120
+ * @supported weapp, h5, rn, tt
121
121
  * @example
122
122
  * ```json
123
123
  * {
@@ -143,7 +143,7 @@ declare module '../../index' {
143
143
  switchTab(option: switchTab.Option): Promise<TaroGeneral.CallbackResult>
144
144
 
145
145
  /** 关闭所有页面,打开到应用内的某个页面
146
- * @supported weapp, h5, rn
146
+ * @supported weapp, h5, rn, tt
147
147
  * @example
148
148
  * ```tsx
149
149
  * Taro.reLaunch({
@@ -155,7 +155,7 @@ declare module '../../index' {
155
155
  reLaunch(option: reLaunch.Option): Promise<TaroGeneral.CallbackResult>
156
156
 
157
157
  /** 关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。
158
- * @supported weapp, h5, rn
158
+ * @supported weapp, h5, rn, tt
159
159
  * @example
160
160
  * ```tsx
161
161
  * Taro.redirectTo({
@@ -167,7 +167,7 @@ declare module '../../index' {
167
167
  redirectTo(option: redirectTo.Option): Promise<TaroGeneral.CallbackResult>
168
168
 
169
169
  /** 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。使用 Taro.navigateBack 可以返回到原页面。小程序中页面栈最多十层。
170
- * @supported weapp, h5, rn
170
+ * @supported weapp, h5, rn, tt
171
171
  * @example
172
172
  * ```tsx
173
173
  * Taro.navigateTo({
@@ -193,7 +193,7 @@ declare module '../../index' {
193
193
  navigateTo(option: navigateTo.Option): Promise<TaroGeneral.CallbackResult>
194
194
 
195
195
  /** 关闭当前页面,返回上一页面或多级页面。可通过 getCurrentPages 获取当前的页面栈,决定需要返回几层。
196
- * @supported weapp, h5, rn
196
+ * @supported weapp, h5, rn, tt
197
197
  * @example
198
198
  * ```tsx
199
199
  * // 注意:调用 navigateTo 跳转时,调用该方法的页面会被加入堆栈,而 redirectTo 方法则不会。见下方示例代码
@@ -181,7 +181,7 @@ declare module '../../index' {
181
181
  updateShareMenu(option: updateShareMenu.Option): Promise<TaroGeneral.CallbackResult>
182
182
 
183
183
  /** 显示当前页面的转发按钮
184
- * @supported weapp, qq
184
+ * @supported weapp, qq, tt
185
185
  * @example
186
186
  * ```tsx
187
187
  * Taro.showShareMenu({
@@ -273,7 +273,7 @@ declare module '../../index' {
273
273
  ): void
274
274
 
275
275
  /** 隐藏当前页面的转发按钮
276
- * @supported weapp
276
+ * @supported weapp, tt
277
277
  * @example
278
278
  * ```tsx
279
279
  * Taro.hideShareMenu()