@oj-module/runtime 0.1.5

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 (185) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +119 -0
  3. package/dist/api/notifications/index.d.ts +2 -0
  4. package/dist/api/system/menu/index.d.ts +6 -0
  5. package/dist/api/system/menu/types.d.ts +19 -0
  6. package/dist/api/system/role/api/client.d.ts +19 -0
  7. package/dist/api/system/role/api/client.schemas.d.ts +94 -0
  8. package/dist/api/system/role/index.d.ts +9 -0
  9. package/dist/api/system/role/types.d.ts +9 -0
  10. package/dist/api/user/index.d.ts +12 -0
  11. package/dist/api/user/types.d.ts +26 -0
  12. package/dist/components/access-control/index.d.ts +15 -0
  13. package/dist/components/basic-button/index.d.ts +7 -0
  14. package/dist/components/basic-content/index.d.ts +7 -0
  15. package/dist/components/basic-form/form-items/form-avatar-item.d.ts +6 -0
  16. package/dist/components/basic-form/form-items/form-tree-item.d.ts +13 -0
  17. package/dist/components/basic-form/form-items/index.d.ts +2 -0
  18. package/dist/components/basic-form/index.d.ts +1 -0
  19. package/dist/components/basic-table/constants.d.ts +1 -0
  20. package/dist/components/basic-table/index.d.ts +12 -0
  21. package/dist/components/basic-table/styles.d.ts +6 -0
  22. package/dist/components/exception-page/index.d.ts +3 -0
  23. package/dist/components/fullscreen-button/index.d.ts +17 -0
  24. package/dist/components/global-spin/index.d.ts +6 -0
  25. package/dist/components/iframe/index.d.ts +1 -0
  26. package/dist/components/jss-theme-provider/index.d.ts +26 -0
  27. package/dist/components/not-found/index.d.ts +6 -0
  28. package/dist/components/page-error/index.d.ts +2 -0
  29. package/dist/components/scrollbar/index.d.ts +7 -0
  30. package/dist/components/unknown-component/index.d.ts +6 -0
  31. package/dist/constants/options.d.ts +9 -0
  32. package/dist/contract/define-api.d.ts +43 -0
  33. package/dist/contract/define-api.js +44 -0
  34. package/dist/contract/errors.d.ts +16 -0
  35. package/dist/contract/errors.js +20 -0
  36. package/dist/contract/index.d.ts +15 -0
  37. package/dist/contract/index.js +13 -0
  38. package/dist/contract/scoped-request-like.d.ts +25 -0
  39. package/dist/contract/scoped-request-like.js +6 -0
  40. package/dist/hooks/use-access/constants.d.ts +24 -0
  41. package/dist/hooks/use-access/index.d.ts +9 -0
  42. package/dist/hooks/use-css-var/index.d.ts +17 -0
  43. package/dist/hooks/use-current-route/index.d.ts +6 -0
  44. package/dist/hooks/use-device-type/index.d.ts +9 -0
  45. package/dist/hooks/use-language/index.d.ts +5 -0
  46. package/dist/hooks/use-layout-menu/index.d.ts +6 -0
  47. package/dist/hooks/use-layout-style/index.d.ts +19 -0
  48. package/dist/hooks/use-preferences/index.d.ts +61 -0
  49. package/dist/icons/index.d.ts +3 -0
  50. package/dist/icons/local-icons.d.ts +17 -0
  51. package/dist/icons/menu-icons.d.ts +4 -0
  52. package/dist/icons/ri.d.ts +14 -0
  53. package/dist/icons/types.d.ts +9 -0
  54. package/dist/index.d.ts +44 -0
  55. package/dist/layout/constants.d.ts +50 -0
  56. package/dist/layout/container-layout/index.d.ts +11 -0
  57. package/dist/layout/fullscreen-layout/index.d.ts +9 -0
  58. package/dist/layout/hooks/index.d.ts +1 -0
  59. package/dist/layout/hooks/use-layout.d.ts +20 -0
  60. package/dist/layout/keep-alive-layer/index.d.ts +15 -0
  61. package/dist/layout/layout-content/index.d.ts +3 -0
  62. package/dist/layout/layout-effects/index.d.ts +9 -0
  63. package/dist/layout/layout-footer/index.d.ts +5 -0
  64. package/dist/layout/layout-header/components/fullscreen-button.d.ts +2 -0
  65. package/dist/layout/layout-header/components/language-button.d.ts +2 -0
  66. package/dist/layout/layout-header/components/theme-button.d.ts +9 -0
  67. package/dist/layout/layout-header/components/user-menu.d.ts +2 -0
  68. package/dist/layout/layout-header/index.d.ts +5 -0
  69. package/dist/layout/layout-menu/index.d.ts +17 -0
  70. package/dist/layout/layout-menu/style.d.ts +6 -0
  71. package/dist/layout/layout-menu/types.d.ts +26 -0
  72. package/dist/layout/layout-menu/use-menu.d.ts +7 -0
  73. package/dist/layout/layout-menu/utils.d.ts +49 -0
  74. package/dist/layout/layout-mixed-sidebar/first-column-menu.d.ts +9 -0
  75. package/dist/layout/layout-mixed-sidebar/index.d.ts +14 -0
  76. package/dist/layout/layout-mobile-menu/index.d.ts +1 -0
  77. package/dist/layout/layout-root/index.d.ts +5 -0
  78. package/dist/layout/layout-sidebar/index.d.ts +5 -0
  79. package/dist/layout/layout-tabbar/components/draggable-tab-bar.d.ts +16 -0
  80. package/dist/layout/layout-tabbar/components/tab-maximize.d.ts +10 -0
  81. package/dist/layout/layout-tabbar/components/tab-options.d.ts +17 -0
  82. package/dist/layout/layout-tabbar/hooks/use-dropdown-menu.d.ts +26 -0
  83. package/dist/layout/layout-tabbar/index.d.ts +5 -0
  84. package/dist/layout/layout-tabbar/style.d.ts +6 -0
  85. package/dist/layout/parent-layout/index.d.ts +1 -0
  86. package/dist/layout/widgets/breadcrumb-views/index.d.ts +1 -0
  87. package/dist/layout/widgets/global-search/components/search-footer.d.ts +5 -0
  88. package/dist/layout/widgets/global-search/components/search-panel.d.ts +11 -0
  89. package/dist/layout/widgets/global-search/index.d.ts +1 -0
  90. package/dist/layout/widgets/logo/index.d.ts +9 -0
  91. package/dist/layout/widgets/notification/index.d.ts +19 -0
  92. package/dist/layout/widgets/notification/notification-container.d.ts +2 -0
  93. package/dist/layout/widgets/notification/types.d.ts +7 -0
  94. package/dist/layout/widgets/preferences/blocks/animation/index.d.ts +1 -0
  95. package/dist/layout/widgets/preferences/blocks/footer/index.d.ts +1 -0
  96. package/dist/layout/widgets/preferences/blocks/general/index.d.ts +1 -0
  97. package/dist/layout/widgets/preferences/blocks/general/utils.d.ts +1 -0
  98. package/dist/layout/widgets/preferences/blocks/index.d.ts +7 -0
  99. package/dist/layout/widgets/preferences/blocks/layout/constants.d.ts +4 -0
  100. package/dist/layout/widgets/preferences/blocks/layout/index.d.ts +1 -0
  101. package/dist/layout/widgets/preferences/blocks/sidebar/index.d.ts +1 -0
  102. package/dist/layout/widgets/preferences/blocks/tabbar/index.d.ts +1 -0
  103. package/dist/layout/widgets/preferences/blocks/theme/builtin.d.ts +1 -0
  104. package/dist/layout/widgets/preferences/blocks/theme/index.d.ts +2 -0
  105. package/dist/layout/widgets/preferences/blocks/theme/theme.d.ts +1 -0
  106. package/dist/layout/widgets/preferences/index.d.ts +2 -0
  107. package/dist/layout/widgets/preferences/number-input-spinner.d.ts +10 -0
  108. package/dist/layout/widgets/preferences/select-item.d.ts +9 -0
  109. package/dist/layout/widgets/preferences/switch-item.d.ts +8 -0
  110. package/dist/layout/widgets/preferences/text-input.d.ts +8 -0
  111. package/dist/layout/widgets/sider-trigger/index.d.ts +5 -0
  112. package/dist/locales/helper.d.ts +15 -0
  113. package/dist/locales/index.d.ts +18 -0
  114. package/dist/locales/t.d.ts +10 -0
  115. package/dist/module-loader/define-module.d.ts +11 -0
  116. package/dist/module-loader/index.d.ts +20 -0
  117. package/dist/module-loader/keep-alive.d.ts +18 -0
  118. package/dist/module-loader/semver.d.ts +8 -0
  119. package/dist/module-loader/slots.d.ts +9 -0
  120. package/dist/module-loader/types.d.ts +91 -0
  121. package/dist/pages/login/index.d.ts +1 -0
  122. package/dist/plugins/hide-loading.d.ts +1 -0
  123. package/dist/plugins/loading.d.ts +7 -0
  124. package/dist/router/constants.d.ts +1 -0
  125. package/dist/router/extra-info/index.d.ts +1 -0
  126. package/dist/router/extra-info/route-path.d.ts +22 -0
  127. package/dist/router/guard/auth-guard.d.ts +21 -0
  128. package/dist/router/guard/index.d.ts +1 -0
  129. package/dist/router/guard/utils.d.ts +2 -0
  130. package/dist/router/index.d.ts +12 -0
  131. package/dist/router/routes/config.d.ts +7 -0
  132. package/dist/router/routes/core/auth.d.ts +13 -0
  133. package/dist/router/routes/core/exception.d.ts +12 -0
  134. package/dist/router/routes/core/fallback.d.ts +3 -0
  135. package/dist/router/routes/core/index.d.ts +2 -0
  136. package/dist/router/routes/index.d.ts +118 -0
  137. package/dist/router/types.d.ts +90 -0
  138. package/dist/router/utils/add-route-id-by-path.d.ts +81 -0
  139. package/dist/router/utils/ascending.d.ts +99 -0
  140. package/dist/router/utils/flatten-routes.d.ts +5 -0
  141. package/dist/router/utils/generate-menu-items-from-routes.d.ts +10 -0
  142. package/dist/router/utils/generate-routes-from-backend.d.ts +79 -0
  143. package/dist/router/utils/generate-routes-from-frontend.d.ts +5 -0
  144. package/dist/router/utils/merge-route-modules.d.ts +2 -0
  145. package/dist/router/utils/remove-trailing-slash.d.ts +10 -0
  146. package/dist/router/utils/resolve-layout.d.ts +17 -0
  147. package/dist/router/utils/resolve-login-route.d.ts +31 -0
  148. package/dist/runtime.js +27121 -0
  149. package/dist/store/access.d.ts +14 -0
  150. package/dist/store/api-provider.d.ts +47 -0
  151. package/dist/store/auth-provider.d.ts +19 -0
  152. package/dist/store/auth.d.ts +20 -0
  153. package/dist/store/global.d.ts +12 -0
  154. package/dist/store/preferences/index.d.ts +80 -0
  155. package/dist/store/preferences/types.d.ts +254 -0
  156. package/dist/store/tabs.d.ts +343 -0
  157. package/dist/store/user.d.ts +7 -0
  158. package/dist/types/app-info.d.ts +18 -0
  159. package/dist/utils/cn/index.d.ts +2 -0
  160. package/dist/utils/dom/index.d.ts +14 -0
  161. package/dist/utils/get-all-expanded-keys/index.d.ts +1 -0
  162. package/dist/utils/get-app-info/index.d.ts +13 -0
  163. package/dist/utils/get-app-namespace/index.d.ts +1 -0
  164. package/dist/utils/get-redirect-path.d.ts +8 -0
  165. package/dist/utils/iframe-guard.d.ts +18 -0
  166. package/dist/utils/is/index.d.ts +56 -0
  167. package/dist/utils/is-dark-theme/index.d.ts +7 -0
  168. package/dist/utils/is-light-theme/index.d.ts +7 -0
  169. package/dist/utils/is-windows-os/index.d.ts +6 -0
  170. package/dist/utils/progress/index.d.ts +3 -0
  171. package/dist/utils/remember-route/index.d.ts +1 -0
  172. package/dist/utils/request/constants.d.ts +5 -0
  173. package/dist/utils/request/envelope.d.ts +5 -0
  174. package/dist/utils/request/error-response.d.ts +12 -0
  175. package/dist/utils/request/global-progress.d.ts +21 -0
  176. package/dist/utils/request/go-login.d.ts +6 -0
  177. package/dist/utils/request/header-safe.d.ts +1 -0
  178. package/dist/utils/request/index.d.ts +1 -0
  179. package/dist/utils/request/refresh.d.ts +11 -0
  180. package/dist/utils/request/scoped.d.ts +17 -0
  181. package/dist/utils/request/whitelist.d.ts +1 -0
  182. package/dist/utils/static-antd/index.d.ts +12 -0
  183. package/dist/utils/toggle-html-class/index.d.ts +9 -0
  184. package/dist/utils/tree/index.d.ts +35 -0
  185. package/package.json +71 -0
