@uni-helper/vite-plugin-uni-pages 0.2.15 → 0.2.17

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.cts CHANGED
@@ -4,332 +4,2528 @@ import { FSWatcher } from 'chokidar';
4
4
  import Debug from 'debug';
5
5
  import { SFCBlock, SFCDescriptor } from '@vue/compiler-sfc';
6
6
 
7
+ interface ConditionItem {
8
+ /**
9
+ * 启动模式名称
10
+ */
11
+ name: string;
12
+ /**
13
+ * 启动页面路径
14
+ */
15
+ path: string;
16
+ /**
17
+ * 启动参数,可在页面的 onLoad 函数里获得
18
+ */
19
+ query?: string;
20
+ }
21
+ interface Condition {
22
+ /**
23
+ * 当前激活的模式,list 节点的索引值
24
+ */
25
+ current: number;
26
+ /**
27
+ * 启动模式列表
28
+ */
29
+ list: Partial<ConditionItem>[];
30
+ }
31
+
7
32
  interface EasyCom {
33
+ /**
34
+ * 是否开启自动扫描,开启后将会自动扫描符合 `components/组件名称/组件名称.vue` 目录结构的组件
35
+ *
36
+ * @default true
37
+ */
8
38
  autoscan?: boolean;
39
+ /**
40
+ * 以正则方式自定义组件匹配规则
41
+ *
42
+ * 如果 `autoscan` 不能满足需求,可以使用 `custom` 自定义匹配规则
43
+ *
44
+ * @example
45
+ * "custom": {
46
+ * "^uni-(.*)": "@/components/uni-$1.vue", // 匹配 components 目录内的 vue 文件
47
+ * "^vue-file-(.*)": "packageName/path/to/vue-file-$1.vue" // 匹配 node_modules 内的 vue 文件
48
+ * }
49
+ }
50
+ */
9
51
  custom?: Record<string, string>;
10
52
  }
11
53
 
12
- type RGBColor = `rgb(${number}, ${number}, ${number})`;
13
54
  type RGBAColor = `rgba(${number}, ${number}, ${number}, ${number})`;
14
55
  type HEXColor = `#${string}`;
15
- type ThemeColor = `@${string}`;
16
- type Color = RGBColor | RGBAColor | HEXColor;
56
+ type PxSize = `${number}px`;
57
+ type PercentageSize = `${number}%`;
58
+ /**
59
+ * 窗口动画,详见 [窗口动画](https://uniapp.dcloud.net.cn/api/router.html#animation)
60
+ */
61
+ type AnimationType = 'slide-in-right' | 'slide-in-left' | 'slide-in-top' | 'slide-in-bottom' | 'pop-in' | 'fade-in' | 'zoom-out' | 'zoom-fade-out' | 'none';
62
+ interface TitleNViewButton {
63
+ /**
64
+ * 自定义按钮样式,详见 [自定义按钮样式](https://uniapp.dcloud.net.cn/collocation/pages#app-titlenview-buttons-type)
65
+ *
66
+ * "forward" 前进按钮
67
+ *
68
+ * "back" 后退按钮
69
+ *
70
+ * "share" 分享按钮
71
+ *
72
+ * "favorite" 收藏按钮
73
+ *
74
+ * "home" 主页按钮
75
+ *
76
+ * "menu" 菜单按钮
77
+ *
78
+ * "close" 关闭按钮
79
+ *
80
+ * "none" 无样式,需通过 text 属性设置按钮上显示的内容、通过 fontSrc 属性设置使用的字体库
81
+ *
82
+ * @default "none"
83
+ */
84
+ type?: 'forward' | 'back' | 'share' | 'favorite' | 'home' | 'menu' | 'close' | 'none';
85
+ /**
86
+ * 自定义按钮文字颜色,支持 HEX 颜色
87
+ *
88
+ * @default 与标题文字样式一样
89
+ *
90
+ * @format color
91
+ */
92
+ color?: HEXColor;
93
+ /**
94
+ * 自定义按钮背景色,仅在标题栏 type 为 "transparent" 时生效,支持 HEX 和 RGBA 颜色
95
+ *
96
+ * @default 灰色半透明
97
+ *
98
+ * @format color
99
+ */
100
+ background?: HEXColor | RGBAColor;
101
+ /**
102
+ * 自定义按钮按下状态文字颜色,支持 HEX 和 RGBA 颜色
103
+ *
104
+ * @default color 属性值自动调整透明度为 0.3
105
+ *
106
+ * @format color
107
+ */
108
+ colorPressed?: HEXColor | RGBAColor;
109
+ /**
110
+ * 自定义按钮在标题栏的显示位置,仅支持 "right" / "left"
111
+ *
112
+ * "right" 右侧
113
+ *
114
+ * "left" 左侧
115
+ *
116
+ * @default "right"
117
+ */
118
+ float?: 'right' | 'left';
119
+ /**
120
+ * 自定义按钮文字粗细,仅支持 "normal" | "bold"
121
+ *
122
+ * "normal" 标准
123
+ *
124
+ * "bold" 加粗
125
+ *
126
+ * @default "normal"
127
+ */
128
+ fontWeight?: 'normal' | 'bold';
129
+ /**
130
+ * 自定义按钮文字大小
131
+ */
132
+ fontSize?: string;
133
+ /**
134
+ * 自定义按钮字体文件路径,只支持本地地址
135
+ */
136
+ fontSrc?: string;
137
+ /**
138
+ * 自定义按钮是否显示选择指示图标(向下箭头),常用于城市选择
139
+ *
140
+ * @default false
141
+ */
142
+ select?: boolean;
143
+ /**
144
+ * 自定义按钮文字内容。使用字体图标时 unicode 字符表示必须以"\\u" 开头,如 "\\ue123"
145
+ */
146
+ text?: string;
147
+ /**
148
+ * 自定义按钮文字宽度,支持单位为 px 的逻辑像素值或 "auto",按钮内容居中显示
149
+ *
150
+ * @default "44px"
151
+ */
152
+ width?: PxSize | 'auto';
153
+ }
154
+
155
+ interface H5 {
156
+ /**
157
+ * 导航栏,详见 [导航栏](https://uniapp.dcloud.net.cn/collocation/pages#h5-titlenview)
158
+ */
159
+ titleNView?: false | {
160
+ /**
161
+ * 背景颜色,支持 HEX 颜色
162
+ *
163
+ * @default "#F7F7F7"
164
+ *
165
+ * @format color
166
+ */
167
+ backgroundColor?: HEXColor;
168
+ /**
169
+ * 自定义按钮,详见 [自定义按钮](https://uniapp.dcloud.net.cn/collocation/pages#app-titlenview-buttons)
170
+ */
171
+ buttons?: TitleNViewButton[];
172
+ /**
173
+ * 标题文字颜色,支持 HEX 颜色
174
+ *
175
+ * @default "#000000"
176
+ *
177
+ * @format color
178
+ */
179
+ titleColor?: HEXColor;
180
+ /**
181
+ * 标题文字内容
182
+ */
183
+ titleText?: string;
184
+ /**
185
+ * 标题文字大小
186
+ */
187
+ titleSize?: string;
188
+ /**
189
+ * 导航栏样式
190
+ *
191
+ * "default" 默认样式
192
+ *
193
+ * "transparent" 滚动透明渐变
194
+ *
195
+ * @default "default"
196
+ */
197
+ type?: 'default' | 'transparent';
198
+ /**
199
+ * 导航栏上的搜索框配置,详见 [searchInput](https://uniapp.dcloud.net.cn/collocation/pages#h5-searchinput)
200
+ *
201
+ * @desc 1.6.5
202
+ */
203
+ searchInput?: {
204
+ /**
205
+ * 是否自动获取焦点
206
+ *
207
+ * @default false
208
+ */
209
+ autoFocus?: boolean;
210
+ /**
211
+ * 非输入状态下文本的对齐方式
212
+ *
213
+ * "left" 居左对齐
214
+ *
215
+ * "right" 居右对齐
216
+ *
217
+ * "center" 居中对齐
218
+ *
219
+ * @default "center"
220
+ */
221
+ align?: 'center' | 'left' | 'right';
222
+ /**
223
+ * 背景颜色,支持 HEX 和 RGBA 颜色
224
+ *
225
+ * @default "rgba(255,255,255,0.5)"
226
+ *
227
+ * @format color
228
+ */
229
+ backgroundColor?: HEXColor | RGBAColor;
230
+ /**
231
+ * 输入框的圆角半径,单位为 px
232
+ *
233
+ * @default "0px"
234
+ */
235
+ borderRadius?: PxSize;
236
+ /**
237
+ * 提示文本
238
+ */
239
+ placeholder?: string;
240
+ /**
241
+ * 提示文本颜色,支持 HEX 颜色
242
+ *
243
+ * @default "#CCCCCC"
244
+ *
245
+ * @format color
246
+ */
247
+ placeholderColor?: HEXColor;
248
+ /**
249
+ * 是否禁止输入
250
+ *
251
+ * @default false
252
+ */
253
+ disabled?: boolean;
254
+ [x: string]: any;
255
+ };
256
+ [x: string]: any;
257
+ };
258
+ /**
259
+ * 下拉刷新,详见 [下拉刷新](https://uniapp.dcloud.net.cn/collocation/pages#h5-pulltorefresh)
260
+ */
261
+ pullToRefresh?: {
262
+ /**
263
+ * 下拉刷新控件颜色,支持 HEX 颜色
264
+ *
265
+ * @default "#2BD009"
266
+ */
267
+ color?: HEXColor;
268
+ /**
269
+ * 下拉刷新控件起始位置,支持支持单位为 px 的逻辑像素值或百分比
270
+ *
271
+ * @default "0px"
272
+ */
273
+ offset?: PxSize | PercentageSize;
274
+ [x: string]: any;
275
+ };
276
+ [x: string]: any;
277
+ }
17
278
 
