@vlian/framework 1.2.61 → 1.2.63

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 (268) hide show
  1. package/dist/analytics.umd.js +1 -1
  2. package/dist/components/index.cjs +1 -1
  3. package/dist/components/index.d.ts +0 -4
  4. package/dist/components/index.js +1 -1
  5. package/dist/index.cjs +1 -1
  6. package/dist/index.d.ts +0 -1
  7. package/dist/index.js +1 -1
  8. package/dist/index.umd.js +31 -246
  9. package/dist/kernel/types.d.ts +46 -3
  10. package/dist/state.umd.js +1 -1
  11. package/package.json +21 -16
  12. package/dist/components/LocaleSwitch.cjs +0 -1
  13. package/dist/components/LocaleSwitch.d.ts +0 -21
  14. package/dist/components/LocaleSwitch.js +0 -1
  15. package/dist/components/ThemeSwitch.cjs +0 -1
  16. package/dist/components/ThemeSwitch.d.ts +0 -20
  17. package/dist/components/ThemeSwitch.js +0 -1
  18. package/dist/core/Test.cjs +0 -1
  19. package/dist/core/Test.d.ts +0 -5
  20. package/dist/core/Test.js +0 -1
  21. package/dist/core/app/AppContext.cjs +0 -1
  22. package/dist/core/app/AppContext.d.ts +0 -113
  23. package/dist/core/app/AppContext.js +0 -1
  24. package/dist/core/app/AppContext.types.cjs +0 -1
  25. package/dist/core/app/AppContext.types.d.ts +0 -146
  26. package/dist/core/app/AppContext.types.js +0 -1
  27. package/dist/core/app/BasicLayout.cjs +0 -1
  28. package/dist/core/app/BasicLayout.d.ts +0 -15
  29. package/dist/core/app/BasicLayout.js +0 -1
  30. package/dist/core/app/DefaultApp.cjs +0 -1
  31. package/dist/core/app/DefaultApp.d.ts +0 -10
  32. package/dist/core/app/DefaultApp.js +0 -1
  33. package/dist/core/app/index.cjs +0 -1
  34. package/dist/core/app/index.d.ts +0 -8
  35. package/dist/core/app/index.js +0 -1
  36. package/dist/core/config/AppConfig.cjs +0 -1
  37. package/dist/core/config/AppConfig.d.ts +0 -88
  38. package/dist/core/config/AppConfig.js +0 -1
  39. package/dist/core/config/ConfigLoader.cjs +0 -1
  40. package/dist/core/config/ConfigLoader.d.ts +0 -118
  41. package/dist/core/config/ConfigLoader.js +0 -1
  42. package/dist/core/config/ConfigValidator.cjs +0 -2
  43. package/dist/core/config/ConfigValidator.d.ts +0 -84
  44. package/dist/core/config/ConfigValidator.js +0 -2
  45. package/dist/core/config/index.cjs +0 -1
  46. package/dist/core/config/index.d.ts +0 -6
  47. package/dist/core/config/index.js +0 -1
  48. package/dist/core/dev/DevTools.cjs +0 -1
  49. package/dist/core/dev/DevTools.d.ts +0 -16
  50. package/dist/core/dev/DevTools.js +0 -1
  51. package/dist/core/error/ErrorBoundary.cjs +0 -1
  52. package/dist/core/error/ErrorBoundary.d.ts +0 -121
  53. package/dist/core/error/ErrorBoundary.js +0 -1
  54. package/dist/core/error/ErrorHandler.cjs +0 -1
  55. package/dist/core/error/ErrorHandler.d.ts +0 -171
  56. package/dist/core/error/ErrorHandler.js +0 -1
  57. package/dist/core/error/index.cjs +0 -1
  58. package/dist/core/error/index.d.ts +0 -7
  59. package/dist/core/error/index.js +0 -1
  60. package/dist/core/event/AppEventBus.cjs +0 -1
  61. package/dist/core/event/AppEventBus.d.ts +0 -178
  62. package/dist/core/event/AppEventBus.js +0 -1
  63. package/dist/core/event/frameworkEvents.cjs +0 -1
  64. package/dist/core/event/frameworkEvents.d.ts +0 -69
  65. package/dist/core/event/frameworkEvents.js +0 -1
  66. package/dist/core/event/hooks.cjs +0 -1
  67. package/dist/core/event/hooks.d.ts +0 -57
  68. package/dist/core/event/hooks.js +0 -1
  69. package/dist/core/event/index.cjs +0 -1
  70. package/dist/core/event/index.d.ts +0 -10
  71. package/dist/core/event/index.js +0 -1
  72. package/dist/core/event/types.cjs +0 -1
  73. package/dist/core/event/types.d.ts +0 -269
  74. package/dist/core/event/types.js +0 -1
  75. package/dist/core/event/useEventBus.cjs +0 -1
  76. package/dist/core/event/useEventBus.d.ts +0 -28
  77. package/dist/core/event/useEventBus.js +0 -1
  78. package/dist/core/index.cjs +0 -1
  79. package/dist/core/index.d.ts +0 -54
  80. package/dist/core/index.js +0 -1
  81. package/dist/core/initialization/InitializationErrorThrower.cjs +0 -1
  82. package/dist/core/initialization/InitializationErrorThrower.d.ts +0 -7
  83. package/dist/core/initialization/InitializationErrorThrower.js +0 -1
  84. package/dist/core/initialization/index.cjs +0 -1
  85. package/dist/core/initialization/index.d.ts +0 -7
  86. package/dist/core/initialization/index.js +0 -1
  87. package/dist/core/initialization/initialization.cjs +0 -1
  88. package/dist/core/initialization/initialization.d.ts +0 -69
  89. package/dist/core/initialization/initialization.js +0 -1
  90. package/dist/core/initialization/initializationErrorState.cjs +0 -1
  91. package/dist/core/initialization/initializationErrorState.d.ts +0 -35
  92. package/dist/core/initialization/initializationErrorState.js +0 -1
  93. package/dist/core/kernel/defaultAdapters.cjs +0 -1
  94. package/dist/core/kernel/defaultAdapters.d.ts +0 -2
  95. package/dist/core/kernel/defaultAdapters.js +0 -1
  96. package/dist/core/kernel/errors.cjs +0 -1
  97. package/dist/core/kernel/errors.d.ts +0 -18
  98. package/dist/core/kernel/errors.js +0 -1
  99. package/dist/core/kernel/index.cjs +0 -1
  100. package/dist/core/kernel/index.d.ts +0 -3
  101. package/dist/core/kernel/index.js +0 -1
  102. package/dist/core/kernel/startKernel.cjs +0 -1
  103. package/dist/core/kernel/startKernel.d.ts +0 -2
  104. package/dist/core/kernel/startKernel.js +0 -1
  105. package/dist/core/kernel/types.cjs +0 -1
  106. package/dist/core/kernel/types.d.ts +0 -114
  107. package/dist/core/kernel/types.js +0 -1
  108. package/dist/core/middleware.cjs +0 -1
  109. package/dist/core/middleware.d.ts +0 -36
  110. package/dist/core/middleware.js +0 -1
  111. package/dist/core/plugin/PluginEventBus.cjs +0 -1
  112. package/dist/core/plugin/PluginEventBus.d.ts +0 -169
  113. package/dist/core/plugin/PluginEventBus.js +0 -1
  114. package/dist/core/plugin/PluginSandbox.cjs +0 -1
  115. package/dist/core/plugin/PluginSandbox.d.ts +0 -101
  116. package/dist/core/plugin/PluginSandbox.js +0 -1
  117. package/dist/core/plugin.cjs +0 -1
  118. package/dist/core/plugin.d.ts +0 -224
  119. package/dist/core/plugin.js +0 -1
  120. package/dist/core/router/RouterManager.cjs +0 -1
  121. package/dist/core/router/RouterManager.d.ts +0 -87
  122. package/dist/core/router/RouterManager.js +0 -1
  123. package/dist/core/router/adapter/AdapterManager.cjs +0 -1
  124. package/dist/core/router/adapter/AdapterManager.d.ts +0 -94
  125. package/dist/core/router/adapter/AdapterManager.js +0 -1
  126. package/dist/core/router/adapter/index.cjs +0 -1
  127. package/dist/core/router/adapter/index.d.ts +0 -6
  128. package/dist/core/router/adapter/index.js +0 -1
  129. package/dist/core/router/adapter/react-router/ReactRouterAdapter.cjs +0 -1
  130. package/dist/core/router/adapter/react-router/ReactRouterAdapter.d.ts +0 -43
  131. package/dist/core/router/adapter/react-router/ReactRouterAdapter.js +0 -1
  132. package/dist/core/router/adapter/react-router/index.cjs +0 -1
  133. package/dist/core/router/adapter/react-router/index.d.ts +0 -4
  134. package/dist/core/router/adapter/react-router/index.js +0 -1
  135. package/dist/core/router/adapter/types.cjs +0 -1
  136. package/dist/core/router/adapter/types.d.ts +0 -111
  137. package/dist/core/router/adapter/types.js +0 -1
  138. package/dist/core/router/dev/RouterDevTools.cjs +0 -1
  139. package/dist/core/router/dev/RouterDevTools.d.ts +0 -5
  140. package/dist/core/router/dev/RouterDevTools.js +0 -1
  141. package/dist/core/router/dev/index.cjs +0 -1
  142. package/dist/core/router/dev/index.d.ts +0 -4
  143. package/dist/core/router/dev/index.js +0 -1
  144. package/dist/core/router/dynamic/DynamicRouteManager.cjs +0 -1
  145. package/dist/core/router/dynamic/DynamicRouteManager.d.ts +0 -71
  146. package/dist/core/router/dynamic/DynamicRouteManager.js +0 -1
  147. package/dist/core/router/dynamic/index.cjs +0 -1
  148. package/dist/core/router/dynamic/index.d.ts +0 -4
  149. package/dist/core/router/dynamic/index.js +0 -1
  150. package/dist/core/router/errors/RouterError.cjs +0 -1
  151. package/dist/core/router/errors/RouterError.d.ts +0 -48
  152. package/dist/core/router/errors/RouterError.js +0 -1
  153. package/dist/core/router/errors/index.cjs +0 -1
  154. package/dist/core/router/errors/index.d.ts +0 -4
  155. package/dist/core/router/errors/index.js +0 -1
  156. package/dist/core/router/index.cjs +0 -1
  157. package/dist/core/router/index.d.ts +0 -16
  158. package/dist/core/router/index.js +0 -1
  159. package/dist/core/router/lifecycle/RouterLifecycleManager.cjs +0 -1
  160. package/dist/core/router/lifecycle/RouterLifecycleManager.d.ts +0 -56
  161. package/dist/core/router/lifecycle/RouterLifecycleManager.js +0 -1
  162. package/dist/core/router/lifecycle/index.cjs +0 -1
  163. package/dist/core/router/lifecycle/index.d.ts +0 -4
  164. package/dist/core/router/lifecycle/index.js +0 -1
  165. package/dist/core/router/middleware/RouterMiddlewareManager.cjs +0 -1
  166. package/dist/core/router/middleware/RouterMiddlewareManager.d.ts +0 -61
  167. package/dist/core/router/middleware/RouterMiddlewareManager.js +0 -1
  168. package/dist/core/router/middleware/auth.cjs +0 -1
  169. package/dist/core/router/middleware/auth.d.ts +0 -54
  170. package/dist/core/router/middleware/auth.js +0 -1
  171. package/dist/core/router/middleware/index.cjs +0 -1
  172. package/dist/core/router/middleware/index.d.ts +0 -6
  173. package/dist/core/router/middleware/index.js +0 -1
  174. package/dist/core/router/middleware/types.cjs +0 -1
  175. package/dist/core/router/middleware/types.d.ts +0 -82
  176. package/dist/core/router/middleware/types.js +0 -1
  177. package/dist/core/router/monitoring/RouterMonitoring.cjs +0 -1
  178. package/dist/core/router/monitoring/RouterMonitoring.d.ts +0 -134
  179. package/dist/core/router/monitoring/RouterMonitoring.js +0 -1
  180. package/dist/core/router/monitoring/index.cjs +0 -1
  181. package/dist/core/router/monitoring/index.d.ts +0 -4
  182. package/dist/core/router/monitoring/index.js +0 -1
  183. package/dist/core/router/navigation/RouterNavigation.cjs +0 -1
  184. package/dist/core/router/navigation/RouterNavigation.d.ts +0 -43
  185. package/dist/core/router/navigation/RouterNavigation.js +0 -1
  186. package/dist/core/router/navigation/index.cjs +0 -1
  187. package/dist/core/router/navigation/index.d.ts +0 -4
  188. package/dist/core/router/navigation/index.js +0 -1
  189. package/dist/core/router/performance/RouteCache.cjs +0 -1
  190. package/dist/core/router/performance/RouteCache.d.ts +0 -113
  191. package/dist/core/router/performance/RouteCache.js +0 -1
  192. package/dist/core/router/performance/RoutePreloader.cjs +0 -1
  193. package/dist/core/router/performance/RoutePreloader.d.ts +0 -111
  194. package/dist/core/router/performance/RoutePreloader.js +0 -1
  195. package/dist/core/router/performance/index.cjs +0 -1
  196. package/dist/core/router/performance/index.d.ts +0 -5
  197. package/dist/core/router/performance/index.js +0 -1
  198. package/dist/core/router/plugin/RouterPluginManager.cjs +0 -1
  199. package/dist/core/router/plugin/RouterPluginManager.d.ts +0 -74
  200. package/dist/core/router/plugin/RouterPluginManager.js +0 -1
  201. package/dist/core/router/plugin/index.cjs +0 -1
  202. package/dist/core/router/plugin/index.d.ts +0 -5
  203. package/dist/core/router/plugin/index.js +0 -1
  204. package/dist/core/router/plugin/types.cjs +0 -1
  205. package/dist/core/router/plugin/types.d.ts +0 -153
  206. package/dist/core/router/plugin/types.js +0 -1
  207. package/dist/core/router/types.cjs +0 -1
  208. package/dist/core/router/types.d.ts +0 -464
  209. package/dist/core/router/types.js +0 -1
  210. package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.cjs +0 -1
  211. package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.d.ts +0 -2
  212. package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.js +0 -1
  213. package/dist/core/router/utils/adapters/react-router/transform.cjs +0 -1
  214. package/dist/core/router/utils/adapters/react-router/transform.d.ts +0 -5
  215. package/dist/core/router/utils/adapters/react-router/transform.js +0 -1
  216. package/dist/core/router/utils/transform.cjs +0 -1
  217. package/dist/core/router/utils/transform.d.ts +0 -348
  218. package/dist/core/router/utils/transform.js +0 -1
  219. package/dist/core/router/validation/RouterConfigValidator.cjs +0 -2
  220. package/dist/core/router/validation/RouterConfigValidator.d.ts +0 -121
  221. package/dist/core/router/validation/RouterConfigValidator.js +0 -2
  222. package/dist/core/router/validation/index.cjs +0 -1
  223. package/dist/core/router/validation/index.d.ts +0 -5
  224. package/dist/core/router/validation/index.js +0 -1
  225. package/dist/core/router/validation/schema.cjs +0 -1
  226. package/dist/core/router/validation/schema.d.ts +0 -180
  227. package/dist/core/router/validation/schema.js +0 -1
  228. package/dist/core/router/version/RouteVersionManager.cjs +0 -1
  229. package/dist/core/router/version/RouteVersionManager.d.ts +0 -124
  230. package/dist/core/router/version/RouteVersionManager.js +0 -1
  231. package/dist/core/router/version/index.cjs +0 -1
  232. package/dist/core/router/version/index.d.ts +0 -4
  233. package/dist/core/router/version/index.js +0 -1
  234. package/dist/core/splash/SplashScreen.cjs +0 -1
  235. package/dist/core/splash/SplashScreen.d.ts +0 -14
  236. package/dist/core/splash/SplashScreen.js +0 -1
  237. package/dist/core/splash/index.cjs +0 -1
  238. package/dist/core/splash/index.d.ts +0 -5
  239. package/dist/core/splash/index.js +0 -1
  240. package/dist/core/splash/splashScreenUtils.cjs +0 -1
  241. package/dist/core/splash/splashScreenUtils.d.ts +0 -7
  242. package/dist/core/splash/splashScreenUtils.js +0 -1
  243. package/dist/core/startup/AppInstance.cjs +0 -1
  244. package/dist/core/startup/AppInstance.d.ts +0 -138
  245. package/dist/core/startup/AppInstance.js +0 -1
  246. package/dist/core/startup/environment.cjs +0 -1
  247. package/dist/core/startup/environment.d.ts +0 -87
  248. package/dist/core/startup/environment.js +0 -1
  249. package/dist/core/startup/index.cjs +0 -1
  250. package/dist/core/startup/index.d.ts +0 -7
  251. package/dist/core/startup/index.js +0 -1
  252. package/dist/core/startup/initializeServices.cjs +0 -1
  253. package/dist/core/startup/initializeServices.d.ts +0 -68
  254. package/dist/core/startup/initializeServices.js +0 -1
  255. package/dist/core/startup/performanceTracker.cjs +0 -1
  256. package/dist/core/startup/performanceTracker.d.ts +0 -104
  257. package/dist/core/startup/performanceTracker.js +0 -1
  258. package/dist/core/startup/renderApp.cjs +0 -1
  259. package/dist/core/startup/renderApp.d.ts +0 -70
  260. package/dist/core/startup/renderApp.js +0 -1
  261. package/dist/core/startup/startApp.cjs +0 -1
  262. package/dist/core/startup/startApp.d.ts +0 -14
  263. package/dist/core/startup/startApp.js +0 -1
  264. package/dist/core/types.cjs +0 -1
  265. package/dist/core/types.d.ts +0 -501
  266. package/dist/core/types.js +0 -1
  267. package/dist/index.umd.cjs +0 -1
  268. package/dist/index.umd.d.ts +0 -7
