@skyroc/scripts 2.5.0

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.
Files changed (333) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +508 -0
  3. package/dist/cli.mjs +78 -0
  4. package/dist/config-BKkdncJS.mjs +987 -0
  5. package/dist/index.mjs +14 -0
  6. package/package.json +83 -0
  7. package/templates/admin/.env +62 -0
  8. package/templates/admin/.env.prod +7 -0
  9. package/templates/admin/.env.test +7 -0
  10. package/templates/admin/.oxlintrc.json +6 -0
  11. package/templates/admin/README.md +508 -0
  12. package/templates/admin/index.html +14 -0
  13. package/templates/admin/package.json +105 -0
  14. package/templates/admin/public/favicon.svg +3 -0
  15. package/templates/admin/src/App.tsx +71 -0
  16. package/templates/admin/src/assets/audio/wechat-style-notification.wav +0 -0
  17. package/templates/admin/src/assets/imgs/skyroc.jpg +0 -0
  18. package/templates/admin/src/assets/svg-icon/activity.svg +1 -0
  19. package/templates/admin/src/assets/svg-icon/at-sign.svg +1 -0
  20. package/templates/admin/src/assets/svg-icon/avatar.svg +1 -0
  21. package/templates/admin/src/assets/svg-icon/banner.svg +1 -0
  22. package/templates/admin/src/assets/svg-icon/cast.svg +1 -0
  23. package/templates/admin/src/assets/svg-icon/chrome.svg +1 -0
  24. package/templates/admin/src/assets/svg-icon/copy.svg +1 -0
  25. package/templates/admin/src/assets/svg-icon/custom-icon.svg +1 -0
  26. package/templates/admin/src/assets/svg-icon/empty-data.svg +1 -0
  27. package/templates/admin/src/assets/svg-icon/error.svg +1 -0
  28. package/templates/admin/src/assets/svg-icon/expectation.svg +1 -0
  29. package/templates/admin/src/assets/svg-icon/heart.svg +1 -0
  30. package/templates/admin/src/assets/svg-icon/logo.svg +15 -0
  31. package/templates/admin/src/assets/svg-icon/network-error.svg +1 -0
  32. package/templates/admin/src/assets/svg-icon/no-icon.svg +1 -0
  33. package/templates/admin/src/assets/svg-icon/no-permission.svg +1 -0
  34. package/templates/admin/src/assets/svg-icon/not-found.svg +1 -0
  35. package/templates/admin/src/assets/svg-icon/service-error.svg +1 -0
  36. package/templates/admin/src/bootstrap.tsx +60 -0
  37. package/templates/admin/src/components/SkyrocAvatar.tsx +13 -0
  38. package/templates/admin/src/components/SystemLogo.tsx +7 -0
  39. package/templates/admin/src/config.ts +125 -0
  40. package/templates/admin/src/features/antd/AntdProvider.tsx +21 -0
  41. package/templates/admin/src/features/auth/components/UserAvatar.tsx +76 -0
  42. package/templates/admin/src/features/auth/use-auth-form-rules.ts +83 -0
  43. package/templates/admin/src/features/auth/use-auth.ts +96 -0
  44. package/templates/admin/src/features/auth/use-login.ts +72 -0
  45. package/templates/admin/src/features/effects/GlobalEffect.tsx +15 -0
  46. package/templates/admin/src/features/menus/dynamic-routes.ts +10 -0
  47. package/templates/admin/src/features/menus/extras.ts +3 -0
  48. package/templates/admin/src/features/menus/menu-category.ts +14 -0
  49. package/templates/admin/src/features/menus/menu-config.ts +5 -0
  50. package/templates/admin/src/features/router/RouterProvider.tsx +18 -0
  51. package/templates/admin/src/features/router/guard.ts +97 -0
  52. package/templates/admin/src/features/router/index.ts +52 -0
  53. package/templates/admin/src/features/router/routeTree.gen.ts +237 -0
  54. package/templates/admin/src/features/router/router-ref.ts +24 -0
  55. package/templates/admin/src/locales/antd.ts +8 -0
  56. package/templates/admin/src/locales/index.ts +22 -0
  57. package/templates/admin/src/locales/sync.ts +14 -0
  58. package/templates/admin/src/main.tsx +9 -0
  59. package/templates/admin/src/pages/(admin)/home/index.tsx +46 -0
  60. package/templates/admin/src/pages/(admin)/layout.tsx +44 -0
  61. package/templates/admin/src/pages/(auth)/login/index.tsx +102 -0
  62. package/templates/admin/src/pages/(auth)/login/layout.tsx +71 -0
  63. package/templates/admin/src/pages/(auth)/login-out.tsx +27 -0
  64. package/templates/admin/src/pages/(errors)/403.tsx +16 -0
  65. package/templates/admin/src/pages/(errors)/404.tsx +16 -0
  66. package/templates/admin/src/pages/(errors)/500.tsx +16 -0
  67. package/templates/admin/src/pages/__root.tsx +54 -0
  68. package/templates/admin/src/pages/error.tsx +19 -0
  69. package/templates/admin/src/pages/index.tsx +14 -0
  70. package/templates/admin/src/pages/loading.tsx +45 -0
  71. package/templates/admin/src/pages/not-found.tsx +9 -0
  72. package/templates/admin/src/plugins/app.tsx +47 -0
  73. package/templates/admin/src/plugins/assets.ts +4 -0
  74. package/templates/admin/src/plugins/index.ts +32 -0
  75. package/templates/admin/src/service/adapter.ts +63 -0
  76. package/templates/admin/src/service/api/auth/api.ts +31 -0
  77. package/templates/admin/src/service/api/auth/hooks.ts +28 -0
  78. package/templates/admin/src/service/api/auth/index.ts +10 -0
  79. package/templates/admin/src/service/api/auth/keys.ts +7 -0
  80. package/templates/admin/src/service/api/auth/urls.ts +7 -0
  81. package/templates/admin/src/service/api/index.ts +2 -0
  82. package/templates/admin/src/service/api/route/api.ts +7 -0
  83. package/templates/admin/src/service/api/route/hooks.ts +21 -0
  84. package/templates/admin/src/service/api/route/index.ts +10 -0
  85. package/templates/admin/src/service/api/route/keys.ts +3 -0
  86. package/templates/admin/src/service/api/route/urls.ts +5 -0
  87. package/templates/admin/src/service/queryClient.ts +13 -0
  88. package/templates/admin/src/service/request/index.ts +62 -0
  89. package/templates/admin/src/styles/scss/global.scss +1 -0
  90. package/templates/admin/src/styles/scss/scrollbar.scss +28 -0
  91. package/templates/admin/src/types/auto-imports.d.ts +186 -0
  92. package/templates/admin/src/types/global.d.ts +16 -0
  93. package/templates/admin/src/types/router.d.ts +14 -0
  94. package/templates/admin/src/types/storage.d.ts +17 -0
  95. package/templates/admin/src/types/vite-env.d.ts +117 -0
  96. package/templates/admin/src/utils/common.tsx +38 -0
  97. package/templates/admin/src/utils/icon.ts +9 -0
  98. package/templates/admin/src/utils/service.ts +75 -0
  99. package/templates/admin/src/utils/storage.ts +7 -0
  100. package/templates/admin/tsconfig.json +22 -0
  101. package/templates/admin/uno.config.ts +18 -0
  102. package/templates/admin/vite.config.ts +13 -0
  103. package/templates/admin-shell/i18n/atoms/lang.ts +20 -0
  104. package/templates/admin-shell/i18n/config/default.ts +11 -0
  105. package/templates/admin-shell/i18n/features/lang/LangEffect.tsx +25 -0
  106. package/templates/admin-shell/i18n/features/lang/LangSwitch.tsx +49 -0
  107. package/templates/admin-shell/i18n/hooks/use-lang.ts +47 -0
  108. package/templates/admin-shell/i18n/i18n.ts +116 -0
  109. package/templates/admin-shell/i18n/index.ts +23 -0
  110. package/templates/admin-shell/i18n/langs/en-us/common.json +49 -0
  111. package/templates/admin-shell/i18n/langs/en-us/datatable.json +8 -0
  112. package/templates/admin-shell/i18n/langs/en-us/dropdown.json +9 -0
  113. package/templates/admin-shell/i18n/langs/en-us/form.json +27 -0
  114. package/templates/admin-shell/i18n/langs/en-us/icon.json +13 -0
  115. package/templates/admin-shell/i18n/langs/en-us/notification.json +20 -0
  116. package/templates/admin-shell/i18n/langs/en-us/page.json +442 -0
  117. package/templates/admin-shell/i18n/langs/en-us/request.json +8 -0
  118. package/templates/admin-shell/i18n/langs/en-us/route.json +84 -0
  119. package/templates/admin-shell/i18n/langs/en-us/system.json +9 -0
  120. package/templates/admin-shell/i18n/langs/en-us/theme.json +173 -0
  121. package/templates/admin-shell/i18n/langs/index.ts +63 -0
  122. package/templates/admin-shell/i18n/langs/zh-cn/common.json +49 -0
  123. package/templates/admin-shell/i18n/langs/zh-cn/datatable.json +8 -0
  124. package/templates/admin-shell/i18n/langs/zh-cn/dropdown.json +9 -0
  125. package/templates/admin-shell/i18n/langs/zh-cn/form.json +27 -0
  126. package/templates/admin-shell/i18n/langs/zh-cn/icon.json +13 -0
  127. package/templates/admin-shell/i18n/langs/zh-cn/notification.json +20 -0
  128. package/templates/admin-shell/i18n/langs/zh-cn/page.json +442 -0
  129. package/templates/admin-shell/i18n/langs/zh-cn/request.json +8 -0
  130. package/templates/admin-shell/i18n/langs/zh-cn/route.json +84 -0
  131. package/templates/admin-shell/i18n/langs/zh-cn/system.json +9 -0
  132. package/templates/admin-shell/i18n/langs/zh-cn/theme.json +173 -0
  133. package/templates/admin-shell/i18n/types/i18n.ts +29 -0
  134. package/templates/admin-shell/i18n/types.ts +53 -0
  135. package/templates/admin-shell/i18n/utils/helpers.ts +18 -0
  136. package/templates/admin-shell/layouts/AdminLayout.tsx +161 -0
  137. package/templates/admin-shell/layouts/constant.ts +56 -0
  138. package/templates/admin-shell/layouts/context.tsx +101 -0
  139. package/templates/admin-shell/layouts/features/menus/MenuBadge.tsx +76 -0
  140. package/templates/admin-shell/layouts/features/menus/dynamic-routes.ts +146 -0
  141. package/templates/admin-shell/layouts/features/menus/menu-generator.tsx +444 -0
  142. package/templates/admin-shell/layouts/features/menus/menu-renderer.tsx +149 -0
  143. package/templates/admin-shell/layouts/features/menus/permissions.ts +28 -0
  144. package/templates/admin-shell/layouts/features/menus/use-menus.ts +98 -0
  145. package/templates/admin-shell/layouts/features/use-route.ts +30 -0
  146. package/templates/admin-shell/layouts/index.ts +44 -0
  147. package/templates/admin-shell/layouts/materials/index.ts +6 -0
  148. package/templates/admin-shell/layouts/materials/libs/admin-layout/index.module.css +63 -0
  149. package/templates/admin-shell/layouts/materials/libs/admin-layout/index.module.css.d.ts +18 -0
  150. package/templates/admin-shell/layouts/materials/libs/admin-layout/index.tsx +238 -0
  151. package/templates/admin-shell/layouts/materials/libs/admin-layout/shared.ts +67 -0
  152. package/templates/admin-shell/layouts/materials/libs/page-tab/ButtonTab.tsx +44 -0
  153. package/templates/admin-shell/layouts/materials/libs/page-tab/ChromeTab.tsx +54 -0
  154. package/templates/admin-shell/layouts/materials/libs/page-tab/ChromeTabBg.tsx +30 -0
  155. package/templates/admin-shell/layouts/materials/libs/page-tab/SliderTab.tsx +44 -0
  156. package/templates/admin-shell/layouts/materials/libs/page-tab/SvgClose.tsx +51 -0
  157. package/templates/admin-shell/layouts/materials/libs/page-tab/hook.ts +34 -0
  158. package/templates/admin-shell/layouts/materials/libs/page-tab/index.module.css +120 -0
  159. package/templates/admin-shell/layouts/materials/libs/page-tab/index.module.css.d.ts +18 -0
  160. package/templates/admin-shell/layouts/materials/libs/page-tab/index.tsx +76 -0
  161. package/templates/admin-shell/layouts/materials/libs/page-tab/shared.ts +32 -0
  162. package/templates/admin-shell/layouts/materials/types/index.ts +322 -0
  163. package/templates/admin-shell/layouts/modules/AdminContent.tsx +285 -0
  164. package/templates/admin-shell/layouts/modules/AdminFooter.tsx +13 -0
  165. package/templates/admin-shell/layouts/modules/AdminLogo.tsx +28 -0
  166. package/templates/admin-shell/layouts/modules/AdminSider.tsx +50 -0
  167. package/templates/admin-shell/layouts/modules/admin-header/AdminHeader.tsx +132 -0
  168. package/templates/admin-shell/layouts/modules/admin-header/components/Breadcrumb.tsx +62 -0
  169. package/templates/admin-shell/layouts/modules/admin-header/components/ThemeButton.tsx +24 -0
  170. package/templates/admin-shell/layouts/modules/admin-menu/AdminMenu.tsx +37 -0
  171. package/templates/admin-shell/layouts/modules/admin-menu/components/FirstLevelMenu.tsx +156 -0
  172. package/templates/admin-shell/layouts/modules/admin-menu/components/HorizontalMenu.tsx +88 -0
  173. package/templates/admin-shell/layouts/modules/admin-menu/components/MenuPortal.tsx +28 -0
  174. package/templates/admin-shell/layouts/modules/admin-menu/components/VerticalMenu.tsx +123 -0
  175. package/templates/admin-shell/layouts/modules/admin-menu/enum.ts +47 -0
  176. package/templates/admin-shell/layouts/modules/admin-menu/modules/Horizontal.tsx +22 -0
  177. package/templates/admin-shell/layouts/modules/admin-menu/modules/TopHybridHeaderFirst.tsx +15 -0
  178. package/templates/admin-shell/layouts/modules/admin-menu/modules/TopHybridSidebarFirst.tsx +18 -0
  179. package/templates/admin-shell/layouts/modules/admin-menu/modules/Vertical.tsx +14 -0
  180. package/templates/admin-shell/layouts/modules/admin-menu/modules/VerticalHybridHeaderFirst.tsx +18 -0
  181. package/templates/admin-shell/layouts/modules/admin-menu/modules/VerticalMix.tsx +132 -0
  182. package/templates/admin-shell/layouts/modules/admin-search/AdminSearch.tsx +36 -0
  183. package/templates/admin-shell/layouts/modules/admin-search/components/SearchFooter.tsx +38 -0
  184. package/templates/admin-shell/layouts/modules/admin-search/components/SearchModal.tsx +171 -0
  185. package/templates/admin-shell/layouts/modules/admin-search/components/SearchResult.tsx +43 -0
  186. package/templates/admin-shell/layouts/modules/admin-tab/AdminTab.tsx +125 -0
  187. package/templates/admin-shell/layouts/modules/admin-tab/components/TabContextMenu.tsx +107 -0
  188. package/templates/admin-shell/layouts/modules/admin-tab/hooks/useTabScroll.ts +86 -0
  189. package/templates/admin-shell/layouts/modules/shared/logo.ts +42 -0
  190. package/templates/admin-shell/layouts/modules/theme-drawer/ThemeDrawer.tsx +68 -0
  191. package/templates/admin-shell/layouts/modules/theme-drawer/components/AnimatedCollapse.tsx +36 -0
  192. package/templates/admin-shell/layouts/modules/theme-drawer/components/AnimatedItem.tsx +35 -0
  193. package/templates/admin-shell/layouts/modules/theme-drawer/components/LayoutModeCard.tsx +110 -0
  194. package/templates/admin-shell/layouts/modules/theme-drawer/components/SettingItem.tsx +31 -0
  195. package/templates/admin-shell/layouts/modules/theme-drawer/modules/ConfigOperation.tsx +53 -0
  196. package/templates/admin-shell/layouts/modules/theme-drawer/modules/appearance/CustomPicker.tsx +105 -0
  197. package/templates/admin-shell/layouts/modules/theme-drawer/modules/appearance/ThemeColor.tsx +58 -0
  198. package/templates/admin-shell/layouts/modules/theme-drawer/modules/appearance/ThemeSchema.tsx +42 -0
  199. package/templates/admin-shell/layouts/modules/theme-drawer/modules/appearance/ThemeToken.tsx +44 -0
  200. package/templates/admin-shell/layouts/modules/theme-drawer/modules/appearance/index.tsx +23 -0
  201. package/templates/admin-shell/layouts/modules/theme-drawer/modules/general/GlobalSettings.tsx +57 -0
  202. package/templates/admin-shell/layouts/modules/theme-drawer/modules/general/ThemeGeneral.tsx +20 -0
  203. package/templates/admin-shell/layouts/modules/theme-drawer/modules/general/WatermarkSettings.tsx +103 -0
  204. package/templates/admin-shell/layouts/modules/theme-drawer/modules/layout/ContentSettings.tsx +100 -0
  205. package/templates/admin-shell/layouts/modules/theme-drawer/modules/layout/FooterSettings.tsx +71 -0
  206. package/templates/admin-shell/layouts/modules/theme-drawer/modules/layout/HeaderSettings.tsx +63 -0
  207. package/templates/admin-shell/layouts/modules/theme-drawer/modules/layout/LayoutMode.tsx +73 -0
  208. package/templates/admin-shell/layouts/modules/theme-drawer/modules/layout/SiderSettings.tsx +124 -0
  209. package/templates/admin-shell/layouts/modules/theme-drawer/modules/layout/TabSettings.tsx +95 -0
  210. package/templates/admin-shell/layouts/modules/theme-drawer/modules/layout/ThemeLayout.tsx +32 -0
  211. package/templates/admin-shell/layouts/modules/theme-drawer/modules/preset/ThemePreset.tsx +132 -0
  212. package/templates/admin-shell/layouts/options.tsx +79 -0
  213. package/templates/admin-shell/layouts/setup.ts +102 -0
  214. package/templates/admin-shell/layouts/state/AdminEffect.tsx +56 -0
  215. package/templates/admin-shell/layouts/state/AdminTabEffect.tsx +28 -0
  216. package/templates/admin-shell/layouts/state/index.ts +3 -0
  217. package/templates/admin-shell/layouts/state/menus/MenuToggler.tsx +53 -0
  218. package/templates/admin-shell/layouts/state/menus/use-admin-menu-badges.ts +46 -0
  219. package/templates/admin-shell/layouts/state/menus/use-admin-menus.tsx +164 -0
  220. package/templates/admin-shell/layouts/state/tabs/index.ts +1 -0
  221. package/templates/admin-shell/layouts/state/tabs/shared.tsx +148 -0
  222. package/templates/admin-shell/layouts/state/tabs/use-admin-tab.ts +377 -0
  223. package/templates/admin-shell/layouts/state/use-admin-state.ts +118 -0
  224. package/templates/admin-shell/layouts/types/router.d.ts +10 -0
  225. package/templates/admin-shell/layouts/types/storage.ts +18 -0
  226. package/templates/admin-shell/notification/NotificationButton.tsx +91 -0
  227. package/templates/admin-shell/notification/NotificationContext.ts +8 -0
  228. package/templates/admin-shell/notification/NotificationPanel.tsx +194 -0
  229. package/templates/admin-shell/notification/NotificationProvider.tsx +59 -0
  230. package/templates/admin-shell/notification/index.ts +12 -0
  231. package/templates/admin-shell/notification/mock.ts +59 -0
  232. package/templates/admin-shell/notification/notification-store.ts +438 -0
  233. package/templates/admin-shell/notification/notification.css +60 -0
  234. package/templates/admin-shell/notification/types.ts +104 -0
  235. package/templates/admin-shell/notification/use-notification.ts +51 -0
  236. package/templates/admin-shell/notification/useNotificationContext.ts +14 -0
  237. package/templates/admin-shell/runtime/app-update.ts +156 -0
  238. package/templates/admin-shell/runtime/dayjs.ts +20 -0
  239. package/templates/admin-shell/runtime/iconify.ts +17 -0
  240. package/templates/admin-shell/runtime/index.ts +10 -0
  241. package/templates/admin-shell/runtime/nprogress.ts +25 -0
  242. package/templates/admin-shell/runtime/plugins.ts +62 -0
  243. package/templates/admin-shell/styles/global.css +54 -0
  244. package/templates/admin-shell/styles/nprogress.css +85 -0
  245. package/templates/admin-shell/styles/reset.css +378 -0
  246. package/templates/admin-shell/theme/antd/AntdProvider.tsx +106 -0
  247. package/templates/admin-shell/theme/antd/index.ts +23 -0
  248. package/templates/admin-shell/theme/antd/shared.ts +80 -0
  249. package/templates/admin-shell/theme/antd/ui.ts +250 -0
  250. package/templates/admin-shell/theme/antd-algorithm/algorithm/dark/colors.ts +99 -0
  251. package/templates/admin-shell/theme/antd-algorithm/algorithm/dark/index.ts +87 -0
  252. package/templates/admin-shell/theme/antd-algorithm/algorithm/default/colors.ts +91 -0
  253. package/templates/admin-shell/theme/antd-algorithm/algorithm/default/index.ts +77 -0
  254. package/templates/admin-shell/theme/antd-algorithm/index.ts +80 -0
  255. package/templates/admin-shell/theme/antd-algorithm/seed/index.ts +41 -0
  256. package/templates/admin-shell/theme/antd-algorithm/shared/colorAlgorithm.ts +10 -0
  257. package/templates/admin-shell/theme/antd-algorithm/shared/genColorMapToken.ts +165 -0
  258. package/templates/admin-shell/theme/antd-algorithm/shared/genCommonMapToken.ts +23 -0
  259. package/templates/admin-shell/theme/antd-algorithm/shared/genControlHeight.ts +14 -0
  260. package/templates/admin-shell/theme/antd-algorithm/shared/genFontMapToken.ts +274 -0
  261. package/templates/admin-shell/theme/antd-algorithm/shared/genRadiusMapToken.ts +139 -0
  262. package/templates/admin-shell/theme/antd-algorithm/shared/genSizeMapToken.ts +114 -0
  263. package/templates/admin-shell/theme/antd-algorithm/types/index.ts +20 -0
  264. package/templates/admin-shell/theme/components/ThemeEffect.tsx +55 -0
  265. package/templates/admin-shell/theme/components/ThemeSchemaSegmented.tsx +27 -0
  266. package/templates/admin-shell/theme/components/ThemeSchemaSwitch.tsx +77 -0
  267. package/templates/admin-shell/theme/components/shared.ts +5 -0
  268. package/templates/admin-shell/theme/config/default.ts +108 -0
  269. package/templates/admin-shell/theme/config/index.ts +1 -0
  270. package/templates/admin-shell/theme/hooks/index.ts +2 -0
  271. package/templates/admin-shell/theme/hooks/use-theme.ts +244 -0
  272. package/templates/admin-shell/theme/index.ts +78 -0
  273. package/templates/admin-shell/theme/presets/azir.json +39 -0
  274. package/templates/admin-shell/theme/presets/compact.json +38 -0
  275. package/templates/admin-shell/theme/presets/dark.json +93 -0
  276. package/templates/admin-shell/theme/presets/default.json +95 -0
  277. package/templates/admin-shell/theme/presets/index.ts +29 -0
  278. package/templates/admin-shell/theme/presets/shadcn.json +99 -0
  279. package/templates/admin-shell/theme/setup.ts +115 -0
  280. package/templates/admin-shell/theme/types/index.ts +27 -0
  281. package/templates/admin-shell/theme/types/theme.d.ts +316 -0
  282. package/templates/admin-shell/theme/utils/dark-mode.ts +46 -0
  283. package/templates/admin-shell/theme/utils/filters.ts +20 -0
  284. package/templates/admin-shell/theme/utils/index.ts +3 -0
  285. package/templates/admin-shell/theme/utils/settings.ts +43 -0
  286. package/templates/admin-shell/types/api/auth.d.ts +148 -0
  287. package/templates/admin-shell/types/api/common.d.ts +54 -0
  288. package/templates/admin-shell/types/api/route.d.ts +104 -0
  289. package/templates/admin-shell/types/api/service.d.ts +51 -0
  290. package/templates/admin-shell/types/api/system-manage.d.ts +160 -0
  291. package/templates/admin-shell/types/app/common.d.ts +31 -0
  292. package/templates/admin-shell/types/app/global.d.ts +71 -0
  293. package/templates/admin-shell/types/app/menu.d.ts +57 -0
  294. package/templates/admin-shell/types/app/router.d.ts +201 -0
  295. package/templates/admin-shell/types/app/storage.d.ts +10 -0
  296. package/templates/admin-shell/types/app/union-key.d.ts +156 -0
  297. package/templates/admin-shell/types/locales/i18n.d.ts +135 -0
  298. package/templates/admin-shell/ui/antd/components/AppTree.tsx +62 -0
  299. package/templates/admin-shell/ui/antd/components/BeyondHiding.tsx +42 -0
  300. package/templates/admin-shell/ui/antd/components/ButtonIcon.tsx +123 -0
  301. package/templates/admin-shell/ui/antd/components/ButtonLink.tsx +30 -0
  302. package/templates/admin-shell/ui/antd/components/ErrorBoundary.tsx +45 -0
  303. package/templates/admin-shell/ui/antd/components/ExceptionBase.tsx +69 -0
  304. package/templates/admin-shell/ui/antd/components/FullScreen.tsx +33 -0
  305. package/templates/admin-shell/ui/antd/components/PinToggler.tsx +35 -0
  306. package/templates/admin-shell/ui/antd/components/ReloadButton.tsx +20 -0
  307. package/templates/admin-shell/ui/antd/components/index.ts +12 -0
  308. package/templates/admin-shell/ui/antd/components/styles/button-icon-animations.css +246 -0
  309. package/templates/admin-shell/ui/antd/index.ts +1 -0
  310. package/templates/admin-shell/ui/antd/styles.d.ts +1 -0
  311. package/templates/admin-shell/ui/compose/animate-feature.ts +5 -0
  312. package/templates/admin-shell/ui/compose/components/BetterScroll.tsx +51 -0
  313. package/templates/admin-shell/ui/compose/components/DarkModeContainer.tsx +22 -0
  314. package/templates/admin-shell/ui/compose/components/FlipText.tsx +41 -0
  315. package/templates/admin-shell/ui/compose/components/I18nLabel.tsx +18 -0
  316. package/templates/admin-shell/ui/compose/components/LazyAnimate.tsx +10 -0
  317. package/templates/admin-shell/ui/compose/components/LookForward.tsx +24 -0
  318. package/templates/admin-shell/ui/compose/components/NumberTicker.tsx +105 -0
  319. package/templates/admin-shell/ui/compose/components/Portal.tsx +74 -0
  320. package/templates/admin-shell/ui/compose/components/SvgIcon.tsx +39 -0
  321. package/templates/admin-shell/ui/compose/components/TypingAnimation.tsx +83 -0
  322. package/templates/admin-shell/ui/compose/components/WaveBg.tsx +56 -0
  323. package/templates/admin-shell/ui/compose/components/index.ts +11 -0
  324. package/templates/admin-shell/ui/compose/index.ts +2 -0
  325. package/templates/admin-shell/ui/compose/table/DragContent.tsx +239 -0
  326. package/templates/admin-shell/ui/compose/table/TableHeaderOperation.tsx +210 -0
  327. package/templates/admin-shell/ui/compose/table/hooks.ts +196 -0
  328. package/templates/admin-shell/ui/compose/table/index.ts +16 -0
  329. package/templates/admin-shell/ui/compose/table/types.ts +244 -0
  330. package/templates/admin-shell/ui/compose/table/use-table-operate.ts +136 -0
  331. package/templates/admin-shell/ui/compose/table/use-table-scroll.ts +49 -0
  332. package/templates/admin-shell/ui/compose/table/use-table.ts +303 -0
  333. package/templates/admin.meta.json +756 -0
