@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.
Files changed (102) hide show
  1. package/README.md +13 -6
  2. package/dist/index.js +223 -1
  3. package/dist/index.js.map +1 -1
  4. package/package.json +25 -56
  5. package/types/api/ad/index.d.ts +3 -6
  6. package/types/api/base/debug.d.ts +8 -8
  7. package/types/api/base/env.d.ts +3 -3
  8. package/types/api/base/index.d.ts +3 -3
  9. package/types/api/base/performance.d.ts +5 -5
  10. package/types/api/base/system.d.ts +8 -16
  11. package/types/api/base/update.d.ts +6 -6
  12. package/types/api/base/weapp/app-event.d.ts +12 -12
  13. package/types/api/base/weapp/life-cycle.d.ts +1 -1
  14. package/types/api/canvas/index.d.ts +71 -72
  15. package/types/api/data-analysis/index.d.ts +1 -1
  16. package/types/api/device/accelerometer.d.ts +4 -4
  17. package/types/api/device/accessibility.d.ts +1 -1
  18. package/types/api/device/battery.d.ts +2 -2
  19. package/types/api/device/bluetooth-ble.d.ts +14 -14
  20. package/types/api/device/bluetooth-peripheral.d.ts +15 -15
  21. package/types/api/device/bluetooth.d.ts +11 -11
  22. package/types/api/device/calendar.d.ts +2 -2
  23. package/types/api/device/clipboard.d.ts +2 -4
  24. package/types/api/device/compass.d.ts +4 -4
  25. package/types/api/device/gyroscope.d.ts +4 -4
  26. package/types/api/device/iBeacon.d.ts +7 -7
  27. package/types/api/device/keyboard.d.ts +3 -3
  28. package/types/api/device/memory.d.ts +2 -2
  29. package/types/api/device/motion.d.ts +4 -4
  30. package/types/api/device/network.d.ts +5 -20
  31. package/types/api/device/nfc.d.ts +17 -17
  32. package/types/api/device/phone.d.ts +1 -1
  33. package/types/api/device/scan.d.ts +1 -1
  34. package/types/api/device/screen.d.ts +6 -6
  35. package/types/api/device/sms.d.ts +1 -1
  36. package/types/api/device/vibrate.d.ts +2 -2
  37. package/types/api/device/wifi.d.ts +10 -10
  38. package/types/api/ext/index.d.ts +2 -2
  39. package/types/api/files/index.d.ts +46 -46
  40. package/types/api/framework/index.d.ts +2 -2
  41. package/types/api/location/index.d.ts +38 -45
  42. package/types/api/media/audio.d.ts +30 -30
  43. package/types/api/media/background-audio.d.ts +1 -1
  44. package/types/api/media/camera.d.ts +12 -25
  45. package/types/api/media/image.d.ts +8 -13
  46. package/types/api/media/map.d.ts +15 -15
  47. package/types/api/media/recorder.d.ts +11 -11
  48. package/types/api/media/video.d.ts +19 -21
  49. package/types/api/navigate/index.d.ts +2 -2
  50. package/types/api/network/download.d.ts +7 -8
  51. package/types/api/network/request.d.ts +14 -33
  52. package/types/api/network/upload.d.ts +7 -9
  53. package/types/api/network/websocket.d.ts +14 -14
  54. package/types/api/open-api/account.d.ts +1 -1
  55. package/types/api/open-api/address.d.ts +5 -5
  56. package/types/api/open-api/authorize.d.ts +1 -1
  57. package/types/api/open-api/login.d.ts +5 -5
  58. package/types/api/open-api/settings.d.ts +2 -2
  59. package/types/api/open-api/subscribe-message.d.ts +15 -15
  60. package/types/api/open-api/user-info.d.ts +2 -3
  61. package/types/api/payment/index.d.ts +1 -1
  62. package/types/api/route/index.d.ts +5 -8
  63. package/types/api/share/index.d.ts +3 -3
  64. package/types/api/storage/background-fetch.d.ts +6 -9
  65. package/types/api/storage/index.d.ts +11 -11
  66. package/types/api/taro.extend.d.ts +7 -24
  67. package/types/api/taro.hooks.d.ts +8 -33
  68. package/types/api/ui/animation.d.ts +33 -36
  69. package/types/api/ui/background.d.ts +2 -4
  70. package/types/api/ui/custom-component.d.ts +1 -1
  71. package/types/api/ui/fonts.d.ts +1 -10
  72. package/types/api/ui/interaction.d.ts +6 -6
  73. package/types/api/ui/menu.d.ts +1 -1
  74. package/types/api/ui/navigation-bar.d.ts +5 -7
  75. package/types/api/ui/pull-down-refresh.d.ts +2 -3
  76. package/types/api/ui/scroll.d.ts +3 -4
  77. package/types/api/ui/tab-bar.d.ts +8 -8
  78. package/types/api/ui/window.d.ts +2 -2
  79. package/types/api/wxml/index.d.ts +19 -23
  80. package/types/compile/compiler.d.ts +4 -10
  81. package/types/compile/config/index.d.ts +0 -3
  82. package/types/compile/config/mini.d.ts +17 -39
  83. package/types/compile/config/plugin.d.ts +14 -4
  84. package/types/compile/config/project.d.ts +23 -61
  85. package/types/compile/config/util.d.ts +18 -73
  86. package/types/compile/index.d.ts +16 -1
  87. package/types/compile/viteCompilerContext.d.ts +18 -52
  88. package/types/global.d.ts +1 -12
  89. package/types/index.d.ts +0 -11
  90. package/types/taro.api.d.ts +0 -9
  91. package/types/taro.component.d.ts +0 -2
  92. package/types/taro.config.d.ts +0 -120
  93. package/types/taro.runtime.d.ts +7 -3
  94. package/types/api/alipay/index.d.ts +0 -69
  95. package/types/api/qq/index.d.ts +0 -354
  96. package/types/api/swan/bookshelf.d.ts +0 -307
  97. package/types/api/swan/download-package.d.ts +0 -80
  98. package/types/api/swan/index.d.ts +0 -251
  99. package/types/api/swan/pay.d.ts +0 -139
  100. package/types/compile/config/h5.d.ts +0 -134
  101. package/types/compile/config/harmony.d.ts +0 -118
  102. package/types/compile/config/rn.d.ts +0 -85
