@@ -18,12 +18,33 @@ declare namespace Layui {
1818 } ;
1919 type LiteralUnion < LiteralType , BaseType extends Primitive > = LiteralType | ( BaseType & Record < never , never > ) ;
2020 type LiteralStringUnion < T > = LiteralUnion < T , string > ;
21+ type ObjectPathLeaf = Primitive | AnyFn | Date | Array < any > ;
22+ type DeepPath < T , Prefix extends string = "" > = {
23+ [ K in keyof T & string ] : T [ K ] extends ObjectPathLeaf ? `${Prefix } ${K } `
24+ : T [ K ] extends object ? DeepPath < T [ K ] , `${Prefix } ${K } .`>
25+ : never ;
26+ } [ keyof T & string ] ;
27+ type DeepType < T , Path extends string > = Path extends `${infer Key } .${infer Rest } `
28+ ? Key extends keyof T ? DeepType < T [ Key ] , Rest >
29+ : T extends any [ ] ? DeepType < T [ number ] , Rest >
30+ : never
31+ : Path extends keyof T ? T [ Path ]
32+ : T extends any [ ] ? T [ number ]
33+ : never ;
34+ type DeepPartial < T > = T extends AnyFn ? T
35+ : T extends Date ? T
36+ : T extends Array < infer U > ? Array < DeepPartial < U > >
37+ : T extends Map < infer K , infer V > ? Map < K , DeepPartial < V > >
38+ : T extends Set < infer U > ? Set < DeepPartial < U > >
39+ : T extends object ? { [ P in keyof T ] ?: DeepPartial < T [ P ] > }
40+ : T ;
2141
2242 type Selector = string ;
2343 type ExportsCallback = ( this : Layui , fn : ( app : string , exports : object ) => void ) => void ;
2444
2545 /**
26- * 全局属性
46+ * 全局配置选项
47+ * layui.config(options)
2748 */
2849 interface GlobalConfigOptions {
2950 /**
@@ -44,6 +65,22 @@ declare namespace Layui {
4465 base ?: string ;
4566 }
4667
68+ /**
69+ * window.LAYUI_GLOBAL
70+ */
71+ interface GlobalProperties {
72+ /**
73+ * 动态加载等特殊场景设置 layui 目录
74+ * @since 2.6.6
75+ */
76+ dir ?: string ;
77+ /**
78+ * 国际化消息对象
79+ * @since 2.13.0
80+ */
81+ i18n ?: I18nMessages ;
82+ }
83+
4784 /**
4885 * 缓存的所有数据
4986 */
@@ -98,6 +135,12 @@ declare namespace Layui {
98135 * @internal
99136 */
100137 all : any ;
138+ /**
139+ * 面包屑
140+ * @see https://layui.dev/docs/2/nav/#separator
141+ * @since 2.13.0
142+ */
143+ breadcrumb : Breadcrumb ;
101144 /**
102145 * 轮播
103146 * @see https://layui.dev/docs/2/carousel/
@@ -108,6 +151,12 @@ declare namespace Layui {
108151 * @see https://layui.dev/docs/2/code/
109152 */
110153 code : Code ;
154+ /**
155+ * 折叠面板
156+ * @see https://layui.dev/docs/2/panel/
157+ * @since 2.13.0
158+ */
159+ collapse : Collapse ;
111160 /**
112161 * 颜色选择器
113162 * @see https://layui.dev/docs/2/colorpicker/
@@ -132,7 +181,7 @@ declare namespace Layui {
132181 * @see https://layui.dev/docs/2/progress/ - 进度条
133182 * @see https://layui.dev/docs/2/nav/#separator - 面包屑
134183 */
135- element : Element ;
184+ element : LayElement ;
136185 /**
137186 * 流加载
138187 * @see https://layui.dev/docs/2/flow/
@@ -181,6 +230,18 @@ declare namespace Layui {
181230 * @internal
182231 */
183232 "layui.all" : string ;
233+ /**
234+ * 导航栏
235+ * @see https://layui.dev/docs/2/nav/
236+ * @since 2.13.0
237+ */
238+ nav : Nav ;
239+ /**
240+ * 进度条
241+ * @see https://layui.dev/docs/2/progress/
242+ * @since 2.13.0
243+ */
244+ progress : Progress ;
184245 /**
185246 * 评分
186247 * @see https://layui.dev/docs/2/rate/
@@ -192,6 +253,13 @@ declare namespace Layui {
192253 * @see https://layui.dev/docs/2/slider/
193254 */
194255 slider : Slider ;
256+ /**
257+ * 选项卡
258+ * @see https://layui.dev/docs/2/tab/
259+ * @since 2.13.0
260+ * @deprecated 已废弃,使用 {@link Tabs}
261+ */
262+ tab : Tab ;
195263 /**
196264 * 表格
197265 * @see https://layui.dev/docs/2/table
@@ -230,6 +298,12 @@ declare namespace Layui {
230298 * @see https://layui.dev/docs/2/util/
231299 */
232300 util : Util ;
301+ /**
302+ * 国际化
303+ * @see https://layui.dev/docs/2/i18n/
304+ * @since 2.12.0
305+ */
306+ i18n : I18n ;
233307 }
234308
235309 /**
0 commit comments