@@ -0,0 +1,104 @@
1
+ // oxlint-disable unicorn/require-module-specifiers
2
+ /**
3
+ * 命名空间 Api.Route
4
+ *
5
+ * 后端 API 模块:路由模块
6
+ */
7
+ declare global {
8
+ namespace Api.Route {
9
+ /** 后端返回的完整动态路由结构。 */
10
+ interface BackendRouteResponse {
11
+ /** 用户首页路由,后端原始响应是字符串,进入布局前再适配成 Router.RoutePath。 */
12
+ home?: string | null;
13
+ /** 用户可访问的后端路由树。 */
14
+ routes: BackendRoutePayload[];
15
+ }
16
+
17
+ /** 后端动态路由节点的原始响应。 */
18
+ interface BackendRoutePayload {
19
+ /** 子路由树。 */
20
+ children?: BackendRoutePayload[] | null;
21
+ /** Vue/React 后端菜单常见的 meta/handle 承载字段。 */
22
+ handle?: BackendRouteHandle | null;
23
+ /** 后端菜单 ID。没有时使用 name 或 path 作为运行时 id。 */
24
+ id?: number | string | null;
25
+ /** 顶层菜单分类 key。 */
26
+ layout?: Router.MenuCategoryKey | null;
27
+ /** 兼容常见后端菜单模型中的 meta 字段。 */
28
+ meta?: BackendRouteHandle | null;
29
+ /** 后端路由名。 */
30
+ name?: string | null;
31
+ /** 父级菜单 ID。 */
32
+ parentId?: number | string | null;
33
+ /** 后端路由路径。 */
34
+ path: string;
35
+ /** 后端重定向字段,布局菜单不会直接消费。 */
36
+ redirect?: string | null;
37
+ }
38
+
39
+ /** 后端动态路由默认携带的 URL search 参数。 */
40
+ interface BackendRouteQuery {
41
+ /** 参数 Key。 */
42
+ key: string;
43
+ /** 参数 Value。 */
44
+ value: string;
45
+ }
46
+
47
+ /** 后端动态路由节点的 meta/handle 字段。 */
48
+ interface BackendRouteHandle {
49
+ /** 隐藏页需要激活的菜单路径。 */
50
+ activeMenu?: string | null;
51
+ /** 标准菜单 badge。 */
52
+ badge?: Router.MenuBadge | null;
53
+ /** 是否常量路由。 */
54
+ constant?: boolean | null;
55
+ /** 自定义菜单 extra key。 */
56
+ extra?: Router.Extra | null;
57
+ /** 固定页签序号。 */
58
+ fixedIndexInTab?: number | null;
59
+ /** 是否在菜单中隐藏。 */
60
+ hideInMenu?: boolean | null;
61
+ /** 外链地址。 */
62
+ href?: string | null;
63
+ /** 国际化 key。 */
64
+ i18nKey?: I18n.I18nKey | null;
65
+ /** Iconify 图标名。 */
66
+ icon?: string | null;
67
+ /** 是否缓存页面。 */
68
+ keepAlive?: boolean | null;
69
+ /** 本地图标名。 */
70
+ localIcon?: string | null;
71
+ /** 是否允许同一路由多页签。 */
72
+ multiTab?: boolean | null;
73
+ /** 菜单排序。 */
74
+ order?: number | null;
75
+ /** 点击菜单进入页面时默认携带的 search 参数。 */
76
+ query?: BackendRouteQuery[] | null;
77
+ /** 允许访问该路由的角色。 */
78
+ roles?: string[] | null;
79
+ /** 菜单标题。 */
80
+ title?: string | null;
81
+ /** 菜单类型。 */
82
+ type?: Router.MenuType | null;
83
+ /** Iframe 或外部页面地址。 */
84
+ url?: string | null;
85
+ }
86
+
87
+ /** 布局运行时消费的动态路由节点。 */
88
+ interface BackendRoute extends Router.Meta {
89
+ children?: BackendRoute[] | null;
90
+
91
+ id: string;
92
+
93
+ layout?: Router.MenuCategoryKey | null;
94
+
95
+ parentId?: string | null;
96
+
97
+ path: Router.RoutePath;
98
+
99
+ query?: BackendRouteQuery[] | null;
100
+ }
101
+ }
102
+ }
103
+
104
+ export {};
@@ -0,0 +1,51 @@
1
+ /** The API service namespace */
2
+ declare global {
3
+ namespace Api.Service {
4
+ /** Other baseURL key */
5
+ type OtherBaseURLKey = 'demo';
6
+
7
+ interface ServiceConfigItem {
8
+ /** The backend service base url */
9
+ baseURL: string;
10
+ /** The proxy pattern of the backend service base url */
11
+ proxyPattern: string;
12
+ }
13
+
14
+ interface OtherServiceConfigItem extends ServiceConfigItem {
15
+ key: OtherBaseURLKey;
16
+ }
17
+
18
+ /** The backend service config */
19
+ interface ServiceConfig extends ServiceConfigItem {
20
+ /** Other backend service config */
21
+ other: OtherServiceConfigItem[];
22
+ }
23
+
24
+ interface SimpleServiceConfig extends Pick<ServiceConfigItem, 'baseURL'> {
25
+ other: Record<OtherBaseURLKey, string>;
26
+ }
27
+
28
+ /** The backend service response data */
29
+ type Response<T = unknown> = {
30
+ /** The backend service response code */
31
+ code: string;
32
+ /** The backend service response data */
33
+ data: T;
34
+ /** The backend service response message */
35
+ msg: string;
36
+ };
37
+
38
+ /** The demo backend service response data */
39
+ type DemoResponse<T = unknown> = {
40
+ /** The backend service response message */
41
+ message: string;
42
+ /** The backend service response data */
43
+ result: T;
44
+ /** The backend service response code */
45
+ status: string;
46
+ };
47
+ }
48
+ }
49
+
50
+ // oxlint-disable-next-line unicorn/require-module-specifiers
51
+ export {};
@@ -0,0 +1,160 @@
1
+ // oxlint-disable unicorn/require-module-specifiers
2
+ /**
3
+ * 命名空间 Api.SystemManage
4
+ *
5
+ * 后端 API 模块:系统管理模块
6
+ */
7
+ declare global {
8
+ namespace Api.SystemManage {
9
+ /** 将查询表单字段转成可选且允许为空的接口查询参数。 */
10
+ type NullableSearchRecord<T> = {
11
+ [K in keyof T]?: T[K] | null;
12
+ };
13
+
14
+ /** 通用搜索参数 */
15
+ type CommonSearchParams = Pick<Api.Common.PaginatingCommonParams, 'current' | 'size'>;
16
+
17
+ /** 角色 */
18
+ type Role = Api.Common.CommonRecord<{
19
+ /** 角色编码 */
20
+ roleCode: string;
21
+ /** 角色描述 */
22
+ roleDesc: string;
23
+ /** 角色名称 */
24
+ roleName: string;
25
+ }>;
26
+
27
+ /** 角色搜索参数 */
28
+ type RoleSearchParams = NullableSearchRecord<Pick<Role, 'roleCode' | 'roleName' | 'status'> & CommonSearchParams>;
29
+
30
+ /** 角色列表 */
31
+ type RoleList = Api.Common.PaginatingQueryRecord<Role>;
32
+
33
+ /** 所有角色(简化版) */
34
+ type AllRole = Pick<Role, 'id' | 'roleCode' | 'roleName'>;
35
+
36
+ /**
37
+ * 用户性别
38
+ *
39
+ * - "1": 男
40
+ * - "2": 女
41
+ */
42
+ type UserGender = '1' | '2';
43
+
44
+ /** 用户 */
45
+ type User = Api.Common.CommonRecord<{
46
+ /** 用户昵称 */
47
+ nickName: string;
48
+ /** 用户邮箱 */
49
+ userEmail: string;
50
+ /** 用户性别 */
51
+ userGender: UserGender | null;
52
+ /** 用户名 */
53
+ userName: string;
54
+ /** 用户手机号 */
55
+ userPhone: string;
56
+ /** 用户角色编码集合 */
57
+ userRoles: string[];
58
+ }>;
59
+
60
+ /** 用户搜索参数 */
61
+ type UserSearchParams = NullableSearchRecord<
62
+ Pick<User, 'nickName' | 'status' | 'userEmail' | 'userGender' | 'userName' | 'userPhone'> & CommonSearchParams
63
+ >;
64
+
65
+ /** 用户列表 */
66
+ type UserList = Api.Common.PaginatingQueryRecord<User>;
67
+
68
+ /**
69
+ * 菜单类型
70
+ *
71
+ * - "1": 目录
72
+ * - "2": 菜单
73
+ */
74
+ type MenuType = '1' | '2';
75
+
76
+ /** 菜单按钮 */
77
+ type MenuButton = {
78
+ /**
79
+ * 按钮编码
80
+ *
81
+ * 可用于控制按钮权限
82
+ */
83
+ code: string;
84
+ /** 按钮描述 */
85
+ desc: string;
86
+ };
87
+
88
+ /** 菜单路由参数 */
89
+ type MenuRouteQuery = {
90
+ /** 参数 Key */
91
+ key: string;
92
+ /** 参数 Value */
93
+ value: string;
94
+ };
95
+
96
+ /** 菜单的路由属性 */
97
+ interface MenuPropsOfRoute {
98
+ /** 高亮的菜单路径 */
99
+ activeMenu?: Router.RoutePath | null;
100
+ /** 是否为常量路由 */
101
+ constant?: boolean | null;
102
+ /** 固定在页签中的序号 */
103
+ fixedIndexInTab?: number | null;
104
+ /** 是否隐藏菜单 */
105
+ hideInMenu?: boolean | null;
106
+ /** 外链地址 */
107
+ href?: string | null;
108
+ /** 国际化键 */
109
+ i18nKey?: I18n.I18nKey | null;
110
+ /** 是否缓存路由 */
111
+ keepAlive?: boolean | null;
112
+ /** 是否支持多页签 */
113
+ multiTab?: boolean | null;
114
+ /** 菜单排序 */
115
+ order?: number | null;
116
+ /** 路由参数 */
117
+ query?: MenuRouteQuery[] | null;
118
+ }
119
+
120
+ /** 菜单 */
121
+ type Menu = Api.Common.CommonRecord<{
122
+ /** 按钮列表 */
123
+ buttons?: MenuButton[] | null;
124
+ /** 子菜单 */
125
+ children?: Menu[] | null;
126
+ /** 组件路径 */
127
+ component?: string;
128
+ /** 图标名称(iconify 图标名或本地图标名) */
129
+ icon: string;
130
+ /** 菜单名称 */
131
+ menuName: string;
132
+ /** 菜单类型 */
133
+ menuType: MenuType;
134
+ /** 父级菜单 ID */
135
+ parentId: number;
136
+ /** 路由名称 */
137
+ routeName: string;
138
+ /** 路由路径 */
139
+ routePath: string;
140
+ }> &
141
+ MenuPropsOfRoute;
142
+
143
+ /** 菜单列表 */
144
+ type MenuList = Api.Common.PaginatingQueryRecord<Menu>;
145
+
146
+ /** 菜单树 */
147
+ type MenuTree = {
148
+ /** 子菜单树 */
149
+ children?: MenuTree[];
150
+ /** 菜单 ID */
151
+ id: number;
152
+ /** 菜单标签 */
153
+ label: string;
154
+ /** 父级菜单 ID */
155
+ pId: number;
156
+ };
157
+ }
158
+ }
159
+
160
+ export {};
@@ -0,0 +1,31 @@
1
+ /** The common type namespace */
2
+ declare global {
3
+ namespace Common {
4
+ /** The strategic pattern */
5
+ interface StrategicPattern {
6
+ /** If the condition is true, then call the action function */
7
+ callback: () => void;
8
+ /** The condition */
9
+ condition: boolean;
10
+ }
11
+
12
+ /**
13
+ * The option type
14
+ *
15
+ * @property value: The option value
16
+ * @property label: The option label
17
+ */
18
+ type Option<K = string, M = string> = { label: M; value: K };
19
+
20
+ type YesOrNo = 'N' | 'Y';
21
+
22
+ type EnableStatus = '1' | '2';
23
+
24
+ /** Add null to all properties */
25
+ type RecordNullable<T> = {
26
+ [K in keyof T]?: T[K] | null;
27
+ };
28
+ }
29
+ }
30
+
31
+ export {};
@@ -0,0 +1,71 @@
1
+ // oxlint-disable unicorn/require-module-specifiers
2
+ /** The global namespace */
3
+ declare global {
4
+ namespace App.Global {
5
+ /**
6
+ * - The global dropdown key
7
+ * - CloseAll: close all tabs
8
+ * - CloseCurrent: close current tab
9
+ * - CloseLeft: close left tabs
10
+ * - CloseOther: close other tabs
11
+ * - CloseRight: close right tabs
12
+ * - Pin: pin tab
13
+ * - Unpin: unpin tab
14
+ */
15
+ type DropdownKey = 'closeAll' | 'closeCurrent' | 'closeLeft' | 'closeOther' | 'closeRight' | 'pin' | 'unpin';
16
+
17
+ type AntdMenu = NonNullable<import('antd').MenuProps['items']>[number];
18
+
19
+ /** The global tab */
20
+ type Tab = {
21
+ /** The tab fixed index */
22
+ fixedIndex?: number | null;
23
+ /** The tab route full path */
24
+ fullPath: string;
25
+ /** I18n key */
26
+ i18nKey?: I18n.I18nKey | null;
27
+ /**
28
+ * Tab icon
29
+ *
30
+ * Iconify icon
31
+ */
32
+ icon?: string | null;
33
+ /** The tab id */
34
+ id: string;
35
+ /** Whether the tab route should keep its page instance alive */
36
+ keepAlive?: boolean | null;
37
+ /** The tab label */
38
+ label: string;
39
+ /**
40
+ * Tab local icon
41
+ *
42
+ * Local icon
43
+ */
44
+ localIcon?: string | null;
45
+
46
+ /**
47
+ * The old tab label
48
+ *
49
+ * When reset the tab label, the tab label will be replaced by this value
50
+ */
51
+ oldLabel?: string | null;
52
+ /** The tab route path */
53
+ routePath: Router.RoutePath;
54
+ };
55
+
56
+ /** The global admin layout menu */
57
+
58
+ namespace AdminLayout {
59
+ interface HeaderProps {
60
+ /** Whether to show the logo */
61
+ showLogo?: boolean;
62
+ /** Whether to show the menu */
63
+ showMenu?: boolean;
64
+ /** Whether to show the menu toggler */
65
+ showMenuToggler?: boolean;
66
+ }
67
+ }
68
+ }
69
+ }
70
+
71
+ export {};
@@ -0,0 +1,57 @@
1
+ // oxlint-disable unicorn/require-module-specifiers
2
+ /** The menu namespace */
3
+ declare global {
4
+ namespace Menu {
5
+ interface CommonMenu {
6
+ /** The menu children */
7
+ children?: CommonMenu[];
8
+ /** The menu extra */
9
+ extra?: React.ReactNode;
10
+ /** The menu i18n key */
11
+ i18nKey?: I18n.I18nKey | null;
12
+ /** The menu icon */
13
+ icon?: React.ReactElement;
14
+ /**
15
+ * The menu key
16
+ *
17
+ * Equal to the route key
18
+ */
19
+ key: string;
20
+ /** The menu label */
21
+ label: React.ReactNode;
22
+ /**
23
+ * Menu order for sorting (using hyphen to avoid React DOM warning)
24
+ *
25
+ * @default 0
26
+ */
27
+ order?: number | null;
28
+ /** The tooltip title */
29
+ title?: string | null;
30
+ /**
31
+ * Menu type
32
+ *
33
+ * @default 'item'
34
+ */
35
+ type?: string;
36
+ }
37
+
38
+ interface QuickReferenceMenu extends Api.Route.BackendRoute {
39
+ /** 菜单深度层级,从 0 开始 */
40
+ depth?: number;
41
+
42
+ /** 菜单的 key */
43
+ key: string;
44
+
45
+ /** 父级菜单的 key 列表 */
46
+ parentKeys?: string[];
47
+ }
48
+
49
+ type QuickReferenceMenuMap = Map<Router.RoutePath, QuickReferenceMenu>;
50
+
51
+ type QuickReferenceMenus = Map<string, QuickReferenceMenuMap>;
52
+
53
+ type Menus = Map<Router.MenuCategoryKey, CommonMenu[]>;
54
+ }
55
+ }
56
+
57
+ export {};
@@ -0,0 +1,201 @@
1
+ // oxlint-disable unicorn/require-module-specifiers
2
+ /** The router namespace */
3
+ declare global {
4
+ namespace Router {
5
+ type QueryClient = import('@tanstack/react-query').QueryClient;
6
+
7
+ interface RouteIdRegistry {}
8
+
9
+ type RouteId = keyof RouteIdRegistry extends never ? string : Extract<keyof RouteIdRegistry, string>;
10
+
11
+ interface RoutePathRegistry {}
12
+
13
+ type RoutePath = keyof RoutePathRegistry extends never ? string : Extract<keyof RoutePathRegistry, string>;
14
+
15
+ type Extra = keyof MenuExtraRegistry extends never ? string : Extract<keyof MenuExtraRegistry, string>;
16
+
17
+ interface MenuExtraRegistry {}
18
+
19
+ type MenuCategoryKey = keyof MenuCategoryRegistry extends never
20
+ ? string
21
+ : Extract<keyof MenuCategoryRegistry, string>;
22
+
23
+ interface MenuCategoryRegistry {}
24
+
25
+ type MenuBadgeType = 'dot' | 'normal';
26
+
27
+ type MenuBadgeValue = number | string | null;
28
+
29
+ type MenuBadgeVariant = 'default' | 'error' | 'info' | 'primary' | 'success' | 'warning';
30
+
31
+ type MenuType = 'divider' | 'group' | 'item';
32
+
33
+ interface MenuBadge {
34
+ /** Whether zero should still be rendered as badge content. */
35
+ showZero?: boolean;
36
+ /** Whether to render a dot badge or content badge. */
37
+ type?: MenuBadgeType;
38
+ /** Static badge content used when no dynamic value is provided. */
39
+ value?: MenuBadgeValue;
40
+ /** Key used to read dynamic badge content from the layout badge value map. */
41
+ valueKey?: string;
42
+ /** Visual status variant for the badge. */
43
+ variant?: MenuBadgeVariant;
44
+ }
45
+
46
+ interface Meta {
47
+ /** External link opened when the route is selected */
48
+ href?: string | null;
49
+
50
+ /**
51
+ * I18n key of the route
52
+ *
53
+ * It's used in i18n, if it is set, the title will be ignored
54
+ */
55
+ i18nKey?: I18n.I18nKey | null;
56
+
57
+ /** Whether to cache the route */
58
+ keepAlive?: boolean | null;
59
+
60
+ /**
61
+ * Menu configuration of the route
62
+ *
63
+ * It controls how the route is displayed in the menu
64
+ */
65
+ menu?: {
66
+ /**
67
+ * The menu key will be activated when entering the route
68
+ *
69
+ * It is usually used for detail pages or hidden routes
70
+ *
71
+ * Active strategy configuration
72
+ *
73
+ * It defines which menu should be activated when entering the route
74
+ */
75
+ activeMenu?: RoutePath | null;
76
+
77
+ /**
78
+ * Standard menu badge.
79
+ *
80
+ * It is used for common menu status like dot, count, new, and hot.
81
+ */
82
+ badge?: MenuBadge | null;
83
+
84
+ /**
85
+ * Custom menu extra component key.
86
+ *
87
+ * It is used for app-provided menu extra components that do not fit the standard badge model.
88
+ */
89
+ extra?: Extra | null;
90
+ /**
91
+ * Whether to hide the route in the menu
92
+ *
93
+ * If true, the route will not be rendered in the menu tree
94
+ */
95
+ hide?: boolean | null;
96
+
97
+ /**
98
+ * Iconify icon
99
+ *
100
+ * It can be used in the menu or breadcrumb
101
+ */
102
+ icon?: string | null;
103
+
104
+ /**
105
+ * Local icon
106
+ *
107
+ * In "src/assets/svg-icon", if it is set, the icon will be ignored
108
+ */
109
+ localIcon?: string | null;
110
+
111
+ /**
112
+ * Meta data of the menu
113
+ *
114
+ * It can be used to add meta data to the menu
115
+ */
116
+ meta?: { key: string; value: string }[] | null;
117
+
118
+ /**
119
+ * The menu order
120
+ *
121
+ * Smaller value means higher priority
122
+ */
123
+ order?: number | null;
124
+
125
+ /**
126
+ * Menu type
127
+ *
128
+ * @default 'item'
129
+ */
130
+ type?: MenuType | null;
131
+ };
132
+
133
+ /** Required permissions to access the route */
134
+ permissions?: string[] | null;
135
+
136
+ /** Default search params carried when this route is opened from a menu. */
137
+ query?: Api.Route.BackendRouteQuery[] | null;
138
+
139
+ /**
140
+ * Whether the route is required
141
+ *
142
+ * It can be used in permission or feature checks
143
+ */
144
+ requiresAuth?: boolean;
145
+
146
+ /**
147
+ * Tabs behavior configuration
148
+ *
149
+ * It controls how the route behaves in the tabs system
150
+ */
151
+ tab?: {
152
+ /** If set, the route will be fixed in tabs, and the value is the order of fixed tabs */
153
+ fixedIndex?: number | null;
154
+
155
+ /**
156
+ * Whether to allow multiple tabs for the same route
157
+ *
158
+ * By default, the same route path will use one tab, even with different query parameters
159
+ */
160
+ multi?: boolean | null;
161
+ };
162
+
163
+ /**
164
+ * Title of the route
165
+ *
166
+ * It can be used in document title
167
+ */
168
+ title?: string | null;
169
+
170
+ /** External page url rendered inside an iframe route */
171
+ url?: string | null;
172
+ }
173
+
174
+ interface RouterContext {
175
+ /** 获取系统首页路由路径 */
176
+ getHomeRoute: () => RoutePath;
177
+
178
+ /** 系统首页路由路径 */
179
+ homeRoute: RoutePath;
180
+ /**
181
+ * Initialize authentication information
182
+ *
183
+ * @returns The user information
184
+ */
185
+ initAuth: () => Promise<Api.Auth.UserInfo | null>;
186
+ /** Whether the authentication information has been initialized */
187
+ isAuthInitialized: boolean;
188
+ /** Whether the user is logged in */
189
+ isLoggedIn: boolean;
190
+ /** Logout user and clear authentication information */
191
+ logout: () => Promise<void>;
192
+
193
+ /** Query client */
194
+ queryClient: QueryClient;
195
+ /** User information */
196
+ userInfo?: Api.Auth.UserInfo;
197
+ }
198
+ }
199
+ }
200
+
201
+ export {};
@@ -0,0 +1,10 @@
1
+ /** Shared storage extension points */
2
+ declare global {
3
+ namespace StorageType {
4
+ interface Session {}
5
+
6
+ interface Local {}
7
+ }
8
+ }
9
+
10
+ export {};