18
279
  interface AppPlus {
19
280
  /**
20
- * 窗体背景色。无论vue页面还是nvue页面,在App上都有一个父级原生窗体,该窗体的背景色生效时间快于页面里的css生效时间
281
+ * 窗体背景色,支持 HEX 颜色
282
+ *
283
+ * 无论 vue 页面还是 nvue 页面,在 App 上都有一个父级原生窗体,该窗体的背景色生效时间快于页面里的 css 生效时间
284
+ *
21
285
  * @default "#FFFFFF"
22
- * @desc App
286
+ *
287
+ * @desc App (vue 页面需要将 body 背景色设为透明)
288
+ *
289
+ * @format color
23
290
  */
24
291
  background?: HEXColor;
25
292
  /**
26
- * 导航栏 ,详见?:导航栏; 设置为 false 不显示默认导航栏
27
- * @desc App、H5
293
+ * 导航栏,详见 [导航栏](https://uniapp.dcloud.net.cn/collocation/pages#app-titlenview)
294
+ *
295
+ * 当 navigationStyle 设为 "custom" 或 titleNView 设为 false时,原生导航栏不显示,详见 [自定义导航栏使用注意](https://uniapp.dcloud.net.cn/collocation/pages#customnav)
28
296
  */
29
- titleNView?: object | false;
297
+ titleNView?: false | {
298
+ /**
299
+ * 背景颜色,支持 HEX 和 RGBA 颜色,App 端仅悬浮导航栏支持 RGBA 颜色
300
+ *
301
+ * @default "#F7F7F7"
302
+ *
303
+ * @format color
304
+ */
305
+ backgroundColor?: HEXColor | RGBAColor;
306
+ /**
307
+ * 自定义按钮,详见 [自定义按钮](https://uniapp.dcloud.net.cn/collocation/pages#app-titlenview-buttons)
308
+ *
309
+ * @desc 纯 nvue 即 render:native 时暂不支持
310
+ */
311
+ buttons?: TitleNViewButton[];
312
+ /**
313
+ * 标题文字颜色,支持 HEX 颜色
314
+ *
315
+ * @default "#000000"
316
+ *
317
+ * @format color
318
+ */
319
+ titleColor?: HEXColor;
320
+ /**
321
+ * 标题文字超出显示区域时处理方式
322
+ *
323
+ * "ellipsis" 超出显示区域时尾部显示省略标记(...)
324
+ *
325
+ * "clip" 超出显示区域时内容裁剪
326
+ *
327
+ * @default "ellipsis"
328
+ */
329
+ titleOverflow?: 'ellipsis' | 'clip';
330
+ /**
331
+ * 标题文字内容
332
+ */
333
+ titleText?: string;
334
+ /**
335
+ * 标题文字大小
336
+ */
337
+ titleSize?: string;
338
+ /**
339
+ * 导航栏样式
340
+ *
341
+ * "default" 默认样式
342
+ *
343
+ * "transparent" 滚动透明渐变
344
+ *
345
+ * "float" 悬浮导航栏
346
+ *
347
+ * @default "default"
348
+ */
349
+ type?: 'default' | 'transparent' | 'float';
350
+ /**
351
+ * 原生 View 增强,详见 [5+ View 控件](http://www.html5plus.org/doc/zh_cn/nativeobj.html#plus.nativeObj.ViewDrawTagStyles)
352
+ */
353
+ tags?: {
354
+ /**
355
+ * 绘制操作标识
356
+ *
357
+ * 可通过 view 对象的 drawBitmap / drawRect / drawText / clearRect 方法进行更新
358
+ */
359
+ id?: string;
360
+ /**
361
+ * 绘制操作类型
362
+ *
363
+ * "img" 绘制图片,与 drawBitmap 操作一致,此时 id、src、position、sprite 属性值有效
364
+ *
365
+ * "rect" 绘制矩形区域,与 drawRect 操作一致,此时 id、color、position、rectStyles 属性值有效
366
+ *
367
+ * "font" 绘制文本内容,与 drawText 操作一致,此时 id、position、text、textStyles 属性值有效
368
+ *
369
+ * "richtext" 绘制富文本内容,与 drawRichText 操作一致,此时 id、position、text、richTextStyles 属性值有效
370
+ *
371
+ * "input" 绘制输入框内容,此时 id、position、inputStyles 属性值有效
372
+ */
373
+ tag?: 'img' | 'rect' | 'font' | 'richtext' | 'input';
374
+ /**
375
+ * 矩形区域颜色,支持 HEX 和 RGBA 颜色
376
+ *
377
+ * 不推荐使用,推荐使用 rectStyles
378
+ *
379
+ * 当 tag 属性值为 "rect" 时有效,用于指定矩形区域颜色
380
+ *
381
+ * @default "#FFFFFF"
382
+ *
383
+ * @format color
384
+ */
385
+ color?: HEXColor | RGBAColor;
386
+ /**
387
+ * 绘制输入框的样式
388
+ *
389
+ * 当 tag 属性值为 "input" 时有效,用于指定绘制输入框的样式、大小位置等信息
390
+ */
391
+ inputStyles?: {
392
+ /**
393
+ * 输入框类型
394
+ *
395
+ * "email" 邮箱地址输入框
396
+ *
397
+ * "number" 数字输入框
398
+ *
399
+ * "search" 搜索文本输入框
400
+ *
401
+ * "tel" 电话号码输入框
402
+ *
403
+ * "text" 普通文本输入框
404
+ *
405
+ * "url" URL地址输入框
406
+ *
407
+ * @default "text"
408
+ */
409
+ type?: 'email' | 'number' | 'search' | 'tel' | 'text' | 'url';
410
+ /**
411
+ * 输入框的提示文本
412
+ *
413
+ * 当用户未输入内容时显示在编辑框中(灰色文字)。
414
+ */
415
+ placeholder?: string;
416
+ /**
417
+ * 输入框的字体大小,单位为 px
418
+ *
419
+ * @default "16px"
420
+ */
421
+ fontSize?: PxSize;
422
+ /**
423
+ * 输入框的边框颜色,支持 HEX 颜色
424
+ *
425
+ * @default "#000000"
426
+ *
427
+ * @format color
428
+ */
429
+ borderColor?: HEXColor;
430
+ /**
431
+ * 输入框的边框圆角半径,单位为 px
432
+ *
433
+ * @default "0px"
434
+ */
435
+ borderRadius?: PxSize;
436
+ /**
437
+ * 输入框的边框宽度,单位为 px
438
+ *
439
+ * @default "1px"
440
+ */
441
+ borderWidth?: PxSize;
442
+ [x: string]: any;
443
+ };
444
+ /**
445
+ * 绘制内容区域,相对于 View 控件的区域信息
446
+ *
447
+ * 当 tag 属性值为 "img" 时,用于指定绘制图片的目标区域
448
+ *
449
+ * 当 tag 属性值为 "rect" 时,用于指定绘制的矩形区域
450
+ *
451
+ * 当 tag 属性值为 "font" 时,用于指定绘制文本的目标区域,此时 height 属性值支持设置为 "wrap_content",表示文本高度根据内容自动计算,此时通过 top 来定位文本绘制的起始位置
452
+ *
453
+ * @default { top: '0px', left: '0px', width: '100%', height: '100%' }
454
+ */
455
+ position?: {
456
+ /**
457
+ * 区域顶部相对于作用对象或容器向下的偏移量,支持单位为 px 的逻辑像素值、百分比(相对于作用对象或容器的高度)或 "auto"
458
+ *
459
+ * @default "0px"
460
+ */
461
+ top?: PxSize | PercentageSize | 'auto';
462
+ /**
463
+ * 区域顶部相对于作用对象或容器向右的偏移量,支持单位为 px 的逻辑像素值、百分比(相对于作用对象或容器的高度)或 "auto"
464
+ *
465
+ * @default "0px"
466
+ */
467
+ left?: PxSize | PercentageSize | 'auto';
468
+ /**
469
+ * 区域宽度,相对于作用对象或容器的宽度,支持单位为 px 的逻辑像素值或百分比
470
+ *
471
+ * @default "100%"
472
+ */
473
+ width?: PxSize | PercentageSize;
474
+ /**
475
+ * 区域高度,相对于作用对象或容器的高度,支持单位为 px 的逻辑像素值或百分比
476
+ *
477
+ * @default "100%"
478
+ */
479
+ height?: PxSize | PercentageSize;
480
+ /**
481
+ * 区域顶部相对于作用对象或容器向上的偏移量,支持单位为 px 的逻辑像素值、百分比(相对于作用对象或容器的高度)或 "auto"
482
+ *
483
+ * 当设置了 top 和 height 值时,忽略此属性值
484
+ *
485
+ * 当未设置 top 值时,可通过 bottom 属性值来确定区域的垂直位置
486
+ *
487
+ * 当未设置 height 值时,可通过 top 和 bottom 属性值来确定区域的高度
488
+ */
489
+ bottom?: PxSize | PercentageSize | 'auto';
490
+ /**
491
+ * 区域顶部相对于作用对象或容器向左的偏移量,支持单位为 px 的逻辑像素值、百分比(相对于作用对象或容器的高度)或 "auto"
492
+ *
493
+ * 当设置了 left 和 width 值时,忽略此属性值
494
+ *
495
+ * 当未设置 left 值时,可通过 right 属性值来确定区域的水平位置
496
+ *
497
+ * 当未设置 width 值时,可通过 left 和 right 属性值来确定区域的宽度
498
+ */
499
+ right?: PxSize | PercentageSize | 'auto';
500
+ [x: string]: any;
501
+ };
502
+ /**
503
+ * 绘制区域的样式
504
+ *
505
+ * 当 tag 属性值为 "rect" 时有效,用于指定绘制区域的样式、填充颜色、圆角大小等信息
506
+ */
507
+ rectStyles?: {
508
+ /**
509
+ * 绘制颜色,矩形填充区域的颜色,支持 HEX 和 RGBA 颜色
510
+ *
511
+ * @default "#FFFFFF"
512
+ *
513
+ * @format color
514
+ */
515
+ color?: HEXColor | RGBAColor;
516
+ /**
517
+ * 矩形区域的圆角半径,单位为 px
518
+ *
519
+ * @default "0px"
520
+ */
521
+ radius?: PxSize;
522
+ /**
523
+ * 矩形边框颜色,绘制矩形边框的颜色,支持 HEX 和 RGBA 颜色
524
+ *
525
+ * @default color 属性值
526
+ *
527
+ * @format color
528
+ */
529
+ borderColor?: HEXColor | RGBAColor;
530
+ /**
531
+ * 矩形边框宽度,单位为 px
532
+ *
533
+ * @default "0px"
534
+ */
535
+ borderWidth?: PxSize;
536
+ [x: string]: any;
537
+ };
538
+ /**
539
+ * 绘制的图片资源
540
+ *
541
+ * 当 tag 属性值为 "img" 时有效,可以是图片资源路径(字符串类型)或者图片对象(plus.nativeObj.Bitmap对象)
542
+ *
543
+ * src 路径支持 gif 图片,设置的图片路径文件使用 ".gif" 后缀时则认为是 gif 图片,如"_www/loading.gif"
544
+ */
545
+ src?: string;
546
+ /**
547
+ * 图片源的绘制区域
548
+ *
549
+ * 当 tag 属性值为 "img" 时有效,用于指定图片源的绘制区域,相对于图片的区域信息
550
+ *
551
+ * @default { top: '0px', left: '0px', width: '100%', height: '100%' }
552
+ */
553
+ sprite?: {
554
+ /**
555
+ * 区域顶部相对于作用对象或容器向下的偏移量,支持单位为 px 的逻辑像素值、百分比(相对于作用对象或容器的高度)或 "auto"
556
+ *
557
+ * @default "0px"
558
+ */
559
+ top?: PxSize | PercentageSize | 'auto';
560
+ /**
561
+ * 区域顶部相对于作用对象或容器向右的偏移量,支持单位为 px 的逻辑像素值、百分比(相对于作用对象或容器的高度)或 "auto"
562
+ *
563
+ * @default "0px"
564
+ */
565
+ left?: PxSize | PercentageSize | 'auto';
566
+ /**
567
+ * 区域宽度,相对于作用对象或容器的宽度,支持单位为 px 的逻辑像素值或百分比
568
+ *
569
+ * @default "100%"
570
+ */
571
+ width?: PxSize | PercentageSize;
572
+ /**
573
+ * 区域高度,相对于作用对象或容器的高度,支持单位为 px 的逻辑像素值或百分比
574
+ *
575
+ * @default "100%"
576
+ */
577
+ height?: PxSize | PercentageSize;
578
+ /**
579
+ * 区域顶部相对于作用对象或容器向上的偏移量,支持单位为 px 的逻辑像素值、百分比(相对于作用对象或容器的高度)或 "auto"
580
+ *
581
+ * 当设置了 top 和 height 值时,忽略此属性值
582
+ *
583
+ * 当未设置 top 值时,可通过 bottom 属性值来确定区域的垂直位置
584
+ *
585
+ * 当未设置 height 值时,可通过 top 和 bottom 属性值来确定区域的高度
586
+ */
587
+ bottom?: PxSize | PercentageSize | 'auto';
588
+ /**
589
+ * 区域顶部相对于作用对象或容器向左的偏移量,支持单位为 px 的逻辑像素值、百分比(相对于作用对象或容器的高度)或 "auto"
590
+ *
591
+ * 当设置了 left 和 width 值时,忽略此属性值
592
+ *
593
+ * 当未设置 left 值时,可通过 right 属性值来确定区域的水平位置
594
+ *
595
+ * 当未设置 width 值时,可通过 left 和 right 属性值来确定区域的宽度
596
+ */
597
+ right?: PxSize | PercentageSize | 'auto';
598
+ [x: string]: any;
599
+ };
600
+ /**
601
+ * 绘制的文本内容
602
+ *
603
+ * 当 tag 属性值为 "font" 时有效,用于保存绘制的文本内容
604
+ */
605
+ text?: string;
606
+ /**
607
+ * 绘制文本的样式
608
+ *
609
+ * 当 tag 属性值为 "font" 时有效,用于指定绘制文本内容的字体大小、字体颜色、字体类型等信息
610
+ */
611
+ textStyles?: {
612
+ /**
613
+ * 水平对齐方式
614
+ *
615
+ * "left" 字体在指定的区域中水平居左对齐
616
+ *
617
+ * "center" 字体在指定的区域中水平居中对齐
618
+ *
619
+ * "right" 字体在指定的区域中水平居右对齐
620
+ *
621
+ * @default "center"
622
+ */
623
+ align?: 'left' | 'right' | 'center';
624
+ /**
625
+ * 字体颜色,支持 HEX 和 RGBA 颜色
626
+ *
627
+ * @default "#000000"
628
+ *
629
+ * @format color
630
+ */
631
+ color?: HEXColor | RGBAColor;
632
+ /**
633
+ * 文本装饰
634
+ *
635
+ * "none" 无装饰效果
636
+ *
637
+ * "underline" 文本带下划线效果
638
+ *
639
+ * "line-through" 文本带贯穿线(删除线)效果
640
+ *
641
+ * @default "none"
642
+ */
643
+ decoration?: 'none' | 'underline' | 'line-through';
644
+ /**
645
+ * 字体名称,如果指定名称的字体不存在,则使用默认字体
646
+ */
647
+ family?: string;
648
+ /**
649
+ * 字体文件路径
650
+ */
651
+ fontSrc?: string;
652
+ /**
653
+ * 文本行间距,支持单位为 px 的逻辑像素值或百分比
654
+ *
655
+ * @default "20%"
656
+ */
657
+ lineSpacing?: PxSize | PercentageSize;
658
+ /**
659
+ * 文本间距,用于设置字体在绘制目标区域四个方向(top / right / bottom / left)的边距,支持单位为 px 的逻辑像素值或百分比(相对于绘制目标区域)
660
+ *
661
+ * @default "0px"
662
+ */
663
+ margin?: string;
664
+ /**
665
+ * 文本内容超出显示区域时处理方式
666
+ *
667
+ * "clip" 超出显示区域时内容裁剪
668
+ *
669
+ * "ellipsis" 超出显示区域时尾部显示省略标记(...)
670
+ *
671
+ * @default "clip"
672
+ */
673
+ overflow?: 'clip' | 'ellipsis';
674
+ /**
675
+ * 字体大小,单位为 px
676
+ *
677
+ * @default "16px"
678
+ */
679
+ size?: PxSize;
680
+ /**
681
+ * 字体样式
682
+ *
683
+ * "normal" 正常样式
684
+ *
685
+ * "italic" 斜体样式
686
+ *
687
+ * @default "normal"
688
+ */
689
+ style?: 'normal' | 'italic';
690
+ /**
691
+ * 垂直对齐方式,文本内容在指定绘制区域中的垂直对齐方式
692
+ *
693
+ * "top" 垂直居顶对齐
694
+ *
695
+ * "middle" 垂直居中对齐
696
+ *
697
+ * "bottom" - 垂直居底对齐
698
+ *
699
+ * @default "middle"
700
+ */
701
+ verticalAlign?: 'top' | 'middle' | 'bottom';
702
+ /**
703
+ * 字体粗细
704
+ *
705
+ * "normal" 正常
706
+ *
707
+ * "bold" 粗体
708
+ *
709
+ * @default "normal"
710
+ */
711
+ weight?: 'normal' | 'bold';
712
+ /**
713
+ * 文本换行模式
714
+ *
715
+ * "nowrap" 不换行,将所有文本在一行中绘制,忽略换行符("\n")
716
+ *
717
+ * "normal" 自动换行,当指定的宽度无法绘制所有文本时自动换行绘制,碰到 "\n" 字符时强制换行
718
+ *
719
+ * @default "nowrap"
720
+ */
721
+ whiteSpace?: 'normal' | 'nowrap';
722
+ [x: string]: any;
723
+ };
724
+ /**
725
+ * 绘制富文本的样式
726
+ *
727
+ * 当 tag 属性值为 "richtext" 时有效,用于指定绘制富文本内容的默认字体颜色、字体类型等信息
728
+ */
729
+ richTextStyles?: {
730
+ /**
731
+ * 富文本内容的水平对齐方式,对整体内容有效,无法单独控制每行的内容
732
+ *
733
+ * "left" 字体在指定的区域中水平居左对齐
734
+ *
735
+ * "center" 字体在指定的区域中水平居中对齐
736
+ *
737
+ * "right" 字体在指定的区域中水平居右对齐
738
+ *
739
+ * @default "left"
740
+ */
741
+ align?: 'left' | 'right' | 'center';
742
+ /**
743
+ * 富文本默认使用的字体名称,如果指定名称的字体不存在,则使用默认字体
744
+ */
745
+ family?: string;
746
+ /**
747
+ * 富文本默认使用的字体文件路径,必须为本地路径,如果指定的文件路径无效,则使用系统默认字体
748
+ */
749
+ fontSrc?: string;
750
+ [x: string]: any;
751
+ };
752
+ [x: string]: any;
753
+ }[];
754
+ /**
755
+ * 原生导航栏上的搜索框配置,详见 [searchInput](https://uniapp.dcloud.net.cn/collocation/pages#app-titlenview-searchinput)
756
+ *
757
+ * @desc 1.6.0
758
+ */
759
+ searchInput?: {
760
+ /**
761
+ * 是否自动获取焦点
762
+ *
763
+ * @default false
764
+ */
765
+ autoFocus?: boolean;
766
+ /**
767
+ * 非输入状态下文本的对齐方式
768
+ *
769
+ * "left" 居左对齐
770
+ *
771
+ * "right" 居右对齐
772
+ *
773
+ * "center" 居中对齐
774
+ *
775
+ * @default "center"
776
+ */
777
+ align?: 'center' | 'left' | 'right';
778
+ /**
779
+ * 背景颜色,支持 HEX 和 RGBA 颜色
780
+ *
781
+ * @default "rgba(255,255,255,0.5)"
782
+ *
783
+ * @format color
784
+ */
785
+ backgroundColor?: HEXColor | RGBAColor;
786
+ /**
787
+ * 输入框的圆角半径,单位为 px
788
+ *
789
+ * @default "0px"
790
+ */
791
+ borderRadius?: PxSize;
792
+ /**
793
+ * 提示文本
794
+ */
795
+ placeholder?: string;
796
+ /**
797
+ * 提示文本颜色,支持 HEX 颜色
798
+ *
799
+ * @default "#CCCCCC"
800
+ *
801
+ * @format color
802
+ */
803
+ placeholderColor?: HEXColor;
804
+ /**
805
+ * 是否禁止输入
806
+ *
807
+ * @default false
808
+ */
809
+ disabled?: boolean;
810
+ [x: string]: any;
811
+ };
812
+ /**
813
+ * 标题栏控件是否显示 Home 按钮
814
+ *
815
+ * @default false
816
+ */
817
+ homeButton?: boolean;
818
+ /**
819
+ * 标题栏控件是否显示左侧返回按钮
820
+ *
821
+ * @desc App 2.6.3+
822
+ *
823
+ * @default true
824
+ */
825
+ autoBackButton?: boolean;
826
+ /**
827
+ * 返回按钮的样式,详见 [backButton](https://uniapp.dcloud.net.cn/collocation/pages#app-titlenview-backbuttonstyles)
828
+ *
829
+ * @desc App 2.6.3
830
+ */
831
+ backButton?: {
832
+ /**
833
+ * 背景颜色,仅在标题栏 type 为 "transparent" 时生效,当标题栏透明时按钮显示的背景颜色,支持 HEX 和 RGBA 颜色
834
+ *
835
+ * @default 灰色半透明
836
+ *
837
+ * @format color
838
+ */
839
+ background?: HEXColor | RGBAColor;
840
+ /**
841
+ * 角标文本,最多显示3个字符,超过则显示为 ...
842
+ */
843
+ badgeText?: string;
844
+ /**
845
+ * 图标和标题颜色,支持 HEX 和 RGBA 颜色
846
+ *
847
+ * @default 窗口标题栏控件的标题文字颜色
848
+ *
849
+ * @format color
850
+ */
851
+ color?: HEXColor | RGBAColor;
852
+ /**
853
+ * 按下状态按钮文字颜色,支持 HEX 和 RGBA 颜色
854
+ *
855
+ * @default color 属性值自动调整透明度为 0.3
856
+ *
857
+ * @format color
858
+ */
859
+ colorPressed?: HEXColor | RGBAColor;
860
+ /**
861
+ * 返回图标的粗细
862
+ *
863
+ * "normal" 正常
864
+ *
865
+ * "bold" 粗体
866
+ *
867
+ * @default "normal"
868
+ */
869
+ fontWeight?: 'normal' | 'bold';
870
+ /**
871
+ * 返回图标文字大小,单位为 px
872
+ *
873
+ * 窗口标题栏为透明样式 type 为 "transparent" 时,默认值为 "22px"
874
+ *
875
+ * 窗口标题栏为默认样式 type 为 "default" 时,默认值为 "27px"
876
+ */
877
+ fontSize?: PxSize;
878
+ /**
879
+ * 是否显示红点,当设置了角标文本时红点不显示
880
+ *
881
+ * @default false
882
+ */
883
+ redDot?: boolean;
884
+ /**
885
+ * 返回按钮上的标题,显示在返回图标(字体图标)后
886
+ *
887
+ * @default ""
888
+ */
889
+ title?: string;
890
+ /**
891
+ * 返回按钮上标题的粗细
892
+ *
893
+ * "normal" 正常
894
+ *
895
+ * "bold" 粗体
896
+ */
897
+ titleWeight?: 'normal' | 'bold';
898
+ [x: string]: any;
899
+ };
900
+ /**
901
+ * 背景图片
902
+ *
903
+ * 背景图片路径,如 "/static/img.png",仅支持本地文件绝对路径,根据实际标题栏宽高拉伸绘制
904
+ *
905
+ * 渐变色,仅支持线性渐变,两种颜色的渐变,如 "linear-gradient(to top, #a80077, #66ff00)",其中第一个参数为渐变方向,可选 "to right"(从左向右渐变)/ "to left"(从右向左渐变)/ "to bottom"(从上到下渐变)/ "to top"(从下到上渐变)/ "to bottom right"(从左上到右下渐变)/"to top left"(从左上到右下渐变)
906
+ */
907
+ backgroundImage?: string;
908
+ /**
909
+ * 仅在 backgroundImage 设置为图片路径时有效
910
+ *
911
+ * "repeat" 背景图片在垂直方向和水平方向平铺
912
+ *
913
+ * "repeat-x" 背景图片在水平方向平铺,垂直方向拉伸
914
+ *
915
+ * "repeat-y" 背景图片在垂直方向平铺,水平方向拉伸
916
+ *
917
+ * "no-repeat" 背景图片在垂直方向和水平方向都拉伸
918
+ *
919
+ * @default "no-repeat"
920
+ */
921
+ backgroundRepeat?: 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat';
922
+ /**
923
+ * 文本对齐方式
924
+ *
925
+ * "center" 居中对齐
926
+ *
927
+ * "left" 居左对齐
928
+ *
929
+ * "auto" 根据平台自动选择(Android 平台居左对齐,iOS 平台居中对齐)
930
+ *
931
+ * @default "auto"
932
+ */
933
+ titleAlign?: 'auto' | 'center' | 'left';
934
+ /**
935
+ * 高斯模糊效果,仅在 type 为 "transparent" 或 "float" 时有效
936
+ *
937
+ * 使用模糊效果时应避免设置背景颜色,设置背景颜色可能覆盖模糊效果
938
+ *
939
+ * "dark" 暗风格模糊,对应 iOS 原生 UIBlurEffectStyleDark 效果
940
+ *
941
+ * "extralight" 高亮风格模糊,对应 iOS 原生 UIBlurEffectStyleExtraLight 效果
942
+ *
943
+ * "light" 亮风格模糊,对应 iOS 原生 UIBlurEffectStyleLight 效果
944
+ *
945
+ * "none" 无模糊效果
946
+ *
947
+ * @default "none"
948
+ */
949
+ blurEffect?: 'dark' | 'extralight' | 'light' | 'none';
950
+ /**
951
+ * 标题栏控件变化作用范围,仅在 type 为 "transparent" 时有效,页面滚动时标题栏背景透明度将发生变化
952
+ *
953
+ * 当页面滚动到指定偏移量时标题栏背景变为完全不透明
954
+ *
955
+ * 支持单位为 px 的逻辑像素值、百分比
956
+ *
957
+ * @default "132px"
958
+ */
959
+ coverage?: PxSize | PercentageSize;
960
+ /**
961
+ * 是否显示标题栏的底部分割线
962
+ *
963
+ * @desc 2.6.6
964
+ *
965
+ * @default false
966
+ */
967
+ splitLine?: boolean | {
968
+ /**
969
+ * 底部分割线颜色,支持 HEX 和 RGBA 颜色
970
+ *
971
+ * @default "#CCCCCC"
972
+ *
973
+ * @format color
974
+ */
975
+ color?: HEXColor | RGBAColor;
976
+ /**
977
+ * 底部分割线高度,支持单位为 px 的逻辑像素值、百分比
978
+ *
979
+ * @default "1px"
980
+ */
981
+ height?: PxSize | PercentageSize;
982
+ [x: string]: any;
983
+ };
984
+ /**
985
+ * 副标题文字颜色,支持 HEX 和 RGBA 颜色
986
+ *
987
+ * @desc 2.6.6
988
+ *
989
+ * @default 与主标题文字颜色一致
990
+ *
991
+ * @format color
992
+ */
993
+ subtitleColor?: HEXColor | RGBAColor;
994
+ /**
995
+ * 副标题文字字体大小,单位为 px
996
+ *
997
+ * "auto" 自动计算,约为 12px
998
+ *
999
+ * @desc 2.6.6
1000
+ *
1001
+ * @default "auto"
1002
+ */
1003
+ subtitleSize?: PxSize | 'auto';
1004
+ /**
1005
+ * 标题文字超出显示区域时处理方式
1006
+ *
1007
+ * "clip" 超出显示区域时内容裁剪
1008
+ *
1009
+ * "ellipsis" 超出显示区域时尾部显示省略标记(...)
1010
+ *
1011
+ * @desc 2.6.6
1012
+ *
1013
+ * @default "ellipsis"
1014
+ */
1015
+ subtitleOverflow?: 'clip' | 'ellipsis';
1016
+ /**
1017
+ * 副标题文字内容,设置副标题后将显示两行标题,副标题显示在主标题(titleText)下方
1018
+ *
1019
+ * 设置副标题后将居左显示
1020
+ *
1021
+ * @desc 2.6.6
1022
+ */
1023
+ subtitleText?: string;
1024
+ /**
1025
+ * 标题图标,图标路径如 "./img/t.png",仅支持本地文件路径,相对路径,相对于当前页面的 host 位置,固定宽高为逻辑像素值 "34px"
1026
+ *
1027
+ * 图片的宽高需要相同
1028
+ *
1029
+ * 设置标题图标后标题将居左显示
1030
+ *
1031
+ * @desc 2.6.6
1032
+ */
1033
+ titleIcon?: string;
1034
+ /**
1035
+ * 标题图标圆角,单位为 px
1036
+ *
1037
+ * @default "0px"
1038
+ */
1039
+ titleIconRadius?: PxSize;
1040
+ [x: string]: any;
1041
+ };
30
1042
  /**
31
- * 原生子窗体,详见?:原生子窗体
1043
+ * 原生子窗体,详见 [原生子窗体](https://uniapp.dcloud.net.cn/collocation/pages#app-subNVues)
1044
+ *
32
1045
  * @desc App 1.9.10+
33
1046
  */
34
- subNVues?: object;
35
- /**
36
- * 页面回弹效果,设置为 "none" 时关闭效果。
37
- * @desc App-vue(nvue Android无页面级bounce效果,仅list、recycle-list、waterfall等滚动组件有bounce效果)
1047
+ subNVues?: {
1048
+ /**
1049
+ * 原生子窗体的标识
1050
+ */
1051
+ id?: string;
1052
+ /**
1053
+ * 配置 nvue 文件路径,nvue 文件需放置到使用 subNVue 的页面文件目录下,cli 项目需要去掉 .nvue 后缀,只保留文件名
1054
+ */
1055
+ path?: string;
1056
+ /**
1057
+ * 原生子窗口内置样式
1058
+ *
1059
+ * "popup" 弹出层
1060
+ *
1061
+ * "navigationBar" 导航栏
1062
+ */
1063
+ type?: string;
1064
+ /**
1065
+ * 原生子窗体的样式
1066
+ */
1067
+ style?: {
1068
+ /**
1069
+ * 原生子窗体的排版位置,排版位置决定原生子窗体在父窗口中的定位方式
1070
+ *
1071
+ * "static" 原生子窗体在页面中正常定位,如果页面存在滚动条则随窗口内容滚动
1072
+ *
1073
+ * "absolute" 原生子窗体在页面中绝对定位,如果页面存在滚动条不随窗口内容滚动
1074
+ *
1075
+ * "dock" 原生子窗体在页面中停靠,停靠位置由 dock 属性值决定
1076
+ *
1077
+ * @default "absolute"
1078
+ */
1079
+ position?: 'static' | 'absolute' | 'dock';
1080
+ /**
1081
+ * 原生子窗体停靠位置,仅 position 为 "dock" 时生效
1082
+ *
1083
+ * "top" 原生子窗体停靠在页面顶部
1084
+ *
1085
+ * "bottom" 原生子窗体停靠在页面底部
1086
+ *
1087
+ * "right" 原生子窗体停靠在页面右侧
1088
+ *
1089
+ * "left" 原生子窗体停靠在页面左侧
1090
+ *
1091
+ * @default "bottom"
1092
+ */
1093
+ dock?: 'top' | 'bottom' | 'right' | 'left';
1094
+ /**
1095
+ * 原生子窗体的遮罩层,仅当原生子窗体 type 为 "popup" 时生效,支持 RGBA 颜色
1096
+ *
1097
+ * @default "rgba(0,0,0,0.5)"
1098
+ *
1099
+ * @format color
1100
+ */
1101
+ mask?: RGBAColor;
1102
+ /**
1103
+ * 原生子窗体的宽度,支持以 px 为单位的逻辑像素值或百分比
1104
+ *
1105
+ * 未设置时,可同时设置 left 和 right 属性值改变窗口的默认宽度
1106
+ *
1107
+ * @default "100%"
1108
+ */
1109
+ width?: PxSize | PercentageSize;
1110
+ /**
1111
+ * 原生子窗体的高度,支持以 px 为单位的逻辑像素值或百分比
1112
+ *
1113
+ * 未设置时,可同时设置 top 和 bottom 属性值改变窗口的默认高度
1114
+ *
1115
+ * @default "100%"
1116
+ */
1117
+ height?: PxSize | PercentageSize;
1118
+ /**
1119
+ * 原生子窗体垂直向下的偏移量,支持以 px 为单位的逻辑像素值或百分比
1120
+ *
1121
+ * 未设置 top 属性值时,优先通过 bottom 和 height 属性值来计算原生子窗体的 top 位置
1122
+ *
1123
+ * @default "0px"
1124
+ */
1125
+ top?: PxSize | PercentageSize;
1126
+ /**
1127
+ * 原生子窗体垂直向上的偏移量,支持以 px 为单位的逻辑像素值或百分比
1128
+ *
1129
+ * 同时设置了 top 和 height 值时,忽略此属性值
1130
+ *
1131
+ * 未设置 height 时,通过 top 和 bottom 属性值来确定原生子窗体的高度
1132
+ *
1133
+ * @default 根据 top 和 height 属性值自动计算
1134
+ */
1135
+ bottom?: PxSize | PercentageSize;
1136
+ /**
1137
+ * 原生子窗体水平向左的偏移量,支持以 px 为单位的逻辑像素值或百分比
1138
+ *
1139
+ * 未设置 left 属性值时,优先通过 right 和 width 属性值来计算原生子窗体的 left 位置
1140
+ *
1141
+ * @default "0px"
1142
+ */
1143
+ left?: PxSize | PercentageSize;
1144
+ /**
1145
+ * 原生子窗体水平向右的偏移量,支持以 px 为单位的逻辑像素值或百分比
1146
+ *
1147
+ * 同时设置了 left 和 height 值时,忽略此属性值
1148
+ *
1149
+ * 未设置 width 时,通过 left 和 bottom 属性值来确定原生子窗体的宽度
1150
+ *
1151
+ * @default 根据 left 和 width 属性值来自动计算
1152
+ */
1153
+ right?: PxSize | PercentageSize;
1154
+ /**
1155
+ * 原生子窗体的边距,用于定位原生子窗体的位置,若设置了 left、right、top、bottom 则对应的边距值失效
1156
+ *
1157
+ * "auto" 居中
1158
+ */
1159
+ margin?: string;
1160
+ /**
1161
+ * 原生子窗体的窗口的堆叠顺序值,拥有更高堆叠顺序的窗口总是会处于堆叠顺序较低的窗口的前面,拥有相同堆叠顺序的窗口后调用 show 方法则在前面
1162
+ */
1163
+ zindex?: number;
1164
+ /**
1165
+ * 窗口的背景颜色,支持 Hex 颜色
1166
+ *
1167
+ * Android 平台 4.0 以上系统支持 "transparent" 背景透明样式,比如 subNVue 为圆角时需要设置为 "transparent" 才能看到正确的效果
1168
+ *
1169
+ * @default "#FFFFFF"
1170
+ *
1171
+ * @format color
1172
+ */
1173
+ background?: HEXColor | 'transparent';
1174
+ [x: string]: any;
1175
+ };
1176
+ [x: string]: any;
1177
+ }[];
1178
+ /**
1179
+ * 页面回弹效果,设置为 "none" 时关闭效果
1180
+ *
1181
+ * @desc App-vue(nvue Android 无页面级bounce效果,仅 list、recycle-list、waterfall 等滚动组件有 bounce 效果)
38
1182
  */
