@uni-helper/uni-pages-types 0.4.9 → 0.6.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.
package/dist/index.d.mts CHANGED
@@ -1,17 +1,17 @@
1
1
  //#region src/common.d.ts
2
- type RGBColor = `rgb(${number}, ${number}, ${number})`;
3
- type RGBAColor = `rgba(${number}, ${number}, ${number}, ${number})`;
4
- type HEXColor = `#${string}`;
5
- type Color = RGBColor | RGBAColor | HEXColor;
6
- type PxSize = `${number}px`;
7
- type RpxSize = `${number}rpx`;
8
- type PercentageSize = `${number}%`;
9
- type ThemeVar = `@${string}`;
2
+ export type RGBColor = `rgb(${number}, ${number}, ${number})`;
3
+ export type RGBAColor = `rgba(${number}, ${number}, ${number}, ${number})`;
4
+ export type HEXColor = `#${string}`;
5
+ export type Color = RGBColor | RGBAColor | HEXColor;
6
+ export type PxSize = `${number}px`;
7
+ export type RpxSize = `${number}rpx`;
8
+ export type PercentageSize = `${number}%`;
9
+ export type ThemeVar = `@${string}`;
10
10
  /**
11
11
  * 窗口动画,详见 [窗口动画](https://uniapp.dcloud.net.cn/api/router.html#animation)
12
12
  */
