@vlian/framework 1.2.60 → 1.2.62

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 (260) 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/core-bak/Test.cjs +1 -0
  6. package/dist/core-bak/Test.d.ts +5 -0
  7. package/dist/core-bak/Test.js +1 -0
  8. package/dist/core-bak/app/AppContext.cjs +1 -0
  9. package/dist/core-bak/app/AppContext.d.ts +113 -0
  10. package/dist/core-bak/app/AppContext.js +1 -0
  11. package/dist/core-bak/app/AppContext.types.cjs +1 -0
  12. package/dist/core-bak/app/AppContext.types.d.ts +146 -0
  13. package/dist/core-bak/app/AppContext.types.js +1 -0
  14. package/dist/core-bak/app/BasicLayout.cjs +1 -0
  15. package/dist/core-bak/app/BasicLayout.d.ts +15 -0
  16. package/dist/core-bak/app/BasicLayout.js +1 -0
  17. package/dist/core-bak/app/DefaultApp.cjs +1 -0
  18. package/dist/core-bak/app/DefaultApp.d.ts +10 -0
  19. package/dist/core-bak/app/DefaultApp.js +1 -0
  20. package/dist/core-bak/app/index.cjs +1 -0
  21. package/dist/core-bak/app/index.d.ts +8 -0
  22. package/dist/core-bak/app/index.js +1 -0
  23. package/dist/core-bak/config/AppConfig.cjs +1 -0
  24. package/dist/core-bak/config/AppConfig.d.ts +88 -0
  25. package/dist/core-bak/config/AppConfig.js +1 -0
  26. package/dist/core-bak/config/ConfigLoader.cjs +1 -0
  27. package/dist/core-bak/config/ConfigLoader.d.ts +118 -0
  28. package/dist/core-bak/config/ConfigLoader.js +1 -0
  29. package/dist/core-bak/config/ConfigValidator.cjs +2 -0
  30. package/dist/core-bak/config/ConfigValidator.d.ts +84 -0
  31. package/dist/core-bak/config/ConfigValidator.js +2 -0
  32. package/dist/core-bak/config/index.cjs +1 -0
  33. package/dist/core-bak/config/index.d.ts +6 -0
  34. package/dist/core-bak/config/index.js +1 -0
  35. package/dist/core-bak/dev/DevTools.cjs +1 -0
  36. package/dist/core-bak/dev/DevTools.d.ts +16 -0
  37. package/dist/core-bak/dev/DevTools.js +1 -0
  38. package/dist/core-bak/error/ErrorBoundary.cjs +1 -0
  39. package/dist/core-bak/error/ErrorBoundary.d.ts +121 -0
  40. package/dist/core-bak/error/ErrorBoundary.js +1 -0
  41. package/dist/core-bak/error/ErrorHandler.cjs +1 -0
  42. package/dist/core-bak/error/ErrorHandler.d.ts +171 -0
  43. package/dist/core-bak/error/ErrorHandler.js +1 -0
  44. package/dist/core-bak/error/index.cjs +1 -0
  45. package/dist/core-bak/error/index.d.ts +7 -0
  46. package/dist/core-bak/error/index.js +1 -0
  47. package/dist/core-bak/event/AppEventBus.cjs +1 -0
  48. package/dist/core-bak/event/AppEventBus.d.ts +178 -0
  49. package/dist/core-bak/event/AppEventBus.js +1 -0
  50. package/dist/core-bak/event/frameworkEvents.cjs +1 -0
  51. package/dist/core-bak/event/frameworkEvents.d.ts +69 -0
  52. package/dist/core-bak/event/frameworkEvents.js +1 -0
  53. package/dist/core-bak/event/hooks.cjs +1 -0
  54. package/dist/core-bak/event/hooks.d.ts +57 -0
  55. package/dist/core-bak/event/hooks.js +1 -0
  56. package/dist/core-bak/event/index.cjs +1 -0
  57. package/dist/core-bak/event/index.d.ts +10 -0
  58. package/dist/core-bak/event/index.js +1 -0
  59. package/dist/core-bak/event/types.cjs +1 -0
  60. package/dist/core-bak/event/types.d.ts +269 -0
  61. package/dist/core-bak/event/types.js +1 -0
  62. package/dist/core-bak/event/useEventBus.cjs +1 -0
  63. package/dist/core-bak/event/useEventBus.d.ts +28 -0
  64. package/dist/core-bak/event/useEventBus.js +1 -0
  65. package/dist/core-bak/index.cjs +1 -0
  66. package/dist/core-bak/index.d.ts +54 -0
  67. package/dist/core-bak/index.js +1 -0
  68. package/dist/core-bak/initialization/InitializationErrorThrower.cjs +1 -0
  69. package/dist/core-bak/initialization/InitializationErrorThrower.d.ts +7 -0
  70. package/dist/core-bak/initialization/InitializationErrorThrower.js +1 -0
  71. package/dist/core-bak/initialization/index.cjs +1 -0
  72. package/dist/core-bak/initialization/index.d.ts +7 -0
  73. package/dist/core-bak/initialization/index.js +1 -0
  74. package/dist/core-bak/initialization/initialization.cjs +1 -0
  75. package/dist/core-bak/initialization/initialization.d.ts +69 -0
  76. package/dist/core-bak/initialization/initialization.js +1 -0
  77. package/dist/core-bak/initialization/initializationErrorState.cjs +1 -0
  78. package/dist/core-bak/initialization/initializationErrorState.d.ts +35 -0
  79. package/dist/core-bak/initialization/initializationErrorState.js +1 -0
  80. package/dist/core-bak/kernel/defaultAdapters.cjs +1 -0
  81. package/dist/core-bak/kernel/defaultAdapters.d.ts +2 -0
  82. package/dist/core-bak/kernel/defaultAdapters.js +1 -0
  83. package/dist/core-bak/kernel/errors.cjs +1 -0
  84. package/dist/core-bak/kernel/errors.d.ts +18 -0
  85. package/dist/core-bak/kernel/errors.js +1 -0
  86. package/dist/core-bak/kernel/index.cjs +1 -0
  87. package/dist/core-bak/kernel/index.d.ts +3 -0
  88. package/dist/core-bak/kernel/index.js +1 -0
  89. package/dist/core-bak/kernel/startKernel.cjs +1 -0
  90. package/dist/core-bak/kernel/startKernel.d.ts +2 -0
  91. package/dist/core-bak/kernel/startKernel.js +1 -0
  92. package/dist/core-bak/kernel/types.cjs +1 -0
  93. package/dist/core-bak/kernel/types.d.ts +114 -0
  94. package/dist/core-bak/kernel/types.js +1 -0
  95. package/dist/core-bak/middleware.cjs +1 -0
  96. package/dist/core-bak/middleware.d.ts +36 -0
  97. package/dist/core-bak/middleware.js +1 -0
  98. package/dist/core-bak/plugin/PluginEventBus.cjs +1 -0
  99. package/dist/core-bak/plugin/PluginEventBus.d.ts +169 -0
  100. package/dist/core-bak/plugin/PluginEventBus.js +1 -0
  101. package/dist/core-bak/plugin/PluginSandbox.cjs +1 -0
  102. package/dist/core-bak/plugin/PluginSandbox.d.ts +101 -0
  103. package/dist/core-bak/plugin/PluginSandbox.js +1 -0
  104. package/dist/core-bak/plugin.cjs +1 -0
  105. package/dist/core-bak/plugin.d.ts +224 -0
  106. package/dist/core-bak/plugin.js +1 -0
  107. package/dist/core-bak/router/RouterManager.cjs +1 -0
  108. package/dist/core-bak/router/RouterManager.d.ts +87 -0
  109. package/dist/core-bak/router/RouterManager.js +1 -0
  110. package/dist/core-bak/router/adapter/AdapterManager.cjs +1 -0
  111. package/dist/core-bak/router/adapter/AdapterManager.d.ts +94 -0
  112. package/dist/core-bak/router/adapter/AdapterManager.js +1 -0
  113. package/dist/core-bak/router/adapter/index.cjs +1 -0
  114. package/dist/core-bak/router/adapter/index.d.ts +6 -0
  115. package/dist/core-bak/router/adapter/index.js +1 -0
  116. package/dist/core-bak/router/adapter/react-router/ReactRouterAdapter.cjs +1 -0
  117. package/dist/core-bak/router/adapter/react-router/ReactRouterAdapter.d.ts +43 -0
  118. package/dist/core-bak/router/adapter/react-router/ReactRouterAdapter.js +1 -0
  119. package/dist/core-bak/router/adapter/react-router/index.cjs +1 -0
  120. package/dist/core-bak/router/adapter/react-router/index.d.ts +4 -0
  121. package/dist/core-bak/router/adapter/react-router/index.js +1 -0
  122. package/dist/core-bak/router/adapter/types.cjs +1 -0
  123. package/dist/core-bak/router/adapter/types.d.ts +111 -0
  124. package/dist/core-bak/router/adapter/types.js +1 -0
  125. package/dist/core-bak/router/dev/RouterDevTools.cjs +1 -0
  126. package/dist/core-bak/router/dev/RouterDevTools.d.ts +5 -0
  127. package/dist/core-bak/router/dev/RouterDevTools.js +1 -0
  128. package/dist/core-bak/router/dev/index.cjs +1 -0
  129. package/dist/core-bak/router/dev/index.d.ts +4 -0
  130. package/dist/core-bak/router/dev/index.js +1 -0
  131. package/dist/core-bak/router/dynamic/DynamicRouteManager.cjs +1 -0
  132. package/dist/core-bak/router/dynamic/DynamicRouteManager.d.ts +71 -0
  133. package/dist/core-bak/router/dynamic/DynamicRouteManager.js +1 -0
  134. package/dist/core-bak/router/dynamic/index.cjs +1 -0
  135. package/dist/core-bak/router/dynamic/index.d.ts +4 -0
  136. package/dist/core-bak/router/dynamic/index.js +1 -0
  137. package/dist/core-bak/router/errors/RouterError.cjs +1 -0
  138. package/dist/core-bak/router/errors/RouterError.d.ts +48 -0
  139. package/dist/core-bak/router/errors/RouterError.js +1 -0
  140. package/dist/core-bak/router/errors/index.cjs +1 -0
  141. package/dist/core-bak/router/errors/index.d.ts +4 -0
  142. package/dist/core-bak/router/errors/index.js +1 -0
  143. package/dist/core-bak/router/index.cjs +1 -0
  144. package/dist/core-bak/router/index.d.ts +16 -0
  145. package/dist/core-bak/router/index.js +1 -0
  146. package/dist/core-bak/router/lifecycle/RouterLifecycleManager.cjs +1 -0
  147. package/dist/core-bak/router/lifecycle/RouterLifecycleManager.d.ts +56 -0
  148. package/dist/core-bak/router/lifecycle/RouterLifecycleManager.js +1 -0
  149. package/dist/core-bak/router/lifecycle/index.cjs +1 -0
  150. package/dist/core-bak/router/lifecycle/index.d.ts +4 -0
  151. package/dist/core-bak/router/lifecycle/index.js +1 -0
  152. package/dist/core-bak/router/middleware/RouterMiddlewareManager.cjs +1 -0
  153. package/dist/core-bak/router/middleware/RouterMiddlewareManager.d.ts +61 -0
  154. package/dist/core-bak/router/middleware/RouterMiddlewareManager.js +1 -0
  155. package/dist/core-bak/router/middleware/auth.cjs +1 -0
  156. package/dist/core-bak/router/middleware/auth.d.ts +54 -0
  157. package/dist/core-bak/router/middleware/auth.js +1 -0
  158. package/dist/core-bak/router/middleware/index.cjs +1 -0
  159. package/dist/core-bak/router/middleware/index.d.ts +6 -0
  160. package/dist/core-bak/router/middleware/index.js +1 -0
  161. package/dist/core-bak/router/middleware/types.cjs +1 -0
  162. package/dist/core-bak/router/middleware/types.d.ts +82 -0
  163. package/dist/core-bak/router/middleware/types.js +1 -0
  164. package/dist/core-bak/router/monitoring/RouterMonitoring.cjs +1 -0
  165. package/dist/core-bak/router/monitoring/RouterMonitoring.d.ts +134 -0
  166. package/dist/core-bak/router/monitoring/RouterMonitoring.js +1 -0
  167. package/dist/core-bak/router/monitoring/index.cjs +1 -0
  168. package/dist/core-bak/router/monitoring/index.d.ts +4 -0
  169. package/dist/core-bak/router/monitoring/index.js +1 -0
  170. package/dist/core-bak/router/navigation/RouterNavigation.cjs +1 -0
  171. package/dist/core-bak/router/navigation/RouterNavigation.d.ts +43 -0
  172. package/dist/core-bak/router/navigation/RouterNavigation.js +1 -0
  173. package/dist/core-bak/router/navigation/index.cjs +1 -0
  174. package/dist/core-bak/router/navigation/index.d.ts +4 -0
  175. package/dist/core-bak/router/navigation/index.js +1 -0
  176. package/dist/core-bak/router/performance/RouteCache.cjs +1 -0
  177. package/dist/core-bak/router/performance/RouteCache.d.ts +113 -0
  178. package/dist/core-bak/router/performance/RouteCache.js +1 -0
  179. package/dist/core-bak/router/performance/RoutePreloader.cjs +1 -0
  180. package/dist/core-bak/router/performance/RoutePreloader.d.ts +111 -0
  181. package/dist/core-bak/router/performance/RoutePreloader.js +1 -0
  182. package/dist/core-bak/router/performance/index.cjs +1 -0
  183. package/dist/core-bak/router/performance/index.d.ts +5 -0
  184. package/dist/core-bak/router/performance/index.js +1 -0
  185. package/dist/core-bak/router/plugin/RouterPluginManager.cjs +1 -0
  186. package/dist/core-bak/router/plugin/RouterPluginManager.d.ts +74 -0
  187. package/dist/core-bak/router/plugin/RouterPluginManager.js +1 -0
  188. package/dist/core-bak/router/plugin/index.cjs +1 -0
  189. package/dist/core-bak/router/plugin/index.d.ts +5 -0
  190. package/dist/core-bak/router/plugin/index.js +1 -0
  191. package/dist/core-bak/router/plugin/types.cjs +1 -0
  192. package/dist/core-bak/router/plugin/types.d.ts +153 -0
  193. package/dist/core-bak/router/plugin/types.js +1 -0
  194. package/dist/core-bak/router/types.cjs +1 -0
  195. package/dist/core-bak/router/types.d.ts +464 -0
  196. package/dist/core-bak/router/types.js +1 -0
  197. package/dist/core-bak/router/utils/adapters/react-router/RouteErrorBoundary.cjs +1 -0
  198. package/dist/core-bak/router/utils/adapters/react-router/RouteErrorBoundary.d.ts +2 -0
  199. package/dist/core-bak/router/utils/adapters/react-router/RouteErrorBoundary.js +1 -0
  200. package/dist/core-bak/router/utils/adapters/react-router/transform.cjs +1 -0
  201. package/dist/core-bak/router/utils/adapters/react-router/transform.d.ts +5 -0
  202. package/dist/core-bak/router/utils/adapters/react-router/transform.js +1 -0
  203. package/dist/core-bak/router/utils/transform.cjs +1 -0
  204. package/dist/core-bak/router/utils/transform.d.ts +348 -0
  205. package/dist/core-bak/router/utils/transform.js +1 -0
  206. package/dist/core-bak/router/validation/RouterConfigValidator.cjs +2 -0
  207. package/dist/core-bak/router/validation/RouterConfigValidator.d.ts +121 -0
  208. package/dist/core-bak/router/validation/RouterConfigValidator.js +2 -0
  209. package/dist/core-bak/router/validation/index.cjs +1 -0
  210. package/dist/core-bak/router/validation/index.d.ts +5 -0
  211. package/dist/core-bak/router/validation/index.js +1 -0
  212. package/dist/core-bak/router/validation/schema.cjs +1 -0
  213. package/dist/core-bak/router/validation/schema.d.ts +180 -0
  214. package/dist/core-bak/router/validation/schema.js +1 -0
  215. package/dist/core-bak/router/version/RouteVersionManager.cjs +1 -0
  216. package/dist/core-bak/router/version/RouteVersionManager.d.ts +124 -0
  217. package/dist/core-bak/router/version/RouteVersionManager.js +1 -0
  218. package/dist/core-bak/router/version/index.cjs +1 -0
  219. package/dist/core-bak/router/version/index.d.ts +4 -0
  220. package/dist/core-bak/router/version/index.js +1 -0
  221. package/dist/core-bak/splash/SplashScreen.cjs +1 -0
  222. package/dist/core-bak/splash/SplashScreen.d.ts +14 -0
  223. package/dist/core-bak/splash/SplashScreen.js +1 -0
  224. package/dist/core-bak/splash/index.cjs +1 -0
  225. package/dist/core-bak/splash/index.d.ts +5 -0
  226. package/dist/core-bak/splash/index.js +1 -0
  227. package/dist/core-bak/splash/splashScreenUtils.cjs +1 -0
  228. package/dist/core-bak/splash/splashScreenUtils.d.ts +7 -0
  229. package/dist/core-bak/splash/splashScreenUtils.js +1 -0
  230. package/dist/core-bak/startup/AppInstance.cjs +1 -0
  231. package/dist/core-bak/startup/AppInstance.d.ts +138 -0
  232. package/dist/core-bak/startup/AppInstance.js +1 -0
  233. package/dist/core-bak/startup/environment.cjs +1 -0
  234. package/dist/core-bak/startup/environment.d.ts +87 -0
  235. package/dist/core-bak/startup/environment.js +1 -0
  236. package/dist/core-bak/startup/index.cjs +1 -0
  237. package/dist/core-bak/startup/index.d.ts +7 -0
  238. package/dist/core-bak/startup/index.js +1 -0
  239. package/dist/core-bak/startup/initializeServices.cjs +1 -0
  240. package/dist/core-bak/startup/initializeServices.d.ts +68 -0
  241. package/dist/core-bak/startup/initializeServices.js +1 -0
  242. package/dist/core-bak/startup/performanceTracker.cjs +1 -0
  243. package/dist/core-bak/startup/performanceTracker.d.ts +104 -0
  244. package/dist/core-bak/startup/performanceTracker.js +1 -0
  245. package/dist/core-bak/startup/renderApp.cjs +1 -0
  246. package/dist/core-bak/startup/renderApp.d.ts +70 -0
  247. package/dist/core-bak/startup/renderApp.js +1 -0
  248. package/dist/core-bak/startup/startApp.cjs +1 -0
  249. package/dist/core-bak/startup/startApp.d.ts +14 -0
  250. package/dist/core-bak/startup/startApp.js +1 -0
  251. package/dist/core-bak/types.cjs +1 -0
  252. package/dist/core-bak/types.d.ts +501 -0
  253. package/dist/core-bak/types.js +1 -0
  254. package/dist/index.cjs +1 -1
  255. package/dist/index.d.ts +0 -1
  256. package/dist/index.js +1 -1
  257. package/dist/index.umd.js +31 -246
  258. package/dist/kernel/types.d.ts +46 -3
  259. package/dist/state.umd.js +1 -1
  260. package/package.json +7 -12
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @vlian/framework v1.2.59
2
+ * @vlian/framework v1.2.61
3
3
  * Secra Framework - 一个现代化的低代码框架
4
4
  * (c) 2026 Secra Framework Contributors
5
5
  * Licensed under Apache-2.0
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get LocaleSwitch(){return _LocaleSwitch.LocaleSwitch},get ThemeSwitch(){return _ThemeSwitch.ThemeSwitch}});const _ThemeSwitch=require("./ThemeSwitch");const _LocaleSwitch=require("./LocaleSwitch");
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});
@@ -1,5 +1 @@
1
- export { ThemeSwitch } from './ThemeSwitch';
2
- export type { ThemeSwitchProps, ThemeSwitchRenderContext } from './ThemeSwitch';
3
- export { LocaleSwitch } from './LocaleSwitch';
4
- export type { LocaleSwitchProps, LocaleSwitchRenderContext } from './LocaleSwitch';
5
1
  export type { PersistenceOptions, StorageLike } from './persistence';
@@ -1 +1 @@
1
- export{ThemeSwitch}from"./ThemeSwitch";export{LocaleSwitch}from"./LocaleSwitch";
1
+ export{};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return _default}});const _jsxruntime=require("react/jsx-runtime");const _react=/*#__PURE__*/_interop_require_wildcard(require("react"));const _logger=require("@vlian/logger");function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interop_require_wildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={__proto__:null};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}const App=({onComplete})=>{(0,_react.useEffect)(()=>{_logger.logger.info("App mounted");onComplete()},[]);return(0,_jsxruntime.jsx)("div",{children:"App"})};const _default=App;
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ declare const App: React.FC<{
3
+ onComplete: () => void;
4
+ }>;
5
+ export default App;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import React,{useEffect}from"react";import{logger}from"@vlian/logger";const App=({onComplete})=>{useEffect(()=>{logger.info("App mounted");onComplete()},[]);return _jsx("div",{children:"App"})};export default App;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get AppContextProvider(){return AppContextProvider},get useAppContext(){return useAppContext},get useConfig(){return useConfig},get useLocale(){return useLocale},get useStateManager(){return useStateManager},get useTheme(){return useTheme}});const _jsxruntime=require("react/jsx-runtime");const _react=/*#__PURE__*/_interop_require_wildcard(require("react"));const _library=require("../../library");const _AppConfig=require("../config/AppConfig");function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interop_require_wildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={__proto__:null};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}const ThemeContext=(0,_react.createContext)(undefined);const LocaleContext=(0,_react.createContext)(undefined);const ConfigContext=(0,_react.createContext)(undefined);const StateManagerContext=(0,_react.createContext)(undefined);const ThemeProvider=_react.default.memo(({children,initialTheme})=>{const[theme,setThemeState]=(0,_react.useState)(initialTheme||_AppConfig.appConfig.getTheme());const applyDocumentThemeClass=(0,_react.useCallback)(mode=>{if(typeof window==="undefined"){return}const html=document.documentElement;html.classList.remove("light","dark");const resolvedMode=mode==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":mode||"light";html.classList.add(resolvedMode)},[]);(0,_react.useEffect)(()=>{_AppConfig.appConfig.setTheme(theme)},[theme]);(0,_react.useEffect)(()=>{if(typeof window==="undefined"){return}applyDocumentThemeClass(theme.mode);if(theme.mode!=="system"){return}const mediaQuery=window.matchMedia("(prefers-color-scheme: dark)");const onSystemThemeChange=()=>applyDocumentThemeClass("system");if(typeof mediaQuery.addEventListener==="function"){mediaQuery.addEventListener("change",onSystemThemeChange);return()=>mediaQuery.removeEventListener("change",onSystemThemeChange)}mediaQuery.addListener(onSystemThemeChange);return()=>mediaQuery.removeListener(onSystemThemeChange)},[applyDocumentThemeClass,theme.mode]);const setTheme=(0,_react.useCallback)(newTheme=>{setThemeState(prev=>{return typeof newTheme==="function"?newTheme(prev):newTheme})},[]);const value=(0,_react.useMemo)(()=>({theme,setTheme}),[theme,setTheme]);return(0,_jsxruntime.jsx)(ThemeContext.Provider,{value:value,children:children})});ThemeProvider.displayName="ThemeProvider";const LocaleProvider=_react.default.memo(({children,initialLocale})=>{const[locale,setLocaleState]=(0,_react.useState)(initialLocale||_AppConfig.appConfig.getLocale());const[isChanging,setIsChanging]=(0,_react.useState)(false);(0,_react.useEffect)(()=>{_AppConfig.appConfig.setLocale(locale)},[locale]);const setLocale=(0,_react.useCallback)(newLocale=>{if(newLocale===locale){return}setIsChanging(true);setLocaleState(newLocale);(0,_library.setLang)(newLocale);requestAnimationFrame(()=>{setIsChanging(false)})},[locale]);const value=(0,_react.useMemo)(()=>({locale,setLocale,isChanging}),[locale,setLocale,isChanging]);return(0,_jsxruntime.jsx)(LocaleContext.Provider,{value:value,children:children})});LocaleProvider.displayName="LocaleProvider";const AppConfigProvider=_react.default.memo(({children,initialAntdConfig,initialInitializationContext})=>{const[antdConfig,setAntdConfigState]=(0,_react.useState)(initialAntdConfig||_AppConfig.appConfig.getAntdConfig());const[initializationContext,setInitializationContextState]=(0,_react.useState)(initialInitializationContext||_AppConfig.appConfig.getInitializationContext());(0,_react.useEffect)(()=>{_AppConfig.appConfig.setAntdConfig(antdConfig)},[antdConfig]);(0,_react.useEffect)(()=>{_AppConfig.appConfig.setInitializationContext(initializationContext)},[initializationContext]);const setAntdConfig=(0,_react.useCallback)(config=>{setAntdConfigState(config)},[]);const setInitializationContext=(0,_react.useCallback)(context=>{setInitializationContextState(context)},[]);const value=(0,_react.useMemo)(()=>({antdConfig,initializationContext,setAntdConfig,setInitializationContext}),[antdConfig,initializationContext,setAntdConfig,setInitializationContext]);return(0,_jsxruntime.jsx)(ConfigContext.Provider,{value:value,children:children})});AppConfigProvider.displayName="AppConfigProvider";const StateManagerProvider=_react.default.memo(({children,stateManager})=>{const value=(0,_react.useMemo)(()=>({stateManager:stateManager??null}),[stateManager]);return(0,_jsxruntime.jsx)(StateManagerContext.Provider,{value:value,children:children})});StateManagerProvider.displayName="StateManagerProvider";const AppContextProvider=({children,initialTheme,initialLocale,initialAntdConfig,initialInitializationContext,stateManager,antdApp:_antdApp,uiApp:_uiApp})=>{const initializedRef=_react.default.useRef(false);_react.default.useEffect(()=>{if(!initializedRef.current){_AppConfig.appConfig.initialize({theme:initialTheme,locale:initialLocale,antdConfig:initialAntdConfig,initializationContext:initialInitializationContext});initializedRef.current=true}},[initialTheme,initialLocale,initialAntdConfig,initialInitializationContext]);return(0,_jsxruntime.jsx)(ThemeProvider,{initialTheme:initialTheme,children:(0,_jsxruntime.jsx)(LocaleProvider,{initialLocale:initialLocale,children:(0,_jsxruntime.jsx)(AppConfigProvider,{initialAntdConfig:initialAntdConfig,initialInitializationContext:initialInitializationContext,children:(0,_jsxruntime.jsx)(StateManagerProvider,{stateManager:stateManager,children:children})})})})};const useTheme=()=>{const context=(0,_react.useContext)(ThemeContext);if(context===undefined){throw new Error("useTheme 必须在 AppContextProvider 内使用")}return context};const useLocale=()=>{const context=(0,_react.useContext)(LocaleContext);if(context===undefined){throw new Error("useLocale 必须在 AppContextProvider 内使用")}return context};const useConfig=()=>{const context=(0,_react.useContext)(ConfigContext);if(context===undefined){throw new Error("useConfig 必须在 AppContextProvider 内使用")}return context};const useStateManager=()=>{const context=(0,_react.useContext)(StateManagerContext);if(context===undefined){throw new Error("useStateManager 必须在 AppContextProvider 内使用")}return context.stateManager};const useAppContext=()=>{const themeContext=useTheme();const localeContext=useLocale();const configContext=useConfig();const stateManagerContext=useStateManager();return(0,_react.useMemo)(()=>({theme:themeContext.theme,locale:localeContext.locale,antdConfig:configContext.antdConfig,initializationContext:configContext.initializationContext,stateManager:stateManagerContext,setTheme:themeContext.setTheme,setLocale:localeContext.setLocale,setAntdConfig:configContext.setAntdConfig,setInitializationContext:configContext.setInitializationContext}),[themeContext.theme,localeContext.locale,configContext.antdConfig,configContext.initializationContext,stateManagerContext,themeContext.setTheme,localeContext.setLocale,configContext.setAntdConfig,configContext.setInitializationContext])};
@@ -0,0 +1,113 @@
1
+ import React from 'react';
2
+ import type { PropsWithChildren } from 'react';
3
+ import type { LangType } from '../../library/locale/types';
4
+ import type { InitializationContext } from '../initialization';
5
+ import type { ThemeContextValue, LocaleContextValue, ConfigContextValue, AppContextValue, ThemeConfig } from './AppContext.types';
6
+ import type { StateManager } from '../../state';
7
+ import type { UIAppConfig, UIProviderConfig } from '../types';
8
+ /**
9
+ * 应用上下文 Provider 属性
10
+ */
11
+ export interface AppContextProviderProps extends PropsWithChildren {
12
+ /**
13
+ * 初始主题配置
14
+ */
15
+ initialTheme?: ThemeConfig;
16
+ /**
17
+ * 初始国际化语言
18
+ */
19
+ initialLocale?: LangType;
20
+ /**
21
+ * 初始 Ant Design 配置
22
+ */
23
+ initialAntdConfig?: UIProviderConfig;
24
+ /**
25
+ * 初始初始化上下文
26
+ */
27
+ initialInitializationContext?: InitializationContext;
28
+ /**
29
+ * 状态管理器实例
30
+ */
31
+ stateManager?: StateManager | null;
32
+ /**
33
+ * UI App 基础配置
34
+ *
35
+ * 用于传递 UI 适配层的应用级配置(如消息、通知、弹窗容器)。
36
+ */
37
+ antdApp?: UIAppConfig;
38
+ /**
39
+ * UI App 配置(无框架绑定)
40
+ */
41
+ uiApp?: UIAppConfig;
42
+ }
43
+ export declare const AppContextProvider: React.FC<AppContextProviderProps>;
44
+ /**
45
+ * 使用主题上下文 Hook
46
+ *
47
+ * @returns 主题上下文值
48
+ * @throws 如果不在 ThemeProvider 内使用会抛出错误
49
+ *
50
+ * @example
51
+ * ```tsx
52
+ * const { theme, setTheme } = useTheme();
53
+ *
54
+ * // 切换主题
55
+ * setTheme({ mode: 'dark' });
56
+ * ```
57
+ */
58
+ export declare const useTheme: () => ThemeContextValue;
59
+ /**
60
+ * 使用国际化上下文 Hook
61
+ *
62
+ * @returns 国际化上下文值
63
+ * @throws 如果不在 LocaleProvider 内使用会抛出错误
64
+ *
65
+ * @example
66
+ * ```tsx
67
+ * const { locale, setLocale } = useLocale();
68
+ *
69
+ * // 切换语言
70
+ * setLocale('en-US');
71
+ * ```
72
+ */
73
+ export declare const useLocale: () => LocaleContextValue;
74
+ /**
75
+ * 使用配置上下文 Hook
76
+ *
77
+ * @returns 配置上下文值
78
+ * @throws 如果不在 ConfigProvider 内使用会抛出错误
79
+ */
80
+ export declare const useConfig: () => ConfigContextValue;
81
+ /**
82
+ * 使用应用上下文 Hook(聚合所有上下文)
83
+ *
84
+ * @returns 应用上下文值
85
+ * @throws 如果不在 AppContextProvider 内使用会抛出错误
86
+ *
87
+ * @example
88
+ * ```tsx
89
+ * const { theme, setTheme, locale, setLocale, antdConfig } = useAppContext();
90
+ *
91
+ * // 切换主题
92
+ * setTheme({ mode: 'dark' });
93
+ *
94
+ * // 切换语言
95
+ * setLocale('en-US');
96
+ * ```
97
+ */
98
+ /**
99
+ * 使用状态管理器 Hook
100
+ *
101
+ * @returns 状态管理器实例
102
+ * @throws 如果不在 AppContextProvider 内使用会抛出错误
103
+ *
104
+ * @example
105
+ * ```tsx
106
+ * const stateManager = useStateManager();
107
+ *
108
+ * // 创建状态实例
109
+ * const countState = stateManager?.createState(0);
110
+ * ```
111
+ */
112
+ export declare const useStateManager: () => StateManager | null;
113
+ export declare const useAppContext: () => AppContextValue;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import React,{createContext,useContext,useState,useCallback,useMemo,useEffect}from"react";import{setLang}from"../../library";import{appConfig}from"../config/AppConfig";const ThemeContext=createContext(undefined);const LocaleContext=createContext(undefined);const ConfigContext=createContext(undefined);const StateManagerContext=createContext(undefined);const ThemeProvider=React.memo(({children,initialTheme})=>{const[theme,setThemeState]=useState(initialTheme||appConfig.getTheme());const applyDocumentThemeClass=useCallback(mode=>{if(typeof window==="undefined"){return}const html=document.documentElement;html.classList.remove("light","dark");const resolvedMode=mode==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":mode||"light";html.classList.add(resolvedMode)},[]);useEffect(()=>{appConfig.setTheme(theme)},[theme]);useEffect(()=>{if(typeof window==="undefined"){return}applyDocumentThemeClass(theme.mode);if(theme.mode!=="system"){return}const mediaQuery=window.matchMedia("(prefers-color-scheme: dark)");const onSystemThemeChange=()=>applyDocumentThemeClass("system");if(typeof mediaQuery.addEventListener==="function"){mediaQuery.addEventListener("change",onSystemThemeChange);return()=>mediaQuery.removeEventListener("change",onSystemThemeChange)}mediaQuery.addListener(onSystemThemeChange);return()=>mediaQuery.removeListener(onSystemThemeChange)},[applyDocumentThemeClass,theme.mode]);const setTheme=useCallback(newTheme=>{setThemeState(prev=>{return typeof newTheme==="function"?newTheme(prev):newTheme})},[]);const value=useMemo(()=>({theme,setTheme}),[theme,setTheme]);return _jsx(ThemeContext.Provider,{value:value,children:children})});ThemeProvider.displayName="ThemeProvider";const LocaleProvider=React.memo(({children,initialLocale})=>{const[locale,setLocaleState]=useState(initialLocale||appConfig.getLocale());const[isChanging,setIsChanging]=useState(false);useEffect(()=>{appConfig.setLocale(locale)},[locale]);const setLocale=useCallback(newLocale=>{if(newLocale===locale){return}setIsChanging(true);setLocaleState(newLocale);setLang(newLocale);requestAnimationFrame(()=>{setIsChanging(false)})},[locale]);const value=useMemo(()=>({locale,setLocale,isChanging}),[locale,setLocale,isChanging]);return _jsx(LocaleContext.Provider,{value:value,children:children})});LocaleProvider.displayName="LocaleProvider";const AppConfigProvider=React.memo(({children,initialAntdConfig,initialInitializationContext})=>{const[antdConfig,setAntdConfigState]=useState(initialAntdConfig||appConfig.getAntdConfig());const[initializationContext,setInitializationContextState]=useState(initialInitializationContext||appConfig.getInitializationContext());useEffect(()=>{appConfig.setAntdConfig(antdConfig)},[antdConfig]);useEffect(()=>{appConfig.setInitializationContext(initializationContext)},[initializationContext]);const setAntdConfig=useCallback(config=>{setAntdConfigState(config)},[]);const setInitializationContext=useCallback(context=>{setInitializationContextState(context)},[]);const value=useMemo(()=>({antdConfig,initializationContext,setAntdConfig,setInitializationContext}),[antdConfig,initializationContext,setAntdConfig,setInitializationContext]);return _jsx(ConfigContext.Provider,{value:value,children:children})});AppConfigProvider.displayName="AppConfigProvider";const StateManagerProvider=React.memo(({children,stateManager})=>{const value=useMemo(()=>({stateManager:stateManager??null}),[stateManager]);return _jsx(StateManagerContext.Provider,{value:value,children:children})});StateManagerProvider.displayName="StateManagerProvider";export const AppContextProvider=({children,initialTheme,initialLocale,initialAntdConfig,initialInitializationContext,stateManager,antdApp:_antdApp,uiApp:_uiApp})=>{const initializedRef=React.useRef(false);React.useEffect(()=>{if(!initializedRef.current){appConfig.initialize({theme:initialTheme,locale:initialLocale,antdConfig:initialAntdConfig,initializationContext:initialInitializationContext});initializedRef.current=true}},[initialTheme,initialLocale,initialAntdConfig,initialInitializationContext]);return _jsx(ThemeProvider,{initialTheme:initialTheme,children:_jsx(LocaleProvider,{initialLocale:initialLocale,children:_jsx(AppConfigProvider,{initialAntdConfig:initialAntdConfig,initialInitializationContext:initialInitializationContext,children:_jsx(StateManagerProvider,{stateManager:stateManager,children:children})})})})};export const useTheme=()=>{const context=useContext(ThemeContext);if(context===undefined){throw new Error("useTheme 必须在 AppContextProvider 内使用")}return context};export const useLocale=()=>{const context=useContext(LocaleContext);if(context===undefined){throw new Error("useLocale 必须在 AppContextProvider 内使用")}return context};export const useConfig=()=>{const context=useContext(ConfigContext);if(context===undefined){throw new Error("useConfig 必须在 AppContextProvider 内使用")}return context};export const useStateManager=()=>{const context=useContext(StateManagerContext);if(context===undefined){throw new Error("useStateManager 必须在 AppContextProvider 内使用")}return context.stateManager};export const useAppContext=()=>{const themeContext=useTheme();const localeContext=useLocale();const configContext=useConfig();const stateManagerContext=useStateManager();return useMemo(()=>({theme:themeContext.theme,locale:localeContext.locale,antdConfig:configContext.antdConfig,initializationContext:configContext.initializationContext,stateManager:stateManagerContext,setTheme:themeContext.setTheme,setLocale:localeContext.setLocale,setAntdConfig:configContext.setAntdConfig,setInitializationContext:configContext.setInitializationContext}),[themeContext.theme,localeContext.locale,configContext.antdConfig,configContext.initializationContext,stateManagerContext,themeContext.setTheme,localeContext.setLocale,configContext.setAntdConfig,configContext.setInitializationContext])};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});
@@ -0,0 +1,146 @@
1
+ import type { LangType } from '../../library/locale/types';
2
+ import type { InitializationContext } from '../initialization';
3
+ import type { StateManager } from '../../state';
4
+ import type { UIProviderConfig } from '../types';
5
+ /**
6
+ * 主题配置
7
+ */
8
+ export interface ThemeConfig {
9
+ /**
10
+ * 主题模式:'light' | 'dark' | 'system'
11
+ * - 'light': 浅色主题
12
+ * - 'dark': 深色主题
13
+ * - 'system': 跟随系统设置
14
+ */
15
+ mode?: 'light' | 'dark' | 'system';
16
+ /**
17
+ * 主题色(主色调)
18
+ */
19
+ primaryColor?: string;
20
+ /**
21
+ * 自定义主题配置
22
+ */
23
+ custom?: Record<string, unknown>;
24
+ }
25
+ /**
26
+ * 应用配置接口
27
+ */
28
+ export interface AppConfig {
29
+ /**
30
+ * 主题配置
31
+ */
32
+ theme: ThemeConfig;
33
+ /**
34
+ * 国际化语言
35
+ */
36
+ locale: LangType;
37
+ /**
38
+ * Ant Design 配置
39
+ */
40
+ antdConfig?: UIProviderConfig;
41
+ /**
42
+ * 初始化上下文
43
+ */
44
+ initializationContext?: InitializationContext;
45
+ }
46
+ /**
47
+ * 主题上下文值
48
+ */
49
+ export interface ThemeContextValue {
50
+ /**
51
+ * 主题配置
52
+ */
53
+ theme: ThemeConfig;
54
+ /**
55
+ * 更新主题
56
+ */
57
+ setTheme: (theme: ThemeConfig | ((prev: ThemeConfig) => ThemeConfig)) => void;
58
+ }
59
+ /**
60
+ * 国际化上下文值
61
+ */
62
+ export interface LocaleContextValue {
63
+ /**
64
+ * 当前语言
65
+ */
66
+ locale: LangType;
67
+ /**
68
+ * 更新语言
69
+ */
70
+ setLocale: (locale: LangType) => void;
71
+ /**
72
+ * 是否正在切换语言
73
+ */
74
+ isChanging?: boolean;
75
+ }
76
+ /**
77
+ * 配置上下文值
78
+ */
79
+ export interface ConfigContextValue {
80
+ /**
81
+ * Ant Design 配置
82
+ */
83
+ antdConfig?: UIProviderConfig;
84
+ /**
85
+ * 初始化上下文
86
+ */
87
+ initializationContext?: InitializationContext;
88
+ /**
89
+ * 更新 Ant Design 配置
90
+ */
91
+ setAntdConfig: (config: UIProviderConfig | undefined) => void;
92
+ /**
93
+ * 更新初始化上下文
94
+ */
95
+ setInitializationContext: (context: InitializationContext | undefined) => void;
96
+ }
97
+ /**
98
+ * 状态管理器上下文值
99
+ */
100
+ export interface StateManagerContextValue {
101
+ /**
102
+ * 状态管理器实例
103
+ */
104
+ stateManager: StateManager | null;
105
+ }
106
+ /**
107
+ * 应用全局上下文值(聚合所有上下文)
108
+ */
109
+ export interface AppContextValue {
110
+ /**
111
+ * 主题配置
112
+ */
113
+ theme: ThemeConfig;
114
+ /**
115
+ * 国际化语言
116
+ */
117
+ locale: LangType;
118
+ /**
119
+ * Ant Design 配置
120
+ */
121
+ antdConfig?: UIProviderConfig;
122
+ /**
123
+ * 初始化上下文
124
+ */
125
+ initializationContext?: InitializationContext;
126
+ /**
127
+ * 状态管理器实例
128
+ */
129
+ stateManager: StateManager | null;
130
+ /**
131
+ * 更新主题
132
+ */
133
+ setTheme: (theme: ThemeConfig | ((prev: ThemeConfig) => ThemeConfig)) => void;
134
+ /**
135
+ * 更新国际化语言
136
+ */
137
+ setLocale: (locale: LangType) => void;
138
+ /**
139
+ * 更新 Ant Design 配置
140
+ */
141
+ setAntdConfig: (config: UIProviderConfig | undefined) => void;
142
+ /**
143
+ * 更新初始化上下文
144
+ */
145
+ setInitializationContext: (context: InitializationContext | undefined) => void;
146
+ }
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"BasicLayout",{enumerable:true,get:function(){return BasicLayout}});const _jsxruntime=require("react/jsx-runtime");const _react=/*#__PURE__*/_interop_require_wildcard(require("react"));const _AppContext=require("./AppContext");function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interop_require_wildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={__proto__:null};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}const BasicLayout=(0,_react.memo)(({children,configProps:externalConfigProps,globalProvider})=>{const{antdConfig,theme}=(0,_AppContext.useAppContext)();const[isSystemDark,setIsSystemDark]=_react.default.useState(()=>{if(typeof window==="undefined"){return false}return window.matchMedia("(prefers-color-scheme: dark)").matches});const finalConfigProps=antdConfig||externalConfigProps;_react.default.useEffect(()=>{if(typeof window==="undefined"){return}const mediaQuery=window.matchMedia("(prefers-color-scheme: dark)");const updateSystemTheme=event=>{setIsSystemDark(event.matches)};setIsSystemDark(mediaQuery.matches);if(typeof mediaQuery.addEventListener==="function"){mediaQuery.addEventListener("change",updateSystemTheme);return()=>mediaQuery.removeEventListener("change",updateSystemTheme)}mediaQuery.addListener(updateSystemTheme);return()=>mediaQuery.removeListener(updateSystemTheme)},[]);const resolvedMode=theme.mode==="system"?isSystemDark?"dark":"light":theme.mode;const cssVars=_react.default.useMemo(()=>{const vars={};if(theme.primaryColor){vars["--app-primary-color"]=theme.primaryColor}if(finalConfigProps&&typeof finalConfigProps==="object"){const cssVariables=finalConfigProps.cssVariables;if(cssVariables&&typeof cssVariables==="object"){Object.entries(cssVariables).forEach(([key,value])=>{vars[`--${key}`]=String(value)})}}return vars},[finalConfigProps,theme.primaryColor]);const GlobalProvider=_react.default.useMemo(()=>globalProvider?_react.default.lazy(globalProvider):null,[globalProvider]);const renderedContent=_react.default.useMemo(()=>{if(!GlobalProvider){return children}return(0,_jsxruntime.jsx)(_react.default.Suspense,{fallback:null,children:(0,_jsxruntime.jsx)(GlobalProvider,{children:children})})},[GlobalProvider,children]);return(0,_jsxruntime.jsx)("div",{"data-theme-mode":resolvedMode,style:cssVars,children:renderedContent})});BasicLayout.displayName="BasicLayout";
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import type { PropsWithChildren } from 'react';
3
+ import type { GlobalProviderLoader, UIProviderConfig } from '../types';
4
+ interface BasicLayoutProps {
5
+ /**
6
+ * 外部传入 UI provider 配置(向后兼容沿用 configProps 命名)
7
+ */
8
+ configProps?: UIProviderConfig;
9
+ /**
10
+ * 全局 UI 包裹组件懒加载器
11
+ */
12
+ globalProvider?: GlobalProviderLoader;
13
+ }
14
+ declare const BasicLayout: React.FC<PropsWithChildren<BasicLayoutProps>>;
15
+ export { BasicLayout };
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import React,{memo}from"react";import{useAppContext}from"./AppContext";const BasicLayout=memo(({children,configProps:externalConfigProps,globalProvider})=>{const{antdConfig,theme}=useAppContext();const[isSystemDark,setIsSystemDark]=React.useState(()=>{if(typeof window==="undefined"){return false}return window.matchMedia("(prefers-color-scheme: dark)").matches});const finalConfigProps=antdConfig||externalConfigProps;React.useEffect(()=>{if(typeof window==="undefined"){return}const mediaQuery=window.matchMedia("(prefers-color-scheme: dark)");const updateSystemTheme=event=>{setIsSystemDark(event.matches)};setIsSystemDark(mediaQuery.matches);if(typeof mediaQuery.addEventListener==="function"){mediaQuery.addEventListener("change",updateSystemTheme);return()=>mediaQuery.removeEventListener("change",updateSystemTheme)}mediaQuery.addListener(updateSystemTheme);return()=>mediaQuery.removeListener(updateSystemTheme)},[]);const resolvedMode=theme.mode==="system"?isSystemDark?"dark":"light":theme.mode;const cssVars=React.useMemo(()=>{const vars={};if(theme.primaryColor){vars["--app-primary-color"]=theme.primaryColor}if(finalConfigProps&&typeof finalConfigProps==="object"){const cssVariables=finalConfigProps.cssVariables;if(cssVariables&&typeof cssVariables==="object"){Object.entries(cssVariables).forEach(([key,value])=>{vars[`--${key}`]=String(value)})}}return vars},[finalConfigProps,theme.primaryColor]);const GlobalProvider=React.useMemo(()=>globalProvider?React.lazy(globalProvider):null,[globalProvider]);const renderedContent=React.useMemo(()=>{if(!GlobalProvider){return children}return _jsx(React.Suspense,{fallback:null,children:_jsx(GlobalProvider,{children:children})})},[GlobalProvider,children]);return _jsx("div",{"data-theme-mode":resolvedMode,style:cssVars,children:renderedContent})});BasicLayout.displayName="BasicLayout";export{BasicLayout};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"DefaultApp",{enumerable:true,get:function(){return DefaultApp}});const _jsxruntime=require("react/jsx-runtime");const _react=require("react");const _library=require("../../library");const cardStyle={background:"rgba(255, 255, 255, 0.96)",borderRadius:10,boxShadow:"0 6px 20px rgba(0, 0, 0, 0.14)",padding:20};const DefaultApp=(0,_react.memo)(({title,description})=>{const displayTitle=title||(0,_library.$t)("defaultApp.title");const displayDescription=description||(0,_library.$t)("defaultApp.description");return(0,_jsxruntime.jsx)("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",padding:24,background:"linear-gradient(130deg, #274c77 0%, #2c7da0 42%, #61a5c2 100%)"},children:(0,_jsxruntime.jsxs)("div",{style:{maxWidth:860,width:"100%"},children:[(0,_jsxruntime.jsxs)("div",{style:{textAlign:"center",marginBottom:28,color:"#fff"},children:[(0,_jsxruntime.jsx)("div",{style:{fontSize:56,lineHeight:"60px",marginBottom:12},children:"🚀"}),(0,_jsxruntime.jsx)("h1",{style:{margin:0,fontSize:34},children:displayTitle}),(0,_jsxruntime.jsx)("p",{style:{marginTop:12,opacity:.9},children:displayDescription})]}),(0,_jsxruntime.jsxs)("div",{style:{display:"grid",gap:16},children:[(0,_jsxruntime.jsxs)("section",{style:cardStyle,children:[(0,_jsxruntime.jsxs)("h2",{style:{marginTop:0},children:["💻 ",(0,_library.$t)("defaultApp.quickStart.title")]}),(0,_jsxruntime.jsx)("p",{children:(0,_library.$t)("defaultApp.quickStart.description")}),(0,_jsxruntime.jsx)("pre",{style:{margin:0,background:"#f4f6f8",borderRadius:8,padding:12,overflowX:"auto"},children:(0,_library.$t)("defaultApp.quickStart.code")})]}),(0,_jsxruntime.jsxs)("section",{style:cardStyle,children:[(0,_jsxruntime.jsxs)("h2",{style:{marginTop:0},children:["📚 ",(0,_library.$t)("defaultApp.nextSteps.title")]}),(0,_jsxruntime.jsxs)("ul",{style:{paddingLeft:20,marginBottom:0},children:[(0,_jsxruntime.jsx)("li",{children:(0,_library.$t)("defaultApp.nextSteps.step1")}),(0,_jsxruntime.jsx)("li",{children:(0,_library.$t)("defaultApp.nextSteps.step2")}),(0,_jsxruntime.jsx)("li",{children:(0,_library.$t)("defaultApp.nextSteps.step3")})]})]})]}),(0,_jsxruntime.jsx)("p",{style:{textAlign:"center",color:"rgba(255,255,255,0.88)",marginTop:18},children:(0,_library.$t)("defaultApp.footer")})]})})});DefaultApp.displayName="DefaultApp";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 默认应用页面组件
3
+ * 当用户未提供 app 选项时显示的默认页面
4
+ */
5
+ interface DefaultAppProps {
6
+ title?: string;
7
+ description?: string;
8
+ }
9
+ declare const DefaultApp: import("react").NamedExoticComponent<DefaultAppProps>;
10
+ export { DefaultApp };
@@ -0,0 +1 @@
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{memo}from"react";import{$t}from"../../library";const cardStyle={background:"rgba(255, 255, 255, 0.96)",borderRadius:10,boxShadow:"0 6px 20px rgba(0, 0, 0, 0.14)",padding:20};const DefaultApp=memo(({title,description})=>{const displayTitle=title||$t("defaultApp.title");const displayDescription=description||$t("defaultApp.description");return _jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",padding:24,background:"linear-gradient(130deg, #274c77 0%, #2c7da0 42%, #61a5c2 100%)"},children:_jsxs("div",{style:{maxWidth:860,width:"100%"},children:[_jsxs("div",{style:{textAlign:"center",marginBottom:28,color:"#fff"},children:[_jsx("div",{style:{fontSize:56,lineHeight:"60px",marginBottom:12},children:"🚀"}),_jsx("h1",{style:{margin:0,fontSize:34},children:displayTitle}),_jsx("p",{style:{marginTop:12,opacity:.9},children:displayDescription})]}),_jsxs("div",{style:{display:"grid",gap:16},children:[_jsxs("section",{style:cardStyle,children:[_jsxs("h2",{style:{marginTop:0},children:["💻 ",$t("defaultApp.quickStart.title")]}),_jsx("p",{children:$t("defaultApp.quickStart.description")}),_jsx("pre",{style:{margin:0,background:"#f4f6f8",borderRadius:8,padding:12,overflowX:"auto"},children:$t("defaultApp.quickStart.code")})]}),_jsxs("section",{style:cardStyle,children:[_jsxs("h2",{style:{marginTop:0},children:["📚 ",$t("defaultApp.nextSteps.title")]}),_jsxs("ul",{style:{paddingLeft:20,marginBottom:0},children:[_jsx("li",{children:$t("defaultApp.nextSteps.step1")}),_jsx("li",{children:$t("defaultApp.nextSteps.step2")}),_jsx("li",{children:$t("defaultApp.nextSteps.step3")})]})]})]}),_jsx("p",{style:{textAlign:"center",color:"rgba(255,255,255,0.88)",marginTop:18},children:$t("defaultApp.footer")})]})})});DefaultApp.displayName="DefaultApp";export{DefaultApp};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get AppContextProvider(){return _AppContext.AppContextProvider},get BasicLayout(){return _BasicLayout.BasicLayout},get DefaultApp(){return _DefaultApp.DefaultApp},get useAppContext(){return _AppContext.useAppContext},get useConfig(){return _AppContext.useConfig},get useLocale(){return _AppContext.useLocale},get useStateManager(){return _AppContext.useStateManager},get useTheme(){return _AppContext.useTheme}});const _AppContext=require("./AppContext");const _DefaultApp=require("./DefaultApp");const _BasicLayout=require("./BasicLayout");
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 应用核心模块
3
+ */
4
+ export { AppContextProvider, useAppContext, useTheme, useLocale, useConfig, useStateManager } from './AppContext';
5
+ export type { AppContextProviderProps } from './AppContext';
6
+ export type { AppContextValue, ThemeContextValue, LocaleContextValue, ConfigContextValue, StateManagerContextValue, ThemeConfig, AppConfig, } from './AppContext.types';
7
+ export { DefaultApp } from './DefaultApp';
8
+ export { BasicLayout } from './BasicLayout';
@@ -0,0 +1 @@
1
+ export{AppContextProvider,useAppContext,useTheme,useLocale,useConfig,useStateManager}from"./AppContext";export{DefaultApp}from"./DefaultApp";export{BasicLayout}from"./BasicLayout";
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"appConfig",{enumerable:true,get:function(){return appConfig}});function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}let AppConfigManager=class AppConfigManager{static getInstance(){if(!AppConfigManager.instance){AppConfigManager.instance=new AppConfigManager}return AppConfigManager.instance}initialize(config){this._config={theme:config.theme||{mode:"light"},locale:config.locale||"zh-CN",antdConfig:config.antdConfig,initializationContext:config.initializationContext}}getConfig(){return{...this._config}}getTheme(){return{...this._config.theme}}setTheme(theme){if(typeof theme==="function"){this._config.theme=theme(this._config.theme)}else{this._config.theme={...theme}}}getLocale(){return this._config.locale}setLocale(locale){this._config.locale=locale}getAntdConfig(){return this._config.antdConfig}setAntdConfig(config){this._config.antdConfig=config}getInitializationContext(){return this._config.initializationContext}setInitializationContext(context){this._config.initializationContext=context}constructor(){_define_property(this,"_config",void 0);this._config={theme:{mode:"light"},locale:"zh-CN"}}};_define_property(AppConfigManager,"instance",null);const appConfig=AppConfigManager.getInstance();
@@ -0,0 +1,88 @@
1
+ import type { LangType } from '../../library/locale/types';
2
+ import type { InitializationContext } from '../initialization';
3
+ import type { AppConfig, ThemeConfig } from '../app';
4
+ import type { UIProviderConfig } from '../types';
5
+ /**
6
+ * 应用配置单例
7
+ *
8
+ * 用于在非 React 代码中访问全局配置
9
+ */
10
+ declare class AppConfigManager {
11
+ private static instance;
12
+ private _config;
13
+ /**
14
+ * 私有构造函数,防止外部直接实例化
15
+ */
16
+ private constructor();
17
+ /**
18
+ * 获取单例实例
19
+ *
20
+ * @returns 单例实例
21
+ */
22
+ static getInstance(): AppConfigManager;
23
+ /**
24
+ * 初始化配置
25
+ *
26
+ * @param config - 应用配置
27
+ */
28
+ initialize(config: Partial<AppConfig>): void;
29
+ /**
30
+ * 获取完整配置
31
+ *
32
+ * @returns 应用配置
33
+ */
34
+ getConfig(): AppConfig;
35
+ /**
36
+ * 获取主题配置
37
+ *
38
+ * @returns 主题配置
39
+ */
40
+ getTheme(): ThemeConfig;
41
+ /**
42
+ * 更新主题配置
43
+ *
44
+ * @param theme - 主题配置或更新函数
45
+ */
46
+ setTheme(theme: ThemeConfig | ((prev: ThemeConfig) => ThemeConfig)): void;
47
+ /**
48
+ * 获取当前语言
49
+ *
50
+ * @returns 当前语言
51
+ */
52
+ getLocale(): LangType;
53
+ /**
54
+ * 更新语言
55
+ *
56
+ * @param locale - 语言类型
57
+ */
58
+ setLocale(locale: LangType): void;
59
+ /**
60
+ * 获取 Ant Design 配置
61
+ *
62
+ * @returns Ant Design 配置
63
+ */
64
+ getAntdConfig(): UIProviderConfig | undefined;
65
+ /**
66
+ * 更新 Ant Design 配置
67
+ *
68
+ * @param config - Ant Design 配置
69
+ */
70
+ setAntdConfig(config: UIProviderConfig | undefined): void;
71
+ /**
72
+ * 获取初始化上下文
73
+ *
74
+ * @returns 初始化上下文
75
+ */
76
+ getInitializationContext(): InitializationContext | undefined;
77
+ /**
78
+ * 更新初始化上下文
79
+ *
80
+ * @param context - 初始化上下文
81
+ */
82
+ setInitializationContext(context: InitializationContext | undefined): void;
83
+ }
84
+ /**
85
+ * 应用配置单例实例
86
+ */
87
+ export declare const appConfig: AppConfigManager;
88
+ export {};
@@ -0,0 +1 @@
1
+ function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}let AppConfigManager=class AppConfigManager{static getInstance(){if(!AppConfigManager.instance){AppConfigManager.instance=new AppConfigManager}return AppConfigManager.instance}initialize(config){this._config={theme:config.theme||{mode:"light"},locale:config.locale||"zh-CN",antdConfig:config.antdConfig,initializationContext:config.initializationContext}}getConfig(){return{...this._config}}getTheme(){return{...this._config.theme}}setTheme(theme){if(typeof theme==="function"){this._config.theme=theme(this._config.theme)}else{this._config.theme={...theme}}}getLocale(){return this._config.locale}setLocale(locale){this._config.locale=locale}getAntdConfig(){return this._config.antdConfig}setAntdConfig(config){this._config.antdConfig=config}getInitializationContext(){return this._config.initializationContext}setInitializationContext(context){this._config.initializationContext=context}constructor(){_define_property(this,"_config",void 0);this._config={theme:{mode:"light"},locale:"zh-CN"}}};_define_property(AppConfigManager,"instance",null);export const appConfig=AppConfigManager.getInstance();
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get ConfigFileFormat(){return ConfigFileFormat},get ConfigLoader(){return ConfigLoader}});const _logger=require("@vlian/logger");function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}var ConfigFileFormat=/*#__PURE__*/function(ConfigFileFormat){ConfigFileFormat["JSON"]="json";ConfigFileFormat["YAML"]="yaml";return ConfigFileFormat}({});let ConfigChangeNotifier=class ConfigChangeNotifier{addListener(listener){this.listeners.add(listener);return()=>{this.listeners.delete(listener)}}removeListener(listener){this.listeners.delete(listener)}notify(newConfig,oldConfig){this.listeners.forEach(listener=>{try{listener(newConfig,oldConfig)}catch(error){_logger.logger.warn("配置变更监听器执行失败:",error)}})}clear(){this.listeners.clear()}constructor(){_define_property(this,"listeners",new Set)}};const configChangeNotifier=new ConfigChangeNotifier;let ConfigLoader=class ConfigLoader{static async loadFromJSON(path){try{if(typeof window!=="undefined"){const response=await fetch(path);if(!response.ok){throw new Error(`无法加载配置文件: ${path} (${response.status})`)}return await response.json()}if(typeof require!=="undefined"){const fs=require("fs");const content=fs.readFileSync(path,"utf-8");return JSON.parse(content)}throw new Error("不支持的环境:无法加载配置文件")}catch(error){_logger.logger.error(`加载JSON配置文件失败: ${path}`,error);throw error}}static async loadFromYAML(path){try{if(typeof window!=="undefined"){const response=await fetch(path);if(!response.ok){throw new Error(`无法加载配置文件: ${path} (${response.status})`)}const text=await response.text();if(typeof window.YAML!=="undefined"){return window.YAML.parse(text)}try{return JSON.parse(text)}catch{throw new Error("需要YAML解析库,请安装 yaml 包")}}if(typeof require!=="undefined"){const fs=require("fs");const yaml=require("yaml");const content=fs.readFileSync(path,"utf-8");return yaml.parse(content)}throw new Error("不支持的环境:无法加载配置文件")}catch(error){_logger.logger.error(`加载YAML配置文件失败: ${path}`,error);throw error}}static async loadFromFile(options){const{path,format="json",required=false,defaultConfig={}}=options;if(!path){if(required){throw new Error("配置文件路径未指定")}return defaultConfig}try{let config;switch(format){case"json":config=await this.loadFromJSON(path);break;case"yaml":config=await this.loadFromYAML(path);break;default:throw new Error(`不支持的配置文件格式: ${format}`)}_logger.logger.info(`成功加载配置文件: ${path}`);return config}catch(error){if(required){throw error}_logger.logger.warn(`配置文件加载失败,使用默认配置: ${path}`,error);return defaultConfig}}static mergeConfig(base,override){const merged={...base};for(const key in override){if(!Object.prototype.hasOwnProperty.call(override,key)){continue}const baseValue=merged[key];const overrideValue=override[key];if(baseValue&&overrideValue&&typeof baseValue==="object"&&typeof overrideValue==="object"&&!Array.isArray(baseValue)&&!Array.isArray(overrideValue)){merged[key]=this.mergeConfig(baseValue,overrideValue)}else{merged[key]=overrideValue}}return merged}static async loadFromMultipleSources(sources){let merged={};for(const source of sources){if("path"in source&&"format"in source){const fileConfig=await this.loadFromFile(source);merged=this.mergeConfig(merged,fileConfig)}else if(!("path"in source)&&!("format"in source)){merged=this.mergeConfig(merged,source)}}return merged}static loadFromEnv(prefix="FRAMEWORK_"){const config={};if(typeof process==="undefined"||!process.env){return config}for(const[key,value]of Object.entries(process.env)){if(!key.startsWith(prefix)){continue}const configKey=key.slice(prefix.length).toLowerCase().split("_").map((part,index)=>index===0?part:part.charAt(0).toUpperCase()+part.slice(1)).join("");let parsedValue=value;if(value==="true"||value==="false"){parsedValue=value==="true"}else if(!isNaN(Number(value))){parsedValue=Number(value)}else if(value?.startsWith("{")||value?.startsWith("[")){try{parsedValue=JSON.parse(value)}catch{}}config[configKey]=parsedValue}_logger.logger.debug("从环境变量加载配置:",config);return config}static async loadFromAllSources(sources=[],defaultConfig={},includeEnv=true,envPrefix="FRAMEWORK_"){const oldConfig={...defaultConfig};let merged={...defaultConfig};const fileConfigs=await this.loadFromMultipleSources(sources.filter(source=>typeof source==="object"&&"path"in source));merged=this.mergeConfig(merged,fileConfigs);if(includeEnv){const envConfig=this.loadFromEnv(envPrefix);merged=this.mergeConfig(merged,envConfig)}const codeConfigs=sources.filter(source=>typeof source==="object"&&!("path"in source));for(const codeConfig of codeConfigs){merged=this.mergeConfig(merged,codeConfig)}configChangeNotifier.notify(merged,oldConfig);return merged}static onConfigChange(listener){return configChangeNotifier.addListener(listener)}static removeConfigChangeListener(listener){configChangeNotifier.removeListener(listener)}};
@@ -0,0 +1,118 @@
1
+ /**
2
+ * 配置文件加载模块
3
+ * 支持从JSON/YAML文件加载配置
4
+ * 优化:支持环境变量配置、配置热更新
5
+ */
6
+ import type { StartOptions } from '../types';
7
+ /**
8
+ * 配置文件格式
9
+ */
10
+ export declare enum ConfigFileFormat {
11
+ JSON = "json",
12
+ YAML = "yaml"
13
+ }
14
+ /**
15
+ * 配置文件加载选项
16
+ */
17
+ export interface ConfigFileLoadOptions {
18
+ /**
19
+ * 配置文件路径
20
+ */
21
+ path?: string;
22
+ /**
23
+ * 配置文件格式
24
+ */
25
+ format?: ConfigFileFormat;
26
+ /**
27
+ * 是否必需(如果为false,文件不存在时不报错)
28
+ */
29
+ required?: boolean;
30
+ /**
31
+ * 默认配置(文件不存在时使用)
32
+ */
33
+ defaultConfig?: Partial<StartOptions>;
34
+ }
35
+ /**
36
+ * 配置变更监听器
37
+ */
38
+ export type ConfigChangeListener = (newConfig: Partial<StartOptions>, oldConfig: Partial<StartOptions>) => void;
39
+ /**
40
+ * 配置加载器
41
+ */
42
+ export declare class ConfigLoader {
43
+ /**
44
+ * 从JSON文件加载配置
45
+ *
46
+ * @param path - 文件路径
47
+ * @returns 配置对象
48
+ */
49
+ static loadFromJSON(path: string): Promise<Partial<StartOptions>>;
50
+ /**
51
+ * 从YAML文件加载配置
52
+ *
53
+ * @param path - 文件路径
54
+ * @returns 配置对象
55
+ */
56
+ static loadFromYAML(path: string): Promise<Partial<StartOptions>>;
57
+ /**
58
+ * 从文件加载配置
59
+ *
60
+ * @param options - 加载选项
61
+ * @returns 配置对象
62
+ */
63
+ static loadFromFile(options: ConfigFileLoadOptions): Promise<Partial<StartOptions>>;
64
+ /**
65
+ * 合并配置(深度合并)
66
+ *
67
+ * @param base - 基础配置
68
+ * @param override - 覆盖配置
69
+ * @returns 合并后的配置
70
+ */
71
+ static mergeConfig(base: Partial<StartOptions>, override: Partial<StartOptions>): Partial<StartOptions>;
72
+ /**
73
+ * 从多个源加载并合并配置
74
+ *
75
+ * @param sources - 配置源列表(按优先级从低到高)
76
+ * @returns 合并后的配置
77
+ */
78
+ static loadFromMultipleSources(sources: Array<Partial<StartOptions> | ConfigFileLoadOptions>): Promise<Partial<StartOptions>>;
79
+ /**
80
+ * 从环境变量加载配置
81
+ *
82
+ * 支持以下环境变量格式:
83
+ * - FRAMEWORK_LOGGER_LEVEL=DEBUG
84
+ * - FRAMEWORK_SHOW_SPLASH_SCREEN=always
85
+ * - FRAMEWORK_MIN_SPLASH_SCREEN_TIME=1000
86
+ *
87
+ * @param prefix - 环境变量前缀,默认为 'FRAMEWORK_'
88
+ * @returns 配置对象
89
+ */
90
+ static loadFromEnv(prefix?: string): Partial<StartOptions>;
91
+ /**
92
+ * 从多个源加载配置(包括环境变量)
93
+ *
94
+ * 优化:明确优先级,从低到高:
95
+ * 1. 默认配置
96
+ * 2. 配置文件
97
+ * 3. 环境变量
98
+ * 4. 代码配置(通过 sources 参数传入)
99
+ *
100
+ * @param sources - 配置源列表(代码配置,优先级最高)
101
+ * @param defaultConfig - 默认配置(优先级最低)
102
+ * @param includeEnv - 是否包含环境变量,默认为 true
103
+ * @param envPrefix - 环境变量前缀,默认为 'FRAMEWORK_'
104
+ * @returns 合并后的配置
105
+ */
106
+ static loadFromAllSources(sources?: Array<Partial<StartOptions> | ConfigFileLoadOptions>, defaultConfig?: Partial<StartOptions>, includeEnv?: boolean, envPrefix?: string): Promise<Partial<StartOptions>>;
107
+ /**
108
+ * 添加配置变更监听器
109
+ *
110
+ * @param listener - 配置变更监听器
111
+ * @returns 取消监听的函数
112
+ */
113
+ static onConfigChange(listener: ConfigChangeListener): () => void;
114
+ /**
115
+ * 移除配置变更监听器
116
+ */
117
+ static removeConfigChangeListener(listener: ConfigChangeListener): void;
118
+ }