@@ -1,501 +0,0 @@
1
- import { LogLevel } from '@vlian/logger';
2
- import type { LangType } from '../library/locale/types';
3
- import { Container, RootOptions } from 'react-dom/client';
4
- import { type ComponentType, type PropsWithChildren, type ReactElement, type ReactNode } from 'react';
5
- import { type InitializationContext } from './initialization';
6
- import type { StorageOptions } from '../types';
7
- import type { ThemeConfig } from './app';
8
- import type { FrameworkError } from '@vlian/utils';
9
- import type { RouterConfig } from './router/types';
10
- export type UIProviderConfig = Record<string, unknown>;
11
- export type UIAppConfig = Record<string, unknown>;
12
- export type GlobalProviderComponent = ComponentType<PropsWithChildren>;
13
- export type GlobalProviderLoader = () => Promise<{
14
- default: GlobalProviderComponent;
15
- }>;
16
- /**
17
- * 生命周期钩子函数类型
18
- */
19
- export type ManagerLifecycle = {
20
- /**
21
- * 在初始化之前执行
22
- */
23
- beforeInitialization?: () => Promise<void> | void;
24
- /**
25
- * 初始化
26
- */
27
- initialization?: () => Promise<void> | void;
28
- /**
29
- * 在初始化之后执行
30
- *
31
- * @param context - 初始化上下文,包含配置、进度、耗时等信息
32
- *
33
- * @example
34
- * ```typescript
35
- * start({
36
- * lifecycle: {
37
- * afterInitialization: (context) => {
38
- * console.log('初始化完成', context);
39
- * },
40
- * },
41
- * });
42
- * ```
43
- */
44
- afterInitialization?: (context: InitializationContext) => Promise<void> | void;
45
- };
46
- /**
47
- * 启动配置选项
48
- */
49
- export interface StartOptions {
50
- /**
51
- * React 应用的挂载容器
52
- *
53
- * 用于指定 React 应用渲染的目标 DOM 元素。如果不提供,框架将自动查找页面中
54
- * 的根元素(通常为 id="root" 的元素)作为默认容器。
55
- *
56
- * @example
57
- * ```typescript
58
- * import { start } from '@vlian/framework';
59
- *
60
- * // 使用默认容器(自动查找 id="root" 的元素)
61
- * start({});
62
- *
63
- * // 指定自定义容器
64
- * const container = document.getElementById('app');
65
- * start({ container });
66
- * ```
67
- */
68
- container?: Container;
69
- /**
70
- * React 根节点的配置选项
71
- *
72
- * 用于配置 React 18+ 的 createRoot 方法的选项,包括:
73
- * - `onRecoverableError`: 错误恢复回调函数
74
- * - `identifierPrefix`: 用于标识符前缀,用于服务端渲染的 hydration
75
- *
76
- * 这些选项将传递给 `react-dom/client` 的 `createRoot` 方法。
77
- *
78
- * @example
79
- * ```typescript
80
- * import { start } from '@vlian/framework';
81
- *
82
- * start({
83
- * rootOptions: {
84
- * onRecoverableError: (error) => {
85
- * console.error('React 错误恢复:', error);
86
- * },
87
- * identifierPrefix: 'my-app-',
88
- * },
89
- * });
90
- * ```
91
- */
92
- rootOptions?: RootOptions;
93
- /**
94
- * 应用根组件
95
- *
96
- * 用于指定要渲染的 React 应用根组件。
97
- *
98
- * @example
99
- * ```typescript
100
- * import { start } from '@vlian/framework';
101
- * import App from './App';
102
- *
103
- * start({
104
- * app: <App />,
105
- * });
106
- * ```
107
- */
108
- app?: ReactElement;
109
- /**
110
- * 是否显示启动页
111
- * - 'auto': 自动判断(推荐)
112
- * - 'always': 总是显示
113
- * - 'never': 从不显示
114
- * - 'first-time-only': 仅首次加载显示
115
- *
116
- * @default 'auto'
117
- */
118
- showSplashScreen?: 'auto' | 'always' | 'never' | 'first-time-only';
119
- /**
120
- * 启动页最小显示时间(毫秒)
121
- *
122
- * 用于避免启动页闪烁,确保用户能看到启动过程。
123
- * 如果初始化完成时间小于此值,将等待至最小时间后再隐藏启动页。
124
- *
125
- * @default 500
126
- *
127
- * @example
128
- * ```typescript
129
- * start({
130
- * minSplashScreenTime: 1000, // 至少显示 1 秒
131
- * });
132
- * ```
133
- */
134
- minSplashScreenTime?: number;
135
- /**
136
- * 路由配置
137
- *
138
- * 配置应用的路由系统,支持内置路由、自定义路由和禁用路由三种模式。
139
- *
140
- * @example
141
- * ```typescript
142
- * start({
143
- * router: {
144
- * enabled: true,
145
- * routes: [
146
- * {
147
- * path: '/login',
148
- * page: LoginPage,
149
- * },
150
- * {
151
- * path: '/',
152
- * layout: MainLayout,
153
- * children: [
154
- * {
155
- * path: 'dashboard',
156
- * page: DashboardPage,
157
- * meta: { title: '仪表盘' },
158
- * },
159
- * ],
160
- * },
161
- * ],
162
- * },
163
- * });
164
- * ```
165
- */
166
- router?: RouterConfig;
167
- /**
168
- * 日志级别
169
- */
170
- loggerLevel?: LogLevel;
171
- /**
172
- * 生命周期钩子
173
- */
174
- lifecycle?: ManagerLifecycle;
175
- /**
176
- * 国际化
177
- */
178
- locale?: Record<LangType, Record<string, unknown>>;
179
- /**
180
- * 启动页完成回调
181
- * 仅在显示启动页时,启动页完成初始化后调用
182
- * 可以在这里执行额外的操作,然后调用 complete() 继续
183
- *
184
- * @example
185
- * ```typescript
186
- * start({
187
- * onSplashComplete: (complete, context) => {
188
- * // 执行额外操作
189
- * await doSomething();
190
- * // 完成后继续
191
- * complete();
192
- * },
193
- * });
194
- * ```
195
- */
196
- onSplashComplete?: (complete: () => void, context: InitializationContext) => Promise<void> | void;
197
- /**
198
- * 存储配置
199
- */
200
- storageOptions?: StorageOptions;
201
- /**
202
- * IndexedDB 表名
203
- */
204
- indexedDBTableName?: string;
205
- /**
206
- * UI Provider 配置(框架无关)
207
- * 可由 UI 适配器消费,适配到 antd/shadcn 等实现。
208
- */
209
- uiProvider?: UIProviderConfig;
210
- /**
211
- * UI App 基础配置(框架无关)
212
- * 可用于通知、弹窗、消息容器等能力的统一注入。
213
- */
214
- uiApp?: UIAppConfig;
215
- /**
216
- * 全局 UI 包裹组件懒加载器
217
- *
218
- * 组件会在 BasicLayout 中统一包裹 children。
219
- * 需返回带 default 导出的 React 组件模块。
220
- *
221
- * @example
222
- * ```typescript
223
- * start({
224
- * globalProvider: () => import('./components/AntdGlobalProvider'),
225
- * });
226
- * ```
227
- */
228
- globalProvider?: GlobalProviderLoader;
229
- /**
230
- * @deprecated 使用 uiProvider 替代
231
- */
232
- antd?: Record<string, unknown>;
233
- /**
234
- * @deprecated 使用 uiApp 替代
235
- */
236
- antdApp?: Record<string, unknown>;
237
- /**
238
- * 主题配置
239
- *
240
- * @example
241
- * ```typescript
242
- * start({
243
- * theme: {
244
- * mode: 'dark',
245
- * primaryColor: '#1890ff',
246
- * },
247
- * });
248
- * ```
249
- */
250
- theme?: ThemeConfig;
251
- /**
252
- * 运行时安全配置
253
- */
254
- runtimeSecurity?: import('../utils/runtimeSecurity').RuntimeSecurityOptions;
255
- /**
256
- * 配置安全选项
257
- */
258
- configSecurity?: import('../utils/configSecurity').ConfigSecurityOptions;
259
- /**
260
- * 性能监控配置
261
- */
262
- performanceMonitor?: import('../utils/performance').PerformanceMonitorConfig;
263
- /**
264
- * 错误监控配置
265
- */
266
- errorMonitor?: import('@vlian/monitoring').ErrorMonitorConfig;
267
- /**
268
- * 分析服务配置
269
- */
270
- analytics?: import('../utils/analytics').AnalyticsConfig;
271
- /**
272
- * 状态管理器配置
273
- *
274
- * 配置框架的状态管理器,支持自定义适配器和作用域设置。
275
- * 如果不提供,将使用默认配置创建状态管理器。
276
- *
277
- * @example
278
- * ```typescript
279
- * import { start } from '@vlian/framework';
280
- *
281
- * start({
282
- * stateManager: {
283
- * enableRegistry: true,
284
- * defaultScope: 'app',
285
- * devMode: true,
286
- * },
287
- * });
288
- * ```
289
- */
290
- stateManager?: import('../state').StateManagerOptions;
291
- /**
292
- * 事件总线配置
293
- *
294
- * 配置应用级事件系统,支持事件追踪、性能监控、安全模式等。
295
- * 如果不提供,将使用默认配置创建事件总线。
296
- *
297
- * @example
298
- * ```typescript
299
- * import { start } from '@vlian/framework';
300
- *
301
- * start({
302
- * eventBus: {
303
- * enableTracking: true,
304
- * maxHistorySize: 200,
305
- * enablePerformanceMonitoring: true,
306
- * namespacePrefix: 'my-app:',
307
- * },
308
- * });
309
- * ```
310
- */
311
- eventBus?: {
312
- enableTracking?: boolean;
313
- maxHistorySize?: number;
314
- enableValidation?: boolean;
315
- validator?: (event: string, data: unknown) => boolean;
316
- enablePerformanceMonitoring?: boolean;
317
- namespacePrefix?: string;
318
- instanceId?: string;
319
- enableSecurityMode?: boolean;
320
- allowedSources?: string[];
321
- };
322
- /**
323
- * 自定义启动屏组件
324
- *
325
- * 如果提供,将使用自定义组件替代默认的启动屏 UI。
326
- * 自定义组件将接收初始化进度、当前步骤和初始化状态作为 props。
327
- *
328
- * @example
329
- * ```typescript
330
- * import { start } from '@vlian/framework';
331
- *
332
- * const CustomSplashScreen = ({ progress, currentStep, isInitializing }) => {
333
- * return (
334
- * <div>
335
- * <h1>加载中...</h1>
336
- * <div>进度: {progress}%</div>
337
- * <div>步骤: {currentStep}</div>
338
- * </div>
339
- * );
340
- * };
341
- *
342
- * start({
343
- * splashScreen: CustomSplashScreen,
344
- * });
345
- * ```
346
- */
347
- splashScreen?: React.ComponentType<SplashScreenCustomProps>;
348
- /**
349
- * 自定义错误反馈组件
350
- *
351
- * 如果提供,将使用自定义的错误 UI 替代默认错误 UI。
352
- * 自定义组件将接收错误对象和重置函数作为参数。
353
- *
354
- * @param error - 标准化后的框架错误对象
355
- * @param resetError - 重置错误边界的函数,调用后可以尝试重新渲染子组件
356
- * @returns 错误 UI 的 React 节点
357
- *
358
- * @example
359
- * ```typescript
360
- * import { start } from '@vlian/framework';
361
- * start({
362
- * errorFallback: (error, reset) => (
363
- * <div>
364
- * <h2>自定义错误标题</h2>
365
- * <p>{error.message}</p>
366
- * <button onClick={reset}>重试</button>
367
- * </div>
368
- * ),
369
- * });
370
- * ```
371
- */
372
- errorFallback?: (error: FrameworkError, resetError: () => void) => ReactNode;
373
- /**
374
- * 安全配置选项
375
- *
376
- * 用于配置框架的安全策略,包括 XSS 防护、配置验证等。
377
- * 框架默认启用所有安全策略,确保应用安全。
378
- *
379
- * @example
380
- * ```typescript
381
- * start({
382
- * security: {
383
- * enableXSSProtection: true, // 默认启用
384
- * validateConfig: true, // 默认启用
385
- * sanitizeUserInput: true, // 默认启用
386
- * },
387
- * });
388
- * ```
389
- */
390
- security?: {
391
- /**
392
- * 是否启用 XSS 防护
393
- * @default true
394
- */
395
- enableXSSProtection?: boolean;
396
- /**
397
- * 是否验证配置项安全性
398
- * @default true
399
- */
400
- validateConfig?: boolean;
401
- /**
402
- * 是否清理用户输入
403
- * @default true
404
- */
405
- sanitizeUserInput?: boolean;
406
- /**
407
- * CSP(内容安全策略)配置
408
- */
409
- csp?: {
410
- defaultSrc?: string[];
411
- scriptSrc?: string[];
412
- styleSrc?: string[];
413
- imgSrc?: string[];
414
- connectSrc?: string[];
415
- fontSrc?: string[];
416
- frameSrc?: string[];
417
- allowUnsafeInline?: boolean;
418
- allowUnsafeEval?: boolean;
419
- };
420
- /**
421
- * CSRF 防护配置
422
- */
423
- csrf?: {
424
- /**
425
- * 是否启用 CSRF 防护
426
- * @default true
427
- */
428
- enabled?: boolean;
429
- /**
430
- * CSRF Token 获取函数
431
- * 如果不提供,框架会自动从 cookie 或 header 中获取
432
- */
433
- getToken?: () => string | Promise<string>;
434
- /**
435
- * CSRF Token 验证函数
436
- * 如果不提供,框架会使用默认验证逻辑
437
- */
438
- validateToken?: (token: string) => boolean | Promise<boolean>;
439
- /**
440
- * CSRF Token 请求头名称
441
- * @default 'X-CSRF-Token'
442
- */
443
- headerName?: string;
444
- /**
445
- * CSRF Token Cookie 名称
446
- * @default 'csrf-token'
447
- */
448
- cookieName?: string;
449
- };
450
- };
451
- /**
452
- * 服务初始化重试配置
453
- *
454
- * 用于配置服务初始化失败时的重试策略。
455
- *
456
- * @example
457
- * ```typescript
458
- * start({
459
- * serviceRetry: {
460
- * maxRetries: 3,
461
- * retryDelay: 1000,
462
- * exponentialBackoff: true,
463
- * },
464
- * });
465
- * ```
466
- */
467
- serviceRetry?: {
468
- /**
469
- * 最大重试次数
470
- * @default 3
471
- */
472
- maxRetries?: number;
473
- /**
474
- * 重试延迟(毫秒)
475
- * @default 1000
476
- */
477
- retryDelay?: number;
478
- /**
479
- * 是否启用指数退避
480
- * @default true
481
- */
482
- exponentialBackoff?: boolean;
483
- };
484
- }
485
- /**
486
- * 自定义启动屏组件的 Props
487
- */
488
- export interface SplashScreenCustomProps {
489
- /**
490
- * 初始化进度(0-100)
491
- */
492
- progress: number;
493
- /**
494
- * 当前步骤描述
495
- */
496
- currentStep: string;
497
- /**
498
- * 是否正在初始化
499
- */
500
- isInitializing: boolean;
501
- }
@@ -1 +0,0 @@
1
- export{};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});_export_star(require("./index"),exports);function _export_star(from,to){Object.keys(from).forEach(function(k){if(k!=="default"&&!Object.prototype.hasOwnProperty.call(to,k)){Object.defineProperty(to,k,{enumerable:true,get:function(){return from[k]}})}});return from}
@@ -1,7 +0,0 @@
1
- /**
2
- * UMD 入口文件
3
- *
4
- * 此文件用于构建 UMD 格式的包,在浏览器环境中会将框架暴露为 window.vlianFramework
5
- * Rollup 会自动处理 UMD 格式的导出,此文件只需要重新导出所有内容
6
- */
7
- export * from './index';