@tarojs/taro 4.0.0-canary.8 → 4.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 (75) hide show
  1. package/package.json +38 -17
  2. package/types/api/base/debug.d.ts +8 -8
  3. package/types/api/base/env.d.ts +2 -2
  4. package/types/api/base/index.d.ts +3 -3
  5. package/types/api/base/performance.d.ts +1 -1
  6. package/types/api/base/system.d.ts +6 -6
  7. package/types/api/base/weapp/app-event.d.ts +10 -10
  8. package/types/api/base/weapp/life-cycle.d.ts +1 -1
  9. package/types/api/canvas/index.d.ts +367 -63
  10. package/types/api/device/battery.d.ts +1 -1
  11. package/types/api/device/clipboard.d.ts +2 -2
  12. package/types/api/device/keyboard.d.ts +1 -1
  13. package/types/api/device/network.d.ts +3 -3
  14. package/types/api/device/phone.d.ts +1 -1
  15. package/types/api/device/screen.d.ts +2 -2
  16. package/types/api/files/index.d.ts +7 -7
  17. package/types/api/framework/index.d.ts +2 -2
  18. package/types/api/location/index.d.ts +4 -4
  19. package/types/api/media/audio.d.ts +21 -12
  20. package/types/api/media/background-audio.d.ts +1 -1
  21. package/types/api/media/image.d.ts +10 -10
  22. package/types/api/media/video.d.ts +11 -11
  23. package/types/api/navigate/index.d.ts +1 -1
  24. package/types/api/network/download.d.ts +5 -5
  25. package/types/api/network/request.d.ts +8 -8
  26. package/types/api/network/upload.d.ts +7 -7
  27. package/types/api/network/websocket.d.ts +8 -8
  28. package/types/api/open-api/account.d.ts +1 -1
  29. package/types/api/open-api/address.d.ts +13 -5
  30. package/types/api/open-api/authorize.d.ts +1 -1
  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/bookshelf.d.ts +307 -0
  44. package/types/api/swan/download-package.d.ts +80 -0
  45. package/types/api/swan/index.d.ts +151 -0
  46. package/types/api/swan/pay.d.ts +139 -0
  47. package/types/api/taro.extend.d.ts +3 -2
  48. package/types/api/taro.hooks.d.ts +9 -9
  49. package/types/api/ui/animation.d.ts +32 -32
  50. package/types/api/ui/custom-component.d.ts +1 -1
  51. package/types/api/ui/fonts.d.ts +1 -1
  52. package/types/api/ui/interaction.d.ts +6 -6
  53. package/types/api/ui/menu.d.ts +1 -1
  54. package/types/api/ui/navigation-bar.d.ts +2 -2
  55. package/types/api/ui/pull-down-refresh.d.ts +2 -2
  56. package/types/api/ui/scroll.d.ts +1 -1
  57. package/types/api/ui/tab-bar.d.ts +8 -8
  58. package/types/api/ui/window.d.ts +2 -2
  59. package/types/api/wxml/index.d.ts +30 -24
  60. package/types/compile/compiler.d.ts +6 -2
  61. package/types/compile/config/h5.d.ts +9 -4
  62. package/types/compile/config/harmony.d.ts +43 -7
  63. package/types/compile/config/index.d.ts +1 -0
  64. package/types/compile/config/mini.d.ts +2 -16
  65. package/types/compile/config/project.d.ts +26 -8
  66. package/types/compile/config/rn.d.ts +22 -1
  67. package/types/compile/index.d.ts +8 -0
  68. package/types/compile/viteCompilerContext.d.ts +7 -3
  69. package/types/global.d.ts +2 -1
  70. package/types/index.d.ts +91 -46
  71. package/types/taro.api.d.ts +22 -14
  72. package/types/taro.component.d.ts +3 -0
  73. package/types/taro.config.d.ts +13 -4
  74. package/types/taro.lifecycle.d.ts +3 -0
  75. package/types/taro.runtime.d.ts +9 -0
package/types/index.d.ts CHANGED
@@ -3,51 +3,64 @@
3
3
  *
4
4
  * 目录结构
