@tarojs/taro 4.0.0-beta.1 → 4.0.0-beta.3

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 (66) hide show
  1. package/package.json +10 -5
  2. package/types/api/base/debug.d.ts +8 -8
  3. package/types/api/base/env.d.ts +1 -1
  4. package/types/api/base/index.d.ts +3 -3
  5. package/types/api/base/system.d.ts +6 -6
  6. package/types/api/base/weapp/app-event.d.ts +10 -10
  7. package/types/api/base/weapp/life-cycle.d.ts +1 -1
  8. package/types/api/canvas/index.d.ts +367 -63
  9. package/types/api/device/battery.d.ts +1 -1
  10. package/types/api/device/clipboard.d.ts +2 -2
  11. package/types/api/device/keyboard.d.ts +1 -1
  12. package/types/api/device/network.d.ts +3 -3
  13. package/types/api/device/phone.d.ts +1 -1
  14. package/types/api/device/screen.d.ts +2 -2
  15. package/types/api/files/index.d.ts +7 -7
  16. package/types/api/framework/index.d.ts +2 -2
  17. package/types/api/location/index.d.ts +4 -4
  18. package/types/api/media/audio.d.ts +11 -11
  19. package/types/api/media/background-audio.d.ts +1 -1
  20. package/types/api/media/image.d.ts +5 -5
  21. package/types/api/media/video.d.ts +11 -11
  22. package/types/api/navigate/index.d.ts +1 -1
  23. package/types/api/network/download.d.ts +5 -5
  24. package/types/api/network/request.d.ts +5 -5
  25. package/types/api/network/upload.d.ts +7 -7
  26. package/types/api/network/websocket.d.ts +8 -8
  27. package/types/api/open-api/account.d.ts +1 -1
  28. package/types/api/open-api/address.d.ts +13 -5
  29. package/types/api/open-api/authorize.d.ts +1 -1
  30. package/types/api/open-api/bookshelf.d.ts +307 -0
  31. package/types/api/open-api/channels.d.ts +16 -0
  32. package/types/api/open-api/device-voip.d.ts +40 -0
  33. package/types/api/open-api/invoice.d.ts +1 -1
  34. package/types/api/open-api/login.d.ts +15 -2
  35. package/types/api/open-api/privacy.d.ts +8 -0
  36. package/types/api/open-api/settings.d.ts +3 -2
  37. package/types/api/open-api/sticker.d.ts +83 -0
  38. package/types/api/open-api/subscribe-message.d.ts +148 -6
  39. package/types/api/open-api/user-info.d.ts +6 -1
  40. package/types/api/qq/index.d.ts +306 -1
  41. package/types/api/route/index.d.ts +5 -5
  42. package/types/api/storage/index.d.ts +10 -10
  43. package/types/api/swan/download-package.d.ts +80 -0
  44. package/types/api/swan/index.d.ts +151 -0
  45. package/types/api/swan/pay.d.ts +139 -0
  46. package/types/api/taro.extend.d.ts +6 -3
  47. package/types/api/taro.hooks.d.ts +9 -9
  48. package/types/api/ui/animation.d.ts +32 -32
  49. package/types/api/ui/custom-component.d.ts +1 -1
  50. package/types/api/ui/fonts.d.ts +1 -1
  51. package/types/api/ui/interaction.d.ts +6 -6
  52. package/types/api/ui/menu.d.ts +1 -1
  53. package/types/api/ui/navigation-bar.d.ts +2 -2
  54. package/types/api/ui/pull-down-refresh.d.ts +2 -2
  55. package/types/api/ui/scroll.d.ts +1 -1
  56. package/types/api/ui/tab-bar.d.ts +8 -8
  57. package/types/api/ui/window.d.ts +2 -2
  58. package/types/api/wxml/index.d.ts +17 -17
  59. package/types/compile/compiler.d.ts +2 -0
  60. package/types/compile/config/harmony.d.ts +5 -0
  61. package/types/compile/config/mini.d.ts +1 -1
  62. package/types/compile/viteCompilerContext.d.ts +6 -0
  63. package/types/global.d.ts +2 -1
  64. package/types/index.d.ts +13 -4
  65. package/types/taro.api.d.ts +22 -14
  66. package/types/taro.config.d.ts +6 -2
@@ -51,6 +51,7 @@ export interface ViteHarmonyBuildConfig extends CommonBuildConfig, IHarmonyConfi
51
51
  fileType: IFileType
52
52
  useETS?: boolean
53
53
  useJSON5?: boolean
54
+ blended?: boolean
54
55
  runtimePath?: string | string[]
55
56
  taroComponentsPath: string
56
57
  }
@@ -110,8 +111,10 @@ export interface ViteCompilerContext<T> {
110
111
  getPages: () => VitePageMeta[]
111
112
  isApp: (id: string) => boolean
112
113
  isPage: (id: string) => boolean
114
+ isComponent: (id: string) => boolean
113
115
  isNativePageORComponent: (templatePath: string) => boolean
114
116
  getPageById: (id: string) => VitePageMeta| undefined
117
+ getComponentById: (id: string) => VitePageMeta| undefined
115
118
  getConfigFilePath: (filePath: string) => string
116
119
  getTargetFilePath: (filePath: string, targetExtName: string) => string
117
120
  }
