@tarojs/taro 4.0.1 → 4.0.3-alpha.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 (38) hide show
  1. package/package.json +40 -16
  2. package/types/api/base/env.d.ts +1 -1
  3. package/types/api/base/system.d.ts +2 -2
  4. package/types/api/base/weapp/app-event.d.ts +4 -4
  5. package/types/api/device/accelerometer.d.ts +4 -4
  6. package/types/api/device/battery.d.ts +2 -2
  7. package/types/api/device/clipboard.d.ts +14 -14
  8. package/types/api/device/keyboard.d.ts +2 -2
  9. package/types/api/device/network.d.ts +3 -3
  10. package/types/api/device/phone.d.ts +1 -1
  11. package/types/api/device/screen.d.ts +2 -2
  12. package/types/api/device/vibrate.d.ts +2 -2
  13. package/types/api/media/image.d.ts +2 -2
  14. package/types/api/network/request.d.ts +1 -1
  15. package/types/api/route/index.d.ts +5 -5
  16. package/types/api/storage/index.d.ts +4 -4
  17. package/types/api/swan/pay.d.ts +4 -4
  18. package/types/api/taro.extend.d.ts +5 -3
  19. package/types/api/ui/animation.d.ts +1 -1
  20. package/types/api/ui/interaction.d.ts +3 -3
  21. package/types/api/ui/navigation-bar.d.ts +5 -5
  22. package/types/api/ui/pull-down-refresh.d.ts +2 -2
  23. package/types/api/ui/scroll.d.ts +1 -1
  24. package/types/api/ui/tab-bar.d.ts +7 -7
  25. package/types/api/wxml/index.d.ts +15 -9
  26. package/types/compile/compiler.d.ts +9 -4
  27. package/types/compile/config/h5.d.ts +23 -10
  28. package/types/compile/config/harmony.d.ts +118 -0
  29. package/types/compile/config/index.d.ts +1 -0
  30. package/types/compile/config/mini.d.ts +29 -24
  31. package/types/compile/config/plugin.d.ts +34 -0
  32. package/types/compile/config/project.d.ts +49 -21
  33. package/types/compile/config/util.d.ts +21 -7
  34. package/types/compile/index.d.ts +8 -0
  35. package/types/compile/viteCompilerContext.d.ts +159 -0
  36. package/types/index.d.ts +0 -1
  37. package/types/taro.component.d.ts +1 -0
  38. package/types/taro.config.d.ts +5 -0
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@tarojs/taro",
3
- "version": "4.0.1",
3
+ "version": "4.0.3-alpha.0",
4
4
  "description": "Taro framework",
5
- "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro#readme",
5
+ "author": "O2Team",
6
+ "license": "MIT",
6
7
  "main": "index.js",
7
8
  "typings": "types/index.d.ts",
