elegant-router.d.ts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. /* eslint-disable */
  2. /* prettier-ignore */
  3. // Generated by elegant-router
  4. // Read more: https://github.com/soybeanjs/elegant-router
  5. declare module "@elegant-router/types" {
  6. type ElegantConstRoute = import('@elegant-router/vue').ElegantConstRoute;
  7. /**
  8. * route layout
  9. */
  10. export type RouteLayout = "base" | "blank";
  11. /**
  12. * route map
  13. */
  14. export type RouteMap = {
  15. "root": "/";
  16. "not-found": "/:pathMatch(.*)*";
  17. "exception": "/exception";
  18. "exception_403": "/exception/403";
  19. "exception_404": "/exception/404";
  20. "exception_500": "/exception/500";
  21. "document": "/document";
  22. "document_project": "/document/project";
  23. "document_project-link": "/document/project-link";
  24. "document_video": "/document/video";
  25. "document_vue": "/document/vue";
  26. "document_vite": "/document/vite";
  27. "document_unocss": "/document/unocss";
  28. "document_naive": "/document/naive";
  29. "document_pro-naive": "/document/pro-naive";
  30. "document_antd": "/document/antd";
  31. "document_alova": "/document/alova";
  32. "403": "/403";
  33. "404": "/404";
  34. "500": "/500";
  35. "about": "/about";
  36. "config": "/config";
  37. "config_fright-config": "/config/fright-config";
  38. "config_order-splitting": "/config/order-splitting";
  39. "delivery": "/delivery";
  40. "delivery_normal-order": "/delivery/normal-order";
  41. "goods": "/goods";
  42. "goods_desk-category": "/goods/desk-category";
  43. "goods_store-goods": "/goods/store-goods";
  44. "goods_tag": "/goods/tag";
  45. "government": "/government";
  46. "government_government-list": "/government/government-list";
  47. "government_points": "/government/points";
  48. "government_user-list": "/government/user-list";
  49. "home": "/home";
  50. "iframe-page": "/iframe-page/:url";
  51. "login": "/login/:module(pwd-login|code-login|register|reset-pwd|bind-wechat)?";
  52. "manage": "/manage";
  53. "manage_config": "/manage/config";
  54. "manage_department": "/manage/department";
  55. "manage_log": "/manage/log";
  56. "manage_menu": "/manage/menu";
  57. "manage_role": "/manage/role";
  58. "manage_schedule": "/manage/schedule";
  59. "manage_user": "/manage/user";
  60. "operation": "/operation";
  61. "operation_advertisement": "/operation/advertisement";
  62. "operation_delivery-admin": "/operation/delivery-admin";
  63. "operation_search": "/operation/search";
  64. "plugin": "/plugin";
  65. "plugin_barcode": "/plugin/barcode";
  66. "plugin_charts": "/plugin/charts";
  67. "plugin_charts_antv": "/plugin/charts/antv";
  68. "plugin_charts_echarts": "/plugin/charts/echarts";
  69. "plugin_charts_vchart": "/plugin/charts/vchart";
  70. "plugin_copy": "/plugin/copy";
  71. "plugin_editor": "/plugin/editor";
  72. "plugin_editor_markdown": "/plugin/editor/markdown";
  73. "plugin_editor_quill": "/plugin/editor/quill";
  74. "plugin_excel": "/plugin/excel";
  75. "plugin_gantt": "/plugin/gantt";
  76. "plugin_gantt_dhtmlx": "/plugin/gantt/dhtmlx";
  77. "plugin_gantt_vtable": "/plugin/gantt/vtable";
  78. "plugin_icon": "/plugin/icon";
  79. "plugin_map": "/plugin/map";
  80. "plugin_pdf": "/plugin/pdf";
  81. "plugin_pinyin": "/plugin/pinyin";
  82. "plugin_print": "/plugin/print";
  83. "plugin_swiper": "/plugin/swiper";
  84. "plugin_tables": "/plugin/tables";
  85. "plugin_tables_vtable": "/plugin/tables/vtable";
  86. "plugin_typeit": "/plugin/typeit";
  87. "plugin_video": "/plugin/video";
  88. "pro-naive": "/pro-naive";
  89. "pro-naive_form": "/pro-naive/form";
  90. "pro-naive_form_basic": "/pro-naive/form/basic";
  91. "pro-naive_form_query": "/pro-naive/form/query";
  92. "pro-naive_form_step": "/pro-naive/form/step";
  93. "pro-naive_table": "/pro-naive/table";
  94. "pro-naive_table_remote": "/pro-naive/table/remote";
  95. "pro-naive_table_row-edit": "/pro-naive/table/row-edit";
  96. "store-management": "/store-management";
  97. "store-management_store-info": "/store-management/store-info";
  98. "user-center": "/user-center";
  99. "user-management": "/user-management";
  100. "user-management_user-list": "/user-management/user-list";
  101. };
  102. /**
  103. * route key
  104. */
  105. export type RouteKey = keyof RouteMap;
  106. /**
  107. * route path
  108. */
  109. export type RoutePath = RouteMap[RouteKey];
  110. /**
  111. * custom route key
  112. */
  113. export type CustomRouteKey = Extract<
  114. RouteKey,
  115. | "root"
  116. | "not-found"
  117. | "exception"
  118. | "exception_403"
  119. | "exception_404"
  120. | "exception_500"
  121. | "document"
  122. | "document_project"
  123. | "document_project-link"
  124. | "document_video"
  125. | "document_vue"
  126. | "document_vite"
  127. | "document_unocss"
  128. | "document_naive"
  129. | "document_pro-naive"
  130. | "document_antd"
  131. | "document_alova"
  132. >;
  133. /**
  134. * the generated route key
  135. */
  136. export type GeneratedRouteKey = Exclude<RouteKey, CustomRouteKey>;
  137. /**
  138. * the first level route key, which contain the layout of the route
  139. */
  140. export type FirstLevelRouteKey = Extract<
  141. RouteKey,
  142. | "403"
  143. | "404"
  144. | "500"
  145. | "about"
  146. | "config"
  147. | "delivery"
  148. | "goods"
  149. | "government"
  150. | "home"
  151. | "iframe-page"
  152. | "login"
  153. | "manage"
  154. | "operation"
  155. | "plugin"
  156. | "pro-naive"
  157. | "store-management"
  158. | "user-center"
  159. | "user-management"
  160. >;
  161. /**
  162. * the custom first level route key
  163. */
  164. export type CustomFirstLevelRouteKey = Extract<
  165. CustomRouteKey,
  166. | "root"
  167. | "not-found"
  168. | "exception"
  169. | "document"
  170. >;
  171. /**
  172. * the last level route key, which has the page file
  173. */
  174. export type LastLevelRouteKey = Extract<
  175. RouteKey,
  176. | "403"
  177. | "404"
  178. | "500"
  179. | "iframe-page"
  180. | "login"
  181. | "about"
  182. | "config_fright-config"
  183. | "config_order-splitting"
  184. | "delivery_normal-order"
  185. | "goods_desk-category"
  186. | "goods_store-goods"
  187. | "goods_tag"
  188. | "government_government-list"
  189. | "government_points"
  190. | "government_user-list"
  191. | "home"
  192. | "manage_config"
  193. | "manage_department"
  194. | "manage_log"
  195. | "manage_menu"
  196. | "manage_role"
  197. | "manage_schedule"
  198. | "manage_user"
  199. | "operation_advertisement"
  200. | "operation_delivery-admin"
  201. | "operation_search"
  202. | "plugin_barcode"
  203. | "plugin_charts_antv"
  204. | "plugin_charts_echarts"
  205. | "plugin_charts_vchart"
  206. | "plugin_copy"
  207. | "plugin_editor_markdown"
  208. | "plugin_editor_quill"
  209. | "plugin_excel"
  210. | "plugin_gantt_dhtmlx"
  211. | "plugin_gantt_vtable"
  212. | "plugin_icon"
  213. | "plugin_map"
  214. | "plugin_pdf"
  215. | "plugin_pinyin"
  216. | "plugin_print"
  217. | "plugin_swiper"
  218. | "plugin_tables_vtable"
  219. | "plugin_typeit"
  220. | "plugin_video"
  221. | "pro-naive_form_basic"
  222. | "pro-naive_form_query"
  223. | "pro-naive_form_step"
  224. | "pro-naive_table_remote"
  225. | "pro-naive_table_row-edit"
  226. | "store-management_store-info"
  227. | "user-center"
  228. | "user-management_user-list"
  229. >;
  230. /**
  231. * the custom last level route key
  232. */
  233. export type CustomLastLevelRouteKey = Extract<
  234. CustomRouteKey,
  235. | "root"
  236. | "not-found"
  237. | "exception_403"
  238. | "exception_404"
  239. | "exception_500"
  240. | "document_project"
  241. | "document_project-link"
  242. | "document_video"
  243. | "document_vue"
  244. | "document_vite"
  245. | "document_unocss"
  246. | "document_naive"
  247. | "document_pro-naive"
  248. | "document_antd"
  249. | "document_alova"
  250. >;
  251. /**
  252. * the single level route key
  253. */
  254. export type SingleLevelRouteKey = FirstLevelRouteKey & LastLevelRouteKey;
  255. /**
  256. * the custom single level route key
  257. */
  258. export type CustomSingleLevelRouteKey = CustomFirstLevelRouteKey & CustomLastLevelRouteKey;
  259. /**
  260. * the first level route key, but not the single level
  261. */
  262. export type FirstLevelRouteNotSingleKey = Exclude<FirstLevelRouteKey, SingleLevelRouteKey>;
  263. /**
  264. * the custom first level route key, but not the single level
  265. */
  266. export type CustomFirstLevelRouteNotSingleKey = Exclude<CustomFirstLevelRouteKey, CustomSingleLevelRouteKey>;
  267. /**
  268. * the center level route key
  269. */
  270. export type CenterLevelRouteKey = Exclude<GeneratedRouteKey, FirstLevelRouteKey | LastLevelRouteKey>;
  271. /**
  272. * the custom center level route key
  273. */
  274. export type CustomCenterLevelRouteKey = Exclude<CustomRouteKey, CustomFirstLevelRouteKey | CustomLastLevelRouteKey>;
  275. /**
  276. * the center level route key
  277. */
  278. type GetChildRouteKey<K extends RouteKey, T extends RouteKey = RouteKey> = T extends `${K}_${infer R}`
  279. ? R extends `${string}_${string}`
  280. ? never
  281. : T
  282. : never;
  283. /**
  284. * the single level route
  285. */
  286. type SingleLevelRoute<K extends SingleLevelRouteKey = SingleLevelRouteKey> = K extends string
  287. ? Omit<ElegantConstRoute, 'children'> & {
  288. name: K;
  289. path: RouteMap[K];
  290. component: `layout.${RouteLayout}$view.${K}`;
  291. }
  292. : never;
  293. /**
  294. * the last level route
  295. */
  296. type LastLevelRoute<K extends GeneratedRouteKey> = K extends LastLevelRouteKey
  297. ? Omit<ElegantConstRoute, 'children'> & {
  298. name: K;
  299. path: RouteMap[K];
  300. component: `view.${K}`;
  301. }
  302. : never;
  303. /**
  304. * the center level route
  305. */
  306. type CenterLevelRoute<K extends GeneratedRouteKey> = K extends CenterLevelRouteKey
  307. ? Omit<ElegantConstRoute, 'component'> & {
  308. name: K;
  309. path: RouteMap[K];
  310. children: (CenterLevelRoute<GetChildRouteKey<K>> | LastLevelRoute<GetChildRouteKey<K>>)[];
  311. }
  312. : never;
  313. /**
  314. * the multi level route
  315. */
  316. type MultiLevelRoute<K extends FirstLevelRouteNotSingleKey = FirstLevelRouteNotSingleKey> = K extends string
  317. ? ElegantConstRoute & {
  318. name: K;
  319. path: RouteMap[K];
  320. component: `layout.${RouteLayout}`;
  321. children: (CenterLevelRoute<GetChildRouteKey<K>> | LastLevelRoute<GetChildRouteKey<K>>)[];
  322. }
  323. : never;
  324. /**
  325. * the custom first level route
  326. */
  327. type CustomSingleLevelRoute<K extends CustomFirstLevelRouteKey = CustomFirstLevelRouteKey> = K extends string
  328. ? Omit<ElegantConstRoute, 'children'> & {
  329. name: K;
  330. path: RouteMap[K];
  331. component?: `layout.${RouteLayout}$view.${LastLevelRouteKey}`;
  332. }
  333. : never;
  334. /**
  335. * the custom last level route
  336. */
  337. type CustomLastLevelRoute<K extends CustomRouteKey> = K extends CustomLastLevelRouteKey
  338. ? Omit<ElegantConstRoute, 'children'> & {
  339. name: K;
  340. path: RouteMap[K];
  341. component?: `view.${LastLevelRouteKey}`;
  342. }
  343. : never;
  344. /**
  345. * the custom center level route
  346. */
  347. type CustomCenterLevelRoute<K extends CustomRouteKey> = K extends CustomCenterLevelRouteKey
  348. ? Omit<ElegantConstRoute, 'component'> & {
  349. name: K;
  350. path: RouteMap[K];
  351. children: (CustomCenterLevelRoute<GetChildRouteKey<K>> | CustomLastLevelRoute<GetChildRouteKey<K>>)[];
  352. }
  353. : never;
  354. /**
  355. * the custom multi level route
  356. */
  357. type CustomMultiLevelRoute<K extends CustomFirstLevelRouteNotSingleKey = CustomFirstLevelRouteNotSingleKey> =
  358. K extends string
  359. ? ElegantConstRoute & {
  360. name: K;
  361. path: RouteMap[K];
  362. component: `layout.${RouteLayout}`;
  363. children: (CustomCenterLevelRoute<GetChildRouteKey<K>> | CustomLastLevelRoute<GetChildRouteKey<K>>)[];
  364. }
  365. : never;
  366. /**
  367. * the custom route
  368. */
  369. type CustomRoute = CustomSingleLevelRoute | CustomMultiLevelRoute;
  370. /**
  371. * the generated route
  372. */
  373. type GeneratedRoute = SingleLevelRoute | MultiLevelRoute;
  374. /**
  375. * the elegant route
  376. */
  377. type ElegantRoute = GeneratedRoute | CustomRoute;
  378. }