13
- type AnimationType = 'slide-in-right' | 'slide-in-left' | 'slide-in-top' | 'slide-in-bottom' | 'pop-in' | 'fade-in' | 'zoom-out' | 'zoom-fade-out' | 'none';
14
- interface TitleNViewButton {
13
+ export type AnimationType = 'slide-in-right' | 'slide-in-left' | 'slide-in-top' | 'slide-in-bottom' | 'pop-in' | 'fade-in' | 'zoom-out' | 'zoom-fade-out' | 'none';
14
+ export interface TitleNViewButton {
15
15
  /**
16
16
  * 自定义按钮样式,详见 [自定义按钮样式](https://uniapp.dcloud.net.cn/collocation/pages#app-titlenview-buttons-type)
17
17
  *
@@ -50,11 +50,19 @@ interface TitleNViewButton {
50
50
  * @format color
51
51
  */
52
52
  background?: HEXColor | RGBAColor;
53
+ /**
54
+ * 自定义按钮上显示的角标文本,最多显示 3 个字符,超过则显示为 ...
55
+ *
56
+ * @desc H5
57
+ */
58
+ badgeText?: string;
53
59
  /**
54
60
  * 自定义按钮按下状态文字颜色,支持 HEX 和 RGBA 颜色
55
61
  *
56
62
  * @default color 属性值自动调整透明度为 0.3
57
63
  *
64
+ * @desc H5 暂不支持
65
+ *
58
66
  * @format color
59
67
  */
60
68
  colorPressed?: HEXColor | RGBAColor;
@@ -105,7 +113,24 @@ interface TitleNViewButton {
105
113
  }
106
114
  //#endregion
107
115
  //#region src/condition.d.ts
108
- interface ConditionItem {
116
+ /**
117
+ * @deprecated 请使用 ConditionListItem
118
+ */
119
+ export interface ConditionItem {
120
+ /**
121
+ * 启动模式名称
122
+ */
123
+ name: string;
124
+ /**
125
+ * 启动页面路径
126
+ */
127
+ path: string;
128
+ /**
129
+ * 启动参数,可在页面的 onLoad 函数里获得
130
+ */
131
+ query?: string;
132
+ }
133
+ export interface ConditionListItem {
109
134
  /**
110
135
  * 启动模式名称
111
136
  */
@@ -118,8 +143,13 @@ interface ConditionItem {
118
143
  * 启动参数,可在页面的 onLoad 函数里获得
119
144
  */
120
145
  query?: string;
146
+ [x: string]: any;
121
147
  }
122
- interface Condition {
148
+ export type ConditionList = ConditionListItem[];
149
+ /**
150
+ * 启动模式配置
151
+ */
152
+ export interface Condition {
123
153
  /**
124
154
  * 当前激活的模式,list 节点的索引值
125
155
  */
@@ -127,11 +157,17 @@ interface Condition {
127
157
  /**
128
158
  * 启动模式列表
129
159
  */
130
- list: ConditionItem[];
160
+ list: ConditionList;
161
+ [x: string]: any;
131
162
  }
132
163
  //#endregion
133
164
  //#region src/easycom.d.ts
134
- interface EasyCom {
165
+ /**
166
+ * 组件自动引入规则
167
+ *
168
+ * @desc 2.5.5+
169
+ */
170
+ export interface EasyCom {
135
171
  /**
136
172
  * 是否开启自动扫描,开启后将会自动扫描符合 `components/组件名称/组件名称.vue` 目录结构的组件
137
173
  *
@@ -151,7 +187,7 @@ interface EasyCom {
151
187
  custom?: Record<string, string>;
152
188
  }
153
189
  //#endregion
154
- //#region src/global-style/app-harmony.d.ts
190
+ //#region src/style/app-harmony.d.ts
155
191
  /**
156
192
  * 设置编译到 App(Harmony)平台的特定样式
157
193
  *
@@ -161,15 +197,19 @@ interface EasyCom {
161
197
  */
162
198
  interface AppHarmony {
163
199
  /**
164
- * 软键盘弹出模式,仅支持 "adjustResize" / "adjustPan"
200
+ * 软键盘弹出模式
201
+ *
202
+ * "adjustResize" 重新测量并压缩布局尺寸
203
+ *
204
+ * "adjustPan" 整体平移窗口而不改变布局大小
165
205
  *
166
206
  * @default "adjustPan"
167
207
  */
168
- softInputMode?: 'adjustResize' | 'adjustPan';
208
+ softinputMode?: 'adjustResize' | 'adjustPan';
169
209
  [x: string]: any;
170
210
  }
171
211
  //#endregion
172
- //#region src/global-style/app-plus.d.ts
212
+ //#region src/style/app-plus.d.ts
173
213
  interface AppPlus {
174
214
  /**
175
215
  * 窗体背景色,支持 HEX 颜色
@@ -787,6 +827,8 @@ interface AppPlus {
787
827
  * "normal" 正常
788
828
  *
789
829
  * "bold" 粗体
830
+ *
831
+ * @default "normal"
790
832
  */
791
833
  titleWeight?: 'normal' | 'bold';
792
834
  [x: string]: any;
@@ -1094,15 +1136,17 @@ interface AppPlus {
1094
1136
  *
1095
1137
  * @desc App-iOS
1096
1138
  */
1097
- softInputNavBar?: 'auto' | 'none';
1139
+ softinputNavBar?: 'auto' | 'none';
1098
1140
  /**
1099
1141
  * 软键盘弹出模式,仅支持 "adjustResize" / "adjustPan"
1100
1142
  *
1101
- * @default "adjustPan"
1143
+ * "adjustResize" 重新测量并压缩布局尺寸
1102
1144
  *
1103
- * @desc App
1145
+ * "adjustPan" 整体平移窗口而不改变布局大小
1146
+ *
1147
+ * @default "adjustPan"
1104
1148
  */
1105
- softInputMode?: 'adjustResize' | 'adjustPan';
1149
+ softinputMode?: 'adjustResize' | 'adjustPan';
1106
1150
  /**
1107
1151
  * 下拉刷新
1108
1152
  *
@@ -1204,7 +1248,7 @@ interface AppPlus {
1204
1248
  [x: string]: any;
1205
1249
  }
1206
1250
  //#endregion
1207
- //#region src/global-style/h5.d.ts
1251
+ //#region src/style/h5.d.ts
1208
1252
  interface H5 {
1209
1253
  /**
1210
1254
  * 导航栏,详见 [导航栏](https://uniapp.dcloud.net.cn/collocation/pages#h5-titlenview)
@@ -1219,7 +1263,7 @@ interface H5 {
1219
1263
  */
1220
1264
  backgroundColor?: HEXColor;
1221
1265
  /**
1222
- * 自定义按钮,详见 [自定义按钮](https://uniapp.dcloud.net.cn/collocation/pages#app-titlenview-buttons)
1266
+ * 自定义按钮,详见 [自定义按钮](https://uniapp.dcloud.net.cn/collocation/pages#h5-titlenview-buttons)
1223
1267
  */
1224
1268
  buttons?: TitleNViewButton[];
1225
1269
  /**
@@ -1310,28 +1354,78 @@ interface H5 {
1310
1354
  };
1311
1355
  /**
1312
1356
  * 下拉刷新,详见 [下拉刷新](https://uniapp.dcloud.net.cn/collocation/pages#h5-pulltorefresh)
1357
+ *
1358
+ * h5 平台下拉刷新动画,只有 circle 类型
1313
1359
  */
1314
1360
  pullToRefresh?: {
1361
+ /**
1362
+ * 是否开启窗口的下拉刷新功能
1363
+ */
1364
+ support?: boolean;
1315
1365
  /**
1316
1366
  * 下拉刷新控件颜色,支持 HEX 颜色
1317
1367
  *
1318
1368
  * @default "#2BD009"
1369
+ *
1370
+ * @format color
1319
1371
  */
1320
1372
  color?: HEXColor;
1321
1373
  /**
1322
- * 下拉刷新控件起始位置,支持支持单位为 px 的逻辑像素值或百分比
1374
+ * 下拉刷新控件样式,h5 平台只有 "circle" 类型
1375
+ */
1376
+ style?: 'default' | 'circle';
1377
+ /**
1378
+ * 下拉刷新控件进入刷新状态的拉拽高度,支持单位为 px 的逻辑像素值或百分比
1379
+ */
1380
+ height?: PxSize | PercentageSize;
1381
+ /**
1382
+ * 可下拉拖拽的范围,支持单位为 px 的逻辑像素值或百分比
1383
+ */
1384
+ range?: PxSize | PercentageSize;
1385
+ /**
1386
+ * 下拉刷新控件的起始位置,支持单位为 px 的逻辑像素值或百分比
1323
1387
  *
1324
1388
  * @default "0px"
1325
1389
  */
1326
1390
  offset?: PxSize | PercentageSize;
1391
+ /**
1392
+ * 下拉可刷新状态时下拉刷新控件显示的内容,仅 style 为 "default" 时有效
1393
+ */
1394
+ contentdown?: {
1395
+ /**
1396
+ * 下拉刷新控件上显示的标题内容
1397
+ */
1398
+ caption?: string;
1399
+ [x: string]: any;
1400
+ };
1401
+ /**
1402
+ * 释放可刷新状态时下拉刷新控件显示的内容,仅 style 为 "default" 时有效
1403
+ */
1404
+ contentover?: {
1405
+ /**
1406
+ * 下拉刷新控件上显示的标题内容
1407
+ */
1408
+ caption?: string;
1409
+ [x: string]: any;
1410
+ };
1411
+ /**
1412
+ * 正在刷新状态时下拉刷新控件显示的内容,仅 style 为 "default" 时有效
1413
+ */
1414
+ contentrefresh?: {
1415
+ /**
1416
+ * 下拉刷新控件上显示的标题内容
1417
+ */
1418
+ caption?: string;
1419
+ [x: string]: any;
1420
+ };
1327
1421
  [x: string]: any;
1328
1422
  };
1329
1423
  [x: string]: any;
1330
1424
  }
1331
1425
  //#endregion
1332
- //#region src/global-style/mp-alipay.d.ts
1426
+ //#region src/style/mp-alipay.d.ts
1333
1427
  /**
1334
- * 设置编译到 mp-alipay 平台的特定样式,配置项参考 [MP-ALIPAY](https://uniapp.dcloud.net.cn/collocation/pages#mp-alipay) 和 <https://opendocs.alipay.com/mini/framework/app-json#window>
1428
+ * 设置编译到 mp-alipay 平台的特定样式,配置项参考 <https://opendocs.alipay.com/mini/framework/app-json#window>
1335
1429
  *
1336
1430
  * 相应的类型是 MpAlipay
1337
1431
  *
@@ -1357,7 +1451,7 @@ interface MpAlipay {
1357
1451
  */
1358
1452
  backgroundImageColor?: HEXColor;
1359
1453
  /**
1360
- * 下拉露出显示背景图的链接,支持网络地址和本地地址,尽量使用绝对地址
1454
+ * 下拉露出显示背景图的链接
1361
1455
  */
1362
1456
  backgroundImageUrl?: string;
1363
1457
  /**
@@ -1373,7 +1467,7 @@ interface MpAlipay {
1373
1467
  /**
1374
1468
  * 仅支持 iOS,是否支持手势返回
1375
1469
  *
1376
- * @default "YES"
1470
+ * @default "NO"
1377
1471
  */
1378
1472
  gestureBack?: 'YES' | 'NO';
1379
1473
  /**
@@ -1423,13 +1517,15 @@ interface MpAlipay {
1423
1517
  */
1424
1518
  titlePenetrate?: 'YES' | 'NO';
1425
1519
  /**
1426
- * 导航栏图片地址,会替换当前文字标题,只支持 https 图片链接
1520
+ * 导航栏图片地址
1427
1521
  */
1428
1522
  titleImage?: string;
1429
1523
  /**
1430
1524
  * 导航栏背景色,支持 HEX 颜色
1525
+ *
1526
+ * @format color
1431
1527
  */
1432
- titleBarColor?: HEXColor;
1528
+ titleBarColor?: HEXColor | ThemeVar;
1433
1529
  /**
1434
1530
  * 导航栏前景色
1435
1531
  *
@@ -1439,9 +1535,9 @@ interface MpAlipay {
1439
1535
  [x: string]: any;
1440
1536
  }
1441
1537
  //#endregion
1442
- //#region src/global-style/mp-baidu.d.ts
1538
+ //#region src/style/mp-baidu.d.ts
1443
1539
  /**
1444
- * 设置编译到 mp-baidu 平台的特定样式,配置项参考 [MP-BAIDU](https://uniapp.dcloud.net.cn/collocation/pages.html#mp-baidu) 和 <https://smartprogram.baidu.com/docs/develop/framework/process/#window>
1540
+ * 设置编译到 mp-baidu 平台的特定样式,配置项参考 <https://smartprogram.baidu.com/docs/develop/framework/process/#window>
1445
1541
  *
1446
1542
  * 相应的类型是 MpBaidu
1447
1543
  *
@@ -1494,12 +1590,16 @@ interface MpBaidu {
1494
1590
  * 顶部窗口的背景色,仅 iOS 支持
1495
1591
  *
1496
1592
  * @default "#FFFFFF"
1593
+ *
1594
+ * @format color
1497
1595
  */
1498
1596
  backgroundColorTop?: HEXColor | ThemeVar;
1499
1597
  /**
1500
1598
  * 底部窗口的背景色,仅 iOS 支持
1501
1599
  *
1502
1600
  * @default "#FFFFFF"
1601
+ *
1602
+ * @format color
1503
1603
  */
1504
1604
  backgroundColorBottom?: HEXColor | ThemeVar;
1505
1605
  /**
@@ -1543,7 +1643,7 @@ interface MpBaidu {
1543
1643
  [x: string]: any;
1544
1644
  }
1545
1645
  //#endregion
1546
- //#region src/global-style/mp-harmony.d.ts
1646
+ //#region src/style/mp-harmony.d.ts
1547
1647
  /**
1548
1648
  * 设置编译到 mp-harmony 平台的特定样式,配置项参考 <https://developer.huawei.com/consumer/cn/doc/SPPartnerCenter-develop-Guides/extjson-description-0000002554249601>
1549
1649
  *
@@ -1574,6 +1674,8 @@ interface MpHarmony {
1574
1674
  * 窗口的背景色,支持 HEX 颜色
1575
1675
  *
1576
1676
  * @default "#FFFFFF"
1677
+ *
1678
+ * @format color
1577
1679
  */
1578
1680
  backgroundColor?: HEXColor | ThemeVar;
1579
1681
  /**
@@ -1597,7 +1699,7 @@ interface MpHarmony {
1597
1699
  [x: string]: any;
1598
1700
  }
1599
1701
  //#endregion
1600
- //#region src/global-style/mp-jd.d.ts
1702
+ //#region src/style/mp-jd.d.ts
1601
1703
  /**
1602
1704
  * 设置编译到 mp-jd 平台的特定样式,配置项参考 <https://mp-docs.jd.com/doc/miniapp/dev/reference/2595#heading-3>
1603
1705
  *
@@ -1638,6 +1740,8 @@ interface MpJd {
1638
1740
  * 下拉窗口的背景色,不是页面的背景颜色
1639
1741
  *
1640
1742
  * @default "#FFFFFF"
1743
+ *
1744
+ * @format color
1641
1745
  */
1642
1746
  backgroundColor?: HEXColor | ThemeVar;
1643
1747
  /**
@@ -1650,12 +1754,16 @@ interface MpJd {
1650
1754
  * 顶部窗口的背景色,仅 iOS 支持
1651
1755
  *
1652
1756
  * @default "#FFFFFF"
1757
+ *
1758
+ * @format color
1653
1759
  */
1654
1760
  backgroundColorTop?: HEXColor | ThemeVar;
1655
1761
  /**
1656
1762
  * 底部窗口的背景色,仅 iOS 支持
1657
1763
  *
1658
1764
  * @default "#FFFFFF"
1765
+ *
1766
+ * @format color
1659
1767
  */
1660
1768
  backgroundColorBottom?: HEXColor | ThemeVar;
1661
1769
  /**
@@ -1673,7 +1781,7 @@ interface MpJd {
1673
1781
  [x: string]: any;
1674
1782
  }
1675
1783
  //#endregion
1676
- //#region src/global-style/mp-kuaishou.d.ts
1784
+ //#region src/style/mp-kuaishou.d.ts
1677
1785
  /**
1678
1786
  * 设置编译到 mp-kuaishou 平台的特定样式,配置项参考 <https://mp.kuaishou.com/docs/develop/frame/config/conf_appjson.html#window>
1679
1787
  *
@@ -1685,7 +1793,7 @@ interface MpKuaishou {
1685
1793
  /**
1686
1794
  * 导航栏背景颜色,支持 HEX 颜色
1687
1795
  *
1688
- * @default "#000000"
1796
+ * @default "#ffffff"
1689
1797
  *
1690
1798
  * @format color
1691
1799
  */
@@ -1714,6 +1822,8 @@ interface MpKuaishou {
1714
1822
  * 窗口的背景色,支持 HEX 颜色
1715
1823
  *
1716
1824
  * @default "#FFFFFF"
1825
+ *
1826
+ * @format color
1717
1827
  */
1718
1828
  backgroundColor?: HEXColor | ThemeVar;
1719
1829
  /**
@@ -1726,12 +1836,16 @@ interface MpKuaishou {
1726
1836
  * 顶部窗口的背景色,仅 iOS 支持
1727
1837
  *
1728
1838
  * @default "#FFFFFF"
1839
+ *
1840
+ * @format color
1729
1841
  */
1730
1842
  backgroundColorTop?: HEXColor | ThemeVar;
1731
1843
  /**
1732
1844
  * 底部窗口的背景色,仅 iOS 支持
1733
1845
  *
1734
1846
  * @default "#FFFFFF"
1847
+ *
1848
+ * @format color
1735
1849
  */
1736
1850
  backgroundColorBottom?: HEXColor | ThemeVar;
1737
1851
  /**
@@ -1761,7 +1875,7 @@ interface MpKuaishou {
1761
1875
  [x: string]: any;
1762
1876
  }
1763
1877
  //#endregion
1764
- //#region src/global-style/mp-lark.d.ts
1878
+ //#region src/style/mp-lark.d.ts
1765
1879
  /**
1766
1880
  * 设置编译到 mp-lark 平台的特定样式,配置项参考 <https://open.feishu.cn/document/client-docs/gadget/introduction/global-settings#a172b7dd>
1767
1881
  *
@@ -1826,6 +1940,8 @@ interface MpLark {
1826
1940
  * @desc iOS, Android, PC(3.14.0+)
1827
1941
  *
1828
1942
  * @default "#FFFFFF"
1943
+ *
1944
+ * @format color
1829
1945
  */
1830
1946
  backgroundColor?: HEXColor | ThemeVar;
1831
1947
  /**
@@ -1842,6 +1958,8 @@ interface MpLark {
1842
1958
  * @desc iOS
1843
1959
  *
1844
1960
  * @default "#FFFFFF"
1961
+ *
1962
+ * @format color
1845
1963
  */
1846
1964
  backgroundColorTop?: HEXColor | ThemeVar;
1847
1965
  /**
@@ -1850,6 +1968,8 @@ interface MpLark {
1850
1968
  * @desc iOS
1851
1969
  *
1852
1970
  * @default "#FFFFFF"
1971
+ *
1972
+ * @format color
1853
1973
  */
1854
1974
  backgroundColorBottom?: HEXColor | ThemeVar;
1855
1975
  /**
@@ -1870,12 +1990,14 @@ interface MpLark {
1870
1990
  onReachBottomDistance?: number;
1871
1991
  /**
1872
1992
  * PCMode 模式下特定的窗口配置,支持的属性与通用 window 配置属性一致,仅当在 ext 内配置了 defaultPages.PCMode 时生效
1993
+ *
1994
+ * @desc PC(3.14.0+)
1873
1995
  */
1874
1996
  PCMode?: Omit<MpLark, 'PCMode'>;
1875
1997
  [x: string]: any;
1876
1998
  }
1877
1999
  //#endregion
1878
- //#region src/global-style/mp-qq.d.ts
2000
+ //#region src/style/mp-qq.d.ts
1879
2001
  /**
1880
2002
  * 设置编译到 mp-qq 平台的特定样式,配置项参考 <https://q.qq.com/wiki/develop/miniprogram/frame/dispose.html#window>
1881
2003
  *
@@ -1916,6 +2038,8 @@ interface MpQq {
1916
2038
  * 窗口的背景色,支持 HEX 颜色
1917
2039
  *
1918
2040
  * @default "#FFFFFF"
2041
+ *
2042
+ * @format color
1919
2043
  */
1920
2044
  backgroundColor?: HEXColor | ThemeVar;
1921
2045
  /**
@@ -1928,12 +2052,16 @@ interface MpQq {
1928
2052
  * 顶部窗口的背景色,仅 iOS 支持
1929
2053
  *
1930
2054
  * @default "#FFFFFF"
2055
+ *
2056
+ * @format color
1931
2057
  */
1932
2058
  backgroundColorTop?: HEXColor | ThemeVar;
1933
2059
  /**
1934
2060
  * 底部窗口的背景色,仅 iOS 支持
1935
2061
  *
1936
2062
  * @default "#FFFFFF"
2063
+ *
2064
+ * @format color
1937
2065
  */
1938
2066
  backgroundColorBottom?: HEXColor | ThemeVar;
1939
2067
  /**
@@ -1963,7 +2091,7 @@ interface MpQq {
1963
2091
  [x: string]: any;
1964
2092
  }
1965
2093
  //#endregion
1966
- //#region src/global-style/mp-toutiao.d.ts
2094
+ //#region src/style/mp-toutiao.d.ts
1967
2095
  /**
1968
2096
  * 设置编译到 mp-toutiao 平台的特定样式,配置项参考 <https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/framework/general-configuration#window>
1969
2097
  *
@@ -1991,7 +2119,13 @@ interface MpToutiao {
1991
2119
  */
1992
2120
  navigationBarTitleText?: string;
1993
2121
  /**
1994
- * 导航栏样式
2122
+ * 导航栏样式,导航栏样式,仅支持 "default" / "custom"
2123
+ *
2124
+ * custom 模式可自定义导航栏,具体效果样式效果参照 [页面自定义结构文档](https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/open-capacity/basic-capacities/custom-page-structure/)
2125
+ *
2126
+ * 具体申请入口在[「控制台」-「我的应用」](https://developer.open-douyin.com/console?type=1)-「具体小程序」-「能力」-「互动能力」中完成自定义导航栏权限申请
2127
+ *
2128
+ * 注意:custom 需要申请权限,否则会阻碍代码包上传,2022 年 5 月 23 日会强制变动,详细参考[获取小程序页面结构自定义能力规范](https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/operation/platform-capabilities/custom-page-structure/custom/)
1995
2129
  *
1996
2130
  * "default" 默认样式
1997
2131
  *
@@ -2004,6 +2138,8 @@ interface MpToutiao {
2004
2138
  * 窗口的背景色,支持 HEX 颜色
2005
2139
  *
2006
2140
  * @default "#FFFFFF"
2141
+ *
2142
+ * @format color
2007
2143
  */
2008
2144
  backgroundColor?: HEXColor | ThemeVar;
2009
2145
  /**
@@ -2016,12 +2152,16 @@ interface MpToutiao {
2016
2152
  * 顶部窗口的背景色,仅 iOS 支持
2017
2153
  *
2018
2154
  * @default 同 backgroundColor
2155
+ *
2156
+ * @format color
2019
2157
  */
2020
2158
  backgroundColorTop?: HEXColor | ThemeVar;
2021
2159
  /**
2022
2160
  * 底部窗口的背景色,仅 iOS 支持
2023
2161
  *
2024
2162
  * @default 同 backgroundColor
2163
+ *
2164
+ * @format color
2025
2165
  */
2026
2166
  backgroundColorBottom?: HEXColor | ThemeVar;
2027
2167
  /**
@@ -2151,9 +2291,9 @@ interface MpToutiao {
2151
2291
  [x: string]: any;
2152
2292
  }
2153
2293
  //#endregion
2154
- //#region src/global-style/mp-weixin.d.ts
2294
+ //#region src/style/mp-weixin.d.ts
2155
2295
  /**
2156
- * 设置编译到 mp-weixin 平台的特定样式,配置项参考 [MP-WEIXIN](https://uniapp.dcloud.net.cn/collocation/pages#mp-weixin) 和 <https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#window>
2296
+ * 设置编译到 mp-weixin 平台的特定样式,配置项参考 <https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#window>
2157
2297
  *
2158
2298
  * 相应的类型是 MpWeixin
2159
2299
  *
@@ -2185,7 +2325,13 @@ interface MpWeixin {
2185
2325
  *
2186
2326
  * "custom" 自定义导航栏,只保留右上角胶囊按钮
2187
2327
  *
2188
- * @desc iOS / Android 微信客户端 6.6.0,Windows 微信客户端不支持
2328
+ * @desc iOS / Android 微信客户端 6.6.0,Windows / Mac 微信基础库 3.6.1
2329
+ *
2330
+ * @desc iOS/Android 客户端 7.0.0 以下版本,navigationStyle 只在 app.json 中生效
2331
+ *
2332
+ * @desc iOS/Android 客户端 6.7.2 版本开始,navigationStyle: custom 对 web-view 组件无效
2333
+ *
2334
+ * @desc 开启 custom 后,低版本客户端需要做好兼容。开发者工具基础库版本切到 1.7.0(不代表最低版本,只供调试用)可方便切到旧视觉
2189
2335
  *
2190
2336
  * @default "default"
2191
2337
  */
@@ -2202,6 +2348,8 @@ interface MpWeixin {
2202
2348
  * 窗口的背景色,支持 HEX 颜色
2203
2349
  *
2204
2350
  * @default "#FFFFFF"
2351
+ *
2352
+ * @format color
2205
2353
  */
2206
2354
  backgroundColor?: HEXColor | ThemeVar;
2207
2355
  /**
@@ -2216,6 +2364,8 @@ interface MpWeixin {
2216
2364
  * @desc 微信客户端 6.5.16
2217
2365
  *
2218
2366
  * @default "#FFFFFF"
2367
+ *
2368
+ * @format color
2219
2369
  */
2220
2370
  backgroundColorTop?: HEXColor | ThemeVar;
2221
2371
  /**
@@ -2224,6 +2374,8 @@ interface MpWeixin {
2224
2374
  * @desc 微信客户端 6.5.16
2225
2375
  *
2226
2376
  * @default "#FFFFFF"
2377
+ *
2378
+ * @format color
2227
2379
  */
2228
2380
  backgroundColorBottom?: HEXColor | ThemeVar;
2229
2381
  /**
@@ -2259,6 +2411,8 @@ interface MpWeixin {
2259
2411
  *
2260
2412
  * "homePageAndLatestPage" 如果从这个页面退出小程序,下次冷启动后立刻加载这个页面,页面的参数保持不变(不可用于 tab 页)
2261
2413
  *
2414
+ * @default "homePage"
2415
+ *
2262
2416
  * @desc [2.8.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
2263
2417
  */
2264
2418
  restartStrategy?: 'homePage' | 'homePageAndLatestPage';
@@ -2290,12 +2444,20 @@ interface MpWeixin {
2290
2444
  * @default "static"
2291
2445
  */
2292
2446
  handleWebviewPreload?: 'static' | 'manual' | 'auto';
2447
+ /**
2448
+ * 是否启用 ucss 样式覆盖
2449
+ *
2450
+ * @default true
2451
+ *
2452
+ * @desc 小程序
2453
+ */
2454
+ enableUcssReset?: boolean;
2293
2455
  [x: string]: any;
2294
2456
  }
2295
2457
  //#endregion
2296
- //#region src/global-style/mp-xhs.d.ts
2458
+ //#region src/style/mp-xhs.d.ts
2297
2459
  /**
2298
- * 设置编译到 mp-xhs 平台的特定样式,配置项参考 <https://miniapp.xiaohongshu.com/doc/DC813994>
2460
+ * 设置编译到 mp-xhs 平台的特定样式,配置项参考 <https://miniapp.xiaohongshu.com/doc/DC813994#anchorId-window>>
2299
2461
  *
2300
2462
  * 相应的类型是 MpXhs
2301
2463
  *
@@ -2334,6 +2496,8 @@ interface MpXhs {
2334
2496
  * 窗口的背景色,支持 HEX 颜色
2335
2497
  *
2336
2498
  * @default "#FFFFFF"
2499
+ *
2500
+ * @format color
2337
2501
  */
2338
2502
  backgroundColor?: HEXColor | ThemeVar;
2339
2503
  /**
@@ -2369,8 +2533,11 @@ interface MpXhs {
2369
2533
  [x: string]: any;
2370
2534
  }
2371
2535
  //#endregion
2372
- //#region src/global-style/index.d.ts
2373
- interface GlobalStyle {
2536
+ //#region src/style/index.d.ts
2537
+ /**
2538
+ * globalStyle 与 pageStyle 共有的配置项
2539
+ */
2540
+ interface BaseStyle {
2374
2541
  /**
2375
2542
  * 导航栏背景颜色(同状态栏背景色),支持 HEX 颜色
2376
2543
  *
@@ -2383,23 +2550,12 @@ interface GlobalStyle {
2383
2550
  * 导航栏标题颜色及状态栏前景颜色,仅支持 "black" / "white"
2384
2551
  *
2385
2552
  * @default "black"
2386
- *
2387
- * @desc 支付宝小程序不支持,请使用 my.setNavigationBar
2388
2553
  */
2389
2554
  'navigationBarTextStyle'?: 'black' | 'white' | ThemeVar;
2390
2555
  /**
2391
2556
  * 导航栏标题文字内容
2392
2557
  */
2393
2558
  'navigationBarTitleText'?: string;
2394
- /**
2395
- * 导航栏阴影
2396
- */
2397
- 'navigationBarShadow'?: {
2398
- /**
2399
- * 阴影颜色
2400
- */
2401
- colorType?: 'grey' | 'blue' | 'green' | 'orange' | 'red' | 'yellow';
2402
- };
2403
2559
  /**
2404
2560
  * 导航栏样式,仅支持 "default" / "custom"
2405
2561
  *
@@ -2441,21 +2597,21 @@ interface GlobalStyle {
2441
2597
  */
2442
2598
  'onReachBottomDistance'?: number;
2443
2599
  /**
2444
- * 顶部窗口的背景色(bounce回弹区域)
2600
+ * 顶部窗口的背景色(bounce 回弹区域),支持 HEX 颜色
2445
2601
  *
2446
2602
  * @default "#ffffff"
2447
2603
  *
2448
- * @desc iOS
2604
+ * @desc 仅 iOS 平台
2449
2605
  *
2450
2606
  * @format color
2451
2607
  */
2452
2608
  'backgroundColorTop'?: HEXColor | ThemeVar;
2453
2609
  /**
2454
- * 底部窗口的背景色(bounce回弹区域)
2610
+ * 底部窗口的背景色(bounce 回弹区域),支持 HEX 颜色
2455
2611
  *
2456
2612
  * @default "#ffffff"
2457
2613
  *
2458
- * @desc iOS
2614
+ * @desc 仅 iOS 平台
2459
2615
  *
2460
2616
  * @format color
2461
2617
  */
@@ -2469,7 +2625,7 @@ interface GlobalStyle {
2469
2625
  */
2470
2626
  'titleImage'?: string;
2471
2627
  /**
2472
- * 导航栏整体(前景、背景)透明设置,仅支持 "always" / "auto" / "none
2628
+ * 导航栏整体(前景、背景)透明设置,仅支持 "always" / "auto" / "none"
2473
2629
  *
2474
2630
  * "always" 一直透明
2475
2631
  *
@@ -2499,51 +2655,79 @@ interface GlobalStyle {
2499
2655
  */
2500
2656
  'allowsBounceVertical'?: 'YES' | 'NO';
2501
2657
  /**
2502
- * 横屏配置,屏幕旋转设置,仅支持 "auto" / "portrait" / "landscape",详见 [响应显示区域变化](https://developers.weixin.qq.com/miniprogram/dev/framework/view/resizable.html)
2658
+ * 是否隐藏系统顶部状态栏
2503
2659
  *
2504
- * "auto" 自动
2660
+ * @default false
2505
2661
  *
2506
- * "portrait" 竖屏
2662
+ * @desc uni-app x App
2663
+ */
2664
+ 'hideStatusBar'?: boolean;
2665
+ /**
2666
+ * 点击系统状态栏滚动条是否返回顶部
2507
2667
  *
2508
- * "landscape" 横屏
2668
+ * @default false
2509
2669
  *
2510
- * @default "portrait"
2670
+ * @desc uni-app x App
2671
+ */
2672
+ 'enableBackToTop'?: boolean;
2673
+ /**
2674
+ * 是否开启回弹效果,优先级高于 allowsBounceVertical
2675
+ *
2676
+ * @default false
2511
2677
  *
2512
- * @desc App 2.4.7+、微信小程序、QQ小程序
2678
+ * @desc uni-app x App
2513
2679
  */
2514
- 'pageOrientation'?: 'auto' | 'portrait' | 'landscape';
2680
+ 'bounces'?: boolean;
2515
2681
  /**
2516
- * 窗口显示的动画效果,详见 [窗口动画](https://uniapp.dcloud.net.cn/api/router#animation)
2682
+ * Android 平台是否开启弹簧回弹效果
2517
2683
  *
2518
- * @default "pop-in"
2684
+ * @default false
2519
2685
  *
2520
- * @desc App
2686
+ * @desc uni-app x App-Android
2521
2687
  */
2522
- 'animationType'?: AnimationType;
2688
+ 'androidOverscroll'?: boolean;
2523
2689
  /**
2524
- * 窗口显示动画的持续时间,单位为 ms
2690
+ * Android 平台下拉刷新前景颜色,支持 HEX 颜色
2525
2691
  *
2526
- * @default 300
2692
+ * @desc uni-app x App-Android
2527
2693
  *
2528
- * @desc App
2694
+ * @format color
2529
2695
  */
2530
- 'animationDuration'?: number;
2696
+ 'androidRefresherColor'?: HEXColor | ThemeVar;
2531
2697
  /**
2532
- * 设置为 true 则页面整体不能上下滚动(bounce 效果),只在页面配置中有效,在 globalStyle 中设置无效
2698
+ * 是否隐藏系统底部导航栏
2699
+ *
2700
+ * 与 hideStatusBar 同时开启可实现页面全屏
2533
2701
  *
2534
2702
  * @default false
2535
2703
  *
2536
- * @desc 微信小程序(iOS)、百度小程序(iOS)
2704
+ * @desc uni-app x App
2537
2705
  */
2538
- 'disableScroll'?: boolean;
2706
+ 'hideBottomNavigationIndicator'?: boolean;
2539
2707
  /**
2540
- * 是否禁用滑动返回
2708
+ * 页面内容是否可以渲染到虚拟按键区域
2541
2709
  *
2542
2710
  * @default false
2543
2711
  *
2544
- * @desc App-iOS(3.4.0+)
2712
+ * @desc uni-app x App-Android 4.41+
2713
+ */
2714
+ 'androidThreeButtonNavigationTranslucent'?: boolean;
2715
+ /**
2716
+ * 虚拟按键区域背景色,支持 HEX 颜色
2717
+ *
2718
+ * @desc uni-app x App-Android
2719
+ *
2720
+ * @format color
2721
+ */
2722
+ 'androidThreeButtonNavigationBackgroundColor'?: HEXColor | ThemeVar;
2723
+ /**
2724
+ * 虚拟按键区域前景色
2725
+ *
2726
+ * @desc uni-app x App-Android
2727
+ *
2728
+ * @format color
2545
2729
  */
2546
- 'disableSwipeBack'?: boolean;
2730
+ 'androidThreeButtonNavigationStyle'?: HEXColor | ThemeVar;
2547
2731
  /**
2548
2732
  * 设置编译到 App 平台的特定样式,配置项参考 [app-plus](https://uniapp.dcloud.net.cn/collocation/pages#app-plus)
2549
2733
  *
@@ -2569,7 +2753,7 @@ interface GlobalStyle {
2569
2753
  */
2570
2754
  'h5'?: H5;
2571
2755
  /**
2572
- * 设置编译到 mp-alipay 平台的特定样式,配置项参考 [MP-ALIPAY](https://uniapp.dcloud.net.cn/collocation/pages#mp-alipay) 和 <https://opendocs.alipay.com/mini/framework/app-json#window>
2756
+ * 设置编译到 mp-alipay 平台的特定样式,配置项参考 [MP-ALIPAY](https://uniapp.dcloud.net.cn/collocation/pages#mp-alipay)
2573
2757
  *
2574
2758
  * 相应的类型是 MpAlipay
2575
2759
  *
@@ -2577,7 +2761,7 @@ interface GlobalStyle {
2577
2761
  */
2578
2762
  'mp-alipay'?: MpAlipay;
2579
2763
  /**
2580
- * 设置编译到 mp-weixin 平台的特定样式,配置项参考 [MP-WEIXIN](https://uniapp.dcloud.net.cn/collocation/pages#mp-weixin) 和 <https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#window>
2764
+ * 设置编译到 mp-weixin 平台的特定样式,配置项参考 [MP-WEIXIN](https://uniapp.dcloud.net.cn/collocation/pages#mp-weixin)
2581
2765
  *
2582
2766
  * 相应的类型是 MpWeixin
2583
2767
  *
@@ -2585,7 +2769,7 @@ interface GlobalStyle {
2585
2769
  */
2586
2770
  'mp-weixin'?: MpWeixin;
2587
2771
  /**
2588
- * 设置编译到 mp-baidu 平台的特定样式,配置项参考 [MP-BAIDU](https://uniapp.dcloud.net.cn/collocation/pages.html#mp-baidu) 和 <https://smartprogram.baidu.com/docs/develop/framework/process/#window>
2772
+ * 设置编译到 mp-baidu 平台的特定样式,配置项参考 [MP-BAIDU](https://uniapp.dcloud.net.cn/collocation/pages.html#mp-baidu)
2589
2773
  *
2590
2774
  * 相应的类型是 MpBaidu
2591
2775
  *
@@ -2593,7 +2777,7 @@ interface GlobalStyle {
2593
2777
  */
2594
2778
  'mp-baidu'?: MpBaidu;
2595
2779
  /**
2596
- * 设置编译到 mp-toutiao 平台的特定样式,配置项参考 <https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/framework/general-configuration#window>
2780
+ * 设置编译到 mp-toutiao 平台的特定样式
2597
2781
  *
2598
2782
  * 相应的类型是 MpToutiao
2599
2783
  *
@@ -2654,12 +2838,6 @@ interface GlobalStyle {
2654
2838
  * @desc App、微信小程序、支付宝小程序、百度小程序、京东小程序
2655
2839
  */
2656
2840
  'usingComponents'?: Record<string, string>;
2657
- /**
2658
- * 同层渲染,webrtc(实时音视频)无法正常时尝试配置为 "seperated" 强制关掉同层渲染
2659
- *
2660
- * @desc 微信小程序
2661
- */
2662
- 'renderingMode'?: string;
2663
2841
  /**
2664
2842
  * 当存在 leftWindow 时,默认是否显示 leftWindow,详见 [topWindow](https://uniapp.dcloud.net.cn/collocation/pages.html#topwindow)
2665
2843
  *
@@ -2684,6 +2862,73 @@ interface GlobalStyle {
2684
2862
  * @desc H5
2685
2863
  */
2686
2864
  'rightWindow'?: boolean;
2865
+ /**
2866
+ * 当浏览器可见区域宽度大于 maxWidth 时两侧留白,当小于等于 maxWidth 时页面铺满,单位为 px
2867
+ *
2868
+ * 不同页面支持配置不同的 maxWidth
2869
+ *
2870
+ * maxWidth = leftWindow(可选)+ page(页面主体)+ rightWindow(可选)
2871
+ *
2872
+ * 使用时,页面内 fixed 元素需要使用 --window-left 和 --window-right 来保证布局位置正确
2873
+ *
2874
+ * @desc H5(2.9.9+)
2875
+ */
2876
+ 'maxWidth'?: number;
2877
+ /**
2878
+ * 是否启用 ucss 样式覆盖
2879
+ *
2880
+ * @default true
2881
+ *
2882
+ * @desc 小程序
2883
+ */
2884
+ 'enableUcssReset'?: boolean;
2885
+ }
2886
+ /**
2887
+ * globalStyle 节点的类型,用于设置应用的状态栏、导航条、标题、窗口背景色等
2888
+ */
2889
+ export interface GlobalStyle extends BaseStyle {
2890
+ /**
2891
+ * 页面容器背景色,支持 HEX 颜色
2892
+ *
2893
+ * @desc App、H5、小程序
2894
+ *
2895
+ * @format color
2896
+ */
2897
+ backgroundColorContent?: HEXColor | ThemeVar;
2898
+ /**
2899
+ * 横屏配置,屏幕旋转设置,仅支持 "auto" / "portrait" / "landscape",详见 [响应显示区域变化](https://developers.weixin.qq.com/miniprogram/dev/framework/view/resizable.html)
2900
+ *
2901
+ * "auto" 自动
2902
+ *
2903
+ * "portrait" 竖屏
2904
+ *
2905
+ * "landscape" 横屏
2906
+ *
2907
+ * @default "portrait"
2908
+ */
2909
+ pageOrientation?: 'auto' | 'portrait' | 'landscape';
2910
+ /**
2911
+ * 窗口显示的动画效果,详见 [窗口动画](https://uniapp.dcloud.net.cn/api/router#animation)
2912
+ *
2913
+ * @default "pop-in"
2914
+ *
2915
+ * @desc App
2916
+ */
2917
+ animationType?: AnimationType;
2918
+ /**
2919
+ * 窗口显示动画的持续时间,单位为 ms
2920
+ *
2921
+ * @default 300
2922
+ *
2923
+ * @desc App
2924
+ */
2925
+ animationDuration?: number;
2926
+ /**
2927
+ * 同层渲染,webrtc(实时音视频)无法正常时尝试配置为 "seperated" 强制关掉同层渲染
2928
+ *
2929
+ * @desc 微信小程序
2930
+ */
2931
+ renderingMode?: string;
2687
2932
  /**
2688
2933
  * rpx 计算所支持的最大设备宽度,单位为 px
2689
2934
  *
@@ -2691,7 +2936,7 @@ interface GlobalStyle {
2691
2936
  *
2692
2937
  * @desc App(vue2 且不含 nvue)、H5(2.8.12+)
2693
2938
  */
2694
- 'rpxCalcMaxDeviceWidth'?: number;
2939
+ rpxCalcMaxDeviceWidth?: number;
2695
2940
  /**
2696
2941
  * rpx 计算使用的基准设备宽度,设备实际宽度超出 rpx 计算所支持的最大设备宽度时将按基准宽度计算,单位为 px
2697
2942
  *
@@ -2699,7 +2944,7 @@ interface GlobalStyle {
2699
2944
  *
2700
2945
  * @desc App(vue2 且不含 nvue)、H5(2.8.12+)
2701
2946
  */
2702
- 'rpxCalcBaseDeviceWidth'?: number;
2947
+ rpxCalcBaseDeviceWidth?: number;
2703
2948
  /**
2704
2949
  * rpx 计算特殊处理的值,始终按实际的设备宽度计算,单位为 rpx
2705
2950
  *
@@ -2707,32 +2952,207 @@ interface GlobalStyle {
2707
2952
  *
2708
2953
  * @desc App(vue2 且不含 nvue)、H5(2.8.12+)
2709
2954
  */
2710
- 'rpxCalcIncludeWidth'?: number;
2955
+ rpxCalcIncludeWidth?: number;
2711
2956
  /**
2712
2957
  * 是否使用动态 rpx,屏幕大小变化会重新渲染 rpx
2713
2958
  *
2714
2959
  * @default false
2715
2960
  *
2716
- * @desc App-nvue(vue3 固定值为 true) 3.2.13+
2961
+ * @desc App-nvue(vue3 固定值为 true) 3.2.13+、App 5.0+
2717
2962
  */
2718
- 'dynamicRpx'?: boolean;
2963
+ dynamicRpx?: boolean;
2964
+ [x: string]: any;
2965
+ }
2966
+ /**
2967
+ * pages 每个页面 style 节点的类型,用于设置每个页面的状态栏、导航条、标题、窗口背景色等
2968
+ *
2969
+ * 页面中配置项会覆盖 globalStyle 中相同的配置项
2970
+ */
2971
+ export interface PageStyle extends BaseStyle {
2719
2972
  /**
2720
- * 当浏览器可见区域宽度大于 maxWidth 时两侧留白,当小于等于 maxWidth 时页面铺满,单位为 px
2973
+ * 页面容器背景色,支持 HEX 颜色
2721
2974
  *
2722
- * 不同页面支持配置不同的 maxWidth
2975
+ * 会覆盖窗口背景色 backgroundColor,backgroundColor 仅在页面设置下拉刷新时才可能看到
2723
2976
  *
2724
- * maxWidth = leftWindow(可选)+ page(页面主体)+ rightWindow(可选)
2977
+ * @default "#ffffff"
2725
2978
  *
2726
- * 使用时,页面内 fixed 元素需要使用 --window-left 和 --window-right 来保证布局位置正确
2979
+ * @desc uni-app x
2727
2980
  *
2728
- * @desc H5(2.9.9+)
2981
+ * @format color
2729
2982
  */
2730
- 'maxWidth'?: number;
2983
+ backgroundColorContent?: HEXColor | ThemeVar;
2984
+ /**
2985
+ * 页面旋转设置
2986
+ *
2987
+ * "auto" 设备自适应
2988
+ *
2989
+ * "portrait" 竖向
2990
+ *
2991
+ * "landscape" 横向
2992
+ *
2993
+ * @default "portrait"
2994
+ *
2995
+ * @desc uni-app x Android 4.13+、uni-app x iOS 4.25+,Web 由手机浏览器控制
2996
+ */
2997
+ pageOrientation?: 'auto' | 'portrait' | 'landscape';
2998
+ /**
2999
+ * 导航栏阴影,配置参考 [导航栏阴影](https://uniapp.dcloud.net.cn/collocation/pages#navigationbarshadow)
3000
+ *
3001
+ * 微信/百度/头条小程序需要配置: "disableScroll": true
3002
+ *
3003
+ * 支付宝小程序需要配置 "allowsBounceVertical": "NO"
3004
+ */
3005
+ navigationBarShadow?: {
3006
+ /**
3007
+ * 阴影颜色
3008
+ *
3009
+ * 支持 grey、blue、green、orange、red、yellow
3010
+ */
3011
+ colorType?: 'grey' | 'blue' | 'green' | 'orange' | 'red' | 'yellow';
3012
+ };
3013
+ /**
3014
+ * 设置为 true 则页面整体不能上下滚动(bounce 效果),只在页面配置中有效,在 globalStyle 中设置无效
3015
+ *
3016
+ * @default false
3017
+ *
3018
+ * @desc 微信小程序(iOS)、百度小程序(iOS)
3019
+ */
3020
+ disableScroll?: boolean;
3021
+ /**
3022
+ * 是否禁用滑动返回
3023
+ *
3024
+ * @default false
3025
+ *
3026
+ * @desc App-iOS(3.4.0+)
3027
+ */
3028
+ disableSwipeBack?: boolean;
3029
+ /**
3030
+ * 是否将侧滑返回手势转为页面 onBackPress 事件
3031
+ *
3032
+ * 仅在 disableSwipeBack 为 false 时生效
3033
+ *
3034
+ * @default false
3035
+ *
3036
+ * @desc uni-app x
3037
+ */
3038
+ swipeBackAsBackPress?: boolean;
3039
+ [x: string]: any;
3040
+ }
3041
+ //#endregion
3042
+ //#region src/pages.d.ts
3043
+ /**
3044
+ * @deprecated 请使用 Page
3045
+ *
3046
+ * pages 数组的元素类型
3047
+ */
3048
+ export interface PageMetaDatum {
3049
+ /**
3050
+ * 配置页面路径
3051
+ */
3052
+ path: string;
3053
+ /**
3054
+ * 配置页面窗口表现,配置项参考 [pageStyle](https://uniapp.dcloud.net.cn/collocation/pages#style)
3055
+ */
3056
+ style?: PageStyle;
3057
+ /**
3058
+ * 当前页面是否需要登录才可以访问,此配置优先级高于 uniIdRouter 下的 needLogin
3059
+ *
3060
+ * @default false
3061
+ */
3062
+ needLogin?: boolean;
3063
+ [x: string]: any;
3064
+ }
3065
+ /**
3066
+ * pages 数组的元素类型
3067
+ */
3068
+ export interface PageItem {
3069
+ /**
3070
+ * 配置页面路径
3071
+ */
3072
+ path: string;
3073
+ /**
3074
+ * 配置页面窗口表现,配置项参考 [pageStyle](https://uniapp.dcloud.net.cn/collocation/pages#style)
3075
+ */
3076
+ style?: PageStyle;
3077
+ /**
3078
+ * 当前页面是否需要登录才可以访问,此配置优先级高于 uniIdRouter 下的 needLogin
3079
+ *
3080
+ * @default false
3081
+ */
3082
+ needLogin?: boolean;
3083
+ [x: string]: any;
3084
+ }
3085
+ /**
3086
+ * 设置页面路径及窗口表现
3087
+ *
3088
+ * 文档中为必填,类型上保持可选,插件可由文件扫描自动生成
3089
+ */
3090
+ export type Pages = PageItem[];
3091
+ //#endregion
3092
+ //#region src/preload-rule.d.ts
3093
+ /**
3094
+ * 进入页面后预下载分包的规则
3095
+ */
3096
+ export interface PreloadRuleItem {
3097
+ /**
3098
+ * 进入页面后预下载分包的 root 或 name
3099
+ *
3100
+ * __APP__ 表示主包
3101
+ */
3102
+ packages: string[];
3103
+ /**
3104
+ * 在指定网络下预下载
3105
+ *
3106
+ * "all" 不限网络
3107
+ *
3108
+ * "wifi" 仅 wifi 下预下载
3109
+ *
3110
+ * @default "wifi"
3111
+ */
3112
+ network?: 'all' | 'wifi';
3113
+ [x: string]: any;
3114
+ }
3115
+ /**
3116
+ * 分包预下载规则
3117
+ *
3118
+ * @desc 微信小程序、QQ 小程序、抖音小程序、支付宝小程序、京东小程序
3119
+ */
3120
+ export type PreloadRule = Record<string, PreloadRuleItem>;
3121
+ //#endregion
3122
+ //#region src/sub-packages.d.ts
3123
+ /**
3124
+ * subPackages 数组的元素类型,即应用的分包
3125
+ */
3126
+ export interface SubPackage {
3127
+ /**
3128
+ * 分包的根目录
3129
+ */
3130
+ root: string;
3131
+ /**
3132
+ * 是否声明对应分包为独立分包
3133
+ *
3134
+ * @default false
3135
+ *
3136
+ * @desc uni-app x
3137
+ */
3138
+ independent?: boolean;
3139
+ /**
3140
+ * 分包由哪些页面组成,参数同 pages
3141
+ */
3142
+ pages: Pages;
3143
+ /**
3144
+ * 分包的插件
3145
+ */
3146
+ plugins?: Record<string, any>;
2731
3147
  [x: string]: any;
2732
3148
  }
3149
+ /**
3150
+ * 分包加载配置,H5 不支持
3151
+ */
3152
+ export type SubPackages = SubPackage[];
2733
3153
  //#endregion
2734
3154
  //#region src/tab-bar.d.ts
2735
- interface TabBarIconFont {
3155
+ export interface TabBarIconFont {
2736
3156
  /**
2737
3157
  * 字库 Unicode 码
2738
3158
  */
@@ -2747,15 +3167,19 @@ interface TabBarIconFont {
2747
3167
  fontSize?: string;
2748
3168
  /**
2749
3169
  * 字体图标颜色
3170
+ *
3171
+ * @format color
2750
3172
  */
2751
3173
  color?: HEXColor;
2752
3174
  /**
2753
3175
  * 字体图标选中颜色
3176
+ *
3177
+ * @format color
2754
3178
  */
2755
3179
  selectedColor?: HEXColor;
2756
3180
  [x: string]: any;
2757
3181
  }
2758
- interface TabBarItem {
3182
+ export interface TabBarItem {
2759
3183
  /**
2760
3184
  * 页面路径,必须在 pages 中先定义
2761
3185
  */
@@ -2770,6 +3194,9 @@ interface TabBarItem {
2770
3194
  * 当 position 为 "top" 时,此参数无效
2771
3195
  *
2772
3196
  * 不支持网络图片,不支持字体图标
3197
+ *
3198
+ * 支持 `@xxx` 主题变量:微信小程序 darkmode(themeLocation)下可按主题切换图标,
3199
+ * uni-app 会原样透传该字段(官方文档表格只标注 String,但 darkmode 场景依赖主题变量)
2773
3200
  */
2774
3201
  iconPath?: string | ThemeVar;
2775
3202
  /**
@@ -2778,10 +3205,14 @@ interface TabBarItem {
2778
3205
  * 当 position 为 "top" 时,此参数无效
2779
3206
  *
2780
3207
  * 不支持网络图片,不支持字体图标
3208
+ *
3209
+ * 支持 `@xxx` 主题变量,同 iconPath 的 darkmode 说明
2781
3210
  */
2782
3211
  selectedIconPath?: string | ThemeVar;
2783
3212
  /**
2784
- * 该项是否显示,默认显示
3213
+ * 该项是否显示
3214
+ *
3215
+ * @default true
2785
3216
  *
2786
3217
  * @desc App (3.2.10+)、H5 (3.2.10+)
2787
3218
  */
@@ -2794,9 +3225,9 @@ interface TabBarItem {
2794
3225
  iconfont?: TabBarIconFont;
2795
3226
  [x: string]: any;
2796
3227
  }
2797
- interface TabBarMidButton {
3228
+ export interface TabBarMidButton {
2798
3229
  /**
2799
- * 中间按钮的宽度,tabBar 其它项为减去此宽度后平分,默认值为与其它项平分宽度
3230
+ * 中间按钮的宽度,tabBar 其它项为减去此宽度后平分
2800
3231
  *
2801
3232
  * @default "80px"
2802
3233
  */
@@ -2805,6 +3236,8 @@ interface TabBarMidButton {
2805
3236
  * 中间按钮的高度,可以大于 tabBar 高度,达到中间凸起的效果
2806
3237
  *
2807
3238
  * @default "50px"
3239
+ *
3240
+ * @desc uni-app x 为 "80px"
2808
3241
  */
2809
3242
  height?: string;
2810
3243
  /**
@@ -2833,7 +3266,10 @@ interface TabBarMidButton {
2833
3266
  iconfont?: TabBarIconFont;
2834
3267
  [x: string]: any;
2835
3268
  }
2836
- interface TabBar {
3269
+ /**
3270
+ * 设置底部 tab 的表现
3271
+ */
3272
+ export interface TabBar {
2837
3273
  /**
2838
3274
  * tab 上的文字默认颜色
2839
3275
  *
@@ -2857,19 +3293,57 @@ interface TabBar {
2857
3293
  *
2858
3294
  * @default "black"
2859
3295
  *
2860
- * @desc App 2.3.4+、H5 3.0.0+
3296
+ * @desc App 2.3.4+、H5 3.0.0+、微信小程序、小红书小程序、京东小程序
2861
3297
  *
2862
3298
  * @format color
2863
3299
  */
2864
3300
  borderStyle?: 'black' | 'white' | HEXColor | ThemeVar;
2865
3301
  /**
2866
- * iOS 高斯模糊效果,参考 [使用说明](https://ask.dcloud.net.cn/article/36617)
3302
+ * tabBar 上边框的颜色,优先级高于 borderStyle
3303
+ *
3304
+ * @desc uni-app x
3305
+ *
3306
+ * @format color
3307
+ */
3308
+ borderColor?: HEXColor | ThemeVar;
3309
+ /**
3310
+ * iOS 高斯模糊效果,参考 [使用说明](https://uniapp.dcloud.net.cn/tutorial/app-blureffect.html)
2867
3311
  *
2868
3312
  * @default "none"
2869
3313
  *
2870
3314
  * @desc App 2.4.0+、H5 3.0.0+(只有最新版浏览器才支持)
2871
3315
  */
2872
3316
  blurEffect?: 'dark' | 'extralight' | 'light' | 'none';
3317
+ /**
3318
+ * 是否开启玻璃效果 tabBar
3319
+ *
3320
+ * iOS 26 及以上使用系统液态玻璃效果,iOS 26 以下降级为系统毛玻璃效果,启用后仅支持图片图标,不支持 iconfont
3321
+ *
3322
+ * 鸿蒙平台为开启沉浸光感效果并叠加在页面内容之上,启用后在 7.0.0(26) 之上为沉浸光感效果且为胶囊形态,在 6.1.0(23) 之上为毛玻璃效果且为胶囊形态,在更低版本为普通毛玻璃效果
3323
+ *
3324
+ * 启用后 tabBar 以悬浮方式覆盖在页面内容上方,页面排版高度包含 tabBar 覆盖区域
3325
+ *
3326
+ * @default false
3327
+ *
3328
+ * @desc uni-app x
3329
+ */
3330
+ glassEffect?: boolean;
3331
+ /**
3332
+ * 鸿蒙平台沉浸光感效果的材质等级
3333
+ *
3334
+ * @default "adaptive"
3335
+ *
3336
+ * @desc uni-app x 鸿蒙 6.1.0(23)+
3337
+ */
3338
+ glassEffectMaterialLevel?: 'exquisite' | 'gentle' | 'smooth' | 'adaptive';
3339
+ /**
3340
+ * 是否禁用玻璃效果 tabBar 自动上推页面滚动内容
3341
+ *
3342
+ * @default false
3343
+ *
3344
+ * @desc uni-app x
3345
+ */
3346
+ disableGlassSafeAreaAutoFit?: boolean;
2873
3347
  /**
2874
3348
  * tab 列表,最少 2个,最多 5 个,app 端没有该限制
2875
3349
  *
@@ -2930,6 +3404,8 @@ interface TabBar {
2930
3404
  iconfontSrc?: string;
2931
3405
  /**
2932
3406
  * 设置背景图片,优先级高于 backgroundColor
3407
+ *
3408
+ * @desc App
2933
3409
  */
2934
3410
  backgroundImage?: string;
2935
3411
  /**
@@ -2944,11 +3420,15 @@ interface TabBar {
2944
3420
  * "no-repeat" 背景图片在垂直方向和水平方向都拉伸
2945
3421
  *
2946
3422
  * @default "no-repeat"
3423
+ *
3424
+ * @desc App
2947
3425
  */
2948
3426
  backgroundRepeat?: 'no-repeat' | 'repeat' | 'repeat-x' | 'repeat-y';
2949
3427
  /**
2950
3428
  * tabBar上红点颜色
2951
3429
  *
3430
+ * @desc App
3431
+ *
2952
3432
  * @format color
2953
3433
  */
2954
3434
  redDotColor?: string;
@@ -2973,100 +3453,22 @@ interface TabBar {
2973
3453
  [x: string]: any;
2974
3454
  }
2975
3455
  //#endregion
2976
- //#region src/page-meta.d.ts
2977
- interface PageMetaDatum {
2978
- /**
2979
- * 配置页面路径
2980
- */
2981
- path: string;
2982
- type?: string;
2983
- /**
2984
- * 配置页面窗口表现,配置项参考下方 pageStyle
2985
- */
2986
- style?: GlobalStyle;
2987
- /**
2988
- * 当前页面是否需要登录才可以访问,此配置优先级高于 uniIdRouter 下的 needLogin
2989
- */
2990
- needLogin?: boolean;
2991
- [x: string]: any;
2992
- }
2993
- type ExcludeIndexSignature<T> = { [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K] };
2994
- interface SubPageMetaDatum {
2995
- /**
2996
- * 子包的根目录
2997
- */
2998
- root: string;
2999
- /**
3000
- * 子包由哪些页面组成
3001
- */
3002
- pages: PageMetaDatum[];
3003
- /**
3004
- * 子包插件
3005
- */
3006
- plugins?: {
3007
- [pluginName: string]: {
3008
- version: string;
3009
- provider: string;
3010
- export?: string;
3011
- [key: string]: any;
3012
- };
3013
- };
3014
- }
3015
- interface UserTabBarItem extends Partial<TabBarItem> {
3016
- /**
3017
- * 配置页面路径
3018
- * @deprecated 可选,将会根据文件路径自动生成
3019
- */
3020
- pagePath?: string;
3021
- /**
3022
- * 排序,数字越小越靠前
3023
- */
3024
- index?: number;
3025
- }
3026
- interface UserPageMeta extends Partial<PageMetaDatum> {
3027
- /**
3028
- * 配置页面路径
3029
- * @deprecated 可选,将会根据文件路径自动生成
3030
- */
3031
- path?: string;
3032
- /**
3033
- * 底部 tabBar 的子项 [tabBar](https://uniapp.dcloud.net.cn/collocation/pages#tabBar)
3034
- */
3035
- tabBar?: UserTabBarItem;
3036
- [x: string]: any;
3037
- }
3038
- type MaybePromise<T> = T | Promise<T>;
3039
- type MaybeCallable<T> = T | (() => T);
3040
- type MaybePromiseCallable<T> = T | (() => T) | (() => Promise<T>);
3041
- declare function definePage(options: MaybePromiseCallable<UserPageMeta>): void;
3042
- type DefinePage = typeof definePage;
3043
- //#endregion
3044
- //#region src/sub-packages.d.ts
3045
- interface SubPackage {
3046
- /**
3047
- * 子包的根目录
3048
- */
3049
- root: string;
3050
- /**
3051
- * 子包由哪些页面组成,参数同 pages
3052
- */
3053
- pages: PageMetaDatum[];
3456
+ //#region src/the-window.d.ts
3457
+ /**
3458
+ * 配置显示该窗口的规则
3459
+ */
3460
+ export interface MatchMedia {
3054
3461
  /**
3055
- * 分包插件
3462
+ * 当设备可见区域宽度 >= minWidth 时,显示该 window
3463
+ *
3464
+ * @default 768
3056
3465
  */
3057
- plugins?: {
3058
- [pluginName: string]: {
3059
- version: string;
3060
- provider: string;
3061
- export?: string;
3062
- [key: string]: any;
3063
- };
3064
- };
3466
+ minWidth?: number;
3065
3467
  }
3066
- type SubPackages = SubPackage[];
3067
- //#endregion
3068
- //#region src/the-window.d.ts
3069
- interface TheWindow {
3468
+ /**
3469
+ * leftWindow / topWindow / rightWindow 的类型
3470
+ */
3471
+ export interface TheWindow {
3070
3472
  /**
3071
3473
  * 配置页面路径
3072
3474
  */
@@ -3074,57 +3476,59 @@ interface TheWindow {
3074
3476
  /**
3075
3477
  * 配置页面窗口表现,配置项参考 [pageStyle](https://uniapp.dcloud.net.cn/collocation/pages#style)
3076
3478
  */
3077
- style?: GlobalStyle;
3479
+ style?: PageStyle;
3078
3480
  /**
3079
3481
  * 配置显示该窗口的规则,配置项参考 [matchMedia](https://uniapp.dcloud.net.cn/collocation/pages#matchmedia)
3080
3482
  */
3081
- matchMedia?: {
3082
- /**
3083
- * 当设备可见区域宽度 >= minWidth 时,显示该 window
3084
- *
3085
- * @default 768
3086
- */
3087
- minWidth?: number;
3088
- };
3483
+ matchMedia?: MatchMedia;
3484
+ [x: string]: any;
3089
3485
  }
3090
3486
  //#endregion
3091
3487
  //#region src/uni-id-router.d.ts
3092
- interface UniIdRouter {
3488
+ /**
3489
+ * 自动跳转相关配置,新增于 HBuilderX 3.5.0
3490
+ *
3491
+ * @desc uni-app 3.5.0+、uni-app-x 3.99+
3492
+ */
3493
+ export interface UniIdRouter {
3093
3494
  /**
3094
3495
  * 登录页面路径
3095
3496
  *
3096
3497
  * @example "pages/index/index"
3097
3498
  */
3098
- loginPage: string;
3499
+ loginPage?: string;
3099
3500
  /**
3100
- * 需要登录才可以访问的页面列表,可以使用正则语法
3501
+ * 需要登录才可访问的页面列表,可以使用正则语法
3101
3502
  *
3102
3503
  * @example ["pages/detail/.*"]
3103
3504
  */
3104
- needLogin: string[];
3505
+ needLogin?: string[];
3105
3506
  /**
3106
- * 是否是否自动解析云对象及 clientDB 的错误码,如果是客户端 token 不正确或 token 过期则自动跳转配置的登录页面
3507
+ * 是否自动解析云对象及 clientDB 的错误码,如果是客户端 token 不正确或 token 过期则自动跳转配置的登录页面,
3107
3508
  *
3108
3509
  * @default true
3109
3510
  */
3110
3511
  resToLogin?: boolean;
3512
+ [x: string]: any;
3111
3513
  }
3112
3514
  //#endregion
3113
- //#region src/pages-config.d.ts
3515
+ //#region src/config.d.ts
3114
3516
  /**
3115
3517
  * 对 uni-app 进行全局配置,决定页面文件的路径、窗口样式、原生的导航栏、底部的原生 tabBar 等,类似微信小程序中 app.json 的页面管理部分
3116
3518
  *
3117
3519
  * 注意定位权限申请等原属于 app.json 的内容,需要在 manifest 中配置
3118
3520
  */
3119
- interface PagesConfig {
3521
+ export interface PagesConfig {
3120
3522
  /**
3121
3523
  * 设置默认页面的窗口表现
3122
3524
  */
3123
3525
  globalStyle?: GlobalStyle;
3124
3526
  /**
3125
3527
  * 设置页面路径及窗口表现
3528
+ *
3529
+ * 文档中为必填,类型上保持可选,插件可由文件扫描自动生成
3126
3530
  */
3127
- pages?: PageMetaDatum[];
3531
+ pages?: Pages;
3128
3532
  /**
3129
3533
  * 组件自动引入规则
3130
3534
  *
@@ -3148,45 +3552,18 @@ interface PagesConfig {
3148
3552
  /**
3149
3553
  * 分包预下载规则
3150
3554
  *
3151
- * @desc 微信小程序
3555
+ * @desc 微信小程序、QQ 小程序、抖音小程序、支付宝小程序、京东小程序
3152
3556
  */
3153
- preloadRule?: {
3154
- /**
3155
- * 页面路径
3156
- */
3157
- [path: string]: {
3158
- /**
3159
- * 进入页面后预下载分包的 root 或 name
3160
- *
3161
- * __APP__ 表示主包
3162
- */
3163
- packages: string[];
3164
- /**
3165
- * 在指定网络下预下载
3166
- *
3167
- * "all" 不限网络
3168
- *
3169
- * "wifi" 仅 wifi 下预下载
3170
- *
3171
- * @default "wifi"
3172
- */
3173
- network?: 'all' | 'wifi';
3174
- };
3175
- };
3557
+ preloadRule?: PreloadRule;
3176
3558
  /**
3177
- * `Worker` 代码放置的目录
3559
+ * worker 代码目录
3178
3560
  *
3179
- * @desc 微信小程序
3561
+ * @desc 微信小程序、支付宝小程序
3180
3562
  */
3181
3563
  workers?: string | {
3182
- /**
3183
- * `Worker` 代码放置的目录
3184
- */
3185
3564
  path: string;
3186
3565
  /**
3187
- * 是否打包为分包
3188
- *
3189
- * @desc 微信小程序基础库 v2.27.3
3566
+ * 是否把 worker 打包为分包
3190
3567
  *
3191
3568
  * @default false
3192
3569
  */
@@ -3224,6 +3601,6 @@ interface PagesConfig {
3224
3601
  entryPagePath?: string;
3225
3602
  [x: string]: any;
3226
3603
  }
3227
- interface UserPagesConfig extends PagesConfig {}
3604
+ export interface UserPagesConfig extends PagesConfig {}
3228
3605
  //#endregion
3229
- export { AnimationType, type AppHarmony, type AppPlus, Color, Condition, ConditionItem, DefinePage, EasyCom, ExcludeIndexSignature, GlobalStyle, type H5, HEXColor, MaybeCallable, MaybePromise, MaybePromiseCallable, type MpAlipay, type MpBaidu, type MpHarmony, type MpJd, type MpKuaishou, type MpLark, type MpQq, type MpToutiao, type MpWeixin, type MpXhs, PageMetaDatum, PagesConfig, PercentageSize, PxSize, RGBAColor, RGBColor, RpxSize, SubPackage, SubPackages, SubPageMetaDatum, TabBar, TabBarIconFont, TabBarItem, TabBarMidButton, TheWindow, ThemeVar, TitleNViewButton, UniIdRouter, UserPageMeta, UserPagesConfig, UserTabBarItem, definePage };
3606
+ export type { AppHarmony, AppPlus, H5, MpAlipay, MpBaidu, MpHarmony, MpJd, MpKuaishou, MpLark, MpQq, MpToutiao, MpWeixin, MpXhs };