8
9
  "files": [
@@ -18,37 +19,60 @@
18
19
  "keywords": [
19
20
  "taro"
20
21
  ],
21
- "author": "O2Team",
22
- "license": "MIT",
22
+ "engines": {
23
+ "node": ">= 18"
24
+ },
23
25
  "dependencies": {
24
- "@tarojs/api": "4.0.1"
26
+ "@types/postcss-url": "^10.0.4",
27
+ "@tarojs/api": "4.0.3-alpha.0",
28
+ "@tarojs/runtime": "4.0.3-alpha.0"
25
29
  },
26
30
  "devDependencies": {
27
- "@tarojs/runtime": "4.0.1",
28
- "@tarojs/helper": "4.0.1"
31
+ "@types/react": "^18.3.1",
32
+ "html-webpack-plugin": "^5.6.0",
33
+ "postcss": "^8.4.38",
34
+ "webpack": "5.91.0",
35
+ "webpack-chain": "^6.5.1",
36
+ "webpack-dev-server": "^4.15.2",
37
+ "rollup": "^3.29.4",
38
+ "@tarojs/shared": "4.0.3-alpha.0",
39
+ "@tarojs/helper": "4.0.3-alpha.0",
40
+ "@tarojs/components": "4.0.3-alpha.0"
29
41
  },
30
42
  "peerDependencies": {
31
- "@tarojs/helper": "~4.0.1",
32
- "@tarojs/runtime": "~4.0.1"
43
+ "@types/react": "^18",
44
+ "html-webpack-plugin": "^5",
45
+ "rollup": "^3",
46
+ "postcss": "^8",
47
+ "vue": "^3",
48
+ "webpack": "^5",
49
+ "webpack-chain": "^6",
50
+ "webpack-dev-server": "^4",
51
+ "@tarojs/helper": "4.0.3-alpha.0",
52
+ "@tarojs/shared": "4.0.3-alpha.0",
53
+ "@tarojs/components": "4.0.3-alpha.0"
33
54
  },
34
55
  "peerDependenciesMeta": {
35
56
  "@types/react": {
36
57
  "optional": true
37
58
  },
38
- "@types/webpack": {
59
+ "html-webpack-plugin": {
60
+ "optional": true
61
+ },
62
+ "rollup": {
39
63
  "optional": true
40
64
  },
41
- "@types/webpack-dev-server": {
65
+ "vue": {
42
66
  "optional": true
43
67
  },
44
- "postcss": {
68
+ "webpack": {
45
69
  "optional": true
46
70
  },
47
- "vue": {
71
+ "webpack-chain": {
72
+ "optional": true
73
+ },
74
+ "webpack-dev-server": {
48
75
  "optional": true
49
76
  }
50
- },
51
- "scripts": {
52
- "test": "echo \"Error: run tests from root\" && exit 1"
53
77
  }
54
78
  }
@@ -9,7 +9,7 @@ declare module '../../index' {
9
9
  env: {
10
10
  [key: string]: string | undefined
11
11
  /** 框架 */
12
- FRAMEWORK: 'react' | 'preact' | 'nerv' | 'vue' | 'vue3'
12
+ FRAMEWORK: 'react' | 'preact' | 'solid' | 'vue3'
13
13
  /** Taro 环境变量 */
14
14
  TARO_ENV: 'weapp' | 'h5' | 'rn' | 'swan' | 'alipay' | 'tt' | 'qq' | 'jd' | 'quickapp'
15
15
  /** 文件系统中的用户目录路径 (本地路径) */
@@ -546,7 +546,7 @@ declare module '../../index' {
546
546
  getSystemSetting(): getSystemSetting.Result
547
547
 
548
548
  /** [Taro.getSystemInfo](./getSystemInfo) 的同步版本
549
- * @supported weapp, h5, rn, tt, harmony_hybrid
549
+ * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
550
550
  * @h5 不支持 version、statusBarHeight、fontSizeSetting、SDKVersion
551
551
  * @weapp 小程序可以在微信和企业微信中调用此接口,但是在企业微信中调用此接口时,会额外返回一个 environment 字段(微信中不返回),如此字段值为 wxwork,则表示当前小程序运行在企业微信环境中。
552
552
  * @example
@@ -591,7 +591,7 @@ declare module '../../index' {
591
591
  getSystemInfoAsync(res?: getSystemInfoAsync.Option): Promise<getSystemInfo.Result>
592
592
 
593
593
  /** 获取系统信息,支持 `Promise` 化使用。
594
- * @supported weapp, h5, rn, tt, harmony_hybrid
594
+ * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
595
595
  * @h5 不支持 version、statusBarHeight、fontSizeSetting、SDKVersion
596
596
  * @weapp 小程序可以在微信和企业微信中调用此接口,但是在企业微信中调用此接口时,会额外返回一个 environment 字段(微信中不返回),如此字段值为 wxwork,则表示当前小程序运行在企业微信环境中。
597
597
  * @example
@@ -113,7 +113,7 @@ declare module '../../../index' {
113
113
  *
114
114
  * **注意**
115
115
  * - 所有的 unhandledRejection 都可以被这一监听捕获,但只有 Error 类型的才会在小程序后台触发报警。
116
- * @supported weapp, tt, h5, harmony_hybrid
116
+ * @supported weapp, tt, h5, harmony, harmony_hybrid
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
@@ -137,7 +137,7 @@ declare module '../../../index' {
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_hybrid
140
+ * @supported weapp, tt, h5, harmony, harmony_hybrid
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
@@ -196,7 +196,7 @@ declare module '../../../index' {
196
196
  ): void
197
197
 
198
198
  /** 取消监听未处理的 Promise 拒绝事件
199
- * @supported weapp, tt, h5, harmony_hybrid
199
+ * @supported weapp, tt, h5, harmony, harmony_hybrid
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
@@ -217,7 +217,7 @@ declare module '../../../index' {
217
217
  ): void
218
218
 
219
219
  /** 取消监听音频播放错误事件
220
- * @supported weapp, tt, h5, harmony_hybrid
220
+ * @supported weapp, tt, h5, harmony, harmony_hybrid
221
221
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offError.html
222
222
  */
223
223
 
@@ -56,7 +56,7 @@ declare module '../../index' {
56
56
  * ```tsx
57
57
  * Taro.startAccelerometer({ interval: 'game' })
58
58
  * ```
59
- * @supported weapp, alipay, swan, jd, qq, tt, h5, rn
59
+ * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony
60
60
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.startAccelerometer.html
61
61
  */
62
62
  startAccelerometer (res?: startAccelerometer.Option): Promise<TaroGeneral.CallbackResult>
@@ -67,14 +67,14 @@ declare module '../../index' {
67
67
  * ```tsx
68
68
  * Taro.stopAccelerometer()
69
69
  * ```
70
- * @supported weapp, alipay, swan, jd, qq, tt, h5, rn
70
+ * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony
71
71
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.stopAccelerometer.html
72
72
  */
73
73
  stopAccelerometer (res?: stopAccelerometer.Option): Promise<TaroGeneral.CallbackResult>
74
74
 
75
75
  /**
76
76
  * 监听加速度数据,频率:5次/秒,接口调用后会自动开始监听,可使用 `Taro.stopAccelerometer` 停止监听。
77
- * @supported weapp, alipay, swan, jd, qq, tt, h5, rn
77
+ * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony
78
78
  * @example
79
79
  * ```tsx
80
80
  * Taro.onAccelerometerChange(res => {
@@ -91,7 +91,7 @@ declare module '../../index' {
91
91
 
92
92
  /**
93
93
  * 取消监听加速度数据事件,参数为空,则取消所有的事件监听。
94
- * @supported weapp, alipay, swan, jd, tt, h5, rn
94
+ * @supported weapp, alipay, swan, jd, tt, h5, rn, harmony
95
95
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.offAccelerometerChange.html
96
96
  */
97
97
  offAccelerometerChange(
@@ -32,13 +32,13 @@ declare module '../../index' {
32
32
 
33
33
  interface TaroStatic {
34
34
  /** Taro.getBatteryInfo 的同步版本
35
- * @supported weapp, alipay, swan, jd, qq
35
+ * @supported weapp, alipay, swan, jd, qq, harmony
36
36
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/battery/wx.getBatteryInfoSync.html
37
37
  */
38
38
  getBatteryInfoSync(): getBatteryInfoSync.Result
39
39
 
40
40
  /** 获取设备电量。同步 API Taro.getBatteryInfoSync 在 iOS 上不可用。
41
- * @supported weapp, alipay, swan, jd, qq, h5, harmony_hybrid
41
+ * @supported weapp, alipay, swan, jd, qq, h5, harmony, harmony_hybrid
42
42
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/battery/wx.getBatteryInfo.html
43
43
  */
44
44
  getBatteryInfo(option?: getBatteryInfo.Option): Promise<getBatteryInfo.SuccessCallbackResult>
@@ -43,7 +43,7 @@ declare module '../../index' {
43
43
 
44
44
  interface TaroStatic {
45
45
  /** 设置系统剪贴板的内容。调用成功后,会弹出 toast 提示"内容已复制",持续 1.5s
46
- * @supported weapp, swan, jd, qq, h5, rn, tt, harmony_hybrid
46
+ * @supported weapp, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid
47
47
  * @h5 部分实现
48
48
  * @example
49
49
  * ```tsx
@@ -63,19 +63,19 @@ declare module '../../index' {
63
63
  setClipboardData(option: setClipboardData.Option): Promise<setClipboardData.Promised>
64
64
 
65
65
  /**
66
- * 获取系统剪贴板内容
67
- * @supported weapp, swan, jd, qq, h5, rn, tt, harmony_hybrid
68
- * @h5 部分实现
69
- * @example
70
- * ```tsx
71
- * Taro.getClipboardData({
72
- * success: function (res){
73
- * console.log(res.data)
74
- * }
75
- * })
76
- * ```
77
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/clipboard/wx.getClipboardData.html
78
- */
66
+ * 获取系统剪贴板内容
67
+ * @supported weapp, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid
68
+ * @h5 部分实现
69
+ * @example
70
+ * ```tsx
71
+ * Taro.getClipboardData({
72
+ * success: function (res){
73
+ * console.log(res.data)
74
+ * }
75
+ * })
76
+ * ```
77
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/clipboard/wx.getClipboardData.html
78
+ */
79
79
  getClipboardData(res?: getClipboardData.Option): Promise<getClipboardData.Promised>
80
80
  }
81
81
  }
@@ -71,7 +71,7 @@ declare module '../../index' {
71
71
  getSelectedTextRange(option?: getSelectedTextRange.Option): Promise<getSelectedTextRange.SuccessCallbackResult>
72
72
 
73
73
  /** 监听键盘高度变化
74
- * @supported weapp, swan, jd, qq, rn
74
+ * @supported weapp, swan, jd, qq, rn, harmony
75
75
  * @example
76
76
  * ```tsx
77
77
  * Taro.onKeyboardHeightChange(res => {
@@ -86,7 +86,7 @@ declare module '../../index' {
86
86
 
87
87
  /**
88
88
  * 取消监听键盘高度变化事件。
89
- * @supported weapp, swan, jd, rn
89
+ * @supported weapp, swan, jd, rn, harmony
90
90
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/keyboard/wx.offKeyboardHeightChange.html
91
91
  */
92
92
  offKeyboardHeightChange(
@@ -107,7 +107,7 @@ declare module '../../index' {
107
107
  ): void
108
108
 
109
109
  /** 监听网络状态变化。
110
- * @supported weapp, swan, h5, rn, tt, harmony_hybrid
110
+ * @supported weapp, swan, h5, rn, tt, harmony, harmony_hybrid
111
111
  * @example
112
112
  * ```tsx
113
113
  * Taro.onNetworkStatusChange(function (res) {
@@ -132,7 +132,7 @@ declare module '../../index' {
132
132
  ): void
133
133
 
134
134
  /** 取消监听网络状态变化事件,参数为空,则取消所有的事件监听。
135
- * @supported weapp, swan, h5, rn, harmony_hybrid
135
+ * @supported weapp, swan, h5, rn, harmony, harmony_hybrid
136
136
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.offNetworkStatusChange.html
137
137
  */
138
138
  offNetworkStatusChange(
@@ -141,7 +141,7 @@ declare module '../../index' {
141
141
  ): void
142
142
 
143
143
  /** 获取网络类型。
144
- * @supported weapp, swan, qq, h5, rn, tt, harmony_hybrid
144
+ * @supported weapp, swan, qq, h5, rn, tt, harmony, harmony_hybrid
145
145
  * @example
146
146
  * ```tsx
147
147
  * Taro.getNetworkType({
@@ -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_hybrid
19
+ * @supported weapp, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid
20
20
  * @example
21
21
  * ```tsx
22
22
  * Taro.makePhoneCall({
@@ -179,7 +179,7 @@ declare module '../../index' {
179
179
 
180
180
  /** 取消用户录屏事件的监听函数
181
181
  * @supported weapp
182
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.offScreenRecordingStateChanged.html
182
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.offScreenRecordingStateChanged.html
183
183
  */
184
184
  offScreenRecordingStateChanged(
185
185
  /** 用户录屏事件的监听函数 */
@@ -207,7 +207,7 @@ declare module '../../index' {
207
207
  *
208
208
  * **说明**
209
209
  * - 若安卓系统设置中开启了自动调节亮度功能,则屏幕亮度会根据光线自动调整,该接口仅能获取自动调节亮度之前的值,而非实时的亮度值。
210
- * @supported weapp, alipay, swan, jd, qq, rn
210
+ * @supported weapp, alipay, swan, jd, qq, rn, harmony
211
211
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.getScreenBrightness.html
212
212
  */
213
213
  getScreenBrightness(
@@ -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
32
+ * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony
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
42
+ * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony
43
43
  * @example
44
44
  * ```tsx
45
45
  * Taro.vibrateLong(params).then(...)
@@ -221,7 +221,7 @@ declare module '../../index' {
221
221
  /** 压缩后图片的宽度,单位为px,若不填写则默认以 compressedHeight 为准等比缩放。 */
222
222
  compressedWidth?: number
223
223
  /** 压缩后图片的高度,单位为px,若不填写则默认以 compressedWidth 为准等比缩放。 */
224
- compressHeight?: number
224
+ compressedHeight?: number
225
225
  /** 接口调用成功的回调函数 */
226
226
  success?: (result: SuccessCallbackResult) => void
227
227
  }
@@ -361,7 +361,7 @@ declare module '../../index' {
361
361
  previewImage(option: previewImage.Option): Promise<TaroGeneral.CallbackResult>
362
362
 
363
363
  /** 获取图片信息。网络图片需先配置download域名才能生效。
364
- * @supported weapp, alipay, swan, tt, h5, rn, harmony_hybrid
364
+ * @supported weapp, alipay, swan, tt, h5, rn, harmony, harmony_hybrid
365
365
  * @example
366
366
  * ```tsx
367
367
  * Taro.getImageInfo({
@@ -400,7 +400,7 @@ declare module '../../index' {
400
400
  * - 对于 `GET` 方法的数据,会将数据转换成 query string(`encodeURIComponent(k)=encodeURIComponent(v)&encodeURIComponent(k)=encodeURIComponent(v)...`)
401
401
  * - 对于 `POST` 方法且 `header['content-type']` 为 `application/json` 的数据,会对数据进行 JSON 序列化
402
402
  * - 对于 `POST` 方法且 `header['content-type']` 为 `application/x-www-form-urlencoded` 的数据,会将数据转换成 query string `(encodeURIComponent(k)=encodeURIComponent(v)&encodeURIComponent(k)=encodeURIComponent(v)...)`
403
- * @supported weapp, h5, rn, alipay, swan, tt, qq, harmony_hybrid
403
+ * @supported weapp, h5, rn, alipay, swan, tt, qq, harmony, harmony_hybrid
404
404
  * @example
405
405
  * ```tsx
406
406
  * Taro.request({
@@ -117,7 +117,7 @@ declare module '../../index' {
117
117
 
118
118
  interface TaroStatic {
119
119
  /** 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面
120
- * @supported weapp, h5, rn, tt, harmony_hybrid
120
+ * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
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, tt, harmony_hybrid
146
+ * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
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, tt, harmony_hybrid
158
+ * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
159
159
  * @h5 未针对 tabbar 页面做限制处理
160
160
  * @example
161
161
  * ```tsx
@@ -168,7 +168,7 @@ declare module '../../index' {
168
168
  redirectTo(option: redirectTo.Option): Promise<TaroGeneral.CallbackResult>
169
169
 
170
170
  /** 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。使用 Taro.navigateBack 可以返回到原页面。小程序中页面栈最多十层。
171
- * @supported weapp, h5, rn, tt, harmony_hybrid
171
+ * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
172
172
  * @h5 未针对 tabbar 页面做限制处理
173
173
  * @example
174
174
  * ```tsx
@@ -195,7 +195,7 @@ declare module '../../index' {
195
195
  navigateTo(option: navigateTo.Option): Promise<TaroGeneral.CallbackResult>
196
196
 
197
197
  /** 关闭当前页面,返回上一页面或多级页面。可通过 getCurrentPages 获取当前的页面栈,决定需要返回几层。
198
- * @supported weapp, h5, rn, tt, harmony_hybrid
198
+ * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
199
199
  * @h5 若入参 delta 大于现有页面数时,返回应用打开的第一个页面(如果想要返回首页请使用 reLaunch 方法)。
200
200
  * @example
201
201
  * ```tsx
@@ -177,7 +177,7 @@ declare module '../../index' {
177
177
  ): void
178
178
 
179
179
  /** 将数据存储在本地缓存中指定的 key 中。会覆盖掉原来该 key 对应的内容。除非用户主动删除或因存储空间原因被系统清理,否则数据都一直可用。单个 key 允许存储的最大数据长度为 1MB,所有数据存储上限为 10MB。
180
- * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony_hybrid
180
+ * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid
181
181
  * @example
182
182
  * ```tsx
183
183
  * Taro.setStorage({
@@ -221,7 +221,7 @@ declare module '../../index' {
221
221
  ): void
222
222
 
223
223
  /** 从本地缓存中移除指定 key
224
- * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony_hybrid
224
+ * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid
225
225
  * @example
226
226
  * ```tsx
227
227
  * Taro.removeStorage({
@@ -289,7 +289,7 @@ declare module '../../index' {
289
289
  getStorageInfo(option?: getStorageInfo.Option): Promise<TaroGeneral.CallbackResult>
290
290
 
291
291
  /** 从本地缓存中异步获取指定 key 的内容
292
- * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony_hybrid
292
+ * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid
293
293
  * @example
294
294
  * ```tsx
295
295
  * Taro.getStorage({
@@ -327,7 +327,7 @@ declare module '../../index' {
327
327
  clearStorageSync(): void
328
328
 
329
329
  /** 清理本地数据缓存
330
- * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony_hybrid
330
+ * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid
331
331
  * @example
332
332
  * ```tsx
333
333
  * Taro.clearStorage()
@@ -1,4 +1,4 @@
1
- import { Interface } from 'readline'
1
+ import { Interface } from 'node:readline'
2
2
  import Taro from '../../index'
3
3
 
4
4
  declare module '../../index' {
@@ -117,12 +117,12 @@ declare module '../../index' {
117
117
  }
118
118
 
119
119
  interface TaroStatic {
120
- /**
120
+ /**
121
121
  * 1)百度收银台,聚合了主流的百度钱包、微信、支付宝、网银等多种支付渠道,方便开发者一站式快速接入多种支付渠道,让百度用户能在智能小程序场景下,直接完成支付、交易闭环,提升用户支付体验的同时,提高智能小程序的订单转化率。
122
122
  * 2)上述支付渠道在 C 端收银台有两种展示方式,开发者可以选择其中一种实现。
123
123
  * 方式一:将支付渠道内嵌在小程序提单页面中,实现方式参考文档[inline-payment-panel内嵌支付组件](https://smartprogram.baidu.com/docs/develop/component/inline_payment_panel/)。
124
124
  * 方式二:在用户确认订单后,调起收银台半屏面板承载支付渠道,实现方式参考文档调起[百度收银台](https://smartprogram.baidu.com/docs/develop/function/tune_up_2.0/#%E7%99%BE%E5%BA%A6%E6%94%B6%E9%93%B6%E5%8F%B0%E6%8E%A5%E5%8F%A32-0-%E8%AF%B4%E6%98%8E)。
125
- *
125
+ *
126
126
  * Web 态说明:为了保证用户交易行为全流程闭环体验,在 Web 态下调用该方法会做打开百度 App 对应小程序页面的降级处理。
127
127
  * @supported swan
128
128
  * @see https://smartprogram.baidu.com/docs/develop/api/open/payment_swan-requestPolymerPayment/
@@ -136,4 +136,4 @@ declare module '../../index' {
136
136
  */
137
137
  getOptimalPriceInfo(option: getOptimalPriceInfo.Option): void
138
138
  }
139
- }
139
+ }
@@ -38,13 +38,15 @@ declare module '../index' {
38
38
  /** @ignore */
39
39
  interface TARO_ENV_TYPE {
40
40
  [TaroGeneral.ENV_TYPE.WEAPP]: TaroGeneral.ENV_TYPE.WEAPP
41
- [TaroGeneral.ENV_TYPE.WEB]: TaroGeneral.ENV_TYPE.WEB
42
- [TaroGeneral.ENV_TYPE.RN]: TaroGeneral.ENV_TYPE.RN
43
41
  [TaroGeneral.ENV_TYPE.SWAN]: TaroGeneral.ENV_TYPE.SWAN
44
42
  [TaroGeneral.ENV_TYPE.ALIPAY]: TaroGeneral.ENV_TYPE.ALIPAY
45
43
  [TaroGeneral.ENV_TYPE.TT]: TaroGeneral.ENV_TYPE.TT
46
44
  [TaroGeneral.ENV_TYPE.QQ]: TaroGeneral.ENV_TYPE.QQ
47
45
  [TaroGeneral.ENV_TYPE.JD]: TaroGeneral.ENV_TYPE.JD
46
+ [TaroGeneral.ENV_TYPE.WEB]: TaroGeneral.ENV_TYPE.WEB
47
+ [TaroGeneral.ENV_TYPE.RN]: TaroGeneral.ENV_TYPE.RN
48
+ [TaroGeneral.ENV_TYPE.HARMONY]: TaroGeneral.ENV_TYPE.HARMONY
49
+ [TaroGeneral.ENV_TYPE.QUICKAPP]: TaroGeneral.ENV_TYPE.QUICKAPP
48
50
  [TaroGeneral.ENV_TYPE.HARMONYHYBRID]: TaroGeneral.ENV_TYPE.HARMONYHYBRID
49
51
  }
50
52
 
@@ -98,7 +100,7 @@ declare module '../index' {
98
100
  }): void
99
101
 
100
102
  /** 小程序获取和 Taro 相关的 App 信息
101
- * @supported weapp, alipay, jd, qq, swan, tt, h5, harmony_hybrid
103
+ * @supported weapp, alipay, jd, qq, swan, tt, h5, harmony, harmony_hybrid
102
104
  */
103
105
  getAppInfo(): getAppInfo.AppInfo
104
106
 
@@ -410,7 +410,7 @@ declare module '../../index' {
410
410
 
411
411
  interface TaroStatic {
412
412
  /** 创建一个动画实例 [animation](../Animation)。调用实例的方法来描述动画。最后通过动画实例的 export 方法导出动画数据传递给组件的 animation 属性。
413
- * @supported weapp, h5, tt, harmony_hybrid
413
+ * @supported weapp, tt, h5, harmony, harmony_hybrid
414
414
  * @example
415
415
  * ```tsx
416
416
  * var animation = Taro.createAnimation({
@@ -160,7 +160,7 @@ declare module '../../index' {
160
160
  * **注意**
161
161
  * - Taro.showLoading 和 Taro.showToast 同时只能显示一个
162
162
  * - Taro.showToast 应与 Taro.hideToast 配对使用
163
- * @supported weapp, h5, rn, tt, harmony_hybrid
163
+ * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
164
164
  * @example
165
165
  * ```tsx
166
166
  * Taro.showToast({
@@ -177,7 +177,7 @@ declare module '../../index' {
177
177
  * **注意**
178
178
  * - Android 6.7.2 以下版本,点击取消或蒙层时,回调 fail, errMsg 为 "fail cancel";
179
179
  * - Android 6.7.2 及以上版本 和 iOS 点击蒙层不会关闭模态弹窗,所以尽量避免使用「取消」分支中实现业务逻辑
180
- * @supported weapp, swan, h5, rn, tt, harmony_hybrid
180
+ * @supported weapp, swan, h5, rn, tt, harmony, harmony_hybrid
181
181
  * @example
182
182
  * ```tsx
183
183
  * Taro.showModal({
@@ -220,7 +220,7 @@ declare module '../../index' {
220
220
  * **注意**
221
221
  * - Android 6.7.2 以下版本,点击取消或蒙层时,回调 fail, errMsg 为 "fail cancel";
222
222
  * - Android 6.7.2 及以上版本 和 iOS 点击蒙层不会关闭模态弹窗,所以尽量避免使用「取消」分支中实现业务逻辑
223
- * @supported weapp, h5, rn, tt, harmony_hybrid
223
+ * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
224
224
  * @example
225
225
  * ```tsx
226
226
  * Taro.showActionSheet({
@@ -79,13 +79,13 @@ declare module '../../index' {
79
79
 
80
80
  interface TaroStatic {
81
81
  /** 在当前页面显示导航条加载动画
82
- * @supported weapp, rn, tt
82
+ * @supported weapp, rn, tt, harmony
83
83
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.showNavigationBarLoading.html
84
84
  */
85
85
  showNavigationBarLoading(option?: showNavigationBarLoading.Option): void
86
86
 
87
87
  /** 动态设置当前页面的标题
88
- * @supported weapp, alipay, h5, rn, tt, harmony_hybrid
88
+ * @supported weapp, alipay, tt, h5, rn, harmony, harmony_hybrid
89
89
  * @example
90
90
  * ```tsx
91
91
  * Taro.setNavigationBarTitle({
@@ -97,7 +97,7 @@ declare module '../../index' {
97
97
  setNavigationBarTitle(option: setNavigationBarTitle.Option): Promise<TaroGeneral.CallbackResult>
98
98
 
99
99
  /** 设置页面导航条颜色
100
- * @supported weapp, h5, rn, tt, harmony_hybrid
100
+ * @supported weapp, tt, h5, rn, harmony, harmony_hybrid
101
101
  * @h5 不支持 animation 参数
102
102
  * @rn 不支持 animation 参数
103
103
  * @example
@@ -116,13 +116,13 @@ declare module '../../index' {
116
116
  setNavigationBarColor(option: setNavigationBarColor.Option): Promise<TaroGeneral.CallbackResult>
117
117
 
118
118
  /** 在当前页面隐藏导航条加载动画
119
- * @supported weapp, rn, tt
119
+ * @supported weapp, rn, tt, harmony
120
120
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.hideNavigationBarLoading.html
121
121
  */
122
122
  hideNavigationBarLoading(option?: hideNavigationBarLoading.Option): void
123
123
 
124
124
  /** 隐藏返回首页按钮。微信7.0.7版本起,当用户打开的小程序最底层页面是非首页时,默认展示“返回首页”按钮,开发者可在页面 onShow 中调用 hideHomeButton 进行隐藏。
125
- * @supported weapp, tt
125
+ * @supported weapp, tt, harmony
126
126
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.hideHomeButton.html
127
127
  */
128
128
  hideHomeButton(option?: hideHomeButton.Option): Promise<TaroGeneral.CallbackResult>
@@ -25,7 +25,7 @@ declare module '../../index' {
25
25
 
26
26
  interface TaroStatic {
27
27
  /** 停止当前页面下拉刷新。
28
- * @supported weapp, h5, rn, tt, harmony_hybrid
28
+ * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
29
29
  * @example
30
30
  * ```tsx
31
31
  * onPullDownRefresh: function (){
@@ -37,7 +37,7 @@ declare module '../../index' {
37
37
  stopPullDownRefresh(option?: stopPullDownRefresh.Option): void
38
38
 
39
39
  /** 开始下拉刷新。调用后触发下拉刷新动画,效果与用户手动下拉刷新一致。
40
- * @supported weapp, h5, rn, tt, harmony_hybrid
40
+ * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
41
41
  * @rn 无动画效果
42
42
  * @example
43
43
  * ```tsx
@@ -99,7 +99,7 @@ declare module '../../index' {
99
99
  * - 后代选择器:.the-ancestor .the-descendant
100
100
  * - 跨自定义组件的后代选择器:.the-ancestor >>> .the-descendant
101
101
  * - 多选择器的并集:#a-node, .some-other-nodes
102
- * @supported weapp, h5, rn, tt, harmony_hybrid
102
+ * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
103
103
  * @example
104
104
  * ```tsx
105
105
  * Taro.pageScrollTo({