5
5
  * ├── api 小程序端能力 API
6
- * │ ├── ad
6
+ * │   ├── ad
7
7
  * │ │ └── index.d.ts 广告 API
8
- * │ ├── alipay
8
+ * │   ├── ai
9
+ * │   │   ├── face.d.ts 人脸检测 API
10
+ * │   │   ├── inference.d.ts AI 推理 API
11
+ * │   │   └── visionkit.d.ts 视觉算法 API
12
+ * │   ├── alipay
9
13
  * │ │ └── index.d.ts 支付宝小程序 API
10
- * │ ├── base
14
+ * │   ├── base
11
15
  * │ │ ├── index.d.ts 基础 API
16
+ * │   │   ├── crypto.d.ts 基础 -> 加密 API
12
17
  * │ │ ├── debug.d.ts 基础 -> 调试 API
18
+ * │   │   ├── env.d.ts 基础 -> ENV
19
+ * │   │   ├── performance.d.ts
13
20
  * │ │ ├── system.d.ts 基础 -> 系统 API
14
- * │ ├── update.d.ts 基础 -> 更新 API
15
- * │ ├── weapp 基础 -> 小程序 API
16
- * │ ├── life-cycle.d.ts 基础 -> 小程序 API -> 生命周期
17
- * │ └── app-event.d.ts 基础 -> 小程序 API -> 应用级事件
18
- * │ │ └── env.d.ts 基础 -> ENV
19
- * │ ├── canvas
21
+ * │      ├── update.d.ts 基础 -> 更新 API
22
+ * │      └── weapp 基础 -> 小程序 API
23
+ * │      ├── app-event.d.ts 基础 -> 小程序 API -> 应用级事件
24
+ * │      └── life-cycle.d.ts 基础 -> 小程序 API -> 生命周期
25
+ * │   ├── canvas
20
26
  * │ │ └── index.d.ts 画布 API
21
- * │ ├── cloud
27
+ * │   ├── cloud
22
28
  * │ │ └── index.d.ts 微信小程序云开发 API
23
- * │ ├── device
29
+ * │   ├── data-analysis
30
+ * │ │ └── index.d.ts 数据分析 API
31
+ * │   ├── device
24
32
  * │ │ ├── accelerometer.d.ts 设备 -> 加速计 API
33
+ * │   │   ├── accessibility.d.ts 设备 -> 无障碍 API
25
34
  * │ │ ├── battery.d.ts 设备 -> 电量 API
26
- * │ ├── ble.d.ts 设备 -> 低功耗蓝牙 API
27
- * │ ├── bluetooth.d. 设备 -> 蓝牙 API
35
+ * │      ├── bluetooth-ble.d.ts 设备 -> 蓝牙-低功耗中心设备 API
36
+ * │      ├── bluetooth-peripheral.d.ts 设备 -> 蓝牙-低功耗外围设备 API
37
+ * │   │   ├── bluetooth.d.ts 设备 -> 蓝牙-通用 API
38
+ * │   │   ├── calendar.d.ts 设备 -> 日历 API
28
39
  * │ │ ├── clipboard.d.ts 设备 -> 剪贴板 API
29
40
  * │ │ ├── compass.d.ts 设备 -> 罗盘 API
30
41
  * │ │ ├── contact.d.ts 设备 -> 联系人 API
31
- * │ │ ├── motion.d.ts 设备 -> 设备方向 API
32
42
  * │ │ ├── gyroscope.d.ts 设备 -> 陀螺仪 API
33
43
  * │ │ ├── iBeacon.d.ts 设备 -> iBeacon API
34
- * │ ├── network.d.ts 设备 -> 网络 API
35
- * │ ├── nfc.d.ts 设备 -> NFC API
36
- * │ │ ├── performance.d.ts 设备 -> 性能 API
44
+ * │      ├── keyboard.d.ts 设备 -> 键盘 API
45
+ * │      ├── memory.d.ts 设备 -> 内存 API
46
+ * │ │ ├── motion.d.ts 设备 -> 设备方向 API
47
+ * │   │   ├── network.d.ts 设备 -> 网络 API
48
+ * │   │   ├── nfc.d.ts 设备 -> NFC 读写 API
37
49
  * │ │ ├── phone.d.ts 设备 -> 电话 API