@@ -542,47 +542,47 @@ declare module '../../index' {
542
542
  }
543
543
 
544
544
  /** NfcA 标签
545
- * @supported weapp, tt
545
+ * @supported weapp
546
546
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.html
547
547
  */
548
548
  interface NfcA {
549
549
  /** 断开连接
550
- * @supported weapp, tt
550
+ * @supported weapp
551
551
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.close.html
552
552
  */
553
553
  close(option?: NfcA.close.Option): Promise<TaroGeneral.NFCError>
554
554
  /** 连接 NFC 标签
555
- * @supported weapp, tt
555
+ * @supported weapp
556
556
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.connect.html
557
557
  */
558
558
  connect(option?: NfcA.connect.Option): Promise<TaroGeneral.NFCError>
559
559
  /** 获取 ATQA 信息
560
- * @supported weapp, tt
560
+ * @supported weapp
561
561
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.getAtqa.html
562
562
  */
563
563
  getAtqa(option?: NfcA.getAtqa.Option): Promise<TaroGeneral.NFCError>
564
564
  /** 获取最大传输长度
565
- * @supported weapp, tt
565
+ * @supported weapp
566
566
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.getMaxTransceiveLength.html
567
567
  */
568
568
  getMaxTransceiveLength(option?: NfcA.getMaxTransceiveLength.Option): Promise<TaroGeneral.NFCError>
569
569
  /** 获取 SAK 信息
570
- * @supported weapp, tt
570
+ * @supported weapp
571
571
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.getSak.html
572
572
  */
573
573
  getSak(option?: NfcA.getSak.Option): Promise<TaroGeneral.NFCError>
574
574
  /** 检查是否已连接
575
- * @supported weapp, tt
575
+ * @supported weapp
576
576
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.isConnected.html
577
577
  */
578
578
  isConnected(option?: NfcA.isConnected.Option): Promise<TaroGeneral.NFCError>
579
579
  /** 设置超时时间
580
- * @supported weapp, tt
580
+ * @supported weapp
581
581
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.setTimeout.html
582
582
  */
583
583
  setTimeout(option?: NfcA.setTimeout.Option): Promise<TaroGeneral.NFCError>
584
584
  /** 发送数据
585
- * @supported weapp, tt
585
+ * @supported weapp
586
586
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.transceive.html
587
587
  */
588
588
  transceive(option?: NfcA.transceive.Option): Promise<TaroGeneral.NFCError>
@@ -701,7 +701,7 @@ declare module '../../index' {
701
701
  */
702
702
  getIsoDep(): IsoDep
703
703
  /** 获取MifareClassic实例,实例支持MIFARE Classic标签的读写
704
- * @supported weapp, tt
704
+ * @supported weapp
705
705
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.getMifareClassic.html
706
706
  */
707
707
  getMifareClassic(): MifareClassic
@@ -716,7 +716,7 @@ declare module '../../index' {
716
716
  */
717
717
  getNdef(): Ndef
718
718
  /** 获取NfcA实例,实例支持NFC-A (ISO 14443-3A)标准的读写
719
- * @supported weapp, tt
719
+ * @supported weapp
720
720
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.getNfcA.html
721
721
  */
722
722
  getNfcA(): NfcA
@@ -736,7 +736,7 @@ declare module '../../index' {
736
736
  */
737
737
  getNfcV(): NfcV
738
738
  /** 取消监听 NFC Tag
739
- * @supported weapp, tt
739
+ * @supported weapp
740
740
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.offDiscovered.html
741
741
  */
742
742
  offDiscovered(
@@ -744,7 +744,7 @@ declare module '../../index' {
744
744
  callback?: NFCAdapter.onDiscovered.Callback,
745
745
  ): void
746
746
  /** 监听 NFC Tag
747
- * @supported weapp, tt
747
+ * @supported weapp
748
748
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.onDiscovered.html
749
749
  */
750
750
  onDiscovered(
@@ -752,12 +752,12 @@ declare module '../../index' {
752
752
  callback: NFCAdapter.onDiscovered.Callback,
753
753
  ): void
754
754
  /** 开始扫描NFC标签
755
- * @supported weapp, tt
755
+ * @supported weapp
756
756
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.startDiscovery.html
757
757
  */
758
758
  startDiscovery(option?: NFCAdapter.startDiscovery.Option): Promise<TaroGeneral.NFCError>
759
759
  /** 关闭NFC标签扫描
760
- * @supported weapp, tt
760
+ * @supported weapp
761
761
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.stopDiscovery.html
762
762
  */
763
763
  stopDiscovery(option?: NFCAdapter.stopDiscovery.Option): Promise<TaroGeneral.NFCError>
@@ -776,7 +776,7 @@ declare module '../../index' {
776
776
  /** NdefMessage 数组,消息格式为 {id: ArrayBuffer, type: ArrayBuffer, payload: ArrayBuffer} */
777
777
  messages: NdefMessage[]
778
778
  /** NFC标签的UID
779
- * @supported tt
779
+ * @supported weapp
780
780
  */
781
781
  id?: ArrayBuffer
782
782
  }
@@ -1216,7 +1216,7 @@ declare module '../../index' {
1216
1216
  ): void
1217
1217
 
1218
1218
  /** 获取 NFC 实例
1219
- * @supported weapp, tt
1219
+ * @supported weapp
1220
1220
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/wx.getNFCAdapter.html
1221
1221
  */
1222
1222
  getNFCAdapter(): NFCAdapter
@@ -16,7 +16,7 @@ declare module '../../index' {
16
16
 
17
17
  interface TaroStatic {
18
18
  /** 拨打电话
19
- * @supported weapp, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid
19
+ * @supported weapp
20
20
  * @example
21
21
  * ```tsx
22
22
  * Taro.makePhoneCall({
@@ -87,7 +87,7 @@ declare module '../../index' {
87
87
  interface TaroStatic {
88
88
  /**
89
89
  * 调起客户端扫码界面,扫码成功后返回对应的结果
90
- * @supported weapp, swan, jd, qq, tt, h5, rn
90
+ * @supported weapp
91
91
  * @example
92
92
  * ```tsx
93
93
  * // 允许从相机和相册扫码
@@ -106,13 +106,13 @@ declare module '../../index' {
106
106
 
107
107
  interface TaroStatic {
108
108
  /** 设置截屏/录屏时屏幕表现,仅支持在 Android 端调用
109
- * @supported weapp, alipay
109
+ * @supported weapp
110
110
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.setVisualEffectOnCapture.html
111
111
  */
112
112
  setVisualEffectOnCapture(option: setVisualEffectOnCapture.Option): Promise<TaroGeneral.CallbackResult>
113
113
 
114
114
  /** 设置屏幕亮度。
115
- * @supported weapp, swan, jd, qq, tt, rn
115
+ * @supported weapp
116
116
  * @example
117
117
  * ```tsx
118
118
  * Taro.setScreenBrightness(params).then(...)
@@ -123,7 +123,7 @@ declare module '../../index' {
123
123
 
124
124
  /**
125
125
  * 设置是否保持常亮状态。仅在当前小程序生效,离开小程序后设置失效。
126
- * @supported weapp, alipay, swan, jd, qq, tt, rn, harmony_hybrid
126
+ * @supported weapp
127
127
  * @example
128
128
  * ```tsx
129
129
  * // 保持屏幕常亮
@@ -137,7 +137,7 @@ declare module '../../index' {
137
137
 
138
138
  /**
139
139
  * 监听用户主动截屏事件,用户使用系统截屏按键截屏时触发此事件
140
- * @supported weapp, alipay, swan, jd, tt, harmony_hybrid
140
+ * @supported weapp
141
141
  * @example
142
142
  * ```tsx
143
143
  * Taro.onUserCaptureScreen(function (res) {
@@ -169,7 +169,7 @@ declare module '../../index' {
169
169
  ): void
170
170
 
171
171
  /** 用户主动截屏事件。取消事件监听。
172
- * @supported weapp, alipay, swan, jd, tt
172
+ * @supported weapp
173
173
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.offUserCaptureScreen.html
174
174
  */
175
175
  offUserCaptureScreen(
@@ -207,7 +207,7 @@ declare module '../../index' {
207
207
  *
208
208
  * **说明**
209
209
  * - 若安卓系统设置中开启了自动调节亮度功能,则屏幕亮度会根据光线自动调整,该接口仅能获取自动调节亮度之前的值,而非实时的亮度值。
210
- * @supported weapp, alipay, swan, jd, qq, rn, harmony
210
+ * @supported weapp
211
211
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.getScreenBrightness.html
212
212
  */
213
213
  getScreenBrightness(
@@ -18,7 +18,7 @@ declare module '../../index' {
18
18
 
19
19
  interface TaroStatic {
20
20
  /** 拉起手机发送短信界面
21
- * @supported weapp, tt
21
+ * @supported weapp
22
22
  * @see declare module '../../index'
23
23
  */
24
24
  sendSms(option: sendSms.Option): Promise<TaroGeneral.CallbackResul>
@@ -29,7 +29,7 @@ declare module '../../index' {
29
29
  /** 使手机发生较短时间的振动(15 ms)。仅在 iPhone `7 / 7 Plus` 以上及 Android 机型生效
30
30
  *
31
31
  * 仅微信小程序平台支持 type 参数
32
- * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony
32
+ * @supported weapp
33
33
  * @example
34
34
  * ```tsx
35
35
  * Taro.vibrateShort(params).then(...)
@@ -39,7 +39,7 @@ declare module '../../index' {
39
39
  vibrateShort(option?: vibrateShort.Option): Promise<TaroGeneral.CallbackResult>
40
40
 
41
41
  /** 使手机发生较长时间的振动(400ms)
42
- * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony
42
+ * @supported weapp
43
43
  * @example
44
44
  * ```tsx
45
45
  * Taro.vibrateLong(params).then(...)
@@ -154,7 +154,7 @@ declare module '../../index' {
154
154
 
155
155
  interface TaroStatic {
156
156
  /** 关闭 Wi-Fi 模块。
157
- * @supported weapp, alipay, swan, jd
157
+ * @supported weapp
158
158
  * @example
159
159
  * ```tsx
160
160
  * Taro.stopWifi({
@@ -168,7 +168,7 @@ declare module '../../index' {
168
168
  stopWifi(option?: stopWifi.Option): Promise<TaroGeneral.WifiError>
169
169
 
170
170
  /** 初始化 Wi-Fi 模块。
171
- * @supported weapp, alipay, swan, jd
171
+ * @supported weapp
172
172
  * @example
173
173
  * ```tsx
174
174
  * Taro.startWifi({
@@ -187,7 +187,7 @@ declare module '../../index' {
187
187
  * - 该接口只能在 `onGetWifiList` 回调之后才能调用。
188
188
  * - 此时客户端会挂起,等待小程序设置 Wi-Fi 信息,请务必尽快调用该接口,若无数据请传入一个空数组。
189
189
  * - 有可能随着周边 Wi-Fi 列表的刷新,单个流程内收到多次带有存在重复的 Wi-Fi 列表的回调。
190
- * @supported weapp, swan, jd
190
+ * @supported weapp
191
191
  * @example
192
192
  * ```tsx
193
193
  * Taro.onGetWifiList(function (res) {
@@ -221,7 +221,7 @@ declare module '../../index' {
221
221
  ): void
222
222
 
223
223
  /** 监听连接上 Wi-Fi 的事件。
224
- * @supported weapp, alipay, swan, jd
224
+ * @supported weapp
225
225
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.onWifiConnected.html
226
226
  */
227
227
  onWifiConnected(
@@ -230,7 +230,7 @@ declare module '../../index' {
230
230
  ): void
231
231
 
232
232
  /** 监听获取到 Wi-Fi 列表数据事件
233
- * @supported weapp, alipay, swan, jd, tt
233
+ * @supported weapp
234
234
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.onGetWifiList.html
235
235
  */
236
236
  onGetWifiList(
@@ -249,7 +249,7 @@ declare module '../../index' {
249
249
 
250
250
  /**
251
251
  * 取消监听连接上 Wi-Fi 的事件。
252
- * @supported weapp, alipay, swan, jd
252
+ * @supported weapp
253
253
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.offWifiConnected.html
254
254
  */
255
255
  offWifiConnected(
@@ -259,7 +259,7 @@ declare module '../../index' {
259
259
 
260
260
  /**
261
261
  * 取消监听获取到 Wi-Fi 列表数据事件。
262
- * @supported weapp, alipay, swan, jd, tt
262
+ * @supported weapp
263
263
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.offGetWifiList.html
264
264
  */
265
265
  offGetWifiList(
@@ -270,13 +270,13 @@ declare module '../../index' {
270
270
  /** 请求获取 Wi-Fi 列表。在 `onGetWifiList` 注册的回调中返回 `wifiList` 数据。 **Android 调用前需要 [用户授权](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html) scope.userLocation。**
271
271
  *
272
272
  * iOS 将跳转到系统的 Wi-Fi 界面,Android 不会跳转。 iOS 11.0 及 iOS 11.1 两个版本因系统问题,该方法失效。但在 iOS 11.2 中已修复。
273
- * @supported weapp, alipay, swan, jd, tt
273
+ * @supported weapp
274
274
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.getWifiList.html
275
275
  */
276
276
  getWifiList(option?: getWifiList.Option): Promise<TaroGeneral.WifiError>
277
277
 
278
278
  /** 获取已连接中的 Wi-Fi 信息。
279
- * @supported weapp, alipay, swan, tt
279
+ * @supported weapp
280
280
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.getConnectedWifi.html
281
281
  */
282
282
  getConnectedWifi(option?: getConnectedWifi.Option): Promise<TaroGeneral.WifiError>
@@ -293,7 +293,7 @@ declare module '../../index' {
293
293
  * }
294
294
  * })
295
295
  * ```
296
- * @supported weapp, alipay, swan, jd
296
+ * @supported weapp
297
297
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.connectWifi.html
298
298
  */
299
299
  connectWifi(option: connectWifi.Option): Promise<TaroGeneral.WifiError>
@@ -31,7 +31,7 @@ declare module '../../index' {
31
31
  *
32
32
  * **Tips**
33
33
  * 1. 本接口暂时无法通过 Taro.canIUse 判断是否兼容,开发者需要自行判断 Taro.getExtConfigSync 是否存在来兼容
34
- * @supported weapp, tt
34
+ * @supported weapp
35
35
  * @example
36
36
  * ```tsx
37
37
  * let extConfig = Taro.getExtConfigSync? Taro.getExtConfigSync(): {}
@@ -46,7 +46,7 @@ declare module '../../index' {
46
46
  *
47
47
  * **Tips**
48
48
  * 1. 本接口暂时无法通过 Taro.canIUse 判断是否兼容,开发者需要自行判断 Taro.getExtConfig 是否存在来兼容
49
- * @supported weapp, tt
49
+ * @supported weapp
50
50
  * @example
51
51
  * ```tsx
52
52
  * if(Taro.getExtConfig) {