@@ -126,11 +129,14 @@ export interface ViteH5CompilerContext extends ViteCompilerContext<ViteH5BuildCo
126
129
  }
127
130
 
128
131
  export interface ViteHarmonyCompilerContext extends ViteCompilerContext<ViteHarmonyBuildConfig> {
132
+ nativeExt: string[]
129
133
  fileType: ViteFileType
130
134
  commonChunks: string[]
135
+ nativeComponents : Map<string, ViteNativeCompMeta>
131
136
  getCommonChunks: () => string[]
132
137
  modifyHarmonyConfig: (config: Partial<AppConfig>) => void
133
138
  modifyHostPackageDep: (outDir: string, deps?: Record<string, string>, devDeps?: Record<string, string>) => void
139
+ collectNativeComponents: (meta: ViteAppMeta | VitePageMeta | ViteNativeCompMeta) => void
134
140
  getScriptPath: (filePath: string) => string
135
141
  getStylePath: (filePath: string) => string
136
142
  getConfigPath: (filePath: string) => string
package/types/global.d.ts CHANGED
@@ -419,7 +419,8 @@ declare namespace TaroGeneral {
419
419
  WEB = 'WEB',
420
420
  RN = 'RN',
421
421
  HARMONY = 'HARMONY',
422
- QUICKAPP = 'QUICKAPP'
422
+ QUICKAPP = 'QUICKAPP',
423
+ HARMONYHYBRID = 'HARMONYHYBRID'
423
424
  }
424
425
 
425
426
  type TDeviceRatio = Record<string, number>
package/types/index.d.ts CHANGED
@@ -20,6 +20,8 @@
20
20
  * │ │ └── index.d.ts 画布 API
21
21
  * │ ├── cloud
22
22
  * │ │ └── index.d.ts 微信小程序云开发 API
23
+ * │ ├── data-analysis
24
+ * │ │ └── index.d.ts 数据分析 API
23
25
  * │ ├── device
24
26
  * │ │ ├── accelerometer.d.ts 设备 -> 加速计 API
25
27
  * │ │ ├── battery.d.ts 设备 -> 电量 API
@@ -69,19 +71,26 @@
69
71
  * │ │ ├── account.d.ts 开放接口 -> 账号信息 API
70
72
  * │ │ ├── address.d.ts 开放接口 -> 收货地址 API
71
73
  * │ │ ├── authorize.d.ts 开放接口 -> 授权 API
74
+ * │ │ ├── bookshelf.d.ts 开放接口 -> 书架 API
72
75
  * │ │ ├── card.d.ts 开放接口 -> 卡券 API
73
- * ├── data-analysis.d.ts 开放接口 -> 数据分析 API
76
+ * | | ├── channels.d.ts 开放接口 -> 视频号 API
77
+ * | | ├── customer-service.d.ts 开放接口 -> 微信客服 API
78
+ * | | ├── device-voip.d.ts 开放接口 -> 音视频通话 API
74
79
  * │ │ ├── facial.d.ts 开放接口 -> 人脸识别 API // 在微信小程序文档已找不到
80
+ * │ │ ├── favorites.d.ts 开放接口 -> 收藏 API
81
+ * │ │ ├── group.d.ts 开放接口 -> 微信群 API
75
82
  * │ │ ├── invoice.d.ts 开放接口 -> 发票 API
83
+ * │ │ ├── licence-plate.d.ts 开放接口 -> 车牌 API
76
84
  * │ │ ├── login.d.ts 开放接口 -> 登录 API
77
- * │ │ ├── navigate.d.ts 开放接口 -> 小程序跳转 API
85
+ * │ │ ├── my-miniprogram.d.ts 开放接口 -> 我的小程序 API
86
+ * │ │ ├── privacy.d.ts 开放接口 -> 隐私信息授权 API
78
87
  * │ │ ├── payment.d.ts 开放接口 -> 支付 API
79
- * │ │ ├── report.d.ts 开放接口 -> 数据上报 API
88
+ * │ │ ├── redpackage.d.ts 开放接口 -> 微信红包 API
80
89
  * │ │ ├── settings.d.ts 开放接口 -> 设置 API
81
90
  * │ │ ├── soter.d.ts 开放接口 -> 生物认证 API
91
+ * │ │ ├── sticker.d.ts 开放接口 -> 微信表情 API
82
92
  * | | ├── subscribe-message.d.ts 开放接口 -> 订阅消息 API
83
93
  * │ │ ├── user-info.d.ts 开放接口 -> 用户信息 API
84
- * │ │ ├── customer-service.d.ts 开放接口 -> 微信客服 API
85
94
  * │ │ └── werun.d.ts 开放接口 -> 微信运动 API
86
95
  * │ ├── route
87
96
  * │ │ └── index.d.ts 路由 API
@@ -59,26 +59,31 @@
59
59
  /// <reference path="api/media/video-decoder.d.ts" />
60
60
  /// <reference path="api/location/index.d.ts" />
61
61
  /// <reference path="api/files/index.d.ts" />
62
- /// <reference path="api/open-api/login.d.ts" />
62
+
63
63
  /// <reference path="api/open-api/account.d.ts" />
64
- /// <reference path="api/open-api/user-info.d.ts" />
65
- /// <reference path="api/open-api/authorize.d.ts" />
66
- /// <reference path="api/open-api/settings.d.ts" />
67
64
  /// <reference path="api/open-api/address.d.ts" />
65
+ /// <reference path="api/open-api/authorize.d.ts" />
66
+ /// <reference path="api/open-api/bookshelf.d.ts" />
68
67
  /// <reference path="api/open-api/card.d.ts" />
69
- /// <reference path="api/open-api/invoice.d.ts" />
70
- /// <reference path="api/open-api/soter.d.ts" />
71
- /// <reference path="api/open-api/werun.d.ts" />
72
- /// <reference path="api/open-api/subscribe-message.d.ts" />
73
- /// <reference path="api/open-api/redpackage.d.ts" />
74
- /// <reference path="api/open-api/favorites.d.ts" />
75
- /// <reference path="api/open-api/my-miniprogram.d.ts" />
76
- /// <reference path="api/open-api/license-plate.d.ts" />
77
68
  /// <reference path="api/open-api/channels.d.ts" />
69
+ /// <reference path="api/open-api/customer-service.d.ts" />
78
70
  /// <reference path="api/open-api/device-voip.d.ts" />
71
+ /// <reference path="api/open-api/facial.d.ts" />
72
+ /// <reference path="api/open-api/favorites.d.ts" />
79
73
  /// <reference path="api/open-api/group.d.ts" />
74
+ /// <reference path="api/open-api/invoice.d.ts" />
75
+ /// <reference path="api/open-api/license-plate.d.ts" />
76
+ /// <reference path="api/open-api/login.d.ts" />
77
+ /// <reference path="api/open-api/my-miniprogram.d.ts" />
80
78
  /// <reference path="api/open-api/privacy.d.ts" />
81
- /// <reference path="api/open-api/customer-service.d.ts" />
79
+ /// <reference path="api/open-api/redpackage.d.ts" />
80
+ /// <reference path="api/open-api/settings.d.ts" />
81
+ /// <reference path="api/open-api/soter.d.ts" />
82
+ /// <reference path="api/open-api/sticker.d.ts" />
83
+ /// <reference path="api/open-api/subscribe-message.d.ts" />
84
+ /// <reference path="api/open-api/user-info.d.ts" />
85
+ /// <reference path="api/open-api/werun.d.ts" />
86
+
82
87
  /// <reference path="api/device/bluetooth.d.ts" />
83
88
  /// <reference path="api/device/bluetooth-ble.d.ts" />
84
89
  /// <reference path="api/device/bluetooth-peripheral.d.ts" />
@@ -112,11 +117,14 @@
112
117
  /// <reference path="api/skyline/index.d.ts" />
113
118
 
114
119
  /// <reference path="api/cloud/index.d.ts" />
115
- /// <reference path="api/open-api/facial.d.ts" />
116
120
 
117
121
  /// <reference path="api/alipay/index.d.ts" />
118
122
  /// <reference path="api/qq/index.d.ts" />
123
+
124
+ /// <reference path="api/swan/download-package.d.ts" />
119
125
  /// <reference path="api/swan/index.d.ts" />
126
+ /// <reference path="api/swan/pay.d.ts" />
127
+
120
128
 
121
129
  /// <reference path="api/taro.extend.d.ts" />
122
130
  /// <reference path="api/taro.hooks.d.ts" />
@@ -10,9 +10,11 @@ declare module './index' {
10
10
  */
11
11
  navigationBarBackgroundColor?: string
12
12
  /** 导航栏标题颜色,仅支持 black/white
13
+ * 当 app.json 中配置 darkmode 为 true 时可通过变量的形式配置
14
+ * @see: https://developers.weixin.qq.com/miniprogram/dev/framework/ability/darkmode.html
13
15
  * @default: "white"
14
16
  */
15
- navigationBarTextStyle?: 'white' | 'black'
17
+ navigationBarTextStyle?: 'white' | 'black' | string
16
18
  /** 导航栏标题文字内容 */
17
19
  navigationBarTitleText?: string
18
20
  /** 导航栏样式,仅支持以下值:
@@ -31,9 +33,11 @@ declare module './index' {
31
33
  */
32
34
  backgroundColor?: string
33
35
  /** 下拉背景字体、loading 图的样式,仅支持 dark/light
36
+ * 当 app.json 中配置 darkmode 为 true 时可通过变量的形式配置
37
+ * @see: https://developers.weixin.qq.com/miniprogram/dev/framework/ability/darkmode.html
34
38
  * @default: "dark"
35
39
  */
36
- backgroundTextStyle?: 'dark' | 'light'
40
+ backgroundTextStyle?: 'dark' | 'light' | string
37
41
  /** 顶部窗口的背景色,仅 iOS 支持
38
42
  * @default: "#ffffff"
39
43
  */