38
50
  * │ │ ├── scan.d.ts 设备 -> 扫码 API
39
51
  * │ │ ├── screen.d.ts 设备 -> 屏幕 API
52
+ * │   │   ├── sms.d.ts 设备 -> 短信 API
40
53
  * │ │ ├── vibrate.d.ts 设备 -> 振动 API
41
54
  * │ │ └── wifi.d.ts 设备 -> Wi-Fi API
42
- * │ ├── ext
55
+ * │   ├── ext
43
56
  * │ │ └── index.d.ts 第三方平台 API
44
- * │ ├── files
57
+ * │   ├── files
45
58
  * │ │ └── index.d.ts 文件 API
46
- * │ ├── framework
59
+ * │   ├── framework
47
60
  * │ │ └── index.d.ts 小程序框架 API
48
- * │ ├── location
61
+ * │   ├── location
49
62
  * │ │ └── index.d.ts 位置 API
50
- * │ ├── media
63
+ * │   ├── media
51
64
  * │ │ ├── audio.d.ts 媒体 -> 音频 API
52
65
  * │ │ ├── background-audio.d.ts 媒体 -> 背景音频 API
53
66
  * │ │ ├── camera.d.ts 媒体 -> 相机 API
@@ -55,51 +68,72 @@
55
68
  * │ │ ├── image.d.ts 媒体 -> 图片 API
56
69
  * │ │ ├── live.d.ts 媒体 -> 实时音视频 API
57
70
  * │ │ ├── map.d.ts 媒体 -> 地图 API
71
+ * │   │   ├── media-recorder.d.ts 媒体 -> 画面录制器 API
58
72
  * │ │ ├── recorder.d.ts 媒体 -> 录音 API
59
- * │ ├── video.d.ts 媒体 -> 视频 API
73
+ * │      ├── video-decoder.d.ts 媒体 -> 视频解码器 API
60
74
  * │ │ └── video-processing.d.ts 媒体 -> 音视频合成 API
61
- * │ ├── network
75
+ * │ ├── video.d.ts 媒体 -> 视频 API
76
+ * │   │   └── voip.d.ts 媒体 -> 实时语音 API
77
+ * │   ├── navigate
78
+ * │   │   └── index.d.ts 跳转 API
79
+ * │   ├── network
62
80
  * │ │ ├── download.d.ts 网络 -> 下载 API
63
81
  * │ │ ├── mdns.d.ts 网络 -> mDNS API
64
82
  * │ │ ├── request.d.ts 网络 -> 发起请求 API
83
+ * │   │   ├── tcp.d.ts 网络 -> TCP 通信 API
65
84
  * │ │ ├── udp.d.ts 网络 -> UDP 通信 API
66
85
  * │ │ ├── upload.d.ts 网络 -> 上传 API
67
86
  * │ │ └── websocket.d.ts 网络 -> WebSocket API
68
- * │ ├── open-api
87
+ * │   ├── open-api
69
88
  * │ │ ├── account.d.ts 开放接口 -> 账号信息 API
70
89
  * │ │ ├── address.d.ts 开放接口 -> 收货地址 API
71
90
  * │ │ ├── authorize.d.ts 开放接口 -> 授权 API
72
91
  * │ │ ├── card.d.ts 开放接口 -> 卡券 API
73
- * ├── data-analysis.d.ts 开放接口 -> 数据分析 API
92
+ * | | ├── channels.d.ts 开放接口 -> 视频号 API
93
+ * | | ├── customer-service.d.ts 开放接口 -> 微信客服 API
94
+ * | | ├── device-voip.d.ts 开放接口 -> 音视频通话 API
74
95
  * │ │ ├── facial.d.ts 开放接口 -> 人脸识别 API // 在微信小程序文档已找不到
96
+ * │ │ ├── favorites.d.ts 开放接口 -> 收藏 API
97
+ * │ │ ├── group.d.ts 开放接口 -> 微信群 API
75
98
  * │ │ ├── invoice.d.ts 开放接口 -> 发票 API
