@dcf-micro/typings 5.5.9

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.
@@ -0,0 +1,415 @@
1
+ import { ComputedRef, MaybeRef, Component } from 'vue';
2
+ import { RouteRecordRaw, RouteLocationNormalized, Router } from 'vue-router';
3
+ export { RouteRecordRaw } from 'vue-router';
4
+
5
+ type LayoutType =
6
+ | 'full-content'
7
+ | 'header-mixed-nav'
8
+ | 'header-nav'
9
+ | 'header-sidebar-nav'
10
+ | 'mixed-nav'
11
+ | 'sidebar-mixed-nav'
12
+ | 'sidebar-nav';
13
+
14
+ type ThemeModeType = 'auto' | 'dark' | 'light';
15
+
16
+ /**
17
+ * 偏好设置按钮位置
18
+ * fixed 固定在右侧
19
+ * header 顶栏
20
+ * auto 自动
21
+ */
22
+ type PreferencesButtonPositionType = 'auto' | 'fixed' | 'header';
23
+
24
+ type BuiltinThemeType =
25
+ | 'custom'
26
+ | 'deep-blue'
27
+ | 'deep-green'
28
+ | 'default'
29
+ | 'gray'
30
+ | 'green'
31
+ | 'neutral'
32
+ | 'orange'
33
+ | 'pink'
34
+ | 'red'
35
+ | 'rose'
36
+ | 'sky-blue'
37
+ | 'slate'
38
+ | 'stone'
39
+ | 'violet'
40
+ | 'yellow'
41
+ | 'zinc'
42
+ | (Record<never, never> & string);
43
+
44
+ type ContentCompactType = 'compact' | 'wide';
45
+
46
+ type LayoutHeaderModeType = 'auto' | 'auto-scroll' | 'fixed' | 'static';
47
+ type LayoutHeaderMenuAlignType = 'center' | 'end' | 'start';
48
+
49
+ /**
50
+ * 登录过期模式
51
+ * modal 弹窗模式
52
+ * page 页面模式
53
+ */
54
+ type LoginExpiredModeType = 'modal' | 'page';
55
+
56
+ /**
57
+ * 面包屑样式
58
+ * background 背景
59
+ * normal 默认
60
+ */
61
+ type BreadcrumbStyleType = 'background' | 'normal';
62
+
63
+ /**
64
+ * 权限模式
65
+ * backend 后端权限模式
66
+ * frontend 前端权限模式
67
+ * mixed 混合权限模式
68
+ */
69
+ type AccessModeType = 'backend' | 'frontend' | 'mixed';
70
+
71
+ /**
72
+ * 导航风格
73
+ * plain 朴素
74
+ * rounded 圆润
75
+ */
76
+ type NavigationStyleType = 'plain' | 'rounded';
77
+
78
+ /**
79
+ * 标签栏风格
80
+ * brisk 轻快
81
+ * card 卡片
82
+ * chrome 谷歌
83
+ * plain 朴素
84
+ */
85
+ type TabsStyleType = 'brisk' | 'card' | 'chrome' | 'plain';
86
+
87
+ /**
88
+ * 页面切换动画
89
+ */
90
+ type PageTransitionType = 'fade' | 'fade-down' | 'fade-slide' | 'fade-up';
91
+
92
+ /**
93
+ * 页面切换动画
94
+ * panel-center 居中布局
95
+ * panel-left 居左布局
96
+ * panel-right 居右布局
97
+ */
98
+ type AuthPageLayoutType = 'panel-center' | 'panel-left' | 'panel-right';
99
+
100
+ interface BasicOption {
101
+ label: string;
102
+ value: string;
103
+ }
104
+
105
+ type SelectOption = BasicOption;
106
+
107
+ type TabOption = BasicOption;
108
+
109
+ interface BasicUserInfo {
110
+ /**
111
+ * 头像
112
+ */
113
+ avatar: string;
114
+ /**
115
+ * 用户昵称
116
+ */
117
+ realName: string;
118
+ /**
119
+ * 用户角色
120
+ */
121
+ roles?: string[];
122
+ /**
123
+ * 用户id
124
+ */
125
+ userId: string;
126
+ /**
127
+ * 用户名
128
+ */
129
+ username: string;
130
+ }
131
+
132
+ type ClassType = Array<object | string> | object | string;
133
+
134
+ /**
135
+ * 深层递归所有属性为可选
136
+ */
137
+ type DeepPartial<T> = T extends object
138
+ ? {
139
+ [P in keyof T]?: DeepPartial<T[P]>;
140
+ }
141
+ : T;
142
+
143
+ /**
144
+ * 深层递归所有属性为只读
145
+ */
146
+ type DeepReadonly<T> = {
147
+ readonly [P in keyof T]: T[P] extends object ? DeepReadonly<T[P]> : T[P];
148
+ };
149
+
150
+ /**
151
+ * 任意类型的异步函数
152
+ */
153
+
154
+ type AnyPromiseFunction<T extends any[] = any[], R = void> = (
155
+ ...arg: T
156
+ ) => PromiseLike<R>;
157
+
158
+ /**
159
+ * 任意类型的普通函数
160
+ */
161
+ type AnyNormalFunction<T extends any[] = any[], R = void> = (...arg: T) => R;
162
+
163
+ /**
164
+ * 任意类型的函数
165
+ */
166
+ type AnyFunction<T extends any[] = any[], R = void> =
167
+ | AnyNormalFunction<T, R>
168
+ | AnyPromiseFunction<T, R>;
169
+
170
+ /**
171
+ * T | null 包装
172
+ */
173
+ type Nullable<T> = null | T;
174
+
175
+ /**
176
+ * T | Not null 包装
177
+ */
178
+ type NonNullable<T> = T extends null | undefined ? never : T;
179
+
180
+ /**
181
+ * 字符串类型对象
182
+ */
183
+ type Recordable$1<T> = Record<string, T>;
184
+
185
+ /**
186
+ * 字符串类型对象(只读)
187
+ */
188
+ interface ReadonlyRecordable<T = any> {
189
+ readonly [key: string]: T;
190
+ }
191
+
192
+ /**
193
+ * setTimeout 返回值类型
194
+ */
195
+ type TimeoutHandle = ReturnType<typeof setTimeout>;
196
+
197
+ /**
198
+ * setInterval 返回值类型
199
+ */
200
+ type IntervalHandle = ReturnType<typeof setInterval>;
201
+
202
+ /**
203
+ * 也许它是一个计算的 ref,或者一个 getter 函数
204
+ *
205
+ */
206
+ type MaybeReadonlyRef<T> = (() => T) | ComputedRef<T>;
207
+
208
+ /**
209
+ * 也许它是一个 ref,或者一个普通值,或者一个 getter 函数
210
+ *
211
+ */
212
+ type MaybeComputedRef<T> = MaybeReadonlyRef<T> | MaybeRef<T>;
213
+
214
+ type Merge<O extends object, T extends object> = {
215
+ [K in keyof O | keyof T]: K extends keyof T
216
+ ? T[K]
217
+ : K extends keyof O
218
+ ? O[K]
219
+ : never;
220
+ };
221
+
222
+ /**
223
+ * T = [
224
+ * { name: string; age: number; },
225
+ * { sex: 'male' | 'female'; age: string }
226
+ * ]
227
+ * =>
228
+ * MergeAll<T> = {
229
+ * name: string;
230
+ * sex: 'male' | 'female';
231
+ * age: string
232
+ * }
233
+ */
234
+ type MergeAll<
235
+ T extends object[],
236
+ R extends object = Record<string, any>,
237
+ > = T extends [infer F extends object, ...infer Rest extends object[]]
238
+ ? MergeAll<Rest, Merge<R, F>>
239
+ : R;
240
+
241
+ type EmitType = (name: Name, ...args: any[]) => void;
242
+
243
+ type MaybePromise<T> = Promise<T> | T;
244
+
245
+ type ExRouteRecordRaw = RouteRecordRaw & {
246
+ parent?: string;
247
+ parents?: string[];
248
+ path?: any;
249
+ };
250
+ interface MenuRecordBadgeRaw {
251
+ badge?: string;
252
+ badgeType?: 'dot' | 'normal';
253
+ badgeVariants?: 'destructive' | 'primary' | string;
254
+ }
255
+ interface MenuRecordRaw extends MenuRecordBadgeRaw {
256
+ activeIcon?: string;
257
+ children?: MenuRecordRaw[];
258
+ disabled?: boolean;
259
+ icon?: Component | string;
260
+ name: string;
261
+ order?: number;
262
+ parent?: string;
263
+ parents?: string[];
264
+ path: string;
265
+ show?: boolean;
266
+ }
267
+
268
+ interface TabDefinition extends RouteLocationNormalized {
269
+ key?: string;
270
+ }
271
+
272
+ interface RouteMeta {
273
+ /**
274
+ * 激活图标(菜单/tab)
275
+ */
276
+ activeIcon?: string;
277
+ /**
278
+ * 当前激活的菜单,有时候不想激活现有菜单,需要激活父级菜单时使用
279
+ */
280
+ activePath?: string;
281
+ /**
282
+ * 是否固定标签页
283
+ * @default false
284
+ */
285
+ affixTab?: boolean;
286
+ /**
287
+ * 固定标签页的顺序
288
+ * @default 0
289
+ */
290
+ affixTabOrder?: number;
291
+ /**
292
+ * 需要特定的角色标识才可以访问
293
+ * @default []
294
+ */
295
+ authority?: string[];
296
+ /**
297
+ * 徽标
298
+ */
299
+ badge?: string;
300
+ /**
301
+ * 徽标类型
302
+ */
303
+ badgeType?: 'dot' | 'normal';
304
+ /**
305
+ * 徽标颜色
306
+ */
307
+ badgeVariants?:
308
+ | 'default'
309
+ | 'destructive'
310
+ | 'primary'
311
+ | 'success'
312
+ | 'warning'
313
+ | string;
314
+ /**
315
+ * 路由的完整路径作为key(默认true)
316
+ */
317
+ fullPathKey?: boolean;
318
+ /**
319
+ * 当前路由的子级在菜单中不展现
320
+ * @default false
321
+ */
322
+ hideChildrenInMenu?: boolean;
323
+ /**
324
+ * 当前路由在面包屑中不展现
325
+ * @default false
326
+ */
327
+ hideInBreadcrumb?: boolean;
328
+ /**
329
+ * 当前路由在菜单中不展现
330
+ * @default false
331
+ */
332
+ hideInMenu?: boolean;
333
+ /**
334
+ * 当前路由在标签页不展现
335
+ * @default false
336
+ */
337
+ hideInTab?: boolean;
338
+ /**
339
+ * 图标(菜单/tab)
340
+ */
341
+ icon?: Component | string;
342
+ /**
343
+ * iframe 地址
344
+ */
345
+ iframeSrc?: string;
346
+ /**
347
+ * 忽略权限,直接可以访问
348
+ * @default false
349
+ */
350
+ ignoreAccess?: boolean;
351
+ /**
352
+ * 开启KeepAlive缓存
353
+ */
354
+ keepAlive?: boolean;
355
+ /**
356
+ * 外链-跳转路径
357
+ */
358
+ link?: string;
359
+ /**
360
+ * 路由是否已经加载过
361
+ */
362
+ loaded?: boolean;
363
+ /**
364
+ * 标签页最大打开数量
365
+ * @default -1
366
+ */
367
+ maxNumOfOpenTab?: number;
368
+ /**
369
+ * 菜单可以看到,但是访问会被重定向到403
370
+ */
371
+ menuVisibleWithForbidden?: boolean;
372
+ /**
373
+ * 不使用基础布局(仅在顶级生效)
374
+ */
375
+ noBasicLayout?: boolean;
376
+ /**
377
+ * 在新窗口打开
378
+ */
379
+ openInNewWindow?: boolean;
380
+ /**
381
+ * 用于路由->菜单排序
382
+ */
383
+ order?: number;
384
+ /**
385
+ * 菜单所携带的参数
386
+ */
387
+ query?: Recordable;
388
+ /**
389
+ * 标题名称
390
+ */
391
+ title: string;
392
+ }
393
+
394
+ // 定义递归类型以将 RouteRecordRaw 的 component 属性更改为 string
395
+ type RouteRecordStringComponent<T = string> = Omit<
396
+ RouteRecordRaw,
397
+ 'children' | 'component'
398
+ > & {
399
+ children?: RouteRecordStringComponent<T>[];
400
+ component: T;
401
+ };
402
+
403
+ type ComponentRecordType = Record<string, () => Promise<Component>>;
404
+
405
+ interface GenerateMenuAndRoutesOptions {
406
+ fetchMenuListAsync?: () => Promise<RouteRecordStringComponent[]>;
407
+ forbiddenComponent?: RouteRecordRaw['component'];
408
+ layoutMap?: ComponentRecordType;
409
+ pageMap?: ComponentRecordType;
410
+ roles?: string[];
411
+ router: Router;
412
+ routes: RouteRecordRaw[];
413
+ }
414
+
415
+ export type { AccessModeType, AnyFunction, AnyNormalFunction, AnyPromiseFunction, AuthPageLayoutType, BasicOption, BasicUserInfo, BreadcrumbStyleType, BuiltinThemeType, ClassType, ComponentRecordType, ContentCompactType, DeepPartial, DeepReadonly, EmitType, ExRouteRecordRaw, GenerateMenuAndRoutesOptions, IntervalHandle, LayoutHeaderMenuAlignType, LayoutHeaderModeType, LayoutType, LoginExpiredModeType, MaybeComputedRef, MaybePromise, MaybeReadonlyRef, MenuRecordBadgeRaw, MenuRecordRaw, Merge, MergeAll, NavigationStyleType, NonNullable, Nullable, PageTransitionType, PreferencesButtonPositionType, ReadonlyRecordable, Recordable$1 as Recordable, RouteMeta, RouteRecordStringComponent, SelectOption, TabDefinition, TabOption, TabsStyleType, ThemeModeType, TimeoutHandle };
@@ -0,0 +1,415 @@
1
+ import { ComputedRef, MaybeRef, Component } from 'vue';
2
+ import { RouteRecordRaw, RouteLocationNormalized, Router } from 'vue-router';
3
+ export { RouteRecordRaw } from 'vue-router';
4
+
5
+ type LayoutType =
6
+ | 'full-content'
7
+ | 'header-mixed-nav'
8
+ | 'header-nav'
9
+ | 'header-sidebar-nav'
10
+ | 'mixed-nav'
11
+ | 'sidebar-mixed-nav'
12
+ | 'sidebar-nav';
13
+
14
+ type ThemeModeType = 'auto' | 'dark' | 'light';
15
+
16
+ /**
17
+ * 偏好设置按钮位置
18
+ * fixed 固定在右侧
19
+ * header 顶栏
20
+ * auto 自动
21
+ */
22
+ type PreferencesButtonPositionType = 'auto' | 'fixed' | 'header';
23
+
24
+ type BuiltinThemeType =
25
+ | 'custom'
26
+ | 'deep-blue'
27
+ | 'deep-green'
28
+ | 'default'
29
+ | 'gray'
30
+ | 'green'
31
+ | 'neutral'
32
+ | 'orange'
33
+ | 'pink'
34
+ | 'red'
35
+ | 'rose'
36
+ | 'sky-blue'
37
+ | 'slate'
38
+ | 'stone'
39
+ | 'violet'
40
+ | 'yellow'
41
+ | 'zinc'
42
+ | (Record<never, never> & string);
43
+
44
+ type ContentCompactType = 'compact' | 'wide';
45
+
46
+ type LayoutHeaderModeType = 'auto' | 'auto-scroll' | 'fixed' | 'static';
47
+ type LayoutHeaderMenuAlignType = 'center' | 'end' | 'start';
48
+
49
+ /**
50
+ * 登录过期模式
51
+ * modal 弹窗模式
52
+ * page 页面模式
53
+ */
54
+ type LoginExpiredModeType = 'modal' | 'page';
55
+
56
+ /**
57
+ * 面包屑样式
58
+ * background 背景
59
+ * normal 默认
60
+ */
61
+ type BreadcrumbStyleType = 'background' | 'normal';
62
+
63
+ /**
64
+ * 权限模式
65
+ * backend 后端权限模式
66
+ * frontend 前端权限模式
67
+ * mixed 混合权限模式
68
+ */
69
+ type AccessModeType = 'backend' | 'frontend' | 'mixed';
70
+
71
+ /**
72
+ * 导航风格
73
+ * plain 朴素
74
+ * rounded 圆润
75
+ */
76
+ type NavigationStyleType = 'plain' | 'rounded';
77
+
78
+ /**
79
+ * 标签栏风格
80
+ * brisk 轻快
81
+ * card 卡片
82
+ * chrome 谷歌
83
+ * plain 朴素
84
+ */
85
+ type TabsStyleType = 'brisk' | 'card' | 'chrome' | 'plain';
86
+
87
+ /**
88
+ * 页面切换动画
89
+ */
90
+ type PageTransitionType = 'fade' | 'fade-down' | 'fade-slide' | 'fade-up';
91
+
92
+ /**
93
+ * 页面切换动画
94
+ * panel-center 居中布局
95
+ * panel-left 居左布局
96
+ * panel-right 居右布局
97
+ */
98
+ type AuthPageLayoutType = 'panel-center' | 'panel-left' | 'panel-right';
99
+
100
+ interface BasicOption {
101
+ label: string;
102
+ value: string;
103
+ }
104
+
105
+ type SelectOption = BasicOption;
106
+
107
+ type TabOption = BasicOption;
108
+
109
+ interface BasicUserInfo {
110
+ /**
111
+ * 头像
112
+ */
113
+ avatar: string;
114
+ /**
115
+ * 用户昵称
116
+ */
117
+ realName: string;
118
+ /**
119
+ * 用户角色
120
+ */
121
+ roles?: string[];
122
+ /**
123
+ * 用户id
124
+ */
125
+ userId: string;
126
+ /**
127
+ * 用户名
128
+ */
129
+ username: string;
130
+ }
131
+
132
+ type ClassType = Array<object | string> | object | string;
133
+
134
+ /**
135
+ * 深层递归所有属性为可选
136
+ */
137
+ type DeepPartial<T> = T extends object
138
+ ? {
139
+ [P in keyof T]?: DeepPartial<T[P]>;
140
+ }
141
+ : T;
142
+
143
+ /**
144
+ * 深层递归所有属性为只读
145
+ */
146
+ type DeepReadonly<T> = {
147
+ readonly [P in keyof T]: T[P] extends object ? DeepReadonly<T[P]> : T[P];
148
+ };
149
+
150
+ /**
151
+ * 任意类型的异步函数
152
+ */
153
+
154
+ type AnyPromiseFunction<T extends any[] = any[], R = void> = (
155
+ ...arg: T
156
+ ) => PromiseLike<R>;
157
+
158
+ /**
159
+ * 任意类型的普通函数
160
+ */
161
+ type AnyNormalFunction<T extends any[] = any[], R = void> = (...arg: T) => R;
162
+
163
+ /**
164
+ * 任意类型的函数
165
+ */
166
+ type AnyFunction<T extends any[] = any[], R = void> =
167
+ | AnyNormalFunction<T, R>
168
+ | AnyPromiseFunction<T, R>;
169
+
170
+ /**
171
+ * T | null 包装
172
+ */
173
+ type Nullable<T> = null | T;
174
+
175
+ /**
176
+ * T | Not null 包装
177
+ */
178
+ type NonNullable<T> = T extends null | undefined ? never : T;
179
+
180
+ /**
181
+ * 字符串类型对象
182
+ */
183
+ type Recordable$1<T> = Record<string, T>;
184
+
185
+ /**
186
+ * 字符串类型对象(只读)
187
+ */
188
+ interface ReadonlyRecordable<T = any> {
189
+ readonly [key: string]: T;
190
+ }
191
+
192
+ /**
193
+ * setTimeout 返回值类型
194
+ */
195
+ type TimeoutHandle = ReturnType<typeof setTimeout>;
196
+
197
+ /**
198
+ * setInterval 返回值类型
199
+ */
200
+ type IntervalHandle = ReturnType<typeof setInterval>;
201
+
202
+ /**
203
+ * 也许它是一个计算的 ref,或者一个 getter 函数
204
+ *
205
+ */
206
+ type MaybeReadonlyRef<T> = (() => T) | ComputedRef<T>;
207
+
208
+ /**
209
+ * 也许它是一个 ref,或者一个普通值,或者一个 getter 函数
210
+ *
211
+ */
212
+ type MaybeComputedRef<T> = MaybeReadonlyRef<T> | MaybeRef<T>;
213
+
214
+ type Merge<O extends object, T extends object> = {
215
+ [K in keyof O | keyof T]: K extends keyof T
216
+ ? T[K]
217
+ : K extends keyof O
218
+ ? O[K]
219
+ : never;
220
+ };
221
+
222
+ /**
223
+ * T = [
224
+ * { name: string; age: number; },
225
+ * { sex: 'male' | 'female'; age: string }
226
+ * ]
227
+ * =>
228
+ * MergeAll<T> = {
229
+ * name: string;
230
+ * sex: 'male' | 'female';
231
+ * age: string
232
+ * }
233
+ */
234
+ type MergeAll<
235
+ T extends object[],
236
+ R extends object = Record<string, any>,
237
+ > = T extends [infer F extends object, ...infer Rest extends object[]]
238
+ ? MergeAll<Rest, Merge<R, F>>
239
+ : R;
240
+
241
+ type EmitType = (name: Name, ...args: any[]) => void;
242
+
243
+ type MaybePromise<T> = Promise<T> | T;
244
+
245
+ type ExRouteRecordRaw = RouteRecordRaw & {
246
+ parent?: string;
247
+ parents?: string[];
248
+ path?: any;
249
+ };
250
+ interface MenuRecordBadgeRaw {
251
+ badge?: string;
252
+ badgeType?: 'dot' | 'normal';
253
+ badgeVariants?: 'destructive' | 'primary' | string;
254
+ }
255
+ interface MenuRecordRaw extends MenuRecordBadgeRaw {
256
+ activeIcon?: string;
257
+ children?: MenuRecordRaw[];
258
+ disabled?: boolean;
259
+ icon?: Component | string;
260
+ name: string;
261
+ order?: number;
262
+ parent?: string;
263
+ parents?: string[];
264
+ path: string;
265
+ show?: boolean;
266
+ }
267
+
268
+ interface TabDefinition extends RouteLocationNormalized {
269
+ key?: string;
270
+ }
271
+
272
+ interface RouteMeta {
273
+ /**
274
+ * 激活图标(菜单/tab)
275
+ */
276
+ activeIcon?: string;
277
+ /**
278
+ * 当前激活的菜单,有时候不想激活现有菜单,需要激活父级菜单时使用
279
+ */
280
+ activePath?: string;
281
+ /**
282
+ * 是否固定标签页
283
+ * @default false
284
+ */
285
+ affixTab?: boolean;
286
+ /**
287
+ * 固定标签页的顺序
288
+ * @default 0
289
+ */
290
+ affixTabOrder?: number;
291
+ /**
292
+ * 需要特定的角色标识才可以访问
293
+ * @default []
294
+ */
295
+ authority?: string[];
296
+ /**
297
+ * 徽标
298
+ */
299
+ badge?: string;
300
+ /**
301
+ * 徽标类型
302
+ */
303
+ badgeType?: 'dot' | 'normal';
304
+ /**
305
+ * 徽标颜色
306
+ */
307
+ badgeVariants?:
308
+ | 'default'
309
+ | 'destructive'
310
+ | 'primary'
311
+ | 'success'
312
+ | 'warning'
313
+ | string;
314
+ /**
315
+ * 路由的完整路径作为key(默认true)
316
+ */
317
+ fullPathKey?: boolean;
318
+ /**
319
+ * 当前路由的子级在菜单中不展现
320
+ * @default false
321
+ */
322
+ hideChildrenInMenu?: boolean;
323
+ /**
324
+ * 当前路由在面包屑中不展现
325
+ * @default false
326
+ */
327
+ hideInBreadcrumb?: boolean;
328
+ /**
329
+ * 当前路由在菜单中不展现
330
+ * @default false
331
+ */
332
+ hideInMenu?: boolean;
333
+ /**
334
+ * 当前路由在标签页不展现
335
+ * @default false
336
+ */
337
+ hideInTab?: boolean;
338
+ /**
339
+ * 图标(菜单/tab)
340
+ */
341
+ icon?: Component | string;
342
+ /**
343
+ * iframe 地址
344
+ */
345
+ iframeSrc?: string;
346
+ /**
347
+ * 忽略权限,直接可以访问
348
+ * @default false
349
+ */
350
+ ignoreAccess?: boolean;
351
+ /**
352
+ * 开启KeepAlive缓存
353
+ */
354
+ keepAlive?: boolean;
355
+ /**
356
+ * 外链-跳转路径
357
+ */
358
+ link?: string;
359
+ /**
360
+ * 路由是否已经加载过
361
+ */
362
+ loaded?: boolean;
363
+ /**
364
+ * 标签页最大打开数量
365
+ * @default -1
366
+ */
367
+ maxNumOfOpenTab?: number;
368
+ /**
369
+ * 菜单可以看到,但是访问会被重定向到403
370
+ */
371
+ menuVisibleWithForbidden?: boolean;
372
+ /**
373
+ * 不使用基础布局(仅在顶级生效)
374
+ */
375
+ noBasicLayout?: boolean;
376
+ /**
377
+ * 在新窗口打开
378
+ */
379
+ openInNewWindow?: boolean;
380
+ /**
381
+ * 用于路由->菜单排序
382
+ */
383
+ order?: number;
384
+ /**
385
+ * 菜单所携带的参数
386
+ */
387
+ query?: Recordable;
388
+ /**
389
+ * 标题名称
390
+ */
391
+ title: string;
392
+ }
393
+
394
+ // 定义递归类型以将 RouteRecordRaw 的 component 属性更改为 string
395
+ type RouteRecordStringComponent<T = string> = Omit<
396
+ RouteRecordRaw,
397
+ 'children' | 'component'
398
+ > & {
399
+ children?: RouteRecordStringComponent<T>[];
400
+ component: T;
401
+ };
402
+
403
+ type ComponentRecordType = Record<string, () => Promise<Component>>;
404
+
405
+ interface GenerateMenuAndRoutesOptions {
406
+ fetchMenuListAsync?: () => Promise<RouteRecordStringComponent[]>;
407
+ forbiddenComponent?: RouteRecordRaw['component'];
408
+ layoutMap?: ComponentRecordType;
409
+ pageMap?: ComponentRecordType;
410
+ roles?: string[];
411
+ router: Router;
412
+ routes: RouteRecordRaw[];
413
+ }
414
+
415
+ export type { AccessModeType, AnyFunction, AnyNormalFunction, AnyPromiseFunction, AuthPageLayoutType, BasicOption, BasicUserInfo, BreadcrumbStyleType, BuiltinThemeType, ClassType, ComponentRecordType, ContentCompactType, DeepPartial, DeepReadonly, EmitType, ExRouteRecordRaw, GenerateMenuAndRoutesOptions, IntervalHandle, LayoutHeaderMenuAlignType, LayoutHeaderModeType, LayoutType, LoginExpiredModeType, MaybeComputedRef, MaybePromise, MaybeReadonlyRef, MenuRecordBadgeRaw, MenuRecordRaw, Merge, MergeAll, NavigationStyleType, NonNullable, Nullable, PageTransitionType, PreferencesButtonPositionType, ReadonlyRecordable, Recordable$1 as Recordable, RouteMeta, RouteRecordStringComponent, SelectOption, TabDefinition, TabOption, TabsStyleType, ThemeModeType, TimeoutHandle };
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@dcf-micro/typings",
3
+ "version": "5.5.9",
4
+ "homepage": "https://github.com/vbenjs/vue-vben-admin",
5
+ "bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/vbenjs/vue-vben-admin.git",
9
+ "directory": "packages/@core/base/typings"
10
+ },
11
+ "license": "MIT",
12
+ "type": "module",
13
+ "scripts": {
14
+ "build": "pnpm unbuild"
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "main": "./dist/index.mjs",
20
+ "module": "./dist/index.mjs",
21
+ "types": "./dist/index.d.ts",
22
+ "exports": {
23
+ ".": {
24
+ "types": "./src/index.ts",
25
+ "development": "./src/index.ts",
26
+ "default": "./dist/index.mjs"
27
+ },
28
+ "./vue-router": {
29
+ "types": "./vue-router.d.ts"
30
+ }
31
+ },
32
+ "publishConfig": {
33
+ "exports": {
34
+ ".": {
35
+ "types": "./dist/index.d.ts",
36
+ "default": "./dist/index.mjs"
37
+ }
38
+ }
39
+ },
40
+ "dependencies": {
41
+ "vue": "catalog:",
42
+ "vue-router": "catalog:"
43
+ }
44
+ }