@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,74 +0,0 @@
1
- /**
2
- * 路由插件管理器
3
- * 负责插件的注册、执行和生命周期管理
4
- */
5
- import type { RouterPlugin, PluginContext, PluginRegisterOptions } from './types';
6
- import { PluginLifecycleStage } from './types';
7
- /**
8
- * 路由插件管理器
9
- */
10
- export declare class RouterPluginManager {
11
- private plugins;
12
- /**
13
- * 注册插件
14
- *
15
- * @param plugin - 插件实例
16
- * @param options - 注册选项
17
- * @returns 取消注册函数
18
- */
19
- register(plugin: RouterPlugin, options?: PluginRegisterOptions): () => void;
20
- /**
21
- * 批量注册插件
22
- *
23
- * @param plugins - 插件数组
24
- * @param options - 注册选项
25
- */
26
- registerBatch(plugins: RouterPlugin[], options?: PluginRegisterOptions): void;
27
- /**
28
- * 按依赖关系排序插件(拓扑排序)
29
- */
30
- private sortByDependencies;
31
- /**
32
- * 取消注册插件
33
- *
34
- * @param name - 插件名称
35
- */
36
- unregister(name: string): void;
37
- /**
38
- * 执行插件钩子
39
- *
40
- * @param stage - 生命周期阶段
41
- * @param context - 插件上下文
42
- */
43
- executeHooks(stage: PluginLifecycleStage, context: PluginContext): Promise<void>;
44
- /**
45
- * 获取插件
46
- *
47
- * @param name - 插件名称
48
- * @returns 插件实例,如果不存在返回 undefined
49
- */
50
- getPlugin(name: string): RouterPlugin | undefined;
51
- /**
52
- * 获取所有插件
53
- *
54
- * @returns 插件数组
55
- */
56
- getAllPlugins(): RouterPlugin[];
57
- /**
58
- * 获取启用的插件
59
- *
60
- * @returns 启用的插件数组
61
- */
62
- getEnabledPlugins(): RouterPlugin[];
63
- /**
64
- * 清空所有插件
65
- */
66
- clear(): void;
67
- /**
68
- * 获取插件数量
69
- *
70
- * @returns 插件数量
71
- */
72
- getCount(): number;
73
- }
74
- export declare function getRouterPluginManager(): RouterPluginManager;
@@ -1 +0,0 @@
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}import{logger}from"@vlian/logger";import{PluginLifecycleStage}from"./types";export class RouterPluginManager{register(plugin,options={}){if(!plugin.name){throw new Error("插件必须提供名称")}if(this.plugins.has(plugin.name)&&!options.overwrite){throw new Error(`插件 "${plugin.name}" 已存在`)}const pluginWithDefaults={priority:100,enabled:true,...plugin};if(pluginWithDefaults.dependencies){const missingDeps=pluginWithDefaults.dependencies.filter(dep=>!this.plugins.has(dep));if(missingDeps.length>0){throw new Error(`插件 "${plugin.name}" 缺少依赖: ${missingDeps.join(", ")}`)}}this.plugins.set(plugin.name,{plugin:pluginWithDefaults,status:"registered",registeredAt:Date.now()});logger.debug(`路由插件已注册: ${plugin.name}`);if(pluginWithDefaults.hooks?.onRegister){try{const context={config:{},meta:{stage:PluginLifecycleStage.REGISTER}};pluginWithDefaults.hooks.onRegister(context)}catch(error){logger.error(`插件注册钩子执行失败: ${plugin.name}`,error)}}return()=>{this.unregister(plugin.name)}}registerBatch(plugins,options={}){const sortedPlugins=this.sortByDependencies(plugins);sortedPlugins.forEach(plugin=>{this.register(plugin,options)})}sortByDependencies(plugins){const sorted=[];const visited=new Set;const visiting=new Set;const visit=plugin=>{if(visiting.has(plugin.name||"")){throw new Error(`检测到循环依赖: ${plugin.name}`)}if(visited.has(plugin.name||"")){return}visiting.add(plugin.name||"");if(plugin.dependencies){plugin.dependencies.forEach(depName=>{const dep=plugins.find(p=>p.name===depName);if(dep){visit(dep)}})}visiting.delete(plugin.name||"");visited.add(plugin.name||"");sorted.push(plugin)};plugins.forEach(plugin=>{if(!visited.has(plugin.name||"")){visit(plugin)}});return sorted}unregister(name){const registration=this.plugins.get(name);if(!registration){return}if(registration.plugin.hooks?.onDestroy){try{const context={config:{},meta:{stage:PluginLifecycleStage.DESTROY}};registration.plugin.hooks.onDestroy(context)}catch(error){logger.error(`插件销毁钩子执行失败: ${name}`,error)}}this.plugins.delete(name);logger.debug(`路由插件已取消注册: ${name}`)}async executeHooks(stage,context){const enabledPlugins=Array.from(this.plugins.values()).filter(reg=>reg.plugin.enabled!==false).sort((a,b)=>(a.plugin.priority||100)-(b.plugin.priority||100));const hookMap={[PluginLifecycleStage.REGISTER]:"onRegister",[PluginLifecycleStage.BEFORE_INIT]:"onBeforeInit",[PluginLifecycleStage.AFTER_INIT]:"onAfterInit",[PluginLifecycleStage.BEFORE_TRANSFORM]:"onBeforeTransform",[PluginLifecycleStage.AFTER_TRANSFORM]:"onAfterTransform",[PluginLifecycleStage.BEFORE_MATCH]:"onBeforeMatch",[PluginLifecycleStage.AFTER_MATCH]:"onAfterMatch",[PluginLifecycleStage.DESTROY]:"onDestroy"};const hookName=hookMap[stage];if(!hookName){return}for(const registration of enabledPlugins){const hook=registration.plugin.hooks?.[hookName];if(hook){try{await hook(context)}catch(error){logger.error(`插件钩子执行失败: ${registration.plugin.name}.${hookName}`,error)}}}}getPlugin(name){return this.plugins.get(name)?.plugin}getAllPlugins(){return Array.from(this.plugins.values()).map(reg=>reg.plugin)}getEnabledPlugins(){return Array.from(this.plugins.values()).filter(reg=>reg.plugin.enabled!==false).map(reg=>reg.plugin)}clear(){for(const[name,registration]of this.plugins.entries()){if(registration.plugin.hooks?.onDestroy){try{const context={config:{},meta:{stage:PluginLifecycleStage.DESTROY}};registration.plugin.hooks.onDestroy(context)}catch(error){logger.error(`插件销毁钩子执行失败: ${name}`,error)}}}this.plugins.clear();logger.debug("所有路由插件已清空")}getCount(){return this.plugins.size}constructor(){_define_property(this,"plugins",new Map)}}let pluginManagerInstance=null;export function getRouterPluginManager(){if(!pluginManagerInstance){pluginManagerInstance=new RouterPluginManager}return pluginManagerInstance}
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});_export_star(require("./types"),exports);_export_star(require("./RouterPluginManager"),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,5 +0,0 @@
1
- /**
2
- * 路由插件模块入口
3
- */
4
- export * from './types';
5
- export * from './RouterPluginManager';
@@ -1 +0,0 @@
1
- export*from"./types";export*from"./RouterPluginManager";
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"PluginLifecycleStage",{enumerable:true,get:function(){return PluginLifecycleStage}});var PluginLifecycleStage=/*#__PURE__*/function(PluginLifecycleStage){PluginLifecycleStage["REGISTER"]="register";PluginLifecycleStage["BEFORE_INIT"]="before-init";PluginLifecycleStage["AFTER_INIT"]="after-init";PluginLifecycleStage["BEFORE_TRANSFORM"]="before-transform";PluginLifecycleStage["AFTER_TRANSFORM"]="after-transform";PluginLifecycleStage["BEFORE_MATCH"]="before-match";PluginLifecycleStage["AFTER_MATCH"]="after-match";PluginLifecycleStage["DESTROY"]="destroy";return PluginLifecycleStage}({});
@@ -1,153 +0,0 @@
1
- /**
2
- * 路由插件类型定义
3
- */
4
- import type { RouterConfig, RouteConfig } from '../types';
5
- import type { RouterMiddlewareContext } from '../middleware/types';
6
- /**
7
- * 插件生命周期阶段
8
- */
9
- export declare enum PluginLifecycleStage {
10
- /**
11
- * 插件注册阶段
12
- */
13
- REGISTER = "register",
14
- /**
15
- * 路由初始化前
16
- */
17
- BEFORE_INIT = "before-init",
18
- /**
19
- * 路由初始化后
20
- */
21
- AFTER_INIT = "after-init",
22
- /**
23
- * 路由转换前
24
- */
25
- BEFORE_TRANSFORM = "before-transform",
26
- /**
27
- * 路由转换后
28
- */
29
- AFTER_TRANSFORM = "after-transform",
30
- /**
31
- * 路由匹配前
32
- */
33
- BEFORE_MATCH = "before-match",
34
- /**
35
- * 路由匹配后
36
- */
37
- AFTER_MATCH = "after-match",
38
- /**
39
- * 插件销毁阶段
40
- */
41
- DESTROY = "destroy"
42
- }
43
- /**
44
- * 插件上下文
45
- */
46
- export interface PluginContext {
47
- /**
48
- * 路由配置
49
- */
50
- config: RouterConfig;
51
- /**
52
- * 转换后的路由
53
- */
54
- routes?: RouteConfig[];
55
- /**
56
- * 中间件上下文(在路由匹配时可用)
57
- */
58
- middlewareContext?: RouterMiddlewareContext;
59
- /**
60
- * 插件元数据
61
- */
62
- meta?: Record<string, unknown>;
63
- }
64
- /**
65
- * 插件钩子函数
66
- */
67
- export type PluginHook = (context: PluginContext) => void | Promise<void>;
68
- /**
69
- * 路由插件接口
70
- */
71
- export interface RouterPlugin {
72
- /**
73
- * 插件名称(唯一标识)
74
- */
75
- name: string;
76
- /**
77
- * 插件版本
78
- */
79
- version?: string;
80
- /**
81
- * 插件描述
82
- */
83
- description?: string;
84
- /**
85
- * 插件优先级(数字越小优先级越高)
86
- * @default 100
87
- */
88
- priority?: number;
89
- /**
90
- * 是否启用
91
- * @default true
92
- */
93
- enabled?: boolean;
94
- /**
95
- * 插件依赖(其他插件名称列表)
96
- */
97
- dependencies?: string[];
98
- /**
99
- * 插件配置
100
- */
101
- config?: Record<string, unknown>;
102
- /**
103
- * 生命周期钩子
104
- */
105
- hooks?: {
106
- /**
107
- * 插件注册时调用
108
- */
109
- onRegister?: PluginHook;
110
- /**
111
- * 路由初始化前调用
112
- */
113
- onBeforeInit?: PluginHook;
114
- /**
115
- * 路由初始化后调用
116
- */
117
- onAfterInit?: PluginHook;
118
- /**
119
- * 路由转换前调用
120
- */
121
- onBeforeTransform?: PluginHook;
122
- /**
123
- * 路由转换后调用
124
- */
125
- onAfterTransform?: PluginHook;
126
- /**
127
- * 路由匹配前调用
128
- */
129
- onBeforeMatch?: PluginHook;
130
- /**
131
- * 路由匹配后调用
132
- */
133
- onAfterMatch?: PluginHook;
134
- /**
135
- * 插件销毁时调用
136
- */
137
- onDestroy?: PluginHook;
138
- };
139
- }
140
- /**
141
- * 插件注册选项
142
- */
143
- export interface PluginRegisterOptions {
144
- /**
145
- * 是否覆盖已存在的插件
146
- * @default false
147
- */
148
- overwrite?: boolean;
149
- /**
150
- * 插件配置
151
- */
152
- config?: Record<string, unknown>;
153
- }
@@ -1 +0,0 @@
1
- export var PluginLifecycleStage=/*#__PURE__*/function(PluginLifecycleStage){PluginLifecycleStage["REGISTER"]="register";PluginLifecycleStage["BEFORE_INIT"]="before-init";PluginLifecycleStage["AFTER_INIT"]="after-init";PluginLifecycleStage["BEFORE_TRANSFORM"]="before-transform";PluginLifecycleStage["AFTER_TRANSFORM"]="after-transform";PluginLifecycleStage["BEFORE_MATCH"]="before-match";PluginLifecycleStage["AFTER_MATCH"]="after-match";PluginLifecycleStage["DESTROY"]="destroy";return PluginLifecycleStage}({});
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});