elegant-router.d.ts 12 KB

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