39
1183
  bounce?: string;
40
1184
  /**
41
- * 侧滑返回功能,可选值:"close"(启用侧滑返回)、"none"(禁用侧滑返回)
1185
+ * 侧滑返回功能,仅支持 "close" / "none"
1186
+ *
1187
+ * "close" 启用侧滑返回
1188
+ *
1189
+ * "none" 禁用侧滑返回
1190
+ *
42
1191
  * @default "close"
1192
+ *
43
1193
  * @desc App-iOS
44
1194
  */
45
- popGesture?: string;
1195
+ popGesture?: 'close' | 'none';
46
1196
  /**
47
- * iOS软键盘上完成工具栏的显示模式,设置为 "none" 时关闭工具栏。
1197
+ * iOS 软键盘上完成工具栏的显示模式,设置为 "none" 时关闭工具栏
1198
+ *
48
1199
  * @default "auto"
1200
+ *
49
1201
  * @desc App-iOS
50
1202
  */
51
- softInputNavBar?: string;
1203
+ softInputNavBar?: 'auto' | 'none';
52
1204
  /**
53
- * 软键盘弹出模式,支持 adjustResize、adjustPan 两种模式
1205
+ * 软键盘弹出模式,仅支持 "adjustResize" / "adjustPan"
1206
+ *
54
1207
  * @default "adjustPan"
1208
+ *
55
1209
  * @desc App
56
1210
  */