@@ -0,0 +1,9 @@
1
+ import type { MenuProps } from "antd";
2
+ import type { MenuItemType } from "../layout-menu/types";
3
+ interface FirstColumnMenuProps {
4
+ menus?: MenuItemType[];
5
+ sideNavMenuKeyInSplitMode?: string;
6
+ handleMenuSelect?: (key: string, mode: MenuProps["mode"]) => void;
7
+ }
8
+ export default function FirstColumnMenu({ handleMenuSelect, menus, sideNavMenuKeyInSplitMode, }: FirstColumnMenuProps): import("#node_modules/@types/react").JSX.Element;
9
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { MenuProps } from "antd";
2
+ import type { MenuItemType } from "../layout-menu/types";
3
+ interface LayoutMixedSidebarProps {
4
+ computedSidebarWidth?: number;
5
+ topNavItems?: MenuItemType[];
6
+ sideNavItems?: MenuItemType[];
7
+ sideNavMenuKeyInSplitMode?: string;
8
+ handleMenuSelect?: (key: string, mode: MenuProps["mode"]) => void;
9
+ }
10
+ /**
11
+ * 双列布局侧边栏
12
+ */
13
+ export default function LayoutMixedSidebar({ computedSidebarWidth, sideNavItems, topNavItems, handleMenuSelect, sideNavMenuKeyInSplitMode, }: LayoutMixedSidebarProps): import("#node_modules/@types/react").JSX.Element;
14
+ export {};
@@ -0,0 +1 @@
1
+ export default function LayoutMobileMenu(): import("#node_modules/@types/react").JSX.Element | null;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @zh 根布局组件
3
+ * @en Root layout component
4
+ */
5
+ export default function LayoutRoot(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export interface LayoutSidebarProps {
2
+ children?: React.ReactNode;
3
+ computedSidebarWidth: number;
4
+ }
5
+ export default function LayoutSidebar({ children, computedSidebarWidth }: LayoutSidebarProps): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import type { MenuProps, TabsProps } from "antd";
2
+ import type { TabItemProps } from "../../../store/tabs";
3
+ interface DraggableTabPaneProps extends React.HTMLAttributes<HTMLElement> {
4
+ "data-node-key": string;
5
+ "children": React.ReactElement;
6
+ }
7
+ export declare function DraggableTabNode({ className, children, ...props }: DraggableTabPaneProps): import("#node_modules/@types/react").ReactElement<unknown, string | import("#node_modules/@types/react").JSXElementConstructor<any>>;
8
+ interface DraggableTabBarProps {
9
+ tabBarProps: Parameters<Required<TabsProps>["renderTabBar"]>[0];
10
+ DefaultTabBar: Parameters<Required<TabsProps>["renderTabBar"]>[1];
11
+ tabItems: TabItemProps[];
12
+ items: (tabKey: string) => MenuProps["items"];
13
+ onClickMenu: (menuKey: string, nodeKey: string) => void;
14
+ }
15
+ export declare function DraggableTabBar({ tabBarProps, DefaultTabBar, tabItems, items, onClickMenu }: DraggableTabBarProps): import("#node_modules/@types/react").JSX.Element;
16
+ export {};
@@ -0,0 +1,10 @@
1
+ interface TabMaximizeProps {
2
+ className?: string;
3
+ }
4
+ /**
5
+ * 切换标签页最大化 / 最小化
6
+ *
7
+ * @returns 返回标签页最大化 / 最小化的按钮组件
8
+ */
9
+ export declare function TabMaximize({ className }: TabMaximizeProps): import("#node_modules/@types/react").JSX.Element;
10
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * TabOptions组件的属性接口
3
+ * @interface TabOptionsProps
4
+ * @property {string} activeKey - 当前激活的标签页的key
5
+ */
6
+ interface TabOptionsProps {
7
+ activeKey: string;
8
+ className?: string;
9
+ }
10
+ /**
11
+ * TabOptions组件
12
+ * 用于显示标签页的操作选项下拉菜单
13
+ * @param {TabOptionsProps} props - 组件属性
14
+ * @returns {JSX.Element} TabOptions组件
15
+ */
16
+ export declare function TabOptions({ activeKey, className }: TabOptionsProps): import("#node_modules/@types/react").JSX.Element;
17
+ export {};
@@ -0,0 +1,26 @@
1
+ import type { MenuProps } from "antd";
2
+ /**
3
+ * 标签页操作的键值对象
4
+ * @readonly
5
+ * @enum {string}
6
+ * @property {string} REFRESH - 重新加载当前标签页
7
+ * @property {string} CLOSE - 关闭当前标签页
8
+ * @property {string} CLOSE_RIGHT - 关闭右侧标签页
9
+ * @property {string} CLOSE_LEFT - 关闭左侧标签页
10
+ * @property {string} CLOSE_OTHERS - 关闭其他标签页
11
+ * @property {string} CLOSE_ALL - 关闭所有标签页
12
+ */
13
+ export declare const TabActionKeys: {
14
+ readonly REFRESH: "refresh";
15
+ readonly CLOSE: "close";
16
+ readonly CLOSE_RIGHT: "closeRight";
17
+ readonly CLOSE_LEFT: "closeLeft";
18
+ readonly CLOSE_OTHERS: "closeOthers";
19
+ readonly CLOSE_ALL: "closeAll";
20
+ };
21
+ export type TabActionKey = typeof TabActionKeys[keyof typeof TabActionKeys];
22
+ /**
23
+ * 自定义钩子,用于处理标签页的下拉菜单
24
+ * @returns {[Function, Function]} 返回一个元组,包含菜单项生成函数和菜单点击处理函数
25
+ */
26
+ export declare function useDropdownMenu(): readonly [(tabKey: string) => MenuProps["items"], (menuKey: string, nodeKey: string) => void];
@@ -0,0 +1,5 @@
1
+ /**
2
+ * LayoutTabbar 组件
3
+ * 用于渲染和管理应用程序的标签页导航
4
+ */
5
+ export default function LayoutTabbar(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 显式标注返回的 classes 形状(P3.5 / TS2883):
3
+ * 推断类型会引用 jss 的 Classes(非直接依赖,声明不可移植),
4
+ * 这里用结构化等价类型 Record<C, string> 替代,声明产物零额外依赖。
5
+ */
6
+ export declare const useStyles: (data?: any) => Record<"tabsContainer" | "resetTabs" | "brisk" | "plain" | "chrome" | "card", string>;
@@ -0,0 +1 @@
1
+ export default function ParentLayout(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function BreadcrumbViews(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ interface SearchFooterProps {
2
+ searchItems: number;
3
+ }
4
+ export declare function SearchFooter({ searchItems }: SearchFooterProps): import("#node_modules/@types/react").JSX.Element;
5
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { MenuItemType } from "../../../layout-menu/types";
2
+ interface SearchPanelProps {
3
+ menuItem: MenuItemType;
4
+ setActiveKey: (activeKey: string) => void;
5
+ enter: (isLink?: boolean) => void;
6
+ removeHistoryItem: (key: string) => void;
7
+ active: boolean;
8
+ showCloseButton: boolean;
9
+ }
10
+ export declare function SearchPanel({ menuItem, active, enter, setActiveKey, showCloseButton, removeHistoryItem }: SearchPanelProps): import("#node_modules/@types/react").JSX.Element;
11
+ export {};
@@ -0,0 +1 @@
1
+ export declare function GlobalSearch(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ export interface LogoProps {
2
+ sidebarCollapsed: boolean;
3
+ className?: string;
4
+ }
5
+ /**
6
+ * @zh 高度 48px
7
+ * @en The height is 48px
8
+ */
9
+ export declare function Logo({ sidebarCollapsed, className }: LogoProps): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import type { ButtonProps } from "antd";
2
+ import type { NotificationItem } from "./types";
3
+ type NotificationEventType = "viewAll" | "makeAll" | "clear" | "read";
4
+ interface Props extends ButtonProps {
5
+ /**
6
+ * 显示圆点
7
+ */
8
+ onEventChange?: (event: NotificationEventType, item?: NotificationItem) => void;
9
+ /**
10
+ * 显示圆点
11
+ */
12
+ dot?: boolean;
13
+ /**
14
+ * 消息列表
15
+ */
16
+ notifications?: NotificationItem[];
17
+ }
18
+ export declare const NotificationPopup: React.FC<Props>;
19
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { ButtonProps } from "antd";
2
+ export declare function NotificationContainer({ ...restProps }: ButtonProps): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ export interface NotificationItem {
2
+ avatar: string;
3
+ date: string;
4
+ isRead?: boolean;
5
+ message: string;
6
+ title: string;
7
+ }
@@ -0,0 +1 @@
1
+ export declare function Animation(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function PreferencesFooter(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function General(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const getLanguageItems: () => any;
@@ -0,0 +1,7 @@
1
+ export * from "./animation";
2
+ export * from "./footer";
3
+ export * from "./general";
4
+ export * from "./layout";
5
+ export * from "./sidebar";
6
+ export * from "./tabbar";
7
+ export * from "./theme";
@@ -0,0 +1,4 @@
1
+ export declare const SIDE_NAVIGATION = "side-navigation";
2
+ export declare const TOP_NAVIGATION = "top-navigation";
3
+ export declare const TWO_COLUMN_NAVIGATION = "two-column-navigation";
4
+ export declare const MIXED_NAVIGATION = "mixed-navigation";
@@ -0,0 +1 @@
1
+ export declare function PreferencesLayout(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function Sidebar(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function Tabbar(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function BuiltinTheme(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from "./builtin";
2
+ export * from "./theme";
@@ -0,0 +1 @@
1
+ export declare function SiteTheme(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { ButtonProps } from "antd";
2
+ export declare function Preferences({ ...restProps }: ButtonProps): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ export interface NumberInputSpinnerProps {
2
+ children: React.ReactNode;
3
+ name: string;
4
+ min: number;
5
+ max: number;
6
+ value?: number;
7
+ disabled?: boolean;
8
+ onChange?: (a: string, b: number) => void;
9
+ }
10
+ export declare function NumberInputSpinner({ children, disabled, value, name, onChange, min, max, }: NumberInputSpinnerProps): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { SelectProps } from "antd";
2
+ export interface SelectItemProps {
3
+ children: React.ReactNode;
4
+ name: string;
5
+ value?: string;
6
+ disabled?: boolean;
7
+ items: SelectProps["options"];
8
+ }
9
+ export declare function SelectItem({ children, items, disabled, value, name }: SelectItemProps): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { SwitchProps } from "antd";
2
+ export interface SwitchItemProps extends Omit<SwitchProps, "onChange"> {
3
+ children: React.ReactNode;
4
+ name: string;
5
+ onChange?: (a: string, b: unknown) => void;
6
+ tooltip?: React.ReactNode;
7
+ }
8
+ export declare function SwitchItem({ tooltip, children, disabled, checked, name, onChange, ...restProps }: SwitchItemProps): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ export interface TextInputProps {
2
+ children: React.ReactNode;
3
+ name: string;
4
+ value?: string;
5
+ disabled?: boolean;
6
+ onChange?: (name: string, value: string) => void;
7
+ }
8
+ export declare function TextInput({ children, disabled, value, name, onChange, }: TextInputProps): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ interface SiderTriggerProps {
2
+ className?: string;
3
+ }
4
+ export declare function SiderTrigger({ className }: SiderTriggerProps): import("#node_modules/@types/react").JSX.Element;
5
+ export {};
@@ -0,0 +1,15 @@
1
+ /**
2
+ * 通用的语言模块映射类型,表示可以嵌套的对象结构
3
+ *
4
+ * 导出供 i18nResources 的声明生成引用(P3.5 / TS4023:未导出类型会阻断 d.ts)
5
+ */
6
+ export interface LanguageModule<T> {
7
+ [key: string]: T | any;
8
+ }
9
+ /**
10
+ * 语言文件的参数类型,用于描述导入的语言文件集合
11
+ */
12
+ export type LanguageFileMap = Record<string, LanguageModule<LanguageFileMap>>;
13
+ export declare function getZhCnLang(): LanguageModule<LanguageFileMap>;
14
+ export declare function getEnUsLang(): LanguageModule<LanguageFileMap>;
15
+ export declare function organizeLanguageFiles(files: LanguageFileMap): LanguageModule<LanguageFileMap>;
@@ -0,0 +1,18 @@
1
+ import type { InitOptions } from "i18next";
2
+ export * from "./t";
3
+ export type LanguageType = "zh-CN" | "en-US";
4
+ export declare const ANT_DESIGN_LOCALE: {
5
+ "zh-CN": import("antd/lib/locale").Locale;
6
+ "en-US": import("antd/lib/locale").Locale;
7
+ };
8
+ export declare const i18nResources: {
9
+ "zh-CN": {
10
+ translation: import("./helper").LanguageModule<import("./helper").LanguageFileMap>;
11
+ };
12
+ "en-US": {
13
+ translation: import("./helper").LanguageModule<import("./helper").LanguageFileMap>;
14
+ };
15
+ };
16
+ export declare const i18nInitOptions: InitOptions;
17
+ export declare const i18n: import("i18next").i18n;
18
+ export declare function setupI18n(): void;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @zh 此函数没有任何意义,仅用于对 lokalise.i18n-ally 插件获取更好良好的语言提示支持。
3
+ * @en This function has no practical meaning; it is only used to obtain better language prompt support for the lokalise.i18n-ally plugin.
4
+ *
5
+ * @link https://github.com/i18next/react-i18next/issues/1058
6
+ * @zh 官方不推荐在纯 JS 或者 TS 文件场景下如何使用 react-i18next,且目前没有较好的解决方案。
7
+ * @en The official recommendation does not cover how to use react-i18next in pure JS or TS file scenarios, and there is currently no good solution.
8
+ *
9
+ */
10
+ export declare function $t(path: string): string;
@@ -0,0 +1,11 @@
1
+ import type { ModuleDefinition } from "./types";
2
+ /**
3
+ * 声明一个模块。
4
+ *
5
+ * 目前只做类型收窄,但它是模块契约的**唯一入口**:
6
+ * - 编译期:收窄 entry.ts 的导出类型,字段名写错会直接报错
7
+ * - 构建期:CLI 用 esbuild bundle + 真实 import() 解析出 name / version
8
+ * (packages/cli/src/build.ts 的 readModuleDefinition),
9
+ * 替代 `scripts/build-modules.ts` 里脆弱的正则(B10)
10
+ */
11
+ export declare function defineModule(definition: ModuleDefinition): ModuleDefinition;
@@ -0,0 +1,20 @@
1
+ import type { AppRouteRecordRaw } from "../router/types";
2
+ import type { Manifest, ModuleInstance } from "./types";
3
+ export declare function loadAll(manifest: Manifest): Promise<ModuleInstance[]>;
4
+ export declare function getModules(): ModuleInstance[];
5
+ export declare function getModule(name: string): ModuleInstance | undefined;
6
+ export declare function getRoutes(): AppRouteRecordRaw[];
7
+ export declare function getRegisteredStore<T = unknown>(name: string): T | undefined;
8
+ export declare function getRegisteredApiPrefix(moduleName: string): string | undefined;
9
+ /**
10
+ * 卸载模块:执行 onDestroy 生命周期 → 清理其布局插槽(US-8)→ 移除实例。
11
+ * 供运维下线单个模块使用,其余模块不受影响。
12
+ */
13
+ export declare function unloadModule(name: string): Promise<void>;
14
+ /**
15
+ * KeepAlive exclude key:各模块路由中 `handle.keepAlive === false` 的路径集合。
16
+ * 由 module-loader 汇总,不再依赖 access store 的 flatRouteList(B13)。
17
+ */
18
+ export declare function getKeepAliveExcludeKeys(): string[];
19
+ /** 全部路由 key:关闭多 tab 时整体排除,仅保留切换动画 */
20
+ export declare function getAllRoutePathKeys(): string[];
@@ -0,0 +1,18 @@
1
+ import type { AppRouteRecordRaw } from "../router/types";
2
+ import type { ModuleDefinition } from "./types";
3
+ /**
4
+ * 纯函数:从一组路由中收集 `handle.keepAlive === false` 的路由 key。
5
+ * key 与 `flattenRoutes` 产出的键一致,从而能和 KeepAlive 的 `activeCacheKey`
6
+ * (= pathname)精确匹配。
7
+ *
8
+ * 这是 P2.1 把 exclude 计算从 access store 的 `flatRouteList` 反转到
9
+ * module-loader 的核心:缓存是否排除只取决于「模块声明」,不再依赖某条路由
10
+ * 是否套了 ContainerLayout(见设计文档 B13 / R9)。
11
+ */
12
+ export declare function collectKeepAliveExcludes(routes: AppRouteRecordRaw[]): string[];
13
+ /** 纯函数:收集所有路由 key(关闭多 tab 时用于整体排除,仅保留切换动画) */
14
+ export declare function collectAllRoutePaths(routes: AppRouteRecordRaw[]): string[];
15
+ /** 基于一组模块定义计算 exclude key(供单元测试) */
16
+ export declare function getKeepAliveExcludes(definitions: ModuleDefinition[]): string[];
17
+ /** 基于一组模块定义计算全部路由 key(供单元测试) */
18
+ export declare function getAllRoutePaths(definitions: ModuleDefinition[]): string[];
@@ -0,0 +1,8 @@
1
+ /**
2
+ * P7.6:最小 semver 范围判定,覆盖 CLI 产出的 peerRuntime 形态子集:
3
+ * 精确版、"^x.y.z"、"~x.y.z"、">=a <b" 空格合取、"*"。
4
+ * 不追求完整 semver 规范——超纲形态一律返回 false(拒绝加载并显式报错,
5
+ * 比静默放行安全)。
6
+ */
7
+ /** version 是否满足 range(空格分隔的多个比较符为合取) */
8
+ export declare function satisfiesSemver(version: string, range: string): boolean;
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from "react";
2
+ /** 供模块上下文调用:注册/覆盖本模块在某插槽上的节点 */
3
+ export declare function registerSlot(moduleName: string, slotName: string, node: ReactNode): void;
4
+ /** 模块卸载时清理其注册的全部插槽节点 */
5
+ export declare function removeModuleSlots(moduleName: string): void;
6
+ /** 纯读:某插槽当前挂载的全部节点(注册顺序即 Object 值序) */
7
+ export declare function getSlotNodes(slotName: string): ReactNode[];
8
+ /** 布局组件订阅:插槽节点变化(注册/卸载)时触发重渲染 */
9
+ export declare function useSlotNodes(slotName: string): ReactNode[];
@@ -0,0 +1,91 @@
1
+ import type { AppRouteRecordRaw } from "../router/types";
2
+ import type { NotificationsApiProvider, SystemApiProvider, UploadApiProvider } from "../store/api-provider";
3
+ import type { AuthProvider } from "../store/auth-provider";
4
+ /** 模块上下文 — 主框架向模块注入的能力 */
5
+ export interface ModuleContext {
6
+ /** 当前模块的元信息 */
7
+ module: {
8
+ name: string;
9
+ version: string;
10
+ };
11
+ /** 主框架工具 */
12
+ utils: {
13
+ request: typeof import("../utils/request/index").request;
14
+ };
15
+ /** 模块注册器 */
16
+ register: {
17
+ /** 注册额外的 Zustand store */
18
+ store: (name: string, store: unknown) => void;
19
+ /** 注册 API 路由前缀 */
20
+ apiPrefix: (prefix: string) => void;
21
+ /** 接管登录/登出/用户信息(P5);先到先得,模块卸载时自动注销 */
22
+ authProvider: (provider: AuthProvider) => void;
23
+ /** 接管系统角色/菜单类 API(D9);先到先得,模块卸载时自动注销 */
24
+ systemApi: (provider: SystemApiProvider) => void;
25
+ /** 接管通知拉取 API(D9);先到先得,模块卸载时自动注销 */
26
+ notificationsApi: (provider: NotificationsApiProvider) => void;
27
+ /** 接管头像/附件上传端点(D9);先到先得,模块卸载时自动注销 */
28
+ uploadApi: (provider: UploadApiProvider) => void;
29
+ };
30
+ /** 注册布局插槽节点(US-8 L2),卸载模块时自动清理 */
31
+ registerSlot: (slotName: string, node: React.ReactNode) => void;
32
+ }
33
+ /** 模块配置 */
34
+ export interface ModuleConfig {
35
+ /** 模块级别要求的角色,用户须满足其一才能激活此模块 */
36
+ requiredRoles?: string[];
37
+ /** 模块级别要求的权限码,用户须全部满足才能激活此模块 */
38
+ requiredPermissions?: string[];
39
+ /** 依赖的其他模块 name 列表,须在 beforeInit 之前完成加载 */
40
+ dependencies?: string[];
41
+ }
42
+ /** 生命周期钩子 */
43
+ export interface ModuleLifecycle {
44
+ beforeInit?: (ctx: ModuleContext) => Promise<void>;
45
+ onInit?: (ctx: ModuleContext) => Promise<void>;
46
+ onActivate?: (ctx: ModuleContext) => Promise<void>;
47
+ onDeactivate?: (ctx: ModuleContext) => Promise<void>;
48
+ onDestroy?: (ctx: ModuleContext) => Promise<void>;
49
+ }
50
+ /** i18n 资源声明 */
51
+ export interface ModuleI18n {
52
+ [locale: string]: () => Promise<Record<string, unknown>>;
53
+ }
54
+ /** 模块定义 — entry.ts 的导出类型 */
55
+ export interface ModuleDefinition {
56
+ name: string;
57
+ description: string;
58
+ version: string;
59
+ routes: AppRouteRecordRaw[];
60
+ lifecycle?: ModuleLifecycle;
61
+ i18n?: ModuleI18n;
62
+ config?: ModuleConfig;
63
+ /** 兼容的宿主 runtime 版本(semver 范围),宿主加载前校验,不兼容则拒绝加载并显式报错 */
64
+ peerRuntime?: string;
65
+ }
66
+ /** 运行时模块实例 */
67
+ export interface ModuleInstance {
68
+ definition: ModuleDefinition;
69
+ /** missing-deps:声明的依赖模块缺失或加载失败,本模块未执行生命周期(US-9 禁止半加载) */
70
+ status: "pending" | "loading" | "loaded" | "active" | "error" | "missing-deps";
71
+ error?: Error;
72
+ }
73
+ /** manifest.json 中的模块条目 */
74
+ export interface ManifestModuleEntry {
75
+ /** 模块名称,需与 entry.ts 中 name 一致 */
76
+ name: string;
77
+ /** 模块资源路径(本地相对路径或远程 URL) */
78
+ entry: string;
79
+ /** 是否启用 */
80
+ enabled?: boolean;
81
+ /** 依赖的其他模块 name 列表(清单层冗余声明,供运维观测) */
82
+ dependencies?: string[];
83
+ /** 兼容的宿主 runtime 版本(semver 范围),P7.6 起在加载后即刻校验 */
84
+ peerRuntime?: string;
85
+ }
86
+ /** manifest.json 格式 */
87
+ export interface Manifest {
88
+ modules: ManifestModuleEntry[];
89
+ /** 宿主 runtime 实际版本(shell 侧取自 versions.json);提供即启用 peerRuntime 校验(US-5) */
90
+ runtimeVersion?: string;
91
+ }
@@ -0,0 +1 @@
1
+ export default function Login(): import("#node_modules/@types/react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function hideLoading(): void;
@@ -0,0 +1,7 @@
1
+ export declare const loadingId = "loading-e8a3a985";
2
+ export declare const loadingContainerId = "loading-container-e8a3a985";
3
+ /**
4
+ * Preview loading page.
5
+ * https://github.com/user-attachments/assets/110701a8-2cf4-4e5f-a07e-b832da4e1586
6
+ */
7
+ export declare function setupLoading(): void;
@@ -0,0 +1 @@
1
+ export declare const ROOT_ROUTE_ID = "root-route";
@@ -0,0 +1 @@
1
+ export * from "./route-path";
@@ -0,0 +1,22 @@
1
+ /**
2
+ * 如果在其他地方用到了路由跳转,将路由的 path 抽离出来,在此方便维护
3
+ * 防止修改 path 时忘记修改其他地方的 path
4
+ */
5
+ export declare const loginPath = "/login";
6
+ export declare const privacyPolicyPath = "/privacy-policy";
7
+ export declare const termsOfServicePath = "/terms-of-service";
8
+ export declare const exceptionPath = "/exception";
9
+ export declare const exception403Path = "/exception/403";
10
+ export declare const exception404Path = "/exception/404";
11
+ export declare const exception500Path = "/exception/500";
12
+ export declare const exceptionUnknownComponentPath = "/exception/not-found-component";
13
+ /**
14
+ * 判断 pathname 是否为登录页(basename 感知,P0)。
15
+ *
16
+ * 供 ky hooks 等 React 之外的场景使用:原始 `location.pathname` 含 BASE_URL,
17
+ * 子路径部署(/app/)下直接与 loginPath 比较恒为 false,401 时会重复 goLogin。
18
+ * React 组件内请用 `useLocation()`(react-router 已剥离 basename),无需本函数。
19
+ *
20
+ * @param base 部署 basename,Vite 保证以 `/` 结尾
21
+ */
22
+ export declare function isLoginPathname(pathname: string, base?: string): boolean;
@@ -0,0 +1,21 @@
1
+ interface AuthGuardProps {
2
+ children?: React.ReactNode;
3
+ }
4
+ /**
5
+ * @zh AuthGuard 组件,用于权限验证,代码的顺序很重要,不要随意调整
6
+ * @en AuthGuard component, used for permission verification. The order of the code is important and should not be arbitrarily adjusted
7
+ */
8
+ export declare function AuthGuard({ children }: AuthGuardProps): string | number | bigint | boolean | Iterable<import("#node_modules/@types/react").ReactNode> | Promise<string | number | bigint | boolean | import("#node_modules/@types/react").ReactPortal | import("#node_modules/@types/react").ReactElement<unknown, string | import("#node_modules/@types/react").JSXElementConstructor<any>> | Iterable<import("#node_modules/@types/react").ReactNode> | null | undefined> | import("#node_modules/@types/react").JSX.Element | null | undefined;
9
+ export {};
10
+ /**
11
+ * 验证路由跳转是否正确的步骤:
12
+ * 1. 未登录情况下,输入 login 路由
13
+ * 2. 未登录情况下,输入非 login 路由
14
+ * 3. 已登录情况下,使用系统的退出登录,然后再次登录
15
+ * 4. 任选一个非 home 页面,使用开发者工具清除 localStorage,刷新页面之后进行登录
16
+ * 5. 已登录情况下,输入 login 路由
17
+ * 6. 已登录情况下,输入非 login 路由
18
+ * 7. 已登录情况下,输入 http://localhost:3333 跳转到 /home 路由,用户接口发送一次
19
+ * 8. 已登录情况下,输入 http://localhost:3333/ 跳转到 /home 路由,用户接口发送一次
20
+ * 9. 已登录情况下,输入 http://localhost:3333/home 跳转到 /home 路由,用户接口发送一次
21
+ */
@@ -0,0 +1 @@
1
+ export * from "./auth-guard";
@@ -0,0 +1,2 @@
1
+ import type { AppRouteRecordRaw } from "../types";
2
+ export declare function removeDuplicateRoutes(routes: AppRouteRecordRaw[]): AppRouteRecordRaw[];
@@ -0,0 +1,12 @@
1
+ /**
2
+ * 当前路由匹配逻辑:
3
+ * https://mermaid.live/edit#pako:eNqNVF1v0zAU_SuWH6uWD21PfUAqGhqVBqo6EBJJH6zETSySuHIcWDVNGh_TGFtZgW2i0yaK0AYPoAIPFLR1_JkmDU_7Czhx1mXrpi1SrGvfc-451048CzWqY5iHVYs-0UzEOLg3oTpAPNNczJR4rIBc7ga4SWeuKyr0t7772_NBezU8eOcv7Ax6b8RUhRXJikAxuuBxc9JDTFf8V-2w1wNILOSMaOUKd2dAsLHY3_uVsIbgmErcEuJm0blLp6hBnAcm4XiKuFzp_274KwvB8ldgRQkQdjuDtR-DzReZTBK2en6z4TfWM5nD_ZX-wbK_--xwf7PGyGOk1XM1ahGtntAS6fPEgLAC_OZu7KjoxkkleN8RS4PWnt9bvwxf4GP-LUeXaDnGyBIysBJHIAorafwk5vddzIpOlSrh666_ujFY-xK87Pb_fgyedoSyrJPYSjs9rj0CuXTxiHeb2jiqAmRVzcTaoxJmNnFdQhP5CwrFzDL1OGZlSrkStP_InQdXpcuTB3GMTJsdGjkLdNT0KXdK8Gk--LATbD__12oON-sU6IQIMRzKcEHTsOuej95a8r81kxZiWuRr_Nq4Il5Qi87wYqUytfCI0_Dz23Dp59CvbDSNSzcrRceE6FhaNN3CmZ_eaMUUBGahLXKI6OIumI0IKuQmtrEK8yLUcRV5FldhVqZsISKkC5ZQlQhGDFPkVWdOlBK_Op2uOxrMc-bhLGTUM0yYryLLFTOvpiOOJwgyGLKHq1gnnLI78jaKL6UsrCHnIaVHmLn_M6fdRw
4
+ * 1. 初次进入应用
5
+ * 2. 加载 auth-guard.tsx 文件
6
+ * 3. 不包括 login 路由的**路由白名单**,例如:privacy-policy 路由
7
+ * 4. ……
8
+ */
9
+ import type { RouteObject } from "react-router";
10
+ export declare const rootRoute: RouteObject[];
11
+ export declare const router: import("react-router").DataRouter;
12
+ export default router;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 开启后端获取路由的情况下,是否发送路由请求获取路由数据
3
+ *
4
+ * 如果设置为 false,则不会单独发送一个请求获取路由数据,而是从用户详情接口中获取动态路由数据
5
+ * 如果设置为 true,则会单独发送一个请求获取路由数据
6
+ */
7
+ export declare const isSendRoutingRequest = true;