99
+ * │   │   ├── license-plate.d.ts 开放接口 -> 车牌 API
76
100
  * │ │ ├── login.d.ts 开放接口 -> 登录 API
77
- * │ │ ├── navigate.d.ts 开放接口 -> 小程序跳转 API
78
- * │ │ ├── payment.d.ts 开放接口 -> 支付 API
79
- * │ │ ├── report.d.ts 开放接口 -> 数据上报 API
101
+ * │ │ ├── my-miniprogram.d.ts 开放接口 -> 我的小程序 API
102
+ * │ │ ├── privacy.d.ts 开放接口 -> 隐私信息授权 API
103
+ * │ │ ├── redpackage.d.ts 开放接口 -> 微信红包 API
80
104
  * │ │ ├── settings.d.ts 开放接口 -> 设置 API
81
105
  * │ │ ├── soter.d.ts 开放接口 -> 生物认证 API
106
+ * │ │ ├── sticker.d.ts 开放接口 -> 微信表情 API
82
107
  * | | ├── subscribe-message.d.ts 开放接口 -> 订阅消息 API
83
108
  * │ │ ├── user-info.d.ts 开放接口 -> 用户信息 API
84
- * │ │ ├── customer-service.d.ts 开放接口 -> 微信客服 API
85
109
  * │ │ └── werun.d.ts 开放接口 -> 微信运动 API
86
- * │ ├── route
110
+ * │   ├── payment
111
+ * │   │   └── index.d.ts 支付 API
112
+ * │   ├── qq
113
+ * │   │   └── index.d.ts QQ 小程序 API
114
+ * │   ├── route
87
115
  * │ │ └── index.d.ts 路由 API
88
- * │ ├── share
116
+ * │   ├── share
89
117
  * │ │ └── index.d.ts 转发 API
90
- * │ ├── skyline
118
+ * │   ├── skyline
91
119
  * │ │ └── index.d.ts 微信 Skyline API
92
- * │ ├── storage
120
+ * │   ├── storage
93
121
  * │ │ ├── background-fetch.d.ts 数据缓存 -> 后台获取 API
94
- * │ └── index.d.ts 数据缓存 API
95
- * │ ├── swan
122
+ * │      ├── cache-manager.d.ts 数据缓存 -> 缓存管理 API
123
+ * │   │   └── index.d.ts 数据缓存 API
124
+ * │   ├── swan
125
+ * │   │   ├── bookshelf.d.ts 百度小程序 -> 书架 API
126
+ * │   │   ├── download-package.d.ts 百度小程序 -> 下载包 API
96
127
  * │ │ └── index.d.ts 百度小程序 API
97
- * │ ├── ui
128
+ * │   │   └── pay.d.ts 百度小程序 -> 支付 API
129
+ * │   ├── taro.extend.d.ts Taro 扩展 API 类型定义
130
+ * │   ├── taro.hooks.d.ts Taro Hooks 类型定义
131
+ * │   ├── ui
98
132
  * │ │ ├── animation.d.ts 界面 -> 动画 API
99
133
  * │ │ ├── background.d.ts 界面 -> 背景 API
100
134
  * │ │ ├── custom-component.d.ts 界面 -> 自定义组件 API
101
135
  * │ │ ├── fonts.d.ts 界面 -> 字体 API
102
- * │ ├── keyboard.d.ts 界面 -> 键盘 API
136
+ * │      ├── interaction.d.ts 界面 -> 交互 API
103
137
  * │ │ ├── menu.d.ts 界面 -> 菜单 API
104
138
  * │ │ ├── navigation-bar.d.ts 界面 -> 导航栏 API
105
139
  * │ │ ├── pull-down-refresh.d.ts 界面 -> 下拉刷新 API
@@ -107,14 +141,25 @@
107
141
  * │ │ ├── sticky.d.ts 界面 -> 置顶 API
108
142
  * │ │ ├── tab-bar.d.ts 界面 -> TabBar API
109
143
  * │ │ ├── window.d.ts 界面 -> 窗口 API