57
- softInputMode?: string;
1211
+ softInputMode?: 'adjustResize' | 'adjustPan';
58
1212
  /**
59
1213
  * 下拉刷新
1214
+ *
60
1215
  * @desc App
61
1216
  */
62
- pullToRefresh?: object;
1217
+ pullToRefresh?: {
1218
+ /**
1219
+ * 是否开启窗口下拉刷新
1220
+ *
1221
+ * @default false
1222
+ */
1223
+ support?: boolean;
1224
+ /**
1225
+ * 下拉刷新控件颜色,仅 style 为 "circle" 时有效,支持 HEX 颜色
1226
+ *
1227
+ * @default "#2BD009"
1228
+ *
1229
+ * @format color
1230
+ */
1231
+ color?: HEXColor;
1232
+ /**
1233
+ * 下拉刷新控件样式
1234
+ *
1235
+ * "default" 下拉拖动时页面内容跟随
1236
+ *
1237
+ * "circle" 下拉拖动时仅刷新控件跟随
1238
+ *
1239
+ * @default Android 为 "circle",iOS 为 "default"
1240
+ */
1241
+ style?: 'default' | 'circle';
1242
+ /**
1243
+ * 下拉刷新控件进入刷新状态的拉拽高度,支持以 px 为单位的逻辑像素值或百分比
1244
+ */
1245
+ height?: PxSize | PercentageSize;
1246
+ /**
1247
+ * 窗口可下拉拖拽的范围,支持以 px 为单位的逻辑像素值或百分比
1248
+ */
1249
+ range?: PxSize | PercentageSize;
1250
+ /**
1251
+ * 下拉刷新控件的起始位置,仅 style 为 "circle" 时有效,用于定义刷新控件下拉时的起始位置,支持以 px 为单位的逻辑像素值或百分比
1252
+ *
1253
+ * 如使用了非原生 title 且需要原生下拉刷新,一般都设置 style 为 "circle" 并将 offset 设置为自定义 title 的高度
1254
+ */
1255
+ offset?: PxSize | PercentageSize;
1256
+ /**
1257
+ * 下拉可刷新状态时配置,仅 style 为 "default" 时有效
1258
+ */
1259
+ contentdown?: {
1260
+ /**
1261
+ * 下拉可刷新状态时下拉刷新控件标题内容
1262
+ */
1263
+ caption?: string;
1264
+ [x: string]: any;
1265
+ };
1266
+ /**
1267
+ * 释放可刷新状态时配置,仅 style 为 "default" 时有效
1268
+ */
1269
+ contentover?: {
1270
+ /**
1271
+ * 释放可刷新状态时下拉刷新控件标题内容
1272
+ */
1273
+ caption?: string;
1274
+ [x: string]: any;
1275
+ };
1276
+ /**
1277
+ * 正在刷新状态时配置,仅 style 为 "default" 时有效
1278
+ */
1279
+ contentrefresh?: {
1280
+ /**
1281
+ * 正在刷新状态时下拉刷新控件标题内容
1282
+ */
1283
+ caption?: string;
1284
+ [x: string]: any;
1285
+ };
1286
+ [x: string]: any;
1287
+ };
63
1288
  /**
64
- * 滚动条显示策略,设置为 "none" 时不显示滚动条。
1289
+ * 滚动条显示策略,设置为 "none" 时不显示滚动条
1290
+ *
65
1291
  * @desc App
66
1292
  */
67
1293
  scrollIndicator?: string;
68
1294
  /**
69
- * 窗口显示的动画效果,详见:窗口动画。
1295
+ * 窗口显示的动画效果,详见 [窗口动画](https://uniapp.dcloud.net.cn/api/router#animation)
1296
+ *
70
1297
  * @default "pop-in"
1298
+ *
71
1299
  * @desc App
72
1300
  */
73
- animationType?: string;
1301
+ animationType?: AnimationType;
74
1302
  /**
75
- * 窗口显示动画的持续时间,单位为 ms。
76
- * @default "300"
1303
+ * 窗口显示动画的持续时间,单位为 ms
1304
+ *
1305
+ * @default 300
1306
+ *
77
1307
  * @desc App
78
1308
  */
