@spcsn/taro 0.1.2 → 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
@@ -546,8 +546,7 @@ declare module '../../index' {
546
546
  openAppAuthorizeSetting(option: openAppAuthorizeSetting.Option): Promise<TaroGeneral.CallbackResult>
547
547
 
548
548
  /** 获取窗口信息
549
- * @supported weapp, harmony_hybrid
550
- * @h5 不支持 statusBarHeight、safeArea
549
+ * @supported weapp
551
550
  * @example
552
551
  * ```tsx
553
552
  * const windowInfo = Taro.getWindowInfo()
@@ -566,8 +565,7 @@ declare module '../../index' {
566
565
  getWindowInfo(): getWindowInfo.Result
567
566
 
568
567
  /** 获取设备设置
569
- * @supported weapp, h5, harmony_hybrid
570
- * @h5 不支持 bluetoothEnabled、locationEnabled、wifiEnabled
568
+ * @supported weapp
571
569
  * @example
572
570
  * ```tsx
573
571
  * const systemSetting = Taro.getSystemSetting()
@@ -582,8 +580,7 @@ declare module '../../index' {
582
580
  getSystemSetting(): getSystemSetting.Result
583
581
 
584
582
  /** [Taro.getSystemInfo](./getSystemInfo) 的同步版本
585
- * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
586
- * @h5 不支持 version、statusBarHeight、fontSizeSetting、SDKVersion
583
+ * @supported weapp
587
584
  * @weapp 小程序可以在微信和企业微信中调用此接口,但是在企业微信中调用此接口时,会额外返回一个 environment 字段(微信中不返回),如此字段值为 wxwork,则表示当前小程序运行在企业微信环境中。
588
585
  * @example
589
586
  * ```tsx
@@ -605,8 +602,7 @@ declare module '../../index' {
605
602
  getSystemInfoSync(): getSystemInfoSync.Result
606
603
 
607
604
  /** 异步获取系统信息。需要一定的微信客户端版本支持,在不支持的客户端上,会使用同步实现来返回。
608
- * @supported weapp, h5
609
- * @h5 不支持 version、statusBarHeight、fontSizeSetting、SDKVersion
605
+ * @supported weapp
610
606
  * @weapp 小程序可以在微信和企业微信中调用此接口,但是在企业微信中调用此接口时,会额外返回一个 environment 字段(微信中不返回),如此字段值为 wxwork,则表示当前小程序运行在企业微信环境中。
611
607
  * @example
612
608
  * ```tsx
@@ -627,8 +623,7 @@ declare module '../../index' {
627
623
  getSystemInfoAsync(res?: getSystemInfoAsync.Option): Promise<getSystemInfo.Result>
628
624
 
629
625
  /** 获取系统信息,支持 `Promise` 化使用。
630
- * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
631
- * @h5 不支持 version、statusBarHeight、fontSizeSetting、SDKVersion
626
+ * @supported weapp
632
627
  * @weapp 小程序可以在微信和企业微信中调用此接口,但是在企业微信中调用此接口时,会额外返回一个 environment 字段(微信中不返回),如此字段值为 wxwork,则表示当前小程序运行在企业微信环境中。
633
628
  * @example
634
629
  * ```tsx
@@ -677,8 +672,7 @@ declare module '../../index' {
677
672
  getRendererUserAgent(option?: getRendererUserAgent.Option): Promise<getRendererUserAgent.Result>
678
673
 
679
674
  /** 获取设备基础信息
680
- * @supported weapp, h5
681
- * @h5 不支持 abi、benchmarkLevel
675
+ * @supported weapp
682
676
  * @example
683
677
  * ```tsx
684
678
  * const deviceInfo = Taro.getDeviceInfo()
@@ -695,8 +689,7 @@ declare module '../../index' {
695
689
  getDeviceInfo(): getDeviceInfo.Result
696
690
 
697
691
  /** 获取微信APP基础信息
698
- * @supported weapp, h5, harmony_hybrid
699
- * @h5 不支持 SDKVersion、host、version
692
+ * @supported weapp
700
693
  * @example
701
694
  * ```tsx
702
695
  * const appBaseInfo = Taro.getAppBaseInfo()
@@ -717,8 +710,7 @@ declare module '../../index' {
717
710
  * - 'authorized' 表示已经获得授权,无需再次请求授权;
718
711
  * - 'denied' 表示请求授权被拒绝,无法再次请求授权;(此情况需要引导用户[打开系统设置](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.openAppAuthorizeSetting.html),在设置页中打开权限)
719
712
  * - 'non determined' 表示尚未请求授权,会在微信下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
720
- * @supported weapp, h5, harmony_hybrid
721
- * @h5 暂未支持设置权限
713
+ * @supported weapp
722
714
  * @example
723
715
  * ```tsx
724
716
  * const appAuthorizeSetting = Taro.getAppAuthorizeSetting()
@@ -28,7 +28,7 @@ declare module '../../index' {
28
28
  * **Tips**
29
29
  * - 微信开发者工具上可以通过「编译模式」下的「下次编译模拟更新」开关来调试
30
30
  * - 小程序开发版/体验版没有「版本」概念,所以无法在开发版/体验版上测试更版本更新情况
31
- * @supported weapp, tt
31
+ * @supported weapp
32
32
  * @example
33
33
  * ```tsx
34
34
  * const updateManager = Taro.getUpdateManager()
@@ -59,12 +59,12 @@ declare module '../../index' {
59
59
  */
60
60
  interface UpdateManager {
61
61
  /** 强制小程序重启并使用新版本。在小程序新版本下载完成后(即收到 `onUpdateReady` 回调)调用。
62
- * @supported weapp, tt
62
+ * @supported weapp
63
63
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.applyUpdate.html
64
64
  */
65
65
  applyUpdate(): void
66
66
  /** 监听向微信后台请求检查更新结果事件。微信在小程序冷启动时自动检查更新,不需由开发者主动触发。
67
- * @supported weapp, tt
67
+ * @supported weapp
68
68
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.onCheckForUpdate.html
69
69
  */
70
70
  onCheckForUpdate(
@@ -72,7 +72,7 @@ declare module '../../index' {
72
72
  callback: UpdateManager.OnCheckForUpdateCallback,
73
73
  ): void
74
74
  /** 监听小程序有版本更新事件。客户端主动触发下载(无需开发者触发),下载成功后回调
75
- * @supported weapp, tt
75
+ * @supported weapp
76
76
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.onUpdateReady.html
77
77
  */
78
78
  onUpdateReady(
@@ -80,7 +80,7 @@ declare module '../../index' {
80
80
  callback: (res: TaroGeneral.CallbackResult) => void,
81
81
  ): void
82
82
  /** 监听小程序更新失败事件。小程序有新版本,客户端主动触发下载(无需开发者触发),下载失败(可能是网络原因等)后回调
83
- * @supported weapp, tt
83
+ * @supported weapp
84
84
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.onUpdateFailed.html
85
85
  */
86
86
  onUpdateFailed(
@@ -122,7 +122,7 @@ declare module '../../index' {
122
122
  * // 新的版本下载失败
123
123
  * })
124
124
  * ```
125
- * @supported weapp, tt
125
+ * @supported weapp
126
126
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/update/wx.getUpdateManager.html
127
127
  */
128
128
  getUpdateManager(): UpdateManager
@@ -113,13 +113,13 @@ declare module '../../../index' {
113
113
  *
114
114
  * **注意**
115
115
  * - 所有的 unhandledRejection 都可以被这一监听捕获,但只有 Error 类型的才会在小程序后台触发报警。
116
- * @supported weapp, tt, h5, harmony, harmony_hybrid
116
+ * @supported weapp
117
117
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onUnhandledRejection.html
118
118
  */
119
119
  onUnhandledRejection<T = any>(callback: onUnhandledRejection.Callback<T>): void
120
120
 
121
121
  /** 监听系统主题改变事件。该事件与 [`App.onThemeChange`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onThemeChange-Object-object) 的回调时机一致。
122
- * @supported weapp, h5
122
+ * @supported weapp
123
123
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onThemeChange.html
124
124
  */
125
125
  onThemeChange(callback: onThemeChange.Callback): void
@@ -131,13 +131,13 @@ declare module '../../../index' {
131
131
  * - 开发者可以在回调中进行页面重定向,但必须在回调中**同步**处理,异步处理(例如 `setTimeout` 异步执行)无效。
132
132
  * - 若开发者没有调用 [Taro.onPageNotFound](/docs/apis/base/weapp/app-event/onPageNotFound) 绑定监听,也没有声明 `App.onPageNotFound`,当跳转页面不存在时,将推入微信客户端原生的页面不存在提示页面。
133
133
  * - 如果回调中又重定向到另一个不存在的页面,将推入微信客户端原生的页面不存在提示页面,并且不再第二次回调。
134
- * @supported weapp, tt, h5, harmony_hybrid
134
+ * @supported weapp
135
135
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onPageNotFound.html
136
136
  */
137
137
  onPageNotFound(callback: onPageNotFound.Callback): void
138
138
 
139
139
  /** 监听小程序错误事件。如脚本错误或 API 调用报错等。该事件与 [`App.onError`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onerrorstring-error) 的回调时机与参数一致。
140
- * @supported weapp, tt, h5, harmony, harmony_hybrid
140
+ * @supported weapp
141
141
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onError.html
142
142
  */
143
143
  onError(callback: onError.Callback): void
@@ -178,7 +178,7 @@ declare module '../../../index' {
178
178
  * **注意**
179
179
  *
180
180
  * 部分版本在无`referrerInfo`的时候会返回 `undefined`,建议使用 `options.referrerInfo && options.referrerInfo.appId` 进行判断。
181
- * @supported weapp, tt, h5, harmony_hybrid
181
+ * @supported weapp
182
182
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onAppShow.html
183
183
  */
184
184
  onAppShow(
@@ -187,7 +187,7 @@ declare module '../../../index' {
187
187
  ): void
188
188
 
189
189
  /** 监听小程序切后台事件。该事件与 [`App.onHide`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onhide) 的回调时机一致。
190
- * @supported weapp, tt, h5, harmony_hybrid
190
+ * @supported weapp
191
191
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onAppHide.html
192
192
  */
193
193
  onAppHide(
@@ -196,19 +196,19 @@ declare module '../../../index' {
196
196
  ): void
197
197
 
198
198
  /** 取消监听未处理的 Promise 拒绝事件
199
- * @supported weapp, tt, h5, harmony, harmony_hybrid
199
+ * @supported weapp
200
200
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offUnhandledRejection.html
201
201
  */
202
202
  offUnhandledRejection<T = any>(callback: onUnhandledRejection.Callback<T>): void
203
203
 
204
204
  /** 取消监听系统主题改变事件
205
- * @supported weapp, h5
205
+ * @supported weapp
206
206
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offThemeChange.html
207
207
  */
208
208
  offThemeChange(callback: onThemeChange.Callback): void
209
209
 
210
210
  /** 取消监听小程序要打开的页面不存在事件
211
- * @supported weapp, tt, h5, harmony_hybrid
211
+ * @supported weapp
212
212
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offPageNotFound.html
213
213
  */
214
214
  offPageNotFound(
@@ -217,7 +217,7 @@ declare module '../../../index' {
217
217
  ): void
218
218
 
219
219
  /** 取消监听音频播放错误事件
220
- * @supported weapp, tt, h5, harmony, harmony_hybrid
220
+ * @supported weapp
221
221
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offError.html
222
222
  */
223
223
 
@@ -245,7 +245,7 @@ declare module '../../../index' {
245
245
  ): void
246
246
 
247
247
  /** 取消监听小程序切前台事件
248
- * @supported weapp, tt, h5, harmony_hybrid
248
+ * @supported weapp
249
249
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offAppShow.html
250
250
  */
251
251
  offAppShow(
@@ -254,7 +254,7 @@ declare module '../../../index' {
254
254
  ): void
255
255
 
256
256
  /** 取消监听小程序切后台事件
257
- * @supported weapp, tt, h5, harmony_hybrid
257
+ * @supported weapp
258
258
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offAppHide.html
259
259
  */
260
260
  offAppHide(
@@ -137,7 +137,7 @@ declare module '../../../index' {
137
137
  *
138
138
  * **注意**
139
139
  * 部分版本在无`referrerInfo`的时候会返回 `undefined`,建议使用 `options.referrerInfo && options.referrerInfo.appId` 进行判断。
140
- * @supported weapp, tt, harmony_hybrid
140
+ * @supported weapp
141
141
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/life-cycle/wx.getLaunchOptionsSync.html
142
142
  */
143
143
  getLaunchOptionsSync(): getLaunchOptionsSync.LaunchOptions