110
- * │ │ └── interaction.d.ts 界面 -> 交互 API
111
- * │ ├── worker
144
+ * │   ├── worker
112
145
  * │ │ └── index.d.ts Worker API
113
- * │ ├── wxml
146
+ * │   └── wxml
114
147
  * │ │ └── index.d.ts WXML API
115
- * ├── taro.extend.d.ts Taro 扩展 API 类型定义
116
- * │ └── taro.hooks.d.ts Taro Hooks 类型定义
148
+ * ├── compile
149
+ * │   ├── compiler.d.ts
150
+ * │   ├── config
151
+ * │   │   ├── h5.d.ts
152
+ * │   │   ├── index.d.ts
153
+ * │   │   ├── manifest.d.ts
154
+ * │   │   ├── mini.d.ts
155
+ * │   │   ├── project.d.ts
156
+ * │   │   ├── rn.d.ts
157
+ * │   │   └── util.d.ts
158
+ * │   ├── hooks.d.ts Taro Hooks 类型定义
159
+ * │   └── index.d.ts
160
+ * ├── global.d.ts
117
161
  * ├── index.d.ts 此文件
162
+ * ├── taro.api.d.ts
118
163
  * ├── taro.component.d.ts Taro Component 类型定义
119
164
  * ├── taro.config.d.ts Taro 小程序 App 与 Window 设置类型定义
120
165
  * └── taro.lifecycle.d.ts Taro 生命周期类型定义
@@ -126,6 +171,7 @@
126
171
  /// <reference path="taro.component.d.ts" />
127
172
  /// <reference path="taro.config.d.ts" />
128
173
  /// <reference path="taro.lifecycle.d.ts" />
174
+ /// <reference path="taro.runtime.d.ts" />
129
175
 
130
176
  /// <reference types="@tarojs/plugin-platform-alipay/types/shims-alipay" />
131
177
  /// <reference types="@tarojs/plugin-platform-jd/types/shims-jd" />
@@ -141,10 +187,9 @@ export as namespace Taro
141
187
  declare const Taro: Taro.TaroStatic
142
188
 
143
189
  declare namespace Taro {
144
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
145
190
  interface TaroStatic {}
146
191
  }
147
192
  declare global {
148
- const defineAppConfig: (config: Taro.Config) => Taro.Config
149
- const definePageConfig: (config: Taro.Config) => Taro.Config
193
+ const defineAppConfig: (config: Taro.AppConfig) => Taro.AppConfig
194
+ const definePageConfig: (config: Taro.PageConfig) => Taro.Config
150
195
  }
@@ -59,26 +59,30 @@
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" />
68
66
  /// <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
67
  /// <reference path="api/open-api/channels.d.ts" />
68
+ /// <reference path="api/open-api/customer-service.d.ts" />
78
69
  /// <reference path="api/open-api/device-voip.d.ts" />
70
+ /// <reference path="api/open-api/facial.d.ts" />
71
+ /// <reference path="api/open-api/favorites.d.ts" />
79
72
  /// <reference path="api/open-api/group.d.ts" />
73
+ /// <reference path="api/open-api/invoice.d.ts" />
74
+ /// <reference path="api/open-api/license-plate.d.ts" />
75
+ /// <reference path="api/open-api/login.d.ts" />
76
+ /// <reference path="api/open-api/my-miniprogram.d.ts" />
80
77
  /// <reference path="api/open-api/privacy.d.ts" />
81
- /// <reference path="api/open-api/customer-service.d.ts" />
78
+ /// <reference path="api/open-api/redpackage.d.ts" />
79
+ /// <reference path="api/open-api/settings.d.ts" />
80
+ /// <reference path="api/open-api/soter.d.ts" />
81
+ /// <reference path="api/open-api/sticker.d.ts" />
82
+ /// <reference path="api/open-api/subscribe-message.d.ts" />
83
+ /// <reference path="api/open-api/user-info.d.ts" />
84
+ /// <reference path="api/open-api/werun.d.ts" />
85
+
82
86
  /// <reference path="api/device/bluetooth.d.ts" />
83
87
  /// <reference path="api/device/bluetooth-ble.d.ts" />
84
88
  /// <reference path="api/device/bluetooth-peripheral.d.ts" />
@@ -112,11 +116,15 @@
112
116
  /// <reference path="api/skyline/index.d.ts" />
113
117
 
114
118
  /// <reference path="api/cloud/index.d.ts" />
115
- /// <reference path="api/open-api/facial.d.ts" />
116
119
 
117
120
  /// <reference path="api/alipay/index.d.ts" />
118
121
  /// <reference path="api/qq/index.d.ts" />
122
+
123
+ /// <reference path="api/swan/bookshelf.d.ts" />
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" />
@@ -19,6 +19,7 @@ declare module './index' {
19
19
  shareTicket: string | undefined
20
20
  scene: number | undefined
21
21
  exitState?: any
22
+ $taroPath?: string
22
23
  }
23
24
 
24
25
  interface Show {
@@ -139,5 +140,7 @@ declare module './index' {
139
140
  path?: string
140
141
  /** 页面的组件选项 */
141
142
  options?: Record<string, unknown>
143
+ /** 获得一个 EventChannel 对象,用于页面间通讯 */
144
+ getOpenerEventChannel?(): Record<string, any>
142
145
  }
143
146
  }
@@ -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
  /** 导航栏样式,仅支持以下值:
@@ -30,10 +32,17 @@ declare module './index' {
30
32
  * @default: "#ffffff"
31
33
  */
32
34
  backgroundColor?: string
35
+ /** 页面容器背景色, HexColor
36
+ * @see: https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/custom-route.html#%E8%AE%BE%E7%BD%AE%E9%A1%B5%E9%9D%A2%E9%80%8F%E6%98%8E
37
+ * @default: "#ffffff"
38
+ */
39
+ backgroundColorContent?: string
33
40
  /** 下拉背景字体、loading 图的样式,仅支持 dark/light
41
+ * 当 app.json 中配置 darkmode 为 true 时可通过变量的形式配置
42
+ * @see: https://developers.weixin.qq.com/miniprogram/dev/framework/ability/darkmode.html
34
43
  * @default: "dark"
35
44
  */
36
- backgroundTextStyle?: 'dark' | 'light'
45
+ backgroundTextStyle?: 'dark' | 'light' | string
37
46
  /** 顶部窗口的背景色,仅 iOS 支持
38
47
  * @default: "#ffffff"
39
48
  */
@@ -420,7 +429,7 @@ declare module './index' {
420
429
  decodeQuery?: 'disable'
421
430
  }
422
431
 
423
- interface AppConfig {
432
+ export interface AppConfig {
424
433
  /** 小程序默认启动首页,未指定 entryPagePath 时,数组的第一项代表小程序的初始页面(首页)。 */
425
434
  entryPagePath?: string
426
435
  /** 接受一个数组,每一项都是字符串,来指定小程序由哪些页面组成,数组的第一项代表小程序的初始页面 */
@@ -557,7 +566,7 @@ declare module './index' {
557
566
  */
558
567
  themeLocation?: string
559
568
  /** 配置自定义组件代码按需注入 */
560
- lazyCodeLoading?: string
569
+ lazyCodeLoading?: 'requiredComponents' | string
561
570
  /** 单页模式相关配置 */
562
571
  singlePage?: SinglePage
563
572
  /** 聊天素材小程序打开相关配置
@@ -56,9 +56,12 @@ declare module './index' {
56
56
  }
57
57
 
58
58
  interface PageResizeObject {
59
+ deviceOrientation?: 'portrait' | 'landscape'
59
60
  size: {
60
61
  windowWidth: number
61
62
  windowHeight: number
63
+ screenWidth?: number
64
+ screenHeight?: number
62
65
  }
63
66
  }
64
67
 
@@ -0,0 +1,9 @@
1
+ import type { options } from '@tarojs/runtime'
2
+
3
+ import Taro from './index'
4
+
5
+ declare module './index' {
6
+ interface TaroStatic {
7
+ options: typeof options
8
+ }
9
+ }