79
- animationDuration?: number;
1309
+ animationDuration?: number;
1310
+ [x: string]: any;
1311
+ }
1312
+
1313
+ /**
1314
+ * 设置编译到 mp-alipay 平台的特定样式,配置项参考 [MP-ALIPAY](https://uniapp.dcloud.net.cn/collocation/pages#mp-alipay) 和 <https://opendocs.alipay.com/mini/framework/app-json#window>
1315
+ *
1316
+ * 相应的类型是 MpAlipay
1317
+ *
1318
+ * @desc 支付宝小程序
1319
+ */
1320
+ interface MpAlipay {
1321
+ /**
1322
+ * 是否允许向下拉拽
1323
+ *
1324
+ * @default "YES"
1325
+ */
1326
+ allowsBounceVertical?: 'YES' | 'NO';
1327
+ /**
1328
+ * 窗口的背景色,支持 HEX 颜色
1329
+ *
1330
+ * @format color
1331
+ */
1332
+ backgroundColor?: HEXColor;
1333
+ /**
1334
+ * 下拉露出显示背景图的底色,仅 Android 有效,iOS 下页面背景图底色会使用 backgroundColor 的值
1335
+ *
1336
+ * @format color
1337
+ */
1338
+ backgroundImageColor?: HEXColor;
1339
+ /**
1340
+ * 下拉露出显示背景图的链接,支持网络地址和本地地址,尽量使用绝对地址
1341
+ */
1342
+ backgroundImageUrl?: string;
1343
+ /**
1344
+ * 页面默认标题
1345
+ */
1346
+ defaultTitle?: string;
1347
+ /**
1348
+ * 仅支持 Android,是否显示 WebView 滚动条
1349
+ *
1350
+ * @default "YES"
1351
+ */
1352
+ enableScrollBar?: 'YES' | 'NO';
1353
+ /**
1354
+ * 仅支持 iOS,是否支持手势返回
1355
+ *
1356
+ * @default "YES"
1357
+ */
1358
+ gestureBack?: 'YES' | 'NO';
1359
+ /**
1360
+ * 页面上拉触底时触发时距离页面底部的距离,单位为 px,详情可查看 [页面事件处理函数](https://opendocs.alipay.com/mini/framework/page-detail#%E9%A1%B5%E9%9D%A2%E4%BA%8B%E4%BB%B6%E5%A4%84%E7%90%86%E5%87%BD%E6%95%B0)
1361
+ *
1362
+ * @desc [1.19.0](https://opendocs.alipay.com/mini/framework/compatibility),目前 iOS 在 page.json 下设置无效,只能全局设置
1363
+ */
1364
+ onReachBottomDistance?: number;
1365
+ /**
1366
+ * 是否允许下拉刷新,allowsBounceVertical 值需要为 "YES",全局配置后全局生效,但是如果单个页面配置了该参数,以页面的配置为准
1367
+ *
1368
+ * @default false
1369
+ */
1370
+ pullRefresh?: boolean;
1371
+ /**
1372
+ * rpx 单位是否宽度自适应
1373
+ *
1374
+ * 当设置为 false 时,2 rpx 将恒等于 1 px,不再根据屏幕宽度进行自适应,此时 750 rpx 将不再等于 100% 宽度
1375
+ *
1376
+ * @desc [1.23.0](https://opendocs.alipay.com/mini/framework/compatibility)
1377
+ *
1378
+ * @default true
1379
+ */
1380
+ responsive?: boolean;
1381
+ /**
1382
+ * 是否进入时显示导航栏的 loading
1383
+ *
1384
+ * @default "NO"
1385
+ */
1386
+ showTitleLoading?: 'YES' | 'NO';
1387
+ /**
1388
+ * 导航栏透明设置
1389
+ *
1390
+ * always 一直透明
1391
+ *
1392
+ * auto 滑动自适应
1393
+ *
1394
+ * none 不透明
1395
+ *
1396
+ * @default "none"
1397
+ */
1398
+ transparentTitle?: 'always' | 'auto' | 'none';
1399
+ /**
1400
+ * 导航栏点击穿透
1401
+ *
1402
+ * @default "NO"
1403
+ */
1404
+ titlePenetrate?: 'YES' | 'NO';
1405
+ /**
1406
+ * 导航栏图片地址,会替换当前文字标题,只支持 https 图片链接
1407
+ */
1408
+ titleImage?: string;
1409
+ /**
1410
+ * 导航栏背景色,支持 HEX 颜色
1411
+ */
1412
+ titleBarColor?: HEXColor;
1413
+ /**
1414
+ * 导航栏前景色
1415
+ *
1416
+ * @desc [支付宝客户端 10.5.30](https://opendocs.alipay.com/mini/framework/compatibility)
1417
+ */
1418
+ navigationBarFrontColor?: 'black' | 'white';
1419
+ [x: string]: any;
1420
+ }
1421
+
1422
+ /**
1423
+ * 设置编译到 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>
1424
+ *
1425
+ * 相应的类型是 MpWeixin
1426
+ *
1427
+ * @desc 微信小程序
1428
+ */
1429
+ interface MpWeixin {
1430
+ /**
1431
+ * 导航栏背景颜色,支持 HEX 颜色
1432
+ *
1433
+ * @default "#000000"
1434
+ *
1435
+ * @format color
1436
+ */
1437
+ navigationBarBackgroundColor?: HEXColor;
1438
+ /**
1439
+ * 导航栏标题、状态栏颜色
1440
+ *
1441
+ * @default "white"
1442
+ */
1443
+ navigationBarTextStyle?: 'black' | 'white';
1444
+ /**
1445
+ * 导航栏标题文字内容
1446
+ */
1447
+ navigationBarTitleText?: string;
1448
+ /**
1449
+ * 导航栏样式
1450
+ *
1451
+ * "default" 默认样式
1452
+ *
1453
+ * "custom" 自定义导航栏,只保留右上角胶囊按钮
1454
+ *
1455
+ * @desc iOS / Android 微信客户端 6.6.0,Windows 微信客户端不支持
1456
+ *
1457
+ * @default "default"
1458
+ */
1459
+ navigationStyle?: 'default' | 'custom';
1460
+ /**
1461
+ * 在非首页、非页面栈最底层页面或非 tabbar 内页面中的导航栏展示 home 键
1462
+ *
1463
+ * @desc 微信客户端 8.0.24
1464
+ *
1465
+ * @default false
1466
+ */
1467
+ homeButton?: boolean;
1468
+ /**
1469
+ * 窗口的背景色,支持 HEX 颜色
1470
+ *
1471
+ * @default "#FFFFFF"
1472
+ */
1473
+ backgroundColor?: HEXColor;
1474
+ /**
1475
+ * 下拉 loading 的样式,仅支持 "dark" / "light"
1476
+ *
1477
+ * @default "dark"
1478
+ */
1479
+ backgroundTextStyle?: 'dark' | 'light';
1480
+ /**
1481
+ * 顶部窗口的背景色,仅 iOS 支持
1482
+ *
1483
+ * @desc 微信客户端 6.5.16
1484
+ *
1485
+ * @default "#FFFFFF"
1486
+ */
1487
+ backgroundColorTop?: HEXColor;
1488
+ /**
1489
+ * 底部窗口的背景色,仅 iOS 支持
1490
+ *
1491
+ * @desc 微信客户端 6.5.16
1492
+ *
1493
+ * @default "#FFFFFF"
1494
+ */
1495
+ backgroundColorBottom?: HEXColor;
1496
+ /**
1497
+ * 是否开启全局的下拉刷新,详见 [Page.onPullDownRefresh](https://developers.weixin.qq.com/miniprogram/dev/reference/api/Page.html#onpulldownrefresh)
1498
+ *
1499
+ * @default false
1500
+ */
1501
+ enablePullDownRefresh?: boolean;
1502
+ /**
1503
+ * 页面上拉触底事件触发时距页面底部距离,单位为 px,详见 [Page.onReachBottom](https://developers.weixin.qq.com/miniprogram/dev/reference/api/Page.html#onreachbottom)
1504
+ *
1505
+ * @default 50
1506
+ */
1507
+ onReachBottomDistance?: number;
1508
+ /**
1509
+ * 屏幕旋转设置,支持 auto / portrait / landscape,详见 [响应显示区域变化](https://developers.weixin.qq.com/miniprogram/dev/framework/view/resizable.html)
1510
+ *
1511
+ * "auto" 自动
1512
+ *
1513
+ * "portrait" 竖屏
1514
+ *
1515
+ * "landscape" 横屏
1516
+ *
1517
+ * @desc [2.4.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) (auto) / [2.5.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) (landscape)
1518
+ *
1519
+ * @default "portrait"
1520
+ */
1521
+ pageOrientation?: 'auto' | 'portrait' | 'landscape';
1522
+ /**
1523
+ * 重新启动策略配置
1524
+ *
1525
+ * "homePage" 如果从这个页面退出小程序,下次将从首页冷启动
1526
+ *
1527
+ * "homePageAndLatestPage" 如果从这个页面退出小程序,下次冷启动后立刻加载这个页面,页面的参数保持不变(不可用于 tab 页)
1528
+ *
1529
+ * @desc [2.8.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
1530
+ */
1531
+ restartStrategy?: 'homePage' | 'homePageAndLatestPage';
1532
+ /**
1533
+ * 页面初始渲染缓存配置,详见 [初始渲染缓存](https://developers.weixin.qq.com/miniprogram/dev/framework/view/initial-rendering-cache.html)
1534
+ *
1535
+ * @desc [2.11.1](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
1536
+ */
1537
+ initialRenderingCache?: 'static' | 'dynamic';
1538
+ /**
1539
+ * 切入系统后台时,隐藏页面内容,保护用户隐私
1540
+ *
1541
+ * @desc [2.15.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
1542
+ *
1543
+ * @default "none"
1544
+ */
1545
+ visualEffectInBackground?: 'hidden' | 'none';
1546
+ /**
1547
+ * 控制预加载下个页面的时机,详见 [控制预加载下个页面的时机](https://developers.weixin.qq.com/miniprogram/dev/framework/performance/tips/runtime_nav.html#_2-4-%E6%8E%A7%E5%88%B6%E9%A2%84%E5%8A%A0%E8%BD%BD%E4%B8%8B%E4%B8%AA%E9%A1%B5%E9%9D%A2%E7%9A%84%E6%97%B6%E6%9C%BA)
1548
+ *
1549
+ * "static" 在当前页面 onReady 触发 200ms 后触发预加载
1550
+ *
1551
+ * "auto" 渲染线程空闲时进行预加载,由基础库根据一段时间内 requestAnimationFrame 的触发频率算法判断
1552
+ *
1553
+ * "manual" 由开发者通过调用 [wx.preloadWebview](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/wx.preloadWebview.html) 触发,开发者可以在页面主要内容的 setData 结束后手动触发
1554
+ *
1555
+ * @desc [2.15.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
1556
+ *
1557
+ * @default "static"
1558
+ */
1559
+ handleWebviewPreload?: 'static' | 'manual' | 'auto';
1560
+ [x: string]: any;
1561
+ }
1562
+
1563
+ /**
1564
+ * 设置编译到 mp-baidu 平台的特定样式,配置项参考 [MP-BAIDU](https://uniapp.dcloud.net.cn/collocation/pages.html#mp-baidu) 和 <https://smartprogram.baidu.com/docs/develop/framework/process/#window>
1565
+ *
1566
+ * 相应的类型是 MpBaidu
1567
+ *
1568
+ * @desc 百度小程序
1569
+ */
1570
+ interface MpBaidu {
1571
+ /**
1572
+ * 导航栏背景颜色,支持 HEX 颜色
1573
+ *
1574
+ * @default "#000000"
1575
+ *
1576
+ * @format color
1577
+ */
1578
+ navigationBarBackgroundColor?: HEXColor;
1579
+ /**
1580
+ * 导航栏标题、状态栏颜色
1581
+ *
1582
+ * @default "white"
1583
+ */
1584
+ navigationBarTextStyle?: 'black' | 'white';
1585
+ /**
1586
+ * 导航栏标题文字内容
1587
+ */
1588
+ navigationBarTitleText?: string;
1589
+ /**
1590
+ * 导航栏样式
1591
+ *
1592
+ * "default" 默认样式
1593
+ *
1594
+ * "custom" 自定义导航栏,只保留右上角胶囊按钮
1595
+ *
1596
+ * @desc 2.10.34
1597
+ *
1598
+ * @default "default"
1599
+ */
1600
+ navigationStyle?: 'default' | 'custom';
1601
+ /**
1602
+ * 窗口的背景色,支持 HEX 颜色
1603
+ *
1604
+ * @default "#FFFFFF"
1605
+ */
1606
+ backgroundColor?: HEXColor;
1607
+ /**
1608
+ * 下拉 loading 的样式,仅支持 "dark" / "light"
1609
+ *
1610
+ * @default "dark"
1611
+ */
1612
+ backgroundTextStyle?: 'dark' | 'light';
1613
+ /**
1614
+ * 顶部窗口的背景色,仅 iOS 支持
1615
+ *
1616
+ * @default "#FFFFFF"
1617
+ */
1618
+ backgroundColorTop?: HEXColor;
1619
+ /**
1620
+ * 底部窗口的背景色,仅 iOS 支持
1621
+ *
1622
+ * @default "#FFFFFF"
1623
+ */
1624
+ backgroundColorBottom?: HEXColor;
1625
+ /**
1626
+ * 是否开启全局的下拉刷新
1627
+ *
1628
+ * @default false
1629
+ */
1630
+ enablePullDownRefresh?: boolean;
1631
+ /**
1632
+ * 页面上拉触底事件触发时距页面底部距离,单位为 px
1633
+ *
1634
+ * @default 50
1635
+ */
1636
+ onReachBottomDistance?: number;
1637
+ /**
1638
+ * 小程序页面是否禁止响应字体大小的设置
1639
+ *
1640
+ * "auto" 默认响应
1641
+ *
1642
+ * "none" 不响应
1643
+ *
1644
+ * @desc 基础库版本 3.200.1
1645
+ *
1646
+ * @default "auto"
1647
+ */
1648
+ textSizeAdjust?: 'auto' | 'none';
1649
+ /**
1650
+ * 屏幕旋转设置,支持 auto / portrait / landscape
1651
+ *
1652
+ * "auto" 自动
1653
+ *
1654
+ * "portrait" 竖屏
1655
+ *
1656
+ * "landscape" 横屏
1657
+ *
1658
+ * @desc 基础库版本 3.450.8,web 化暂不支持
1659
+ *
1660
+ * @default "portrait"
1661
+ */
1662
+ pageOrientation?: 'auto' | 'portrait' | 'landscape';
1663
+ [x: string]: any;
1664
+ }
1665
+
1666
+ /**
1667
+ * 设置编译到 mp-toutiao 平台的特定样式,配置项参考 <https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/framework/general-configuration#window>
1668
+ *
1669
+ * 相应的类型是 MpToutiao
1670
+ *
1671
+ * @desc 抖音小程序
1672
+ */
1673
+ interface MpToutiao {
1674
+ /**
1675
+ * 导航栏背景颜色,支持 HEX 颜色
1676
+ *
1677
+ * @default "#000000"
1678
+ *
1679
+ * @format color
1680
+ */
1681
+ navigationBarBackgroundColor?: HEXColor;
1682
+ /**
1683
+ * 导航栏标题颜色,同时影响标题颜色、右胶囊颜色、左返回箭头颜色
1684
+ *
1685
+ * @default "white"
1686
+ */
1687
+ navigationBarTextStyle?: 'black' | 'white';
1688
+ /**
1689
+ * 导航栏标题文字内容
1690
+ */
1691
+ navigationBarTitleText?: string;
1692
+ /**
1693
+ * 导航栏样式
1694
+ *
1695
+ * "default" 默认样式
1696
+ *
1697
+ * "custom" 自定义导航栏,只保留右上角胶囊按钮
1698
+ *
1699
+ * @default "default"
1700
+ */
1701
+ navigationStyle?: 'default' | 'custom';
1702
+ /**
1703
+ * 窗口的背景色,支持 HEX 颜色
1704
+ *
1705
+ * @default "#FFFFFF"
1706
+ */
1707
+ backgroundColor?: HEXColor;
1708
+ /**
1709
+ * 下拉 loading 的样式,仅支持 "dark" / "light"
1710
+ *
1711
+ * @default "dark"
1712
+ */
1713
+ backgroundTextStyle?: 'dark' | 'light';
1714
+ /**
1715
+ * 顶部窗口的背景色,仅 iOS 支持
1716
+ *
1717
+ * @default 同 backgroundColor
1718
+ */
1719
+ backgroundColorTop?: HEXColor;
1720
+ /**
1721
+ * 底部窗口的背景色,仅 iOS 支持
1722
+ *
1723
+ * @default 同 backgroundColor
1724
+ */
1725
+ backgroundColorBottom?: HEXColor;
1726
+ /**
1727
+ * 是否开启全局的下拉刷新
1728
+ *
1729
+ * @default false
1730
+ */
1731
+ enablePullDownRefresh?: boolean;
1732
+ /**
1733
+ * 页面上拉触底事件触发时距页面底部距离,单位为 px
1734
+ *
1735
+ * @default 50
1736
+ */
1737
+ onReachBottomDistance?: number;
1738
+ /**
1739
+ * 仅在 navigationStyle 为 "default" 时生效,用来控制导航栏透明设置
1740
+ *
1741
+ * "always" 一直透明
1742
+ *
1743
+ * "auto" 滑动自适应
1744
+ *
1745
+ * "none" 不透明
1746
+ *
1747
+ * @default "none"
1748
+ */
1749
+ transparentTitle?: 'always' | 'auto' | 'none';
1750
+ /**
1751
+ * 框架骨架屏配置,仅支持配置 config 属性,优先级高于 app.json,详见 [小程序框架骨架屏](https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/guide/experience-optimization/list/skeleton)
1752
+ *
1753
+ * @desc 2.47.0
1754
+ */
1755
+ skeleton?: {
1756
+ /**
1757
+ * 包含超时移除及自动生成配置等
1758
+ */
1759
+ config?: {
1760
+ /**
1761
+ * 设置骨架屏超时移除时间,单位为 ms,为 0 时关闭超时移除
1762
+ *
1763
+ * @default 2000
1764
+ */
1765
+ timeout?: number;
1766
+ /**
1767
+ * 骨架屏显示时的动画
1768
+ *
1769
+ * @default 'spin'
1770
+ */
1771
+ loading?: 'spin' | 'chiaroscuro' | 'shine';
1772
+ /**
1773
+ * 骨架页面中图片块配置
1774
+ *
1775
+ * @default { shape: 'rect', color: '#efefef' }
1776
+ */
1777
+ image?: {
1778
+ /**
1779
+ * 骨架页面中图片块形状
1780
+ *
1781
+ * circle 圆形
1782
+ *
1783
+ * rect 矩形
1784
+ *
1785
+ * @default "rect"
1786
+ */
1787
+ shape?: 'circle' | 'rect';
1788
+ /**
1789
+ * 骨架页面中图片块颜色,支持 HEX 颜色
1790
+ *
1791
+ * @default "#efefef"
1792
+ *
1793
+ * @format color
1794
+ */
1795
+ color?: HEXColor;
1796
+ [x: string]: any;
1797
+ };
1798
+ /**
1799
+ * 骨架页面中被视为按钮块的配置
1800
+ *
1801
+ * @default { color: '#efefef }
1802
+ */
1803
+ button?: {
1804
+ /**
1805
+ * 骨架页面中被视为按钮块的颜色,支持 HEX 颜色
1806
+ *
1807
+ * @default "#efefef"
1808
+ *
1809
+ * @format color
1810
+ */
1811
+ color?: HEXColor;
1812
+ [x: string]: any;
1813
+ };
1814
+ /**
1815
+ * 骨架屏背景色,支持 HEX 颜色
1816
+ *
1817
+ * @default "#fff"
1818
+ *
1819
+ * @format color
1820
+ */
1821
+ backgroundColor?: HEXColor;
1822
+ /**
1823
+ * 默认为使用绝对定位占满全屏
1824
+ *
1825
+ * 当对自定义组件使用,作为局部加载的样式时,可设置为 "auto",高度随内容高度撑开
1826
+ *
1827
+ * @default "fullscreen"
1828
+ */
1829
+ mode?: 'fullscreen' | 'auto';
1830
+ /**
1831
+ * CSS单位,元素绝对定位都使用 "vw" 与 "vh"
1832
+ *
1833
+ * @default "vw"
1834
+ */
1835
+ cssUnit?: 'px' | 'rem' | 'vw' | 'vh' | 'vmin' | 'vmax';
1836
+ /**
1837
+ * 生成骨架屏页面中 css 值保留的小数点位数,默认为 4
1838
+ *
1839
+ * @default 4
1840
+ */
1841
+ decimal?: number;
1842
+ [x: string]: any;
1843
+ };
1844
+ /**
1845
+ * 页面路径同骨架屏文件的对应关系
1846
+ */
1847
+ page?: Record<string, string>;
1848
+ [x: string]: any;
1849
+ };
1850
+ [x: string]: any;
1851
+ }
1852
+
1853
+ /**
1854
+ * 设置编译到 mp-lark 平台的特定样式,配置项参考 <https://open.feishu.cn/document/client-docs/gadget/introduction/global-settings#a172b7dd>
1855
+ *
1856
+ * 相应的类型是 MpLark
1857
+ *
1858
+ * @desc 飞书小程序
1859
+ */
1860
+ interface MpLark {
1861
+ /**
1862
+ * 导航栏背景颜色,支持 HEX 颜色
1863
+ *
1864
+ * @desc iOS, Android
1865
+ *
1866
+ * @default "#000000"
1867
+ *
1868
+ * @format color
1869
+ */
1870
+ navigationBarBackgroundColor?: HEXColor;
1871
+ /**
1872
+ * 导航栏标题、状态栏颜色
1873
+ *
1874
+ * @desc iOS, Android
1875
+ *
1876
+ * @default "white"
1877
+ */
1878
+ navigationBarTextStyle?: 'black' | 'white';
1879
+ /**
1880
+ * 导航栏标题文字内容
1881
+ *
1882
+ * @desc iOS, Android, PC
1883
+ */
1884
+ navigationBarTitleText?: string;
1885
+ /**
1886
+ * 导航栏透明设置
1887
+ *
1888
+ * "always" 一直透明
1889
+ *
1890
+ * "auto" 滑动自适应
1891
+ *
1892
+ * "none" 不透明
1893
+ *
1894
+ * @desc iOS, Android
1895
+ *
1896
+ * @default "none"
1897
+ */
1898
+ transparentTitle?: 'always' | 'auto' | 'none';
1899
+ /**
1900
+ * 导航栏样式
1901
+ *
1902
+ * "default" 默认样式
1903
+ *
1904
+ * "custom" 自定义导航栏,只保留右上角胶囊按钮
1905
+ *
1906
+ * @desc iOS, Android, PC
1907
+ *
1908
+ * @default "default"
1909
+ */
1910
+ navigationStyle?: 'default' | 'custom';
1911
+ /**
1912
+ * 窗口的背景色,支持 HEX 颜色
1913
+ *
1914
+ * @desc iOS, Android, PC(3.14.0+)
1915
+ *
1916
+ * @default "#FFFFFF"
1917
+ */
1918
+ backgroundColor?: HEXColor;
1919
+ /**
1920
+ * 下拉 loading 的样式,仅支持 "dark" / "light"
1921
+ *
1922
+ * @desc iOS, Android
1923
+ *
1924
+ * @default "dark"
1925
+ */
1926
+ backgroundTextStyle?: 'dark' | 'light';
1927
+ /**
1928
+ * 顶部窗口的背景色
1929
+ *
1930
+ * @desc iOS
1931
+ *
1932
+ * @default "#FFFFFF"
1933
+ */
1934
+ backgroundColorTop?: HEXColor;
1935
+ /**
1936
+ * 底部窗口的背景色
1937
+ *
1938
+ * @desc iOS
1939
+ *
1940
+ * @default "#FFFFFF"
1941
+ */
1942
+ backgroundColorBottom?: HEXColor;
1943
+ /**
1944
+ * 是否开启全局的下拉刷新
1945
+ *
1946
+ * @desc iOS, Android
1947
+ *
1948
+ * @default false
1949
+ */
1950
+ enablePullDownRefresh?: boolean;
1951
+ /**
1952
+ * 页面上拉触底事件触发时距页面底部距离,单位为 px
1953
+ *
1954
+ * @desc iOS, Android
1955
+ *
1956
+ * @default 50
1957
+ */
1958
+ onReachBottomDistance?: number;
1959
+ /**
1960
+ * PCMode 模式下特定的窗口配置,支持的属性与通用 window 配置属性一致,仅当在 ext 内配置了 defaultPages.PCMode 时生效
1961
+ */
1962
+ PCMode?: Omit<MpLark, 'PCMode'>;
1963
+ [x: string]: any;
1964
+ }
1965
+
1966
+ /**
1967
+ * 设置编译到 mp-qq 平台的特定样式,配置项参考 <https://q.qq.com/wiki/develop/miniprogram/frame/dispose.html#window>
1968
+ *
1969
+ * 相应的类型是 MpQq
1970
+ *
1971
+ * @desc QQ 小程序
1972
+ */
1973
+ interface MpQq {
1974
+ /**
1975
+ * 导航栏背景颜色,支持 HEX 颜色
1976
+ *
1977
+ * @default "#000000"
1978
+ *
1979
+ * @format color
1980
+ */
1981
+ navigationBarBackgroundColor?: HEXColor;
1982
+ /**
1983
+ * 导航栏标题、状态栏颜色
1984
+ *
1985
+ * @default "white"
1986
+ */
1987
+ navigationBarTextStyle?: 'black' | 'white';
1988
+ /**
1989
+ * 导航栏标题文字内容
1990
+ */
1991
+ navigationBarTitleText?: string;
1992
+ /**
1993
+ * 导航栏样式
1994
+ *
1995
+ * "default" 默认样式
1996
+ *
1997
+ * "custom" 自定义导航栏,只保留右上角胶囊按钮
1998
+ *
1999
+ * @default "default"
2000
+ */
2001
+ navigationStyle?: 'default' | 'custom';
2002
+ /**
2003
+ * 窗口的背景色,支持 HEX 颜色
2004
+ *
2005
+ * @default "#FFFFFF"
2006
+ */
2007
+ backgroundColor?: HEXColor;
2008
+ /**
2009
+ * 下拉 loading 的样式,仅支持 "dark" / "light"
2010
+ *
2011
+ * @default "dark"
2012
+ */
2013
+ backgroundTextStyle?: 'dark' | 'light';
2014
+ /**
2015
+ * 顶部窗口的背景色,仅 iOS 支持
2016
+ *
2017
+ * @default "#FFFFFF"
2018
+ */
2019
+ backgroundColorTop?: HEXColor;
2020
+ /**
2021
+ * 底部窗口的背景色,仅 iOS 支持
2022
+ *
2023
+ * @default "#FFFFFF"
2024
+ */
2025
+ backgroundColorBottom?: HEXColor;
2026
+ /**
2027
+ * 是否开启全局的下拉刷新,详见 [Page.onPullDownRefresh](https://q.qq.com/wiki/develop/miniprogram/frame/logic/logic_register_page.html#onPullDownRefresh)
2028
+ *
2029
+ * @default false
2030
+ */
2031
+ enablePullDownRefresh?: boolean;
2032
+ /**
2033
+ * 屏幕旋转设置,支持 auto / portrait / landscape,详见 [响应显示区域变化](https://q.qq.com/wiki/develop/miniprogram/frame/view/view_section_change.html)
2034
+ *
2035
+ * "auto" 自动
2036
+ *
2037
+ * "portrait" 竖屏
2038
+ *
2039
+ * "landscape" 横屏
2040
+ *
2041
+ * @default "portrait"
2042
+ */
2043
+ pageOrientation?: 'auto' | 'portrait' | 'landscape';
2044
+ [x: string]: any;
2045
+ }
2046
+
2047
+ /**
2048
+ * 设置编译到 mp-kuaishou 平台的特定样式,配置项参考 <https://mp.kuaishou.com/docs/develop/frame/config/conf_appjson.html#window>
2049
+ *
2050
+ * 相应的类型是 MpKuaishou
2051
+ *
2052
+ * @desc 快手小程序
2053
+ */
2054
+ interface MpKuaishou {
2055
+ /**
2056
+ * 导航栏背景颜色,支持 HEX 颜色
2057
+ *
2058
+ * @default "#000000"
2059
+ *
2060
+ * @format color
2061
+ */
2062
+ navigationBarBackgroundColor?: HEXColor;
2063
+ /**
2064
+ * 导航栏标题、状态栏颜色
2065
+ *
2066
+ * @default "white"
2067
+ */
2068
+ navigationBarTextStyle?: 'black' | 'white';
2069
+ /**
2070
+ * 导航栏标题文字内容
2071
+ */
2072
+ navigationBarTitleText?: string;
2073
+ /**
2074
+ * 导航栏样式
2075
+ *
2076
+ * "default" 默认样式
2077
+ *
2078
+ * "custom" 自定义导航栏,只保留右上角胶囊按钮
2079
+ *
2080
+ * @default "default"
2081
+ */
2082
+ navigationStyle?: 'default' | 'custom';
2083
+ /**
2084
+ * 窗口的背景色,支持 HEX 颜色
2085
+ *
2086
+ * @default "#FFFFFF"
2087
+ */
2088
+ backgroundColor?: HEXColor;
2089
+ /**
2090
+ * 下拉 loading 的样式,仅支持 "dark" / "light"
2091
+ *
2092
+ * @default "dark"
2093
+ */
2094
+ backgroundTextStyle?: 'dark' | 'light';
2095
+ /**
2096
+ * 顶部窗口的背景色,仅 iOS 支持
2097
+ *
2098
+ * @default "#FFFFFF"
2099
+ */
2100
+ backgroundColorTop?: HEXColor;
2101
+ /**
2102
+ * 底部窗口的背景色,仅 iOS 支持
2103
+ *
2104
+ * @default "#FFFFFF"
2105
+ */
2106
+ backgroundColorBottom?: HEXColor;
2107
+ /**
2108
+ * 是否开启全局的下拉刷新,详见 [Page.onPullDownRefresh](https://mp.kuaishou.com/docs/develop/frame/page/page_page.html#onpulldownrefresh)
2109
+ *
2110
+ * @default false
2111
+ */
2112
+ enablePullDownRefresh?: boolean;
2113
+ /**
2114
+ * 页面上拉触底事件触发时距页面底部距离,单位为 px,详见 [Page.onReachBottom](https://mp.kuaishou.com/docs/develop/frame/page/page_page.html#onreachbottom)
2115
+ *
2116
+ * @default 50
2117
+ */
2118
+ onReachBottomDistance?: number;
2119
+ /**
2120
+ * 屏幕旋转设置,支持 auto / portrait / landscape,详见 [响应显示区域变化](https://developers.weixin.qq.com/miniprogram/dev/framework/view/resizable.html)
2121
+ *
2122
+ * "auto" 自动
2123
+ *
2124
+ * "portrait" 竖屏
2125
+ *
2126
+ * "landscape" 横屏
2127
+ *
2128
+ * @default "portrait"
2129
+ */
2130
+ pageOrientation?: 'auto' | 'portrait' | 'landscape';
80
2131
  [x: string]: any;
81
2132
  }
82
2133
 
83
- interface H5 {
2134
+ /**
2135
+ * 设置编译到 mp-jd 平台的特定样式,配置项参考 <https://mp-docs.jd.com/doc/dev/framework/504#heading-3>
2136
+ *
2137
+ * 相应的类型是 MpJd
2138
+ *
2139
+ * @desc 京东小程序
2140
+ */
2141
+ interface MpJd {
84
2142
  /**
85
- * 背景颜色,颜色值格式为"#RRGGBB"。
86
- * @default "#F7F7F7"
87
- * @desc
2143
+ * 导航栏背景颜色,支持 HEX 颜色
2144
+ *
2145
+ * @default "#000000"
2146
+ *
2147
+ * @format color
88
2148
  */
89
- backgroundColor?: HEXColor;
2149
+ navigationBarBackgroundColor?: HEXColor;
90
2150
  /**
91
- * 自定义按钮,参考 buttons
92
- * @desc
2151
+ * 导航栏标题、状态栏颜色
2152
+ *
2153
+ * @default "white"
93
2154
  */
94
- buttons?: any[];
2155
+ navigationBarTextStyle?: 'black' | 'white';
95
2156
  /**
96
- * 标题文字颜色
97
- * @default "#000000"
98
- * @desc
2157
+ * 导航栏标题文字内容
99
2158
  */
100
- titleColor?: HEXColor;
2159
+ navigationBarTitleText?: string;
101
2160
  /**
102
- * 标题文字内容
103
- * @desc
2161
+ * 导航栏样式
2162
+ *
2163
+ * "default" 默认样式
2164
+ *
2165
+ * "custom" 自定义导航栏,只保留右上角胶囊按钮
2166
+ *
2167
+ * @default "default"
104
2168
  */
105
- titleText?: string;
2169
+ navigationStyle?: 'default' | 'custom';
106
2170
  /**
107
- * 标题文字字体大小
108
- * @desc
2171
+ * 下拉窗口的背景色,不是页面的背景颜色
2172
+ *
2173
+ * @default "#FFFFFF"
109
2174
  */
110
- titleSize?: string;
2175
+ backgroundColor?: HEXColor;
111
2176
  /**
112
- * 导航栏样式。"default"-默认样式;"transparent"-透明渐变。
113
- * @default "default"
114
- * @desc
2177
+ * 下拉 loading 的样式,仅支持 "dark" / "light"
2178
+ *
2179
+ * @default "dark"
115
2180
  */
116
- type?: string;
2181
+ backgroundTextStyle?: 'dark' | 'light';
2182
+ /**
2183
+ * 顶部窗口的背景色,仅 iOS 支持
2184
+ *
2185
+ * @default "#FFFFFF"
2186
+ */
2187
+ backgroundColorTop?: HEXColor;
2188
+ /**
2189
+ * 底部窗口的背景色,仅 iOS 支持
2190
+ *
2191
+ * @default "#FFFFFF"
2192
+ */
2193
+ backgroundColorBottom?: HEXColor;
117
2194
  /**
118
- * 导航栏上的搜索框样式,详见:searchInput
119
- * @desc 1.6.5
2195
+ * 是否开启全局的下拉刷新,详见 [Page.onPullDownRefresh](https://mp-docs.jd.com/doc/dev/framework/520#heading-10)
2196
+ *
2197
+ * @default false
120
2198
  */
121
- searchInput?: object;
2199
+ enablePullDownRefresh?: boolean;
122
2200
  [x: string]: any;
123
2201
  }
124
2202
 
125
2203
  interface GlobalStyle {
126
2204
  /**
127
- * 导航栏背景颜色(同状态栏背景色)
128
- * @default "#F7F7F7"
129
- * @desc APP与H5为#F7F7F7,小程序平台请参考相应小程序文档
2205
+ * 导航栏背景颜色(同状态栏背景色),支持 HEX 颜色
2206
+ *
2207
+ * @desc APP 与 H5 为 #F8F8F8,小程序平台请参考相应小程序文档
2208
+ *
2209
+ * @format color
130
2210
  */
131
- navigationBarBackgroundColor?: HEXColor | ThemeColor;
2211
+ 'navigationBarBackgroundColor'?: HEXColor;
132
2212
  /**
133
- * 导航栏标题颜色及状态栏前景颜色,仅支持 black/white
134
- * @default "white"
2213
+ * 导航栏标题颜色及状态栏前景颜色,仅支持 "black" / "white"
2214
+ *
2215
+ * @default "black"
2216
+ *
135
2217
  * @desc 支付宝小程序不支持,请使用 my.setNavigationBar
136
2218
  */
137
- navigationBarTextStyle?: string;
2219
+ 'navigationBarTextStyle'?: 'black' | 'white';
138
2220
  /**
139
2221
  * 导航栏标题文字内容
140
- * @desc
141
2222
  */
142
- navigationBarTitleText?: string;
2223
+ 'navigationBarTitleText'?: string;
2224
+ /**
2225
+ * 导航栏阴影
2226
+ */
2227
+ 'navigationBarShadow'?: {
2228
+ /**
2229
+ * 阴影颜色
2230
+ */
2231
+ colorType?: 'grey' | 'blue' | 'green' | 'orange' | 'red' | 'yellow';
2232
+ };
143
2233
  /**
144
- * 导航栏样式,仅支持 default/custom。custom即取消默认的原生导航栏,需看使用注意
2234
+ * 导航栏样式,仅支持 "default" / "custom"
2235
+ *
2236
+ * "custom" 即取消默认的原生导航栏,详看 [使用注意](https://uniapp.dcloud.net.cn/collocation/pages#customnav)
2237
+ *
145
2238
  * @default "default"
2239
+ *
146
2240
  * @desc 微信小程序 7.0+、百度小程序、H5、App(2.0.3+)
147
2241
  */
148
- navigationStyle?: string;
2242
+ 'navigationStyle'?: 'default' | 'custom';
149
2243
  /**
150
- * 下拉显示出来的窗口的背景色
2244
+ * 下拉显示出来的窗口的背景色,支持 HEX 颜色
2245
+ *
151
2246
  * @default "#ffffff"
2247
+ *
152
2248
  * @desc 微信小程序
2249
+ *
2250
+ * @format color
153
2251
  */
154
- backgroundColor?: HEXColor | ThemeColor;
2252
+ 'backgroundColor'?: HEXColor;
155
2253
  /**
156
- * 下拉 loading 的样式,仅支持 dark / light
2254
+ * 下拉 loading 的样式,仅支持 "dark" / "light"
2255
+ *
157
2256
  * @default "dark"
2257
+ *
158
2258
  * @desc 微信小程序
159
2259
  */
160
- backgroundTextStyle?: string;
2260
+ 'backgroundTextStyle'?: 'dark' | 'light';
161
2261
  /**
162
- * 是否开启下拉刷新,详见页面生命周期。
163
- * @default "false"
164
- * @desc
2262
+ * 是否开启下拉刷新,详见 [页面生命周期](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
2263
+ *
2264
+ * @default false
165
2265
  */
166
- enablePullDownRefresh?: boolean;
2266
+ 'enablePullDownRefresh'?: boolean;
167
2267
  /**
168
- * 页面上拉触底事件触发时距页面底部距离,单位只支持px,详见页面生命周期
169
- * @default "50"
170
- * @desc
2268
+ * 页面上拉触底事件触发时距页面底部距离,单位为 px,详见 [页面生命周期](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
2269
+ *
2270
+ * @default 50
171
2271
  */
172
- onReachBottomDistance?: number;
2272
+ 'onReachBottomDistance'?: number;
173
2273
  /**
174
2274
  * 顶部窗口的背景色(bounce回弹区域)
2275
+ *
175
2276
  * @default "#ffffff"
176
- * @desc 仅 iOS 平台
2277
+ *
2278
+ * @desc iOS
2279
+ *
2280
+ * @format color
177
2281
  */
178
- backgroundColorTop?: HEXColor | ThemeColor;
2282
+ 'backgroundColorTop'?: HEXColor;
179
2283
  /**
180
2284
  * 底部窗口的背景色(bounce回弹区域)
2285
+ *
181
2286
  * @default "#ffffff"
182
- * @desc 仅 iOS 平台
2287
+ *
2288
+ * @desc iOS
2289
+ *
2290
+ * @format color
183
2291
  */
184
- backgroundColorBottom?: HEXColor | ThemeColor;
2292
+ 'backgroundColorBottom'?: HEXColor;
185
2293
  /**
186
- * 导航栏图片地址(替换当前文字标题),支付宝小程序内必须使用https的图片链接地址
2294
+ * 导航栏图片地址(替换当前文字标题)
2295
+ *
2296
+ * 支付宝小程序内必须使用 https 图片链接地址
2297
+ *
187
2298
  * @desc 支付宝小程序、H5、APP
188
2299
  */
189
- titleImage?: string;
2300
+ 'titleImage'?: string;
190
2301
  /**
191
- * 导航栏整体(前景、背景)透明设置。支持 always 一直透明 / auto 滑动自适应 / none 不透明
2302
+ * 导航栏整体(前景、背景)透明设置,仅支持 "always" / "auto" / "none
2303
+ *
2304
+ * "always" 一直透明
2305
+ *
2306
+ * "auto" 滑动自适应
2307
+ *
2308
+ * "none" 不透明
2309
+ *
192
2310
  * @default "none"
2311
+ *
193
2312
  * @desc 支付宝小程序、H5、APP
194
2313
  */
195
- transparentTitle?: string;
2314
+ 'transparentTitle'?: 'always' | 'auto' | 'none';
196
2315
  /**
197
2316
  * 导航栏点击穿透
2317
+ *
198
2318
  * @default "NO"
2319
+ *
199
2320
  * @desc 支付宝小程序、H5
200
2321
  */
201
- titlePenetrate?: string;
2322
+ 'titlePenetrate'?: 'YES' | 'NO';
202
2323
  /**
203
- * 横屏配置,屏幕旋转设置,仅支持 auto / portrait / landscape 详见 响应显示区域变化
2324
+ * 横屏配置,屏幕旋转设置,仅支持 "auto" / "portrait" / "landscape",详见 [响应显示区域变化](https://developers.weixin.qq.com/miniprogram/dev/framework/view/resizable.html)
2325
+ *
2326
+ * "auto" 自动
2327
+ *
2328
+ * "portrait" 竖屏
2329
+ *
2330
+ * "landscape" 横屏
2331
+ *
204
2332
  * @default "portrait"
2333
+ *
205
2334
  * @desc App 2.4.7+、微信小程序、QQ小程序
206
2335
  */
207
- pageOrientation?: string;
2336
+ 'pageOrientation'?: string;
208
2337
  /**
209
- * 窗口显示的动画效果,详见:窗口动画
2338
+ * 窗口显示的动画效果,详见 [窗口动画](https://uniapp.dcloud.net.cn/api/router#animation)
2339
+ *
210
2340
  * @default "pop-in"
2341
+ *
211
2342
  * @desc App
212
2343
  */
213
- animationType?: string;
2344
+ 'animationType'?: AnimationType;
214
2345
  /**
215
2346
  * 窗口显示动画的持续时间,单位为 ms
216
- * @default "300"
2347
+ *
2348
+ * @default 300
2349
+ *
217
2350
  * @desc App
218
2351
  */
219
- animationDuration?: number;
2352
+ 'animationDuration'?: number;
220
2353
  /**
221
- * 设置编译到 App 平台的特定样式,配置项参考下方 app-plus
2354
+ * 设置编译到 App 平台的特定样式,配置项参考 [app-plus](https://uniapp.dcloud.net.cn/collocation/pages#app-plus)
2355
+ *
2356
+ * 相应的类型是 AppPlus
2357
+ *
222
2358
  * @desc App
223
2359
  */
224
2360
  'app-plus'?: AppPlus;
225
2361
  /**
226
- * 设置编译到 H5 平台的特定样式,配置项参考下方 H5
227
- * @type {H5}
2362
+ * 设置编译到 H5 平台的特定样式,配置项参考 [H5](https://uniapp.dcloud.net.cn/collocation/pages#h5)
2363
+ *
2364
+ * 相应的类型是 H5
2365
+ *
228
2366
  * @desc H5
229
2367
  */
230
- h5?: H5;
2368
+ 'h5'?: H5;
231
2369
  /**
232
- * 设置编译到 mp-alipay 平台的特定样式,配置项参考下方 MP-ALIPAY
2370
+ * 设置编译到 mp-alipay 平台的特定样式,配置项参考 [MP-ALIPAY](https://uniapp.dcloud.net.cn/collocation/pages#mp-alipay) 和 <https://opendocs.alipay.com/mini/framework/app-json#window>
2371
+ *
2372
+ * 相应的类型是 MpAlipay
2373
+ *
233
2374
  * @desc 支付宝小程序
234
2375
  */
235
- 'mp-alipay'?: object;
2376
+ 'mp-alipay'?: MpAlipay;
236
2377
  /**
237
- * 设置编译到 mp-weixin 平台的特定样式
2378
+ * 设置编译到 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>
2379
+ *
2380
+ * 相应的类型是 MpWeixin
2381
+ *
238
2382
  * @desc 微信小程序
239
2383
  */
240
- 'mp-weixin'?: object;
2384
+ 'mp-weixin'?: MpWeixin;
241
2385
  /**
242
- * 设置编译到 mp-baidu 平台的特定样式
2386
+ * 设置编译到 mp-baidu 平台的特定样式,配置项参考 [MP-BAIDU](https://uniapp.dcloud.net.cn/collocation/pages.html#mp-baidu) 和 <https://smartprogram.baidu.com/docs/develop/framework/process/#window>
2387
+ *
2388
+ * 相应的类型是 MpBaidu
2389
+ *
243
2390
  * @desc 百度小程序
244
2391
  */
245
- 'mp-baidu'?: object;
2392
+ 'mp-baidu'?: MpBaidu;
246
2393
  /**
247
- * 设置编译到 mp-toutiao 平台的特定样式
248
- * @desc 字节跳动小程序
2394
+ * 设置编译到 mp-toutiao 平台的特定样式,配置项参考 <https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/framework/general-configuration#window>
2395
+ *
2396
+ * 相应的类型是 MpToutiao
2397
+ *
2398
+ * @desc 抖音小程序
249
2399
  */
250
- 'mp-toutiao'?: object;
2400
+ 'mp-toutiao'?: MpToutiao;
251
2401
  /**
252
2402
  * 设置编译到 mp-lark 平台的特定样式
2403
+ *
2404
+ * 相应的类型是 MpLark
2405
+ *
253
2406
  * @desc 飞书小程序
254
2407
  */
255
- 'mp-lark'?: object;
2408
+ 'mp-lark'?: MpLark;
256
2409
  /**
257
2410
  * 设置编译到 mp-qq 平台的特定样式
258
- * @desc QQ小程序
2411
+ *
2412
+ * 相应的类型是 MpQq
2413
+ *
2414
+ * @desc QQ 小程序
259
2415
  */
260
- 'mp-qq'?: object;
2416
+ 'mp-qq'?: MpQq;
261
2417
  /**
262
2418
  * 设置编译到 mp-kuaishou 平台的特定样式
2419
+ *
2420
+ * 相应的类型是 MpKuaishou
2421
+ *
263
2422
  * @desc 快手小程序
264
2423
  */
265
- 'mp-kuaishou'?: object;
2424
+ 'mp-kuaishou'?: MpKuaishou;
266
2425
  /**
267
2426
  * 设置编译到 mp-jd 平台的特定样式
2427
+ *
2428
+ * 相应的类型是 MpJd
2429
+ *
268
2430
  * @desc 京东小程序
269
2431
  */
270
- 'mp-jd'?: object;
2432
+ 'mp-jd'?: MpJd;
271
2433
  /**
272
- * 引用小程序组件,参考 小程序组件
273
- * @type {Record<string, string>}
274
- * @desc
2434
+ * 引用小程序组件,详见 [小程序组件](https://uniapp.dcloud.net.cn/tutorial/miniprogram-subject.html#%E5%B0%8F%E7%A8%8B%E5%BA%8F%E8%87%AA%E5%AE%9A%E4%B9%89%E7%BB%84%E4%BB%B6%E6%94%AF%E6%8C%81)
2435
+ *
2436
+ * @desc App、微信小程序、支付宝小程序、百度小程序、京东小程序
275
2437
  */
276
- usingComponents?: Record<string, string>;
2438
+ 'usingComponents'?: Record<string, string>;
277
2439
  /**
278
- * 同层渲染,webrtc(实时音视频) 无法正常时尝试配置 seperated 强制关掉同层
2440
+ * 同层渲染,webrtc(实时音视频)无法正常时尝试配置为 "seperated" 强制关掉同层渲染
2441
+ *
279
2442
  * @desc 微信小程序
280
2443
  */
281
- renderingMode?: string;
2444
+ 'renderingMode'?: string;
282
2445
  /**
283
- * 当存在 leftWindow 时,默认是否显示 leftWindow
284
- * @default "true"
2446
+ * 当存在 leftWindow 时,默认是否显示 leftWindow,详见 [topWindow](https://uniapp.dcloud.net.cn/collocation/pages.html#topwindow)
2447
+ *
2448
+ * @default true
2449
+ *
285
2450
  * @desc H5
286
2451
  */
287
- leftWindow?: boolean;
2452
+ 'leftWindow'?: boolean;
288
2453
  /**
289
- * 当存在 topWindow 时,默认是否显示 topWindow
290
- * @default "true"
2454
+ * 当存在 topWindow 时,默认是否显示 topWindow,详见 [topWindow](https://uniapp.dcloud.net.cn/collocation/pages.html#topwindow)
2455
+ *
2456
+ * @default true
2457
+ *
291
2458
  * @desc H5
292
2459
  */
293
- topWindow?: boolean;
2460
+ 'topWindow'?: boolean;
294
2461
  /**
295
- * 当存在 rightWindow 时,默认是否显示 rightWindow
296
- * @default "true"
2462
+ * 当存在 rightWindow 时,默认是否显示 rightWindow,详见 [topWindow](https://uniapp.dcloud.net.cn/collocation/pages.html#topwindow)
2463
+ *
2464
+ * @default true
2465
+ *
297
2466
  * @desc H5
298
2467
  */
299
- rightWindow?: boolean;
2468
+ 'rightWindow'?: boolean;
300
2469
  /**
301
- * rpx 计算所支持的最大设备宽度,单位 px
302
- * @default "960"
2470
+ * rpx 计算所支持的最大设备宽度,单位为 px
2471
+ *
2472
+ * @default 960
2473
+ *
303
2474
  * @desc App(vue2 且不含 nvue)、H5(2.8.12+)
304
2475
  */
305
- rpxCalcMaxDeviceWidth?: number;
2476
+ 'rpxCalcMaxDeviceWidth'?: number;
306
2477
  /**
307
- * rpx 计算使用的基准设备宽度,设备实际宽度超出 rpx 计算所支持的最大设备宽度时将按基准宽度计算,单位 px
308
- * @default "375"
2478
+ * rpx 计算使用的基准设备宽度,设备实际宽度超出 rpx 计算所支持的最大设备宽度时将按基准宽度计算,单位为 px
2479
+ *
2480
+ * @default 375
2481
+ *
309
2482
  * @desc App(vue2 且不含 nvue)、H5(2.8.12+)
310
2483
  */
311
- rpxCalcBaseDeviceWidth?: number;
2484
+ 'rpxCalcBaseDeviceWidth'?: number;
312
2485
  /**
313
- * rpx 计算特殊处理的值,始终按实际的设备宽度计算,单位 rpx
314
- * @default "750"
2486
+ * rpx 计算特殊处理的值,始终按实际的设备宽度计算,单位为 rpx
2487
+ *
2488
+ * @default 750
2489
+ *
315
2490
  * @desc App(vue2 且不含 nvue)、H5(2.8.12+)
316
2491
  */
317
- rpxCalcIncludeWidth?: number;
2492
+ 'rpxCalcIncludeWidth'?: number;
318
2493
  /**
319
- * 动态 rpx,屏幕大小变化会重新渲染 rpx
320
- * @default "false"
2494
+ * 是否使用动态 rpx,屏幕大小变化会重新渲染 rpx
2495
+ *
2496
+ * @default false
2497
+ *
321
2498
  * @desc App-nvue(vue3 固定值为 true) 3.2.13+
322
2499
  */
323
- dynamicRpx?: boolean;
2500
+ 'dynamicRpx'?: boolean;
324
2501
  /**
325
- * 单位px,当浏览器可见区域宽度大于maxWidth时,两侧留白,当小于等于maxWidth时,页面铺满;不同页面支持配置不同的maxWidth;maxWidth = leftWindow(可选)+page(页面主体)+rightWindow(可选)
2502
+ * 当浏览器可见区域宽度大于 maxWidth 时两侧留白,当小于等于 maxWidth 时页面铺满,单位为 px
2503
+ *
2504
+ * 不同页面支持配置不同的 maxWidth
2505
+ *
2506
+ * maxWidth = leftWindow(可选)+ page(页面主体)+ rightWindow(可选)
2507
+ *
2508
+ * 使用时,页面内 fixed 元素需要使用 --window-left 和 --window-right 来保证布局位置正确
2509
+ *
326
2510
  * @desc H5(2.9.9+)
327
2511
  */
328
- maxWidth?: number;
2512
+ 'maxWidth'?: number;
329
2513
  [x: string]: any;
330
2514
  }
331
2515
 
332
- interface IconFont {
2516
+ interface SubPackage {
2517
+ /**
2518
+ * 子包的根目录
2519
+ */
2520
+ root: string;
2521
+ /**
2522
+ * 子包由哪些页面组成,参数同 pages
2523
+ */
2524
+ pages: PageMetaDatum[];
2525
+ }
2526
+ type SubPackages = SubPackage[];
2527
+
2528
+ interface TabBarIconFont {
333
2529
  /**
334
2530
  * 字库 Unicode 码
335
2531
  */
@@ -339,56 +2535,68 @@ interface IconFont {
339
2535
  */
340
2536
  selectedText?: string;
341
2537
  /**
342
- * 字体图标字号(px)
2538
+ * 字体图标字号,单位为 px
343
2539
  */
344
2540
  fontSize?: string;
345
2541
  /**
346
2542
  * 字体图标颜色
347
2543
  */
348
- color?: string;
2544
+ color?: HEXColor;
349
2545
  /**
350
2546
  * 字体图标选中颜色
351
2547
  */
352
- selectedColor?: string;
2548
+ selectedColor?: HEXColor;
2549
+ [x: string]: any;
353
2550
  }
354
2551
  interface TabBarItem {
355
2552
  /**
356
2553
  * 页面路径,必须在 pages 中先定义
357
2554
  */
358
- pagePath?: string;
2555
+ pagePath: string;
359
2556
  /**
360
- * tab 上按钮文字,在 App 和 H5 平台为非必填。例如中间可放一个没有文字的+号图标
2557
+ * tab 上按钮文字,在 App 和 H5 平台为非必填,例如中间可放一个没有文字的 + 号图标
361
2558
  */
362
2559
  text?: string;
363
2560
  /**
364
- * 图片路径,icon 大小限制为40kb,建议尺寸为 81px * 81px,
365
- * 当 position 为 top 时,此参数无效,不支持网络图片,不支持字体图标
2561
+ * 图片路径,icon 大小限制为 40 kb,建议尺寸为 81px * 81px
2562
+ *
2563
+ * 当 position 为 "top" 时,此参数无效
2564
+ *
2565
+ * 不支持网络图片,不支持字体图标
366
2566
  */
367
2567
  iconPath?: string;
368
2568
  /**
369
- * 选中时的图片路径,icon 大小限制为40kb,建议尺寸为 81px * 81px ,当 position 为 top 时,此参数无效
2569
+ * 选中时的图片路径,icon 大小限制为 40 kb,建议尺寸为 81px * 81px
2570
+ *
2571
+ * 当 position 为 "top" 时,此参数无效
2572
+ *
2573
+ * 不支持网络图片,不支持字体图标
370
2574
  */
371
2575
  selectedIconPath?: string;
372
2576
  /**
373
2577
  * 该项是否显示,默认显示
2578
+ *
374
2579
  * @desc App (3.2.10+)、H5 (3.2.10+)
375
2580
  */
376
2581
  visible?: boolean;
377
2582
  /**
378
2583
  * 字体图标,优先级高于 iconPath
2584
+ *
379
2585
  * @desc App(3.4.4+)、H5 (3.5.3+)
380
2586
  */
381
- iconfont?: IconFont;
2587
+ iconfont?: TabBarIconFont;
382
2588
  [x: string]: any;
383
2589
  }
384
- interface MidButton {
2590
+ interface TabBarMidButton {
385
2591
  /**
386
2592
  * 中间按钮的宽度,tabBar 其它项为减去此宽度后平分,默认值为与其它项平分宽度
2593
+ *
387
2594
  * @default "80px"
388
2595
  */
389
2596
  width?: string;
390
2597
  /**
391
2598
  * 中间按钮的高度,可以大于 tabBar 高度,达到中间凸起的效果
2599
+ *
392
2600
  * @default "50px"
393
2601
  */
394
2602
  height?: string;
@@ -402,6 +2610,7 @@ interface MidButton {
402
2610
  iconPath?: string;
403
2611
  /**
404
2612
  * 图片宽度(高度等比例缩放)
2613
+ *
405
2614
  * @default "24px"
406
2615
  */
407
2616
  iconWidth?: string;
@@ -411,79 +2620,131 @@ interface MidButton {
411
2620
  backgroundImage?: string;
412
2621
  /**
413
2622
  * 字体图标,优先级高于 iconPath
2623
+ *
2624
+ * @desc App (3.4.4+)
414
2625
  */
415
- iconfont?: IconFont;
2626
+ iconfont?: TabBarIconFont;
2627
+ [x: string]: any;
416
2628
  }
417
2629
  interface TabBar {
418
2630
  /**
419
2631
  * tab 上的文字默认颜色
2632
+ *
2633
+ * @format color
420
2634
  */
421
- color?: Color | ThemeColor;
2635
+ color: HEXColor;
422
2636
  /**
423
2637
  * tab 上的文字选中时的颜色
2638
+ *
2639
+ * @format color
424
2640
  */
425
- selectedColor?: Color | ThemeColor;
2641
+ selectedColor: HEXColor;
426
2642
  /**
427
2643
  * tab 的背景色
2644
+ *
2645
+ * @format color
428
2646
  */
429
- backgroundColor?: Color | ThemeColor;
2647
+ backgroundColor?: HEXColor;
430
2648
  /**
431
- * tabbar 上边框的颜色,可选值 black/white,也支持其他颜色值
2649
+ * tabBar 上边框的颜色
2650
+ *
432
2651
  * @default "black"
433
- * @desc App 2.3.4+ 、H5 3.0.0+
2652
+ *
2653
+ * @desc App 2.3.4+、H5 3.0.0+
2654
+ *
2655
+ * @format color
434
2656
  */
435
- borderStyle?: string | ThemeColor;
2657
+ borderStyle?: 'black' | 'white' | HEXColor;
436
2658
  /**
437
- * iOS 高斯模糊效果,可选值 dark/extralight/light/none(参考?:使用说明)
2659
+ * iOS 高斯模糊效果,参考 [使用说明](https://ask.dcloud.net.cn/article/36617)
2660
+ *
438
2661
  * @default "none"
439
- * @desc App 2.4.0+ 支持、H5 3.0.0+(只有最新版浏览器才支持)
2662
+ *
2663
+ * @desc App 2.4.0+、H5 3.0.0+(只有最新版浏览器才支持)
440
2664
  */
441
- blurEffect?: string;
2665
+ blurEffect?: 'dark' | 'extralight' | 'light' | 'none';
442
2666
  /**
443
- * tab 的列表,详见 list 属性说明,最少2个、最多5个 tab
2667
+ * tab 列表,最少 2个,最多 5 个
2668
+ *
444
2669
  * @type {TabBarItem[]}
445
2670
  */
446
2671
  list: [TabBarItem, TabBarItem, TabBarItem?, TabBarItem?, TabBarItem?];
447
2672
  /**
448
- * 可选值 bottom、top
2673
+ * tab 位置
2674
+ *
449
2675
  * @default "bottom"
450
- * @desc top 值仅微信小程序支持
2676
+ *
2677
+ * @desc "top" 仅微信小程序支持
451
2678
  */
452
- position?: string;
2679
+ position?: 'bottom' | 'top';
453
2680
  /**
454
2681
  * 文字默认大小
2682
+ *
455
2683
  * @default "10px"
2684
+ *
456
2685
  * @desc App 2.3.4+、H5 3.0.0+
457
2686
  */
458
2687
  fontSize?: string;
459
2688
  /**
460
2689
  * 图标默认宽度(高度等比例缩放)
2690
+ *
461
2691
  * @default "24px"
2692
+ *
462
2693
  * @desc App 2.3.4+、H5 3.0.0+
463
2694
  */
464
2695
  iconWidth?: string;
465
2696
  /**
466
2697
  * 图标和文字的间距
2698
+ *
467
2699
  * @default "3px"
2700
+ *
468
2701
  * @desc App 2.3.4+、H5 3.0.0+
469
2702
  */
470
2703
  spacing?: string;
471
2704
  /**
472
2705
  * tabBar 默认高度
2706
+ *
473
2707
  * @default "50px"
2708
+ *
474
2709
  * @desc App 2.3.4+、H5 3.0.0+
475
2710
  */
476
2711
  height?: string;
477
2712
  /**
478
2713
  * 中间按钮 仅在 list 项为偶数时有效
2714
+ *
479
2715
  * @desc App 2.3.4+、H5 3.0.0+
480
2716
  */
481
- midButton?: MidButton;
2717
+ midButton?: TabBarMidButton;
482
2718
  /**
483
- * list设置 iconfont 属性时,需要指定字体文件路径
2719
+ * list 设置 iconfont 属性时,需要指定字体文件路径
2720
+ *
484
2721
  * @desc App 3.4.4+、H5 3.5.3+
485
2722
  */
486
2723
  iconfontSrc?: string;
2724
+ /**
2725
+ * 设置背景图片,优先级高于 backgroundColor
2726
+ */
2727
+ backgroundImage?: string;
2728
+ /**
2729
+ * 设置标题栏的背景图平铺方式
2730
+ *
2731
+ * "repeat" 背景图片在垂直方向和水平方向平铺
2732
+ *
2733
+ * "repeat-x" 背景图片在水平方向平铺,垂直方向拉伸
2734
+ *
2735
+ * "repeat-y" 背景图片在垂直方向平铺,水平方向拉伸
2736
+ *
2737
+ * "no-repeat" 背景图片在垂直方向和水平方向都拉伸
2738
+ *
2739
+ * @default "no-repeat"
2740
+ */
2741
+ backgroundRepeat?: 'no-repeat' | 'repeat' | 'repeat-x' | 'repeat-y';
2742
+ /**
2743
+ * tabBar上红点颜色
2744
+ *
2745
+ * @format color
2746
+ */
2747
+ redDotColor?: string;
487
2748
  [x: string]: any;
488
2749
  }
489
2750
 
@@ -493,92 +2754,60 @@ interface TheWindow {
493
2754
  */
494
2755
  path: string;
495
2756
  /**
496
- * 配置页面窗口表现,配置项参考下方 pageStyle
2757
+ * 配置页面窗口表现,配置项参考 [pageStyle](https://uniapp.dcloud.net.cn/collocation/pages#style)
497
2758
  */
498
2759
  style?: GlobalStyle;
499
2760
  /**
500
- * 配置显示该窗口的规则,配置项参考下方 matchMedia
2761
+ * 配置显示该窗口的规则,配置项参考 [matchMedia](https://uniapp.dcloud.net.cn/collocation/pages#matchmedia)
501
2762
  */
502
2763
  matchMedia?: {
503
2764
  /**
504
2765
  * 当设备可见区域宽度 >= minWidth 时,显示该 window
505
- * @default "768"
2766
+ *
2767
+ * @default 768
506
2768
  */
507
2769
  minWidth?: number;
508
2770
  };
509
2771
  }
510
- interface PreloadRule {
511
- /**
512
- * 进入页面后预下载分包的 root 或 name。__APP__ 表示主包。
513
- */
514
- packages?: string[];
515
- /**
516
- * 在指定网络下预下载,可选值为:all(不限网络)、wifi(仅wifi下预下载)
517
- * @default "wifi"
518
- */
519
- network?: string;
520
- }
2772
+
521
2773
  interface UniIdRouter {
522
2774
  /**
523
2775
  * 登录页面路径
2776
+ *
2777
+ * @example "pages/index/index"
524
2778
  */
525
2779
  loginPage: string;
526
2780
  /**
527
2781
  * 需要登录才可以访问的页面列表,可以使用正则语法
2782
+ *
2783
+ * @example ["pages/detail/.*"]
528
2784
  */
529
2785
  needLogin: string[];
530
2786
  /**
531
- * 是否自动解析云对象及 clientDB 的错误码,如果是客户端 token 不正确或 token 过期则自动跳转配置的登录页面
2787
+ * 是否是否自动解析云对象及 clientDB 的错误码,如果是客户端 token 不正确或 token 过期则自动跳转配置的登录页面
532
2788
  *
533
2789
  * @default true
534
2790
  */
535
2791
  resToLogin?: boolean;
536
2792
  }
537
- interface SubPackage {
538
- /**
539
- * 子包的根目录
540
- */
541
- root?: string;
542
- /**
543
- * 子包由哪些页面组成,参数同 pages
544
- */
545
- pages?: any[];
546
- }
547
- interface ConditionItem {
548
- /**
549
- * 启动模式名称
550
- */
551
- name?: string;
552
- /**
553
- * 启动页面路径
554
- */
555
- path: string;
556
- /**
557
- * 启动参数,可在页面的 onLoad 函数里获得
558
- */
559
- query?: string;
560
- }
561
- interface Condition {
562
- /**
563
- * 当前激活的模式,list节点的索引值
564
- */
565
- current?: number;
2793
+
2794
+ /**
2795
+ * 对 uni-app 进行全局配置,决定页面文件的路径、窗口样式、原生的导航栏、底部的原生 tabBar 等,类似微信小程序中 app.json 的页面管理部分
2796
+ *
2797
+ * 注意定位权限申请等原属于 app.json 的内容,需要在 manifest 中配置
2798
+ */
2799
+ interface PagesConfig {
566
2800
  /**
567
- * 启动模式列表
2801
+ * 设置默认页面的窗口表现
568
2802
  */
569
- list?: Partial<ConditionItem>[];
570
- }
571
- interface PagesConfig {
2803
+ globalStyle?: GlobalStyle;
572
2804
  /**
573
2805
  * 设置页面路径及窗口表现
574
2806
  */
575
2807
  pages?: PageMetaDatum[];
576
- /**
577
- * 设置默认页面的窗口表现
578
- */
579
- globalStyle?: GlobalStyle;
580
2808
  /**
581
2809
  * 组件自动引入规则
2810
+ *
582
2811
  * @desc 2.5.5+
583
2812
  */
584
2813
  easycom?: EasyCom;
@@ -587,46 +2816,90 @@ interface PagesConfig {
587
2816
  */
588
2817
  tabBar?: TabBar;
589
2818
  /**
590
- * 启动模式配置
2819
+ * 启动模式配置,仅开发期间生效
591
2820
  */
592
2821
  condition?: Condition;
593
2822
  /**
594
2823
  * 分包加载配置
2824
+ *
2825
+ * @desc H5 不支持
595
2826
  */
596
- subPackages?: SubPackage[];
2827
+ subPackages?: SubPackages;
597
2828
  /**
598
2829
  * 分包预下载规则
2830
+ *
599
2831
  * @desc 微信小程序
600
2832
  */
601
2833
  preloadRule?: {
602
- [path: string]: PreloadRule;
2834
+ /**
2835
+ * 页面路径
2836
+ */
2837
+ [path: string]: {
2838
+ /**
2839
+ * 进入页面后预下载分包的 root 或 name
2840
+ *
2841
+ * __APP__ 表示主包
2842
+ */
2843
+ packages: string[];
2844
+ /**
2845
+ * 在指定网络下预下载
2846
+ *
2847
+ * "all" 不限网络
2848
+ *
2849
+ * "wifi" 仅 wifi 下预下载
2850
+ *
2851
+ * @default "wifi"
2852
+ */
2853
+ network?: 'all' | 'wifi';
2854
+ };
603
2855
  };
604
2856
  /**
605
2857
  * `Worker` 代码放置的目录
2858
+ *
606
2859
  * @desc 微信小程序
607
2860
  */
608
- workers?: any;
2861
+ workers?: string | {
2862
+ /**
2863
+ * `Worker` 代码放置的目录
2864
+ */
2865
+ path: string;
2866
+ /**
2867
+ * 是否打包为分包
2868
+ *
2869
+ * @desc 微信小程序基础库 v2.27.3
2870
+ *
2871
+ * @default false
2872
+ */
2873
+ isSubpackage?: boolean;
2874
+ };
609
2875
  /**
610
2876
  * 大屏左侧窗口
2877
+ *
611
2878
  * @desc H5
612
2879
  */
613
2880
  leftWindow?: TheWindow;
614
2881
  /**
615
2882
  * 大屏顶部窗口
2883
+ *
616
2884
  * @desc H5
617
2885
  */
618
2886
  topWindow?: TheWindow;
619
2887
  /**
620
2888
  * 大屏右侧窗口
2889
+ *
621
2890
  * @desc H5
622
2891
  */
623
2892
  rightWindow?: TheWindow;
624
2893
  /**
625
2894
  * 自动跳转相关配置,新增于 HBuilderX 3.5.0
2895
+ *
2896
+ * @desc uni-app 3.5.0+、uni-app-x 3.99+
626
2897
  */
627
2898
  uniIdRouter?: UniIdRouter;
628
2899
  /**
629
2900
  * 默认启动首页,新增于 HBuilderX 3.7.0
2901
+ *
2902
+ * @desc 微信小程序、支付宝小程序
630
2903
  */
631
2904
  entryPagePath?: string;
632
2905
  [x: string]: any;
@@ -848,4 +3121,4 @@ declare function getRouteBlock(path: string, blockStr: SFCBlock | undefined, opt
848
3121
 
849
3122
  declare function VitePluginUniPages(userOptions?: UserOptions): Plugin;
850
3123
 
851
- export { type Condition, type ConditionItem, type ConfigSource, type CustomBlock, type EasyCom, FILE_EXTENSIONS, type GlobalStyle, type IconFont, MODULE_ID_VIRTUAL, type MidButton, OUTPUT_NAME, type Options, PageContext, type PageMetaDatum, type PagePath, type PagesConfig, type PreloadRule, RESOLVED_MODULE_ID_VIRTUAL, type ResolvedOptions, type SubPackage, type SubPageMetaDatum, type TabBar, type TabBarItem, type TheWindow, type UniIdRouter, type UserOptions, type UserPagesConfig, VitePluginUniPages, checkPagesJsonFile, debug, type debugType, VitePluginUniPages as default, defineUniPages, extsToGlob, getPageFiles, getRouteBlock, getRouteSfcBlock, invalidatePagesModule, isTargetFile, mergePageMetaDataArray, parseCustomBlock, parseSFC, resolveOptions, resolvePageDirs, useCachedPages, writeFileSync };
3124
+ export { type Condition, type ConditionItem, type ConfigSource, type CustomBlock, type EasyCom, FILE_EXTENSIONS, type GlobalStyle, MODULE_ID_VIRTUAL, OUTPUT_NAME, type Options, PageContext, type PageMetaDatum, type PagePath, type PagesConfig, RESOLVED_MODULE_ID_VIRTUAL, type ResolvedOptions, type SubPackage, type SubPackages, type SubPageMetaDatum, type TabBar, type TabBarIconFont, type TabBarItem, type TabBarMidButton, type TheWindow, type UniIdRouter, type UserOptions, type UserPagesConfig, VitePluginUniPages, checkPagesJsonFile, debug, type debugType, VitePluginUniPages as default, defineUniPages, extsToGlob, getPageFiles, getRouteBlock, getRouteSfcBlock, invalidatePagesModule, isTargetFile, mergePageMetaDataArray, parseCustomBlock, parseSFC, resolveOptions, resolvePageDirs, useCachedPages, writeFileSync };