@vlian/framework 1.2.62 → 2.0.1
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.
- package/README.md +21 -141
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -9
- package/dist/index.js +1 -1
- package/dist/index.umd.js +10 -220
- package/dist/kernel/constants.cjs +1 -1
- package/dist/kernel/constants.d.ts +1 -3
- package/dist/kernel/constants.js +1 -1
- package/dist/kernel/custom-manager/i18n/constants.cjs +1 -0
- package/dist/kernel/custom-manager/i18n/constants.d.ts +4 -0
- package/dist/kernel/custom-manager/i18n/constants.js +1 -0
- package/dist/kernel/custom-manager/i18n/index.cjs +1 -0
- package/dist/kernel/custom-manager/i18n/index.d.ts +7 -0
- package/dist/kernel/custom-manager/i18n/index.js +1 -0
- package/dist/kernel/custom-manager/i18n/types.d.ts +10 -0
- package/dist/kernel/custom-manager/index.cjs +1 -0
- package/dist/kernel/custom-manager/index.d.ts +4 -0
- package/dist/kernel/custom-manager/index.js +1 -0
- package/dist/kernel/custom-manager/theme/constants.cjs +1 -0
- package/dist/kernel/custom-manager/theme/constants.d.ts +4 -0
- package/dist/kernel/custom-manager/theme/constants.js +1 -0
- package/dist/kernel/custom-manager/theme/index.cjs +1 -0
- package/dist/kernel/custom-manager/theme/index.d.ts +7 -0
- package/dist/kernel/custom-manager/theme/index.js +1 -0
- package/dist/kernel/custom-manager/theme/types.d.ts +14 -0
- package/dist/kernel/index.cjs +1 -1
- package/dist/kernel/index.d.ts +4 -2
- package/dist/kernel/index.js +1 -1
- package/dist/kernel/kernel.cjs +1 -1
- package/dist/kernel/kernel.d.ts +3 -7
- package/dist/kernel/kernel.js +1 -1
- package/dist/kernel/manager/i18n/I18nManager.cjs +1 -1
- package/dist/kernel/manager/i18n/I18nManager.d.ts +2 -1
- package/dist/kernel/manager/i18n/I18nManager.js +1 -1
- package/dist/kernel/manager/i18n/i18n.persistence.d.ts +2 -1
- package/dist/kernel/manager/i18n/i18n.runtime.cjs +1 -0
- package/dist/kernel/manager/i18n/i18n.runtime.d.ts +8 -0
- package/dist/kernel/manager/i18n/i18n.runtime.js +1 -0
- package/dist/kernel/manager/i18n/i18n.schema.d.ts +1 -1
- package/dist/kernel/manager/i18nManager.cjs +1 -1
- package/dist/kernel/manager/i18nManager.d.ts +1 -1
- package/dist/kernel/manager/i18nManager.js +1 -1
- package/dist/kernel/manager/index.cjs +1 -1
- package/dist/kernel/manager/index.d.ts +0 -2
- package/dist/kernel/manager/index.js +1 -1
- package/dist/kernel/manager/theme/ThemeManager.cjs +1 -1
- package/dist/kernel/manager/theme/ThemeManager.d.ts +8 -1
- package/dist/kernel/manager/theme/ThemeManager.js +1 -1
- package/dist/kernel/manager/theme/theme.dom.cjs +1 -1
- package/dist/kernel/manager/theme/theme.dom.d.ts +10 -3
- package/dist/kernel/manager/theme/theme.dom.js +1 -1
- package/dist/kernel/manager/theme/theme.persistence.d.ts +2 -1
- package/dist/kernel/manager/theme/theme.schema.cjs +1 -1
- package/dist/kernel/manager/theme/theme.schema.d.ts +3 -1
- package/dist/kernel/manager/theme/theme.schema.js +1 -1
- package/dist/kernel/manager/themeManager.cjs +1 -1
- package/dist/kernel/manager/themeManager.d.ts +1 -1
- package/dist/kernel/manager/themeManager.js +1 -1
- package/dist/kernel/types.d.ts +10 -39
- package/package.json +19 -127
- package/dist/analytics/index.cjs +0 -1
- package/dist/analytics/index.d.ts +0 -2
- package/dist/analytics/index.js +0 -1
- package/dist/analytics.umd.js +0 -19
- package/dist/components/LocaleSwitch.cjs +0 -1
- package/dist/components/LocaleSwitch.d.ts +0 -21
- package/dist/components/LocaleSwitch.js +0 -1
- package/dist/components/ThemeSwitch.cjs +0 -1
- package/dist/components/ThemeSwitch.d.ts +0 -20
- package/dist/components/ThemeSwitch.js +0 -1
- package/dist/components/index.cjs +0 -1
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.js +0 -1
- package/dist/components/persistence.cjs +0 -1
- package/dist/components/persistence.d.ts +0 -12
- package/dist/components/persistence.js +0 -1
- package/dist/core/Test.cjs +0 -1
- package/dist/core/Test.d.ts +0 -5
- package/dist/core/Test.js +0 -1
- package/dist/core/app/AppContext.cjs +0 -1
- package/dist/core/app/AppContext.d.ts +0 -113
- package/dist/core/app/AppContext.js +0 -1
- package/dist/core/app/AppContext.types.cjs +0 -1
- package/dist/core/app/AppContext.types.d.ts +0 -146
- package/dist/core/app/AppContext.types.js +0 -1
- package/dist/core/app/BasicLayout.cjs +0 -1
- package/dist/core/app/BasicLayout.d.ts +0 -15
- package/dist/core/app/BasicLayout.js +0 -1
- package/dist/core/app/DefaultApp.cjs +0 -1
- package/dist/core/app/DefaultApp.d.ts +0 -10
- package/dist/core/app/DefaultApp.js +0 -1
- package/dist/core/app/index.cjs +0 -1
- package/dist/core/app/index.d.ts +0 -8
- package/dist/core/app/index.js +0 -1
- package/dist/core/config/AppConfig.cjs +0 -1
- package/dist/core/config/AppConfig.d.ts +0 -88
- package/dist/core/config/AppConfig.js +0 -1
- package/dist/core/config/ConfigLoader.cjs +0 -1
- package/dist/core/config/ConfigLoader.d.ts +0 -118
- package/dist/core/config/ConfigLoader.js +0 -1
- package/dist/core/config/ConfigValidator.cjs +0 -2
- package/dist/core/config/ConfigValidator.d.ts +0 -84
- package/dist/core/config/ConfigValidator.js +0 -2
- package/dist/core/config/index.cjs +0 -1
- package/dist/core/config/index.d.ts +0 -6
- package/dist/core/config/index.js +0 -1
- package/dist/core/dev/DevTools.cjs +0 -1
- package/dist/core/dev/DevTools.d.ts +0 -16
- package/dist/core/dev/DevTools.js +0 -1
- package/dist/core/error/ErrorBoundary.cjs +0 -1
- package/dist/core/error/ErrorBoundary.d.ts +0 -121
- package/dist/core/error/ErrorBoundary.js +0 -1
- package/dist/core/error/ErrorHandler.cjs +0 -1
- package/dist/core/error/ErrorHandler.d.ts +0 -171
- package/dist/core/error/ErrorHandler.js +0 -1
- package/dist/core/error/index.cjs +0 -1
- package/dist/core/error/index.d.ts +0 -7
- package/dist/core/error/index.js +0 -1
- package/dist/core/event/AppEventBus.cjs +0 -1
- package/dist/core/event/AppEventBus.d.ts +0 -178
- package/dist/core/event/AppEventBus.js +0 -1
- package/dist/core/event/frameworkEvents.cjs +0 -1
- package/dist/core/event/frameworkEvents.d.ts +0 -69
- package/dist/core/event/frameworkEvents.js +0 -1
- package/dist/core/event/hooks.cjs +0 -1
- package/dist/core/event/hooks.d.ts +0 -57
- package/dist/core/event/hooks.js +0 -1
- package/dist/core/event/index.cjs +0 -1
- package/dist/core/event/index.d.ts +0 -10
- package/dist/core/event/index.js +0 -1
- package/dist/core/event/types.cjs +0 -1
- package/dist/core/event/types.d.ts +0 -269
- package/dist/core/event/types.js +0 -1
- package/dist/core/event/useEventBus.cjs +0 -1
- package/dist/core/event/useEventBus.d.ts +0 -28
- package/dist/core/event/useEventBus.js +0 -1
- package/dist/core/index.cjs +0 -1
- package/dist/core/index.d.ts +0 -54
- package/dist/core/index.js +0 -1
- package/dist/core/initialization/InitializationErrorThrower.cjs +0 -1
- package/dist/core/initialization/InitializationErrorThrower.d.ts +0 -7
- package/dist/core/initialization/InitializationErrorThrower.js +0 -1
- package/dist/core/initialization/index.cjs +0 -1
- package/dist/core/initialization/index.d.ts +0 -7
- package/dist/core/initialization/index.js +0 -1
- package/dist/core/initialization/initialization.cjs +0 -1
- package/dist/core/initialization/initialization.d.ts +0 -69
- package/dist/core/initialization/initialization.js +0 -1
- package/dist/core/initialization/initializationErrorState.cjs +0 -1
- package/dist/core/initialization/initializationErrorState.d.ts +0 -35
- package/dist/core/initialization/initializationErrorState.js +0 -1
- package/dist/core/kernel/defaultAdapters.cjs +0 -1
- package/dist/core/kernel/defaultAdapters.d.ts +0 -2
- package/dist/core/kernel/defaultAdapters.js +0 -1
- package/dist/core/kernel/errors.cjs +0 -1
- package/dist/core/kernel/errors.d.ts +0 -18
- package/dist/core/kernel/errors.js +0 -1
- package/dist/core/kernel/index.cjs +0 -1
- package/dist/core/kernel/index.d.ts +0 -3
- package/dist/core/kernel/index.js +0 -1
- package/dist/core/kernel/startKernel.cjs +0 -1
- package/dist/core/kernel/startKernel.d.ts +0 -2
- package/dist/core/kernel/startKernel.js +0 -1
- package/dist/core/kernel/types.cjs +0 -1
- package/dist/core/kernel/types.d.ts +0 -114
- package/dist/core/kernel/types.js +0 -1
- package/dist/core/middleware.cjs +0 -1
- package/dist/core/middleware.d.ts +0 -36
- package/dist/core/middleware.js +0 -1
- package/dist/core/plugin/PluginEventBus.cjs +0 -1
- package/dist/core/plugin/PluginEventBus.d.ts +0 -169
- package/dist/core/plugin/PluginEventBus.js +0 -1
- package/dist/core/plugin/PluginSandbox.cjs +0 -1
- package/dist/core/plugin/PluginSandbox.d.ts +0 -101
- package/dist/core/plugin/PluginSandbox.js +0 -1
- package/dist/core/plugin.cjs +0 -1
- package/dist/core/plugin.d.ts +0 -224
- package/dist/core/plugin.js +0 -1
- package/dist/core/router/RouterManager.cjs +0 -1
- package/dist/core/router/RouterManager.d.ts +0 -87
- package/dist/core/router/RouterManager.js +0 -1
- package/dist/core/router/adapter/AdapterManager.cjs +0 -1
- package/dist/core/router/adapter/AdapterManager.d.ts +0 -94
- package/dist/core/router/adapter/AdapterManager.js +0 -1
- package/dist/core/router/adapter/index.cjs +0 -1
- package/dist/core/router/adapter/index.d.ts +0 -6
- package/dist/core/router/adapter/index.js +0 -1
- package/dist/core/router/adapter/react-router/ReactRouterAdapter.cjs +0 -1
- package/dist/core/router/adapter/react-router/ReactRouterAdapter.d.ts +0 -43
- package/dist/core/router/adapter/react-router/ReactRouterAdapter.js +0 -1
- package/dist/core/router/adapter/react-router/index.cjs +0 -1
- package/dist/core/router/adapter/react-router/index.d.ts +0 -4
- package/dist/core/router/adapter/react-router/index.js +0 -1
- package/dist/core/router/adapter/types.cjs +0 -1
- package/dist/core/router/adapter/types.d.ts +0 -111
- package/dist/core/router/adapter/types.js +0 -1
- package/dist/core/router/dev/RouterDevTools.cjs +0 -1
- package/dist/core/router/dev/RouterDevTools.d.ts +0 -5
- package/dist/core/router/dev/RouterDevTools.js +0 -1
- package/dist/core/router/dev/index.cjs +0 -1
- package/dist/core/router/dev/index.d.ts +0 -4
- package/dist/core/router/dev/index.js +0 -1
- package/dist/core/router/dynamic/DynamicRouteManager.cjs +0 -1
- package/dist/core/router/dynamic/DynamicRouteManager.d.ts +0 -71
- package/dist/core/router/dynamic/DynamicRouteManager.js +0 -1
- package/dist/core/router/dynamic/index.cjs +0 -1
- package/dist/core/router/dynamic/index.d.ts +0 -4
- package/dist/core/router/dynamic/index.js +0 -1
- package/dist/core/router/errors/RouterError.cjs +0 -1
- package/dist/core/router/errors/RouterError.d.ts +0 -48
- package/dist/core/router/errors/RouterError.js +0 -1
- package/dist/core/router/errors/index.cjs +0 -1
- package/dist/core/router/errors/index.d.ts +0 -4
- package/dist/core/router/errors/index.js +0 -1
- package/dist/core/router/index.cjs +0 -1
- package/dist/core/router/index.d.ts +0 -16
- package/dist/core/router/index.js +0 -1
- package/dist/core/router/lifecycle/RouterLifecycleManager.cjs +0 -1
- package/dist/core/router/lifecycle/RouterLifecycleManager.d.ts +0 -56
- package/dist/core/router/lifecycle/RouterLifecycleManager.js +0 -1
- package/dist/core/router/lifecycle/index.cjs +0 -1
- package/dist/core/router/lifecycle/index.d.ts +0 -4
- package/dist/core/router/lifecycle/index.js +0 -1
- package/dist/core/router/middleware/RouterMiddlewareManager.cjs +0 -1
- package/dist/core/router/middleware/RouterMiddlewareManager.d.ts +0 -61
- package/dist/core/router/middleware/RouterMiddlewareManager.js +0 -1
- package/dist/core/router/middleware/auth.cjs +0 -1
- package/dist/core/router/middleware/auth.d.ts +0 -54
- package/dist/core/router/middleware/auth.js +0 -1
- package/dist/core/router/middleware/index.cjs +0 -1
- package/dist/core/router/middleware/index.d.ts +0 -6
- package/dist/core/router/middleware/index.js +0 -1
- package/dist/core/router/middleware/types.cjs +0 -1
- package/dist/core/router/middleware/types.d.ts +0 -82
- package/dist/core/router/middleware/types.js +0 -1
- package/dist/core/router/monitoring/RouterMonitoring.cjs +0 -1
- package/dist/core/router/monitoring/RouterMonitoring.d.ts +0 -134
- package/dist/core/router/monitoring/RouterMonitoring.js +0 -1
- package/dist/core/router/monitoring/index.cjs +0 -1
- package/dist/core/router/monitoring/index.d.ts +0 -4
- package/dist/core/router/monitoring/index.js +0 -1
- package/dist/core/router/navigation/RouterNavigation.cjs +0 -1
- package/dist/core/router/navigation/RouterNavigation.d.ts +0 -43
- package/dist/core/router/navigation/RouterNavigation.js +0 -1
- package/dist/core/router/navigation/index.cjs +0 -1
- package/dist/core/router/navigation/index.d.ts +0 -4
- package/dist/core/router/navigation/index.js +0 -1
- package/dist/core/router/performance/RouteCache.cjs +0 -1
- package/dist/core/router/performance/RouteCache.d.ts +0 -113
- package/dist/core/router/performance/RouteCache.js +0 -1
- package/dist/core/router/performance/RoutePreloader.cjs +0 -1
- package/dist/core/router/performance/RoutePreloader.d.ts +0 -111
- package/dist/core/router/performance/RoutePreloader.js +0 -1
- package/dist/core/router/performance/index.cjs +0 -1
- package/dist/core/router/performance/index.d.ts +0 -5
- package/dist/core/router/performance/index.js +0 -1
- package/dist/core/router/plugin/RouterPluginManager.cjs +0 -1
- package/dist/core/router/plugin/RouterPluginManager.d.ts +0 -74
- package/dist/core/router/plugin/RouterPluginManager.js +0 -1
- package/dist/core/router/plugin/index.cjs +0 -1
- package/dist/core/router/plugin/index.d.ts +0 -5
- package/dist/core/router/plugin/index.js +0 -1
- package/dist/core/router/plugin/types.cjs +0 -1
- package/dist/core/router/plugin/types.d.ts +0 -153
- package/dist/core/router/plugin/types.js +0 -1
- package/dist/core/router/types.cjs +0 -1
- package/dist/core/router/types.d.ts +0 -464
- package/dist/core/router/types.js +0 -1
- package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.cjs +0 -1
- package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.d.ts +0 -2
- package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.js +0 -1
- package/dist/core/router/utils/adapters/react-router/transform.cjs +0 -1
- package/dist/core/router/utils/adapters/react-router/transform.d.ts +0 -5
- package/dist/core/router/utils/adapters/react-router/transform.js +0 -1
- package/dist/core/router/utils/transform.cjs +0 -1
- package/dist/core/router/utils/transform.d.ts +0 -348
- package/dist/core/router/utils/transform.js +0 -1
- package/dist/core/router/validation/RouterConfigValidator.cjs +0 -2
- package/dist/core/router/validation/RouterConfigValidator.d.ts +0 -121
- package/dist/core/router/validation/RouterConfigValidator.js +0 -2
- package/dist/core/router/validation/index.cjs +0 -1
- package/dist/core/router/validation/index.d.ts +0 -5
- package/dist/core/router/validation/index.js +0 -1
- package/dist/core/router/validation/schema.cjs +0 -1
- package/dist/core/router/validation/schema.d.ts +0 -180
- package/dist/core/router/validation/schema.js +0 -1
- package/dist/core/router/version/RouteVersionManager.cjs +0 -1
- package/dist/core/router/version/RouteVersionManager.d.ts +0 -124
- package/dist/core/router/version/RouteVersionManager.js +0 -1
- package/dist/core/router/version/index.cjs +0 -1
- package/dist/core/router/version/index.d.ts +0 -4
- package/dist/core/router/version/index.js +0 -1
- package/dist/core/splash/SplashScreen.cjs +0 -1
- package/dist/core/splash/SplashScreen.d.ts +0 -14
- package/dist/core/splash/SplashScreen.js +0 -1
- package/dist/core/splash/index.cjs +0 -1
- package/dist/core/splash/index.d.ts +0 -5
- package/dist/core/splash/index.js +0 -1
- package/dist/core/splash/splashScreenUtils.cjs +0 -1
- package/dist/core/splash/splashScreenUtils.d.ts +0 -7
- package/dist/core/splash/splashScreenUtils.js +0 -1
- package/dist/core/startup/AppInstance.cjs +0 -1
- package/dist/core/startup/AppInstance.d.ts +0 -138
- package/dist/core/startup/AppInstance.js +0 -1
- package/dist/core/startup/environment.cjs +0 -1
- package/dist/core/startup/environment.d.ts +0 -87
- package/dist/core/startup/environment.js +0 -1
- package/dist/core/startup/index.cjs +0 -1
- package/dist/core/startup/index.d.ts +0 -7
- package/dist/core/startup/index.js +0 -1
- package/dist/core/startup/initializeServices.cjs +0 -1
- package/dist/core/startup/initializeServices.d.ts +0 -68
- package/dist/core/startup/initializeServices.js +0 -1
- package/dist/core/startup/performanceTracker.cjs +0 -1
- package/dist/core/startup/performanceTracker.d.ts +0 -104
- package/dist/core/startup/performanceTracker.js +0 -1
- package/dist/core/startup/renderApp.cjs +0 -1
- package/dist/core/startup/renderApp.d.ts +0 -70
- package/dist/core/startup/renderApp.js +0 -1
- package/dist/core/startup/startApp.cjs +0 -1
- package/dist/core/startup/startApp.d.ts +0 -14
- package/dist/core/startup/startApp.js +0 -1
- package/dist/core/types.cjs +0 -1
- package/dist/core/types.d.ts +0 -501
- package/dist/core/types.js +0 -1
- package/dist/core-bak/Test.cjs +0 -1
- package/dist/core-bak/Test.d.ts +0 -5
- package/dist/core-bak/Test.js +0 -1
- package/dist/core-bak/app/AppContext.cjs +0 -1
- package/dist/core-bak/app/AppContext.d.ts +0 -113
- package/dist/core-bak/app/AppContext.js +0 -1
- package/dist/core-bak/app/AppContext.types.cjs +0 -1
- package/dist/core-bak/app/AppContext.types.d.ts +0 -146
- package/dist/core-bak/app/AppContext.types.js +0 -1
- package/dist/core-bak/app/BasicLayout.cjs +0 -1
- package/dist/core-bak/app/BasicLayout.d.ts +0 -15
- package/dist/core-bak/app/BasicLayout.js +0 -1
- package/dist/core-bak/app/DefaultApp.cjs +0 -1
- package/dist/core-bak/app/DefaultApp.d.ts +0 -10
- package/dist/core-bak/app/DefaultApp.js +0 -1
- package/dist/core-bak/app/index.cjs +0 -1
- package/dist/core-bak/app/index.d.ts +0 -8
- package/dist/core-bak/app/index.js +0 -1
- package/dist/core-bak/config/AppConfig.cjs +0 -1
- package/dist/core-bak/config/AppConfig.d.ts +0 -88
- package/dist/core-bak/config/AppConfig.js +0 -1
- package/dist/core-bak/config/ConfigLoader.cjs +0 -1
- package/dist/core-bak/config/ConfigLoader.d.ts +0 -118
- package/dist/core-bak/config/ConfigLoader.js +0 -1
- package/dist/core-bak/config/ConfigValidator.cjs +0 -2
- package/dist/core-bak/config/ConfigValidator.d.ts +0 -84
- package/dist/core-bak/config/ConfigValidator.js +0 -2
- package/dist/core-bak/config/index.cjs +0 -1
- package/dist/core-bak/config/index.d.ts +0 -6
- package/dist/core-bak/config/index.js +0 -1
- package/dist/core-bak/dev/DevTools.cjs +0 -1
- package/dist/core-bak/dev/DevTools.d.ts +0 -16
- package/dist/core-bak/dev/DevTools.js +0 -1
- package/dist/core-bak/error/ErrorBoundary.cjs +0 -1
- package/dist/core-bak/error/ErrorBoundary.d.ts +0 -121
- package/dist/core-bak/error/ErrorBoundary.js +0 -1
- package/dist/core-bak/error/ErrorHandler.cjs +0 -1
- package/dist/core-bak/error/ErrorHandler.d.ts +0 -171
- package/dist/core-bak/error/ErrorHandler.js +0 -1
- package/dist/core-bak/error/index.cjs +0 -1
- package/dist/core-bak/error/index.d.ts +0 -7
- package/dist/core-bak/error/index.js +0 -1
- package/dist/core-bak/event/AppEventBus.cjs +0 -1
- package/dist/core-bak/event/AppEventBus.d.ts +0 -178
- package/dist/core-bak/event/AppEventBus.js +0 -1
- package/dist/core-bak/event/frameworkEvents.cjs +0 -1
- package/dist/core-bak/event/frameworkEvents.d.ts +0 -69
- package/dist/core-bak/event/frameworkEvents.js +0 -1
- package/dist/core-bak/event/hooks.cjs +0 -1
- package/dist/core-bak/event/hooks.d.ts +0 -57
- package/dist/core-bak/event/hooks.js +0 -1
- package/dist/core-bak/event/index.cjs +0 -1
- package/dist/core-bak/event/index.d.ts +0 -10
- package/dist/core-bak/event/index.js +0 -1
- package/dist/core-bak/event/types.cjs +0 -1
- package/dist/core-bak/event/types.d.ts +0 -269
- package/dist/core-bak/event/types.js +0 -1
- package/dist/core-bak/event/useEventBus.cjs +0 -1
- package/dist/core-bak/event/useEventBus.d.ts +0 -28
- package/dist/core-bak/event/useEventBus.js +0 -1
- package/dist/core-bak/index.cjs +0 -1
- package/dist/core-bak/index.d.ts +0 -54
- package/dist/core-bak/index.js +0 -1
- package/dist/core-bak/initialization/InitializationErrorThrower.cjs +0 -1
- package/dist/core-bak/initialization/InitializationErrorThrower.d.ts +0 -7
- package/dist/core-bak/initialization/InitializationErrorThrower.js +0 -1
- package/dist/core-bak/initialization/index.cjs +0 -1
- package/dist/core-bak/initialization/index.d.ts +0 -7
- package/dist/core-bak/initialization/index.js +0 -1
- package/dist/core-bak/initialization/initialization.cjs +0 -1
- package/dist/core-bak/initialization/initialization.d.ts +0 -69
- package/dist/core-bak/initialization/initialization.js +0 -1
- package/dist/core-bak/initialization/initializationErrorState.cjs +0 -1
- package/dist/core-bak/initialization/initializationErrorState.d.ts +0 -35
- package/dist/core-bak/initialization/initializationErrorState.js +0 -1
- package/dist/core-bak/kernel/defaultAdapters.cjs +0 -1
- package/dist/core-bak/kernel/defaultAdapters.d.ts +0 -2
- package/dist/core-bak/kernel/defaultAdapters.js +0 -1
- package/dist/core-bak/kernel/errors.cjs +0 -1
- package/dist/core-bak/kernel/errors.d.ts +0 -18
- package/dist/core-bak/kernel/errors.js +0 -1
- package/dist/core-bak/kernel/index.cjs +0 -1
- package/dist/core-bak/kernel/index.d.ts +0 -3
- package/dist/core-bak/kernel/index.js +0 -1
- package/dist/core-bak/kernel/startKernel.cjs +0 -1
- package/dist/core-bak/kernel/startKernel.d.ts +0 -2
- package/dist/core-bak/kernel/startKernel.js +0 -1
- package/dist/core-bak/kernel/types.d.ts +0 -114
- package/dist/core-bak/middleware.cjs +0 -1
- package/dist/core-bak/middleware.d.ts +0 -36
- package/dist/core-bak/middleware.js +0 -1
- package/dist/core-bak/plugin/PluginEventBus.cjs +0 -1
- package/dist/core-bak/plugin/PluginEventBus.d.ts +0 -169
- package/dist/core-bak/plugin/PluginEventBus.js +0 -1
- package/dist/core-bak/plugin/PluginSandbox.cjs +0 -1
- package/dist/core-bak/plugin/PluginSandbox.d.ts +0 -101
- package/dist/core-bak/plugin/PluginSandbox.js +0 -1
- package/dist/core-bak/plugin.cjs +0 -1
- package/dist/core-bak/plugin.d.ts +0 -224
- package/dist/core-bak/plugin.js +0 -1
- package/dist/core-bak/router/RouterManager.cjs +0 -1
- package/dist/core-bak/router/RouterManager.d.ts +0 -87
- package/dist/core-bak/router/RouterManager.js +0 -1
- package/dist/core-bak/router/adapter/AdapterManager.cjs +0 -1
- package/dist/core-bak/router/adapter/AdapterManager.d.ts +0 -94
- package/dist/core-bak/router/adapter/AdapterManager.js +0 -1
- package/dist/core-bak/router/adapter/index.cjs +0 -1
- package/dist/core-bak/router/adapter/index.d.ts +0 -6
- package/dist/core-bak/router/adapter/index.js +0 -1
- package/dist/core-bak/router/adapter/react-router/ReactRouterAdapter.cjs +0 -1
- package/dist/core-bak/router/adapter/react-router/ReactRouterAdapter.d.ts +0 -43
- package/dist/core-bak/router/adapter/react-router/ReactRouterAdapter.js +0 -1
- package/dist/core-bak/router/adapter/react-router/index.cjs +0 -1
- package/dist/core-bak/router/adapter/react-router/index.d.ts +0 -4
- package/dist/core-bak/router/adapter/react-router/index.js +0 -1
- package/dist/core-bak/router/adapter/types.d.ts +0 -111
- package/dist/core-bak/router/dev/RouterDevTools.cjs +0 -1
- package/dist/core-bak/router/dev/RouterDevTools.d.ts +0 -5
- package/dist/core-bak/router/dev/RouterDevTools.js +0 -1
- package/dist/core-bak/router/dev/index.cjs +0 -1
- package/dist/core-bak/router/dev/index.d.ts +0 -4
- package/dist/core-bak/router/dev/index.js +0 -1
- package/dist/core-bak/router/dynamic/DynamicRouteManager.cjs +0 -1
- package/dist/core-bak/router/dynamic/DynamicRouteManager.d.ts +0 -71
- package/dist/core-bak/router/dynamic/DynamicRouteManager.js +0 -1
- package/dist/core-bak/router/dynamic/index.cjs +0 -1
- package/dist/core-bak/router/dynamic/index.d.ts +0 -4
- package/dist/core-bak/router/dynamic/index.js +0 -1
- package/dist/core-bak/router/errors/RouterError.cjs +0 -1
- package/dist/core-bak/router/errors/RouterError.d.ts +0 -48
- package/dist/core-bak/router/errors/RouterError.js +0 -1
- package/dist/core-bak/router/errors/index.cjs +0 -1
- package/dist/core-bak/router/errors/index.d.ts +0 -4
- package/dist/core-bak/router/errors/index.js +0 -1
- package/dist/core-bak/router/index.cjs +0 -1
- package/dist/core-bak/router/index.d.ts +0 -16
- package/dist/core-bak/router/index.js +0 -1
- package/dist/core-bak/router/lifecycle/RouterLifecycleManager.cjs +0 -1
- package/dist/core-bak/router/lifecycle/RouterLifecycleManager.d.ts +0 -56
- package/dist/core-bak/router/lifecycle/RouterLifecycleManager.js +0 -1
- package/dist/core-bak/router/lifecycle/index.cjs +0 -1
- package/dist/core-bak/router/lifecycle/index.d.ts +0 -4
- package/dist/core-bak/router/lifecycle/index.js +0 -1
- package/dist/core-bak/router/middleware/RouterMiddlewareManager.cjs +0 -1
- package/dist/core-bak/router/middleware/RouterMiddlewareManager.d.ts +0 -61
- package/dist/core-bak/router/middleware/RouterMiddlewareManager.js +0 -1
- package/dist/core-bak/router/middleware/auth.cjs +0 -1
- package/dist/core-bak/router/middleware/auth.d.ts +0 -54
- package/dist/core-bak/router/middleware/auth.js +0 -1
- package/dist/core-bak/router/middleware/index.cjs +0 -1
- package/dist/core-bak/router/middleware/index.d.ts +0 -6
- package/dist/core-bak/router/middleware/index.js +0 -1
- package/dist/core-bak/router/middleware/types.cjs +0 -1
- package/dist/core-bak/router/middleware/types.d.ts +0 -82
- package/dist/core-bak/router/middleware/types.js +0 -1
- package/dist/core-bak/router/monitoring/RouterMonitoring.cjs +0 -1
- package/dist/core-bak/router/monitoring/RouterMonitoring.d.ts +0 -134
- package/dist/core-bak/router/monitoring/RouterMonitoring.js +0 -1
- package/dist/core-bak/router/monitoring/index.cjs +0 -1
- package/dist/core-bak/router/monitoring/index.d.ts +0 -4
- package/dist/core-bak/router/monitoring/index.js +0 -1
- package/dist/core-bak/router/navigation/RouterNavigation.cjs +0 -1
- package/dist/core-bak/router/navigation/RouterNavigation.d.ts +0 -43
- package/dist/core-bak/router/navigation/RouterNavigation.js +0 -1
- package/dist/core-bak/router/navigation/index.cjs +0 -1
- package/dist/core-bak/router/navigation/index.d.ts +0 -4
- package/dist/core-bak/router/navigation/index.js +0 -1
- package/dist/core-bak/router/performance/RouteCache.cjs +0 -1
- package/dist/core-bak/router/performance/RouteCache.d.ts +0 -113
- package/dist/core-bak/router/performance/RouteCache.js +0 -1
- package/dist/core-bak/router/performance/RoutePreloader.cjs +0 -1
- package/dist/core-bak/router/performance/RoutePreloader.d.ts +0 -111
- package/dist/core-bak/router/performance/RoutePreloader.js +0 -1
- package/dist/core-bak/router/performance/index.cjs +0 -1
- package/dist/core-bak/router/performance/index.d.ts +0 -5
- package/dist/core-bak/router/performance/index.js +0 -1
- package/dist/core-bak/router/plugin/RouterPluginManager.cjs +0 -1
- package/dist/core-bak/router/plugin/RouterPluginManager.d.ts +0 -74
- package/dist/core-bak/router/plugin/RouterPluginManager.js +0 -1
- package/dist/core-bak/router/plugin/index.cjs +0 -1
- package/dist/core-bak/router/plugin/index.d.ts +0 -5
- package/dist/core-bak/router/plugin/index.js +0 -1
- package/dist/core-bak/router/plugin/types.cjs +0 -1
- package/dist/core-bak/router/plugin/types.d.ts +0 -153
- package/dist/core-bak/router/plugin/types.js +0 -1
- package/dist/core-bak/router/types.cjs +0 -1
- package/dist/core-bak/router/types.d.ts +0 -464
- package/dist/core-bak/router/types.js +0 -1
- package/dist/core-bak/router/utils/adapters/react-router/RouteErrorBoundary.cjs +0 -1
- package/dist/core-bak/router/utils/adapters/react-router/RouteErrorBoundary.d.ts +0 -2
- package/dist/core-bak/router/utils/adapters/react-router/RouteErrorBoundary.js +0 -1
- package/dist/core-bak/router/utils/adapters/react-router/transform.cjs +0 -1
- package/dist/core-bak/router/utils/adapters/react-router/transform.d.ts +0 -5
- package/dist/core-bak/router/utils/adapters/react-router/transform.js +0 -1
- package/dist/core-bak/router/utils/transform.cjs +0 -1
- package/dist/core-bak/router/utils/transform.d.ts +0 -348
- package/dist/core-bak/router/utils/transform.js +0 -1
- package/dist/core-bak/router/validation/RouterConfigValidator.cjs +0 -2
- package/dist/core-bak/router/validation/RouterConfigValidator.d.ts +0 -121
- package/dist/core-bak/router/validation/RouterConfigValidator.js +0 -2
- package/dist/core-bak/router/validation/index.cjs +0 -1
- package/dist/core-bak/router/validation/index.d.ts +0 -5
- package/dist/core-bak/router/validation/index.js +0 -1
- package/dist/core-bak/router/validation/schema.cjs +0 -1
- package/dist/core-bak/router/validation/schema.d.ts +0 -180
- package/dist/core-bak/router/validation/schema.js +0 -1
- package/dist/core-bak/router/version/RouteVersionManager.cjs +0 -1
- package/dist/core-bak/router/version/RouteVersionManager.d.ts +0 -124
- package/dist/core-bak/router/version/RouteVersionManager.js +0 -1
- package/dist/core-bak/router/version/index.cjs +0 -1
- package/dist/core-bak/router/version/index.d.ts +0 -4
- package/dist/core-bak/router/version/index.js +0 -1
- package/dist/core-bak/splash/SplashScreen.cjs +0 -1
- package/dist/core-bak/splash/SplashScreen.d.ts +0 -14
- package/dist/core-bak/splash/SplashScreen.js +0 -1
- package/dist/core-bak/splash/index.cjs +0 -1
- package/dist/core-bak/splash/index.d.ts +0 -5
- package/dist/core-bak/splash/index.js +0 -1
- package/dist/core-bak/splash/splashScreenUtils.cjs +0 -1
- package/dist/core-bak/splash/splashScreenUtils.d.ts +0 -7
- package/dist/core-bak/splash/splashScreenUtils.js +0 -1
- package/dist/core-bak/startup/AppInstance.cjs +0 -1
- package/dist/core-bak/startup/AppInstance.d.ts +0 -138
- package/dist/core-bak/startup/AppInstance.js +0 -1
- package/dist/core-bak/startup/environment.cjs +0 -1
- package/dist/core-bak/startup/environment.d.ts +0 -87
- package/dist/core-bak/startup/environment.js +0 -1
- package/dist/core-bak/startup/index.cjs +0 -1
- package/dist/core-bak/startup/index.d.ts +0 -7
- package/dist/core-bak/startup/index.js +0 -1
- package/dist/core-bak/startup/initializeServices.cjs +0 -1
- package/dist/core-bak/startup/initializeServices.d.ts +0 -68
- package/dist/core-bak/startup/initializeServices.js +0 -1
- package/dist/core-bak/startup/performanceTracker.cjs +0 -1
- package/dist/core-bak/startup/performanceTracker.d.ts +0 -104
- package/dist/core-bak/startup/performanceTracker.js +0 -1
- package/dist/core-bak/startup/renderApp.cjs +0 -1
- package/dist/core-bak/startup/renderApp.d.ts +0 -70
- package/dist/core-bak/startup/renderApp.js +0 -1
- package/dist/core-bak/startup/startApp.cjs +0 -1
- package/dist/core-bak/startup/startApp.d.ts +0 -14
- package/dist/core-bak/startup/startApp.js +0 -1
- package/dist/core-bak/types.cjs +0 -1
- package/dist/core-bak/types.d.ts +0 -501
- package/dist/core-bak/types.js +0 -1
- package/dist/index.umd.cjs +0 -1
- package/dist/index.umd.d.ts +0 -7
- package/dist/library/index.cjs +0 -1
- package/dist/library/index.d.ts +0 -2
- package/dist/library/index.js +0 -1
- package/dist/library/locale/index.cjs +0 -1
- package/dist/library/locale/index.d.ts +0 -6
- package/dist/library/locale/index.js +0 -1
- package/dist/library/locale/langs/en-us/index.cjs +0 -1
- package/dist/library/locale/langs/en-us/index.d.ts +0 -3
- package/dist/library/locale/langs/en-us/index.js +0 -1
- package/dist/library/locale/langs/zh-cn/index.cjs +0 -1
- package/dist/library/locale/langs/zh-cn/index.d.ts +0 -3
- package/dist/library/locale/langs/zh-cn/index.js +0 -1
- package/dist/library/locale/types.cjs +0 -1
- package/dist/library/locale/types.d.ts +0 -38
- package/dist/library/locale/types.js +0 -1
- package/dist/library/storage/cache.cjs +0 -1
- package/dist/library/storage/cache.d.ts +0 -57
- package/dist/library/storage/cache.js +0 -1
- package/dist/library/storage/encryption.cjs +0 -1
- package/dist/library/storage/encryption.d.ts +0 -45
- package/dist/library/storage/encryption.js +0 -1
- package/dist/library/storage/index.cjs +0 -1
- package/dist/library/storage/index.d.ts +0 -62
- package/dist/library/storage/index.js +0 -1
- package/dist/state/StateManager.cjs +0 -1
- package/dist/state/StateManager.d.ts +0 -120
- package/dist/state/StateManager.js +0 -1
- package/dist/state/adapters/AdapterFactory.cjs +0 -1
- package/dist/state/adapters/AdapterFactory.d.ts +0 -51
- package/dist/state/adapters/AdapterFactory.js +0 -1
- package/dist/state/adapters/DefaultAdapter.cjs +0 -1
- package/dist/state/adapters/DefaultAdapter.d.ts +0 -38
- package/dist/state/adapters/DefaultAdapter.js +0 -1
- package/dist/state/adapters/ReduxAdapter.cjs +0 -1
- package/dist/state/adapters/ReduxAdapter.d.ts +0 -129
- package/dist/state/adapters/ReduxAdapter.js +0 -1
- package/dist/state/adapters/ZustandAdapter.cjs +0 -1
- package/dist/state/adapters/ZustandAdapter.d.ts +0 -46
- package/dist/state/adapters/ZustandAdapter.js +0 -1
- package/dist/state/adapters/index.cjs +0 -1
- package/dist/state/adapters/index.d.ts +0 -8
- package/dist/state/adapters/index.js +0 -1
- package/dist/state/adapters/types.cjs +0 -1
- package/dist/state/adapters/types.d.ts +0 -4
- package/dist/state/adapters/types.js +0 -1
- package/dist/state/core/DerivedStateInstance.cjs +0 -1
- package/dist/state/core/DerivedStateInstance.d.ts +0 -100
- package/dist/state/core/DerivedStateInstance.js +0 -1
- package/dist/state/core/StateInstance.cjs +0 -1
- package/dist/state/core/StateInstance.d.ts +0 -85
- package/dist/state/core/StateInstance.js +0 -1
- package/dist/state/core/StateRegistry.cjs +0 -1
- package/dist/state/core/StateRegistry.d.ts +0 -55
- package/dist/state/core/StateRegistry.js +0 -1
- package/dist/state/core/StateScope.cjs +0 -1
- package/dist/state/core/StateScope.d.ts +0 -71
- package/dist/state/core/StateScope.js +0 -1
- package/dist/state/core/index.cjs +0 -1
- package/dist/state/core/index.d.ts +0 -7
- package/dist/state/core/index.js +0 -1
- package/dist/state/index.cjs +0 -1
- package/dist/state/index.d.ts +0 -8
- package/dist/state/index.js +0 -1
- package/dist/state/types.cjs +0 -1
- package/dist/state/types.d.ts +0 -230
- package/dist/state/types.js +0 -1
- package/dist/state.umd.js +0 -41
- package/dist/types.cjs +0 -1
- package/dist/types.d.ts +0 -7
- package/dist/types.js +0 -1
- package/dist/utils/analytics.cjs +0 -1
- package/dist/utils/analytics.d.ts +0 -127
- package/dist/utils/analytics.js +0 -1
- package/dist/utils/configSecurity.cjs +0 -3
- package/dist/utils/configSecurity.d.ts +0 -100
- package/dist/utils/configSecurity.js +0 -3
- package/dist/utils/csrf.cjs +0 -1
- package/dist/utils/csrf.d.ts +0 -1
- package/dist/utils/csrf.js +0 -1
- package/dist/utils/errors/ErrorCodes.cjs +0 -1
- package/dist/utils/errors/ErrorCodes.d.ts +0 -1
- package/dist/utils/errors/ErrorCodes.js +0 -1
- package/dist/utils/errors.cjs +0 -1
- package/dist/utils/errors.d.ts +0 -30
- package/dist/utils/errors.js +0 -1
- package/dist/utils/index.cjs +0 -1
- package/dist/utils/index.d.ts +0 -39
- package/dist/utils/index.js +0 -1
- package/dist/utils/logger.cjs +0 -1
- package/dist/utils/logger.d.ts +0 -2
- package/dist/utils/logger.js +0 -1
- package/dist/utils/logger.types.cjs +0 -1
- package/dist/utils/logger.types.d.ts +0 -2
- package/dist/utils/logger.types.js +0 -1
- package/dist/utils/monitoring.cjs +0 -1
- package/dist/utils/monitoring.d.ts +0 -1
- package/dist/utils/monitoring.js +0 -1
- package/dist/utils/performance.cjs +0 -1
- package/dist/utils/performance.d.ts +0 -2
- package/dist/utils/performance.js +0 -1
- package/dist/utils/resourceLoader.cjs +0 -1
- package/dist/utils/resourceLoader.d.ts +0 -2
- package/dist/utils/resourceLoader.js +0 -1
- package/dist/utils/runtimeSecurity.cjs +0 -1
- package/dist/utils/runtimeSecurity.d.ts +0 -2
- package/dist/utils/runtimeSecurity.js +0 -1
- package/dist/utils/security.cjs +0 -1
- package/dist/utils/security.d.ts +0 -2
- package/dist/utils/security.js +0 -1
- package/dist/utils/traceId.cjs +0 -1
- package/dist/utils/traceId.d.ts +0 -1
- package/dist/utils/traceId.js +0 -1
- package/dist/utils/validation.cjs +0 -1
- package/dist/utils/validation.d.ts +0 -2
- package/dist/utils/validation.js +0 -1
- /package/dist/{core-bak/kernel → kernel/custom-manager/i18n}/types.cjs +0 -0
- /package/dist/{core-bak/kernel → kernel/custom-manager/i18n}/types.js +0 -0
- /package/dist/{core-bak/router/adapter → kernel/custom-manager/theme}/types.cjs +0 -0
- /package/dist/{core-bak/router/adapter → kernel/custom-manager/theme}/types.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
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 useAppEvent(){return useAppEvent},get useAppEventEmitter(){return useAppEventEmitter},get useAppEventOnce(){return useAppEventOnce}});const _react=require("react");function useAppEvent(eventBus,event,listener,options){const listenerRef=(0,_react.useRef)(listener);listenerRef.current=listener;const optionsRef=(0,_react.useRef)(options);optionsRef.current=options;(0,_react.useEffect)(()=>{const wrappedListener=(data,metadata)=>{return listenerRef.current(data,metadata)};const unsubscribe=eventBus.on(event,wrappedListener,optionsRef.current);return unsubscribe},[eventBus,event])}function useAppEventOnce(eventBus,event,listener,options){const listenerRef=(0,_react.useRef)(listener);listenerRef.current=listener;const optionsRef=(0,_react.useRef)(options);optionsRef.current=options;(0,_react.useEffect)(()=>{const wrappedListener=(data,metadata)=>{return listenerRef.current(data,metadata)};const unsubscribe=eventBus.once(event,wrappedListener,optionsRef.current);return unsubscribe},[eventBus,event])}function useAppEventEmitter(eventBus){return(0,_react.useCallback)((event,data,metadata)=>{return eventBus.emit(event,data,metadata)},[eventBus])}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* React Hooks 支持
|
|
3
|
-
* 提供便捷的 React 组件事件订阅能力
|
|
4
|
-
*/
|
|
5
|
-
import type { EventListener, EventListenerOptions } from './types';
|
|
6
|
-
import type { AppEventBus } from './AppEventBus';
|
|
7
|
-
/**
|
|
8
|
-
* 使用事件总线的 Hook
|
|
9
|
-
*
|
|
10
|
-
* @param eventBus - 事件总线实例
|
|
11
|
-
* @param event - 事件名称
|
|
12
|
-
* @param listener - 事件监听器
|
|
13
|
-
* @param options - 监听器选项
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```tsx
|
|
17
|
-
* import { useAppEventBus } from '@vlian/framework';
|
|
18
|
-
*
|
|
19
|
-
* function MyComponent() {
|
|
20
|
-
* useAppEvent('user:login', (data, metadata) => {
|
|
21
|
-
* console.log('用户登录:', data);
|
|
22
|
-
* });
|
|
23
|
-
*
|
|
24
|
-
* return <div>My Component</div>;
|
|
25
|
-
* }
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export declare function useAppEvent<T = unknown>(eventBus: AppEventBus, event: string, listener: EventListener<T>, options?: EventListenerOptions): void;
|
|
29
|
-
/**
|
|
30
|
-
* 一次性事件订阅 Hook
|
|
31
|
-
*
|
|
32
|
-
* @param eventBus - 事件总线实例
|
|
33
|
-
* @param event - 事件名称
|
|
34
|
-
* @param listener - 事件监听器
|
|
35
|
-
* @param options - 监听器选项
|
|
36
|
-
*/
|
|
37
|
-
export declare function useAppEventOnce<T = unknown>(eventBus: AppEventBus, event: string, listener: EventListener<T>, options?: Omit<EventListenerOptions, 'once'>): void;
|
|
38
|
-
/**
|
|
39
|
-
* 创建事件发射器 Hook
|
|
40
|
-
*
|
|
41
|
-
* @param eventBus - 事件总线实例
|
|
42
|
-
* @returns 事件发射函数
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* ```tsx
|
|
46
|
-
* function MyComponent() {
|
|
47
|
-
* const emit = useAppEventEmitter(eventBus);
|
|
48
|
-
*
|
|
49
|
-
* const handleClick = () => {
|
|
50
|
-
* emit('button:click', { buttonId: 'submit' });
|
|
51
|
-
* };
|
|
52
|
-
*
|
|
53
|
-
* return <button onClick={handleClick}>Click</button>;
|
|
54
|
-
* }
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
export declare function useAppEventEmitter(eventBus: AppEventBus): <T = unknown>(event: string, data?: T, metadata?: Partial<import("./types").EventMetadata>) => Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useEffect,useRef,useCallback}from"react";export function useAppEvent(eventBus,event,listener,options){const listenerRef=useRef(listener);listenerRef.current=listener;const optionsRef=useRef(options);optionsRef.current=options;useEffect(()=>{const wrappedListener=(data,metadata)=>{return listenerRef.current(data,metadata)};const unsubscribe=eventBus.on(event,wrappedListener,optionsRef.current);return unsubscribe},[eventBus,event])}export function useAppEventOnce(eventBus,event,listener,options){const listenerRef=useRef(listener);listenerRef.current=listener;const optionsRef=useRef(options);optionsRef.current=options;useEffect(()=>{const wrappedListener=(data,metadata)=>{return listenerRef.current(data,metadata)};const unsubscribe=eventBus.once(event,wrappedListener,optionsRef.current);return unsubscribe},[eventBus,event])}export function useAppEventEmitter(eventBus){return useCallback((event,data,metadata)=>{return eventBus.emit(event,data,metadata)},[eventBus])}
|
|
@@ -1 +0,0 @@
|
|
|
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 AppEventBus(){return _AppEventBus.AppEventBus},get FrameworkEventManager(){return _frameworkEvents.FrameworkEventManager},get FrameworkEventType(){return _types.FrameworkEventType},get useAppEvent(){return _hooks.useAppEvent},get useAppEventEmitter(){return _hooks.useAppEventEmitter},get useAppEventOnce(){return _hooks.useAppEventOnce},get useEventBus(){return _useEventBus.useEventBus}});const _AppEventBus=require("./AppEventBus");const _frameworkEvents=require("./frameworkEvents");const _hooks=require("./hooks");const _useEventBus=require("./useEventBus");const _types=require("./types");
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 应用级事件系统
|
|
3
|
-
* 提供高性能、类型安全、可观测的事件通信能力
|
|
4
|
-
*/
|
|
5
|
-
export { AppEventBus } from './AppEventBus';
|
|
6
|
-
export { FrameworkEventManager } from './frameworkEvents';
|
|
7
|
-
export { useAppEvent, useAppEventOnce, useAppEventEmitter, } from './hooks';
|
|
8
|
-
export { useEventBus } from './useEventBus';
|
|
9
|
-
export type { EventListener, EventMetadata, EventWrapper, EventMiddleware, EventListenerOptions, AppEventBusConfig, EventStats, FrameworkEventData, } from './types';
|
|
10
|
-
export { FrameworkEventType } from './types';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{AppEventBus}from"./AppEventBus";export{FrameworkEventManager}from"./frameworkEvents";export{useAppEvent,useAppEventOnce,useAppEventEmitter}from"./hooks";export{useEventBus}from"./useEventBus";export{FrameworkEventType}from"./types";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"FrameworkEventType",{enumerable:true,get:function(){return FrameworkEventType}});var FrameworkEventType=/*#__PURE__*/function(FrameworkEventType){FrameworkEventType["APP_START"]="framework:app:start";FrameworkEventType["APP_STARTED"]="framework:app:started";FrameworkEventType["APP_INIT_START"]="framework:app:init:start";FrameworkEventType["APP_INIT_COMPLETE"]="framework:app:init:complete";FrameworkEventType["APP_INIT_ERROR"]="framework:app:init:error";FrameworkEventType["APP_RENDER_START"]="framework:app:render:start";FrameworkEventType["APP_RENDER_COMPLETE"]="framework:app:render:complete";FrameworkEventType["ROUTE_CHANGE"]="framework:route:change";FrameworkEventType["ROUTE_NAVIGATE_START"]="framework:route:navigate:start";FrameworkEventType["ROUTE_NAVIGATE_COMPLETE"]="framework:route:navigate:complete";FrameworkEventType["ERROR_OCCURRED"]="framework:error:occurred";FrameworkEventType["INSTANCE_CREATED"]="framework:instance:created";FrameworkEventType["INSTANCE_DESTROYED"]="framework:instance:destroyed";FrameworkEventType["PERFORMANCE_UPDATE"]="framework:performance:update";return FrameworkEventType}({});
|
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 应用级事件系统类型定义
|
|
3
|
-
* 提供类型安全的事件通信能力
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* 事件监听器类型
|
|
7
|
-
*
|
|
8
|
-
* @template T - 事件数据类型
|
|
9
|
-
*/
|
|
10
|
-
export type EventListener<T = unknown> = (data: T, metadata: EventMetadata) => void | Promise<void>;
|
|
11
|
-
/**
|
|
12
|
-
* 事件元数据
|
|
13
|
-
*/
|
|
14
|
-
export interface EventMetadata {
|
|
15
|
-
/**
|
|
16
|
-
* 事件来源(模块/组件名称)
|
|
17
|
-
*/
|
|
18
|
-
source?: string;
|
|
19
|
-
/**
|
|
20
|
-
* 事件时间戳
|
|
21
|
-
*/
|
|
22
|
-
timestamp: number;
|
|
23
|
-
/**
|
|
24
|
-
* 事件ID(用于追踪)
|
|
25
|
-
*/
|
|
26
|
-
eventId: string;
|
|
27
|
-
/**
|
|
28
|
-
* 事件优先级(数字越小优先级越高)
|
|
29
|
-
*/
|
|
30
|
-
priority?: number;
|
|
31
|
-
/**
|
|
32
|
-
* 应用实例ID(多实例场景)
|
|
33
|
-
*/
|
|
34
|
-
instanceId?: string;
|
|
35
|
-
/**
|
|
36
|
-
* 事件命名空间(用于作用域隔离)
|
|
37
|
-
*/
|
|
38
|
-
namespace?: string;
|
|
39
|
-
/**
|
|
40
|
-
* 自定义元数据
|
|
41
|
-
*/
|
|
42
|
-
[key: string]: unknown;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* 事件包装器
|
|
46
|
-
*
|
|
47
|
-
* @template T - 事件数据类型
|
|
48
|
-
*/
|
|
49
|
-
export interface EventWrapper<T = unknown> {
|
|
50
|
-
/**
|
|
51
|
-
* 事件数据
|
|
52
|
-
*/
|
|
53
|
-
data: T;
|
|
54
|
-
/**
|
|
55
|
-
* 事件元数据
|
|
56
|
-
*/
|
|
57
|
-
metadata: EventMetadata;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* 事件中间件函数类型
|
|
61
|
-
*
|
|
62
|
-
* @template T - 事件数据类型
|
|
63
|
-
*/
|
|
64
|
-
export type EventMiddleware<T = unknown> = (event: string, data: T, metadata: EventMetadata, next: () => Promise<void>) => Promise<void> | void;
|
|
65
|
-
/**
|
|
66
|
-
* 事件监听器选项
|
|
67
|
-
*/
|
|
68
|
-
export interface EventListenerOptions {
|
|
69
|
-
/**
|
|
70
|
-
* 监听器优先级(数字越小优先级越高)
|
|
71
|
-
*/
|
|
72
|
-
priority?: number;
|
|
73
|
-
/**
|
|
74
|
-
* 是否只执行一次
|
|
75
|
-
*/
|
|
76
|
-
once?: boolean;
|
|
77
|
-
/**
|
|
78
|
-
* 事件命名空间(用于作用域隔离)
|
|
79
|
-
*/
|
|
80
|
-
namespace?: string;
|
|
81
|
-
/**
|
|
82
|
-
* 是否异步执行
|
|
83
|
-
*/
|
|
84
|
-
async?: boolean;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* 事件总线配置
|
|
88
|
-
*/
|
|
89
|
-
export interface AppEventBusConfig {
|
|
90
|
-
/**
|
|
91
|
-
* 是否启用事件追踪
|
|
92
|
-
*/
|
|
93
|
-
enableTracking?: boolean;
|
|
94
|
-
/**
|
|
95
|
-
* 最大事件历史记录数
|
|
96
|
-
*/
|
|
97
|
-
maxHistorySize?: number;
|
|
98
|
-
/**
|
|
99
|
-
* 是否启用事件验证
|
|
100
|
-
*/
|
|
101
|
-
enableValidation?: boolean;
|
|
102
|
-
/**
|
|
103
|
-
* 事件验证函数
|
|
104
|
-
*/
|
|
105
|
-
validator?: (event: string, data: unknown) => boolean;
|
|
106
|
-
/**
|
|
107
|
-
* 是否启用性能监控
|
|
108
|
-
*/
|
|
109
|
-
enablePerformanceMonitoring?: boolean;
|
|
110
|
-
/**
|
|
111
|
-
* 事件命名空间前缀(用于多实例隔离)
|
|
112
|
-
*/
|
|
113
|
-
namespacePrefix?: string;
|
|
114
|
-
/**
|
|
115
|
-
* 应用实例ID(多实例场景)
|
|
116
|
-
*/
|
|
117
|
-
instanceId?: string;
|
|
118
|
-
/**
|
|
119
|
-
* 是否启用安全模式(限制事件来源)
|
|
120
|
-
*/
|
|
121
|
-
enableSecurityMode?: boolean;
|
|
122
|
-
/**
|
|
123
|
-
* 允许的事件来源白名单(安全模式)
|
|
124
|
-
*/
|
|
125
|
-
allowedSources?: string[];
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* 事件统计信息
|
|
129
|
-
*/
|
|
130
|
-
export interface EventStats {
|
|
131
|
-
/**
|
|
132
|
-
* 事件名称
|
|
133
|
-
*/
|
|
134
|
-
event: string;
|
|
135
|
-
/**
|
|
136
|
-
* 触发次数
|
|
137
|
-
*/
|
|
138
|
-
count: number;
|
|
139
|
-
/**
|
|
140
|
-
* 平均执行时间(毫秒)
|
|
141
|
-
*/
|
|
142
|
-
avgExecutionTime: number;
|
|
143
|
-
/**
|
|
144
|
-
* 监听器数量
|
|
145
|
-
*/
|
|
146
|
-
listenerCount: number;
|
|
147
|
-
/**
|
|
148
|
-
* 最后触发时间
|
|
149
|
-
*/
|
|
150
|
-
lastTriggered: number;
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* 框架内置事件类型
|
|
154
|
-
*/
|
|
155
|
-
export declare enum FrameworkEventType {
|
|
156
|
-
/**
|
|
157
|
-
* 应用启动开始
|
|
158
|
-
*/
|
|
159
|
-
APP_START = "framework:app:start",
|
|
160
|
-
/**
|
|
161
|
-
* 应用启动完成
|
|
162
|
-
*/
|
|
163
|
-
APP_STARTED = "framework:app:started",
|
|
164
|
-
/**
|
|
165
|
-
* 应用初始化开始
|
|
166
|
-
*/
|
|
167
|
-
APP_INIT_START = "framework:app:init:start",
|
|
168
|
-
/**
|
|
169
|
-
* 应用初始化完成
|
|
170
|
-
*/
|
|
171
|
-
APP_INIT_COMPLETE = "framework:app:init:complete",
|
|
172
|
-
/**
|
|
173
|
-
* 应用初始化失败
|
|
174
|
-
*/
|
|
175
|
-
APP_INIT_ERROR = "framework:app:init:error",
|
|
176
|
-
/**
|
|
177
|
-
* 应用渲染开始
|
|
178
|
-
*/
|
|
179
|
-
APP_RENDER_START = "framework:app:render:start",
|
|
180
|
-
/**
|
|
181
|
-
* 应用渲染完成
|
|
182
|
-
*/
|
|
183
|
-
APP_RENDER_COMPLETE = "framework:app:render:complete",
|
|
184
|
-
/**
|
|
185
|
-
* 路由变化
|
|
186
|
-
*/
|
|
187
|
-
ROUTE_CHANGE = "framework:route:change",
|
|
188
|
-
/**
|
|
189
|
-
* 路由导航开始
|
|
190
|
-
*/
|
|
191
|
-
ROUTE_NAVIGATE_START = "framework:route:navigate:start",
|
|
192
|
-
/**
|
|
193
|
-
* 路由导航完成
|
|
194
|
-
*/
|
|
195
|
-
ROUTE_NAVIGATE_COMPLETE = "framework:route:navigate:complete",
|
|
196
|
-
/**
|
|
197
|
-
* 错误发生
|
|
198
|
-
*/
|
|
199
|
-
ERROR_OCCURRED = "framework:error:occurred",
|
|
200
|
-
/**
|
|
201
|
-
* 实例创建
|
|
202
|
-
*/
|
|
203
|
-
INSTANCE_CREATED = "framework:instance:created",
|
|
204
|
-
/**
|
|
205
|
-
* 实例销毁
|
|
206
|
-
*/
|
|
207
|
-
INSTANCE_DESTROYED = "framework:instance:destroyed",
|
|
208
|
-
/**
|
|
209
|
-
* 性能指标更新
|
|
210
|
-
*/
|
|
211
|
-
PERFORMANCE_UPDATE = "framework:performance:update"
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* 框架事件数据类型定义
|
|
215
|
-
*/
|
|
216
|
-
export interface FrameworkEventData {
|
|
217
|
-
[FrameworkEventType.APP_START]: {
|
|
218
|
-
instanceId?: string;
|
|
219
|
-
};
|
|
220
|
-
[FrameworkEventType.APP_STARTED]: {
|
|
221
|
-
instanceId?: string;
|
|
222
|
-
duration: number;
|
|
223
|
-
};
|
|
224
|
-
[FrameworkEventType.APP_INIT_START]: {
|
|
225
|
-
instanceId?: string;
|
|
226
|
-
};
|
|
227
|
-
[FrameworkEventType.APP_INIT_COMPLETE]: {
|
|
228
|
-
instanceId?: string;
|
|
229
|
-
context: unknown;
|
|
230
|
-
duration: number;
|
|
231
|
-
};
|
|
232
|
-
[FrameworkEventType.APP_INIT_ERROR]: {
|
|
233
|
-
instanceId?: string;
|
|
234
|
-
error: Error;
|
|
235
|
-
};
|
|
236
|
-
[FrameworkEventType.APP_RENDER_START]: {
|
|
237
|
-
instanceId?: string;
|
|
238
|
-
};
|
|
239
|
-
[FrameworkEventType.APP_RENDER_COMPLETE]: {
|
|
240
|
-
instanceId?: string;
|
|
241
|
-
duration: number;
|
|
242
|
-
};
|
|
243
|
-
[FrameworkEventType.ROUTE_CHANGE]: {
|
|
244
|
-
from: string;
|
|
245
|
-
to: string;
|
|
246
|
-
params?: Record<string, unknown>;
|
|
247
|
-
};
|
|
248
|
-
[FrameworkEventType.ROUTE_NAVIGATE_START]: {
|
|
249
|
-
to: string;
|
|
250
|
-
options?: unknown;
|
|
251
|
-
};
|
|
252
|
-
[FrameworkEventType.ROUTE_NAVIGATE_COMPLETE]: {
|
|
253
|
-
to: string;
|
|
254
|
-
duration: number;
|
|
255
|
-
};
|
|
256
|
-
[FrameworkEventType.ERROR_OCCURRED]: {
|
|
257
|
-
error: Error;
|
|
258
|
-
context?: unknown;
|
|
259
|
-
};
|
|
260
|
-
[FrameworkEventType.INSTANCE_CREATED]: {
|
|
261
|
-
instanceId: string;
|
|
262
|
-
};
|
|
263
|
-
[FrameworkEventType.INSTANCE_DESTROYED]: {
|
|
264
|
-
instanceId: string;
|
|
265
|
-
};
|
|
266
|
-
[FrameworkEventType.PERFORMANCE_UPDATE]: {
|
|
267
|
-
metrics: Record<string, number>;
|
|
268
|
-
};
|
|
269
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var FrameworkEventType=/*#__PURE__*/function(FrameworkEventType){FrameworkEventType["APP_START"]="framework:app:start";FrameworkEventType["APP_STARTED"]="framework:app:started";FrameworkEventType["APP_INIT_START"]="framework:app:init:start";FrameworkEventType["APP_INIT_COMPLETE"]="framework:app:init:complete";FrameworkEventType["APP_INIT_ERROR"]="framework:app:init:error";FrameworkEventType["APP_RENDER_START"]="framework:app:render:start";FrameworkEventType["APP_RENDER_COMPLETE"]="framework:app:render:complete";FrameworkEventType["ROUTE_CHANGE"]="framework:route:change";FrameworkEventType["ROUTE_NAVIGATE_START"]="framework:route:navigate:start";FrameworkEventType["ROUTE_NAVIGATE_COMPLETE"]="framework:route:navigate:complete";FrameworkEventType["ERROR_OCCURRED"]="framework:error:occurred";FrameworkEventType["INSTANCE_CREATED"]="framework:instance:created";FrameworkEventType["INSTANCE_DESTROYED"]="framework:instance:destroyed";FrameworkEventType["PERFORMANCE_UPDATE"]="framework:performance:update";return FrameworkEventType}({});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"useEventBus",{enumerable:true,get:function(){return useEventBus}});const _AppInstance=require("../startup/AppInstance");function useEventBus(){const instanceManager=(0,_AppInstance.getAppInstanceManager)();const instance=instanceManager.getInstance();if(!instance){throw new Error("应用实例未找到")}const eventBus=instance.getEventBus();if(!eventBus){throw new Error("事件总线未初始化")}return eventBus}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 便捷的 Hook:获取当前应用实例的事件总线
|
|
3
|
-
*/
|
|
4
|
-
import type { AppEventBus } from './AppEventBus';
|
|
5
|
-
/**
|
|
6
|
-
* 获取当前应用实例的事件总线
|
|
7
|
-
*
|
|
8
|
-
* @returns 事件总线实例
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```tsx
|
|
12
|
-
* import { useEventBus } from '@vlian/framework';
|
|
13
|
-
*
|
|
14
|
-
* function MyComponent() {
|
|
15
|
-
* const eventBus = useEventBus();
|
|
16
|
-
*
|
|
17
|
-
* useEffect(() => {
|
|
18
|
-
* const unsubscribe = eventBus.on('user:login', (data) => {
|
|
19
|
-
* console.log('用户登录:', data);
|
|
20
|
-
* });
|
|
21
|
-
* return unsubscribe;
|
|
22
|
-
* }, [eventBus]);
|
|
23
|
-
*
|
|
24
|
-
* return <div>My Component</div>;
|
|
25
|
-
* }
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export declare function useEventBus(): AppEventBus;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getAppInstanceManager}from"../startup/AppInstance";export function useEventBus(){const instanceManager=getAppInstanceManager();const instance=instanceManager.getInstance();if(!instance){throw new Error("应用实例未找到")}const eventBus=instance.getEventBus();if(!eventBus){throw new Error("事件总线未初始化")}return eventBus}
|
package/dist/core-bak/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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 _app.AppContextProvider},get DevTools(){return _DevTools.DevTools},get DevToolsTrigger(){return _DevTools.DevToolsTrigger},get ErrorBoundary(){return _error.ErrorBoundary},get MiddlewareManager(){return _middleware.MiddlewareManager},get PluginManager(){return _plugin.PluginManager},get appConfig(){return _AppConfig.appConfig},get getAppInstanceManager(){return _AppInstance.getAppInstanceManager},get getStateManager(){return getStateManager},get middlewareManager(){return _middleware.middlewareManager},get pluginManager(){return _plugin.pluginManager},get start(){return start},get startApp(){return _startApp.startApp},get storage(){return _library.storage},get useAppContext(){return _app.useAppContext},get useConfig(){return _app.useConfig},get useErrorHandler(){return _error.useErrorHandler},get useLocale(){return _app.useLocale},get useStateManager(){return _app.useStateManager},get useTheme(){return _app.useTheme},get withErrorBoundary(){return _error.withErrorBoundary}});const _library=require("../library");const _startApp=require("./startup/startApp");const _AppInstance=require("./startup/AppInstance");const _app=require("./app");const _error=require("./error");const _AppConfig=require("./config/AppConfig");const _middleware=require("./middleware");const _plugin=require("./plugin");_export_star(require("./startup"),exports);_export_star(require("./config"),exports);_export_star(require("./kernel"),exports);_export_star(require("./router"),exports);_export_star(require("./event"),exports);const _DevTools=require("./dev/DevTools");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}const start=async(options={})=>{await (0,_startApp.startApp)(options)};const getStateManager=()=>{const instanceManager=(0,_AppInstance.getAppInstanceManager)();const instance=instanceManager.getInstance();if(instance){return instance.getServices().stateManager}return null};
|
package/dist/core-bak/index.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { StartOptions } from "./types";
|
|
2
|
-
import { storage } from '../library';
|
|
3
|
-
import { StateManager } from '../state';
|
|
4
|
-
/**
|
|
5
|
-
* 启动框架
|
|
6
|
-
*
|
|
7
|
-
* @param options - 启动配置选项
|
|
8
|
-
* @returns Promise<void>
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* import { start } from '@vlian/framework';
|
|
13
|
-
*
|
|
14
|
-
* start({
|
|
15
|
-
* loggerLevel: LogLevel.DEBUG,
|
|
16
|
-
* lifecycle: {
|
|
17
|
-
* beforeInitialization: async () => {
|
|
18
|
-
* console.log('初始化前执行');
|
|
19
|
-
* },
|
|
20
|
-
* },
|
|
21
|
-
* });
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* 启动框架(向后兼容的API)
|
|
26
|
-
*
|
|
27
|
-
* @param options - 启动配置选项
|
|
28
|
-
* @returns Promise<void>
|
|
29
|
-
*
|
|
30
|
-
* @deprecated 建议使用 startApp 函数,支持多实例
|
|
31
|
-
*/
|
|
32
|
-
declare const start: (options?: StartOptions) => Promise<void>;
|
|
33
|
-
export { startApp } from './startup/startApp';
|
|
34
|
-
export { getAppInstanceManager } from './startup/AppInstance';
|
|
35
|
-
export type { AppInstance } from './startup/AppInstance';
|
|
36
|
-
export { start, storage, };
|
|
37
|
-
export declare const getStateManager: () => StateManager | null;
|
|
38
|
-
export { AppContextProvider, useAppContext, useTheme, useLocale, useConfig, useStateManager, } from './app';
|
|
39
|
-
export { ErrorBoundary, withErrorBoundary, useErrorHandler } from './error';
|
|
40
|
-
export type { ErrorBoundaryProps } from './error';
|
|
41
|
-
export { appConfig } from './config/AppConfig';
|
|
42
|
-
export type { InitializationContext, InitializationOptions, ProgressCallback, } from './initialization';
|
|
43
|
-
export { MiddlewareManager, middlewareManager } from './middleware';
|
|
44
|
-
export type { Middleware } from './middleware';
|
|
45
|
-
export { PluginManager, pluginManager } from './plugin';
|
|
46
|
-
export type { Plugin } from './plugin';
|
|
47
|
-
export type { AppContextValue, ThemeContextValue, LocaleContextValue, ConfigContextValue, StateManagerContextValue, ThemeConfig, AppConfig, AppContextProviderProps, } from './app';
|
|
48
|
-
export type { StartOptions, ManagerLifecycle, SplashScreenCustomProps } from './types';
|
|
49
|
-
export * from './startup';
|
|
50
|
-
export * from './config';
|
|
51
|
-
export * from './kernel';
|
|
52
|
-
export * from './router';
|
|
53
|
-
export * from './event';
|
|
54
|
-
export { DevTools, DevToolsTrigger } from './dev/DevTools';
|
package/dist/core-bak/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{storage}from"../library";import{startApp}from"./startup/startApp";import{getAppInstanceManager}from"./startup/AppInstance";const start=async(options={})=>{await startApp(options)};export{startApp}from"./startup/startApp";export{getAppInstanceManager}from"./startup/AppInstance";export{start,storage};export const getStateManager=()=>{const instanceManager=getAppInstanceManager();const instance=instanceManager.getInstance();if(instance){return instance.getServices().stateManager}return null};export{AppContextProvider,useAppContext,useTheme,useLocale,useConfig,useStateManager}from"./app";export{ErrorBoundary,withErrorBoundary,useErrorHandler}from"./error";export{appConfig}from"./config/AppConfig";export{MiddlewareManager,middlewareManager}from"./middleware";export{PluginManager,pluginManager}from"./plugin";export*from"./startup";export*from"./config";export*from"./kernel";export*from"./router";export*from"./event";export{DevTools,DevToolsTrigger}from"./dev/DevTools";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"InitializationErrorThrower",{enumerable:true,get:function(){return InitializationErrorThrower}});const _react=/*#__PURE__*/_interop_require_wildcard(require("react"));const _initializationErrorState=require("./initializationErrorState");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 InitializationErrorThrower=()=>{const[error,setError]=(0,_react.useState)(null);(0,_react.useEffect)(()=>{const currentError=_initializationErrorState.initializationErrorState.getError();if(currentError){setError(currentError);return}const unsubscribe=_initializationErrorState.initializationErrorState.subscribe(()=>{const newError=_initializationErrorState.initializationErrorState.getError();setError(newError)});return unsubscribe},[]);if(error){throw error}return null};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import React,{useEffect,useState}from"react";import{initializationErrorState}from"./initializationErrorState";export const InitializationErrorThrower=()=>{const[error,setError]=useState(null);useEffect(()=>{const currentError=initializationErrorState.getError();if(currentError){setError(currentError);return}const unsubscribe=initializationErrorState.subscribe(()=>{const newError=initializationErrorState.getError();setError(newError)});return unsubscribe},[]);if(error){throw error}return null};
|
|
@@ -1 +0,0 @@
|
|
|
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 InitializationErrorThrower(){return _InitializationErrorThrower.InitializationErrorThrower},get initialization(){return _initialization.initialization},get initializationErrorState(){return _initializationErrorState.initializationErrorState}});const _initialization=require("./initialization");const _InitializationErrorThrower=require("./InitializationErrorThrower");const _initializationErrorState=require("./initializationErrorState");
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 初始化模块统一导出
|
|
3
|
-
*/
|
|
4
|
-
export { initialization } from './initialization';
|
|
5
|
-
export type { InitializationContext, InitializationOptions, ProgressCallback, } from './initialization';
|
|
6
|
-
export { InitializationErrorThrower } from './InitializationErrorThrower';
|
|
7
|
-
export { initializationErrorState } from './initializationErrorState';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{initialization}from"./initialization";export{InitializationErrorThrower}from"./InitializationErrorThrower";export{initializationErrorState}from"./initializationErrorState";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"initialization",{enumerable:true,get:function(){return initialization}});const _logger=require("@vlian/logger");const _library=require("../../library");const _plugin=require("../plugin");async function initialization(options,onProgress){const startTime=Date.now();let config={};try{await _plugin.pluginManager.executeBeforeInit(options);onProgress?.(5,"初始化日志系统...");_logger.logger.setLevel(options.loggerLevel??_logger.LogLevel.INFO);onProgress?.(30);if(options.lifecycle?.beforeInitialization){onProgress?.(35,"执行初始化前回调...");await options.lifecycle.beforeInitialization()}onProgress?.(40,"设置国际化...");(0,_library.setupI18n)(options.locale||undefined);if(options.lifecycle?.initialization){onProgress?.(50,"初始化核心功能...");await options.lifecycle.initialization();onProgress?.(70,"核心功能初始化完成")}else{onProgress?.(70)}onProgress?.(80,"准备完成...");const duration=Date.now()-startTime;const context={config,progress:100,isReady:true,duration};await _plugin.pluginManager.executeInit(options,context);await _plugin.pluginManager.executeAfterInit(options,context);if(options.lifecycle?.afterInitialization){onProgress?.(90,"执行初始化后回调...");await options.lifecycle.afterInitialization(context)}onProgress?.(100,"初始化完成");return context}catch(error){_logger.logger.error("初始化失败:",error);throw error}}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { LogLevel } from '@vlian/logger';
|
|
2
|
-
import type { LangType } from '../../library/locale/types';
|
|
3
|
-
import type { ManagerLifecycle, StartOptions } from '../types';
|
|
4
|
-
/**
|
|
5
|
-
* 初始化上下文
|
|
6
|
-
*/
|
|
7
|
-
export interface InitializationContext {
|
|
8
|
-
/**
|
|
9
|
-
* 已加载的配置
|
|
10
|
-
*/
|
|
11
|
-
config: Record<string, unknown>;
|
|
12
|
-
/**
|
|
13
|
-
* 初始化进度(0-100)
|
|
14
|
-
*/
|
|
15
|
-
progress: number;
|
|
16
|
-
/**
|
|
17
|
-
* 是否准备就绪
|
|
18
|
-
*/
|
|
19
|
-
isReady: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* 初始化耗时(毫秒)
|
|
22
|
-
*/
|
|
23
|
-
duration: number;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* 初始化选项
|
|
27
|
-
*/
|
|
28
|
-
export interface InitializationOptions {
|
|
29
|
-
/**
|
|
30
|
-
* 日志级别
|
|
31
|
-
*/
|
|
32
|
-
loggerLevel?: LogLevel;
|
|
33
|
-
/**
|
|
34
|
-
* 国际化配置
|
|
35
|
-
*/
|
|
36
|
-
locale?: Record<LangType, Record<string, unknown>>;
|
|
37
|
-
/**
|
|
38
|
-
* 生命周期钩子
|
|
39
|
-
*/
|
|
40
|
-
lifecycle?: ManagerLifecycle;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* 进度回调函数
|
|
44
|
-
*/
|
|
45
|
-
export type ProgressCallback = (progress: number, step?: string) => void;
|
|
46
|
-
/**
|
|
47
|
-
* 初始化方法
|
|
48
|
-
*
|
|
49
|
-
* 这是核心的初始化逻辑,可被启动页或直接调用
|
|
50
|
-
*
|
|
51
|
-
* @param options - 初始化选项
|
|
52
|
-
* @param onProgress - 进度回调函数(可选)
|
|
53
|
-
* @returns Promise<InitializationContext>
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```typescript
|
|
57
|
-
* const context = await initialization({
|
|
58
|
-
* loggerLevel: LogLevel.INFO,
|
|
59
|
-
* lifecycle: {
|
|
60
|
-
* initialization: async () => {
|
|
61
|
-
* // 初始化逻辑
|
|
62
|
-
* },
|
|
63
|
-
* },
|
|
64
|
-
* }, (progress, step) => {
|
|
65
|
-
* console.log(`进度: ${progress}%, 步骤: ${step}`);
|
|
66
|
-
* });
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
export declare function initialization(options: StartOptions, onProgress?: ProgressCallback): Promise<InitializationContext>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{logger,LogLevel}from"@vlian/logger";import{setupI18n}from"../../library";import{pluginManager}from"../plugin";export async function initialization(options,onProgress){const startTime=Date.now();let config={};try{await pluginManager.executeBeforeInit(options);onProgress?.(5,"初始化日志系统...");logger.setLevel(options.loggerLevel??LogLevel.INFO);onProgress?.(30);if(options.lifecycle?.beforeInitialization){onProgress?.(35,"执行初始化前回调...");await options.lifecycle.beforeInitialization()}onProgress?.(40,"设置国际化...");setupI18n(options.locale||undefined);if(options.lifecycle?.initialization){onProgress?.(50,"初始化核心功能...");await options.lifecycle.initialization();onProgress?.(70,"核心功能初始化完成")}else{onProgress?.(70)}onProgress?.(80,"准备完成...");const duration=Date.now()-startTime;const context={config,progress:100,isReady:true,duration};await pluginManager.executeInit(options,context);await pluginManager.executeAfterInit(options,context);if(options.lifecycle?.afterInitialization){onProgress?.(90,"执行初始化后回调...");await options.lifecycle.afterInitialization(context)}onProgress?.(100,"初始化完成");return context}catch(error){logger.error("初始化失败:",error);throw error}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"initializationErrorState",{enumerable:true,get:function(){return initializationErrorState}});const _utils=require("@vlian/utils");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 InitializationErrorState=class InitializationErrorState{setError(error){this.error=_utils.errorUtils.normalizeError(error);this.listeners.forEach(listener=>listener())}getError(){return this.error}clearError(){this.error=null;this.listeners.forEach(listener=>listener())}subscribe(listener){this.listeners.add(listener);return()=>{this.listeners.delete(listener)}}hasError(){return this.error!==null}constructor(){_define_property(this,"error",null);_define_property(this,"listeners",new Set)}};const initializationErrorState=new InitializationErrorState;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { FrameworkError } from '@vlian/utils';
|
|
2
|
-
/**
|
|
3
|
-
* 初始化错误状态管理器
|
|
4
|
-
*
|
|
5
|
-
* 用于在初始化过程中捕获和存储错误,以便 ErrorBoundary 能够捕获并显示
|
|
6
|
-
*/
|
|
7
|
-
declare class InitializationErrorState {
|
|
8
|
-
private error;
|
|
9
|
-
private listeners;
|
|
10
|
-
/**
|
|
11
|
-
* 设置错误
|
|
12
|
-
*/
|
|
13
|
-
setError(error: unknown): void;
|
|
14
|
-
/**
|
|
15
|
-
* 获取错误
|
|
16
|
-
*/
|
|
17
|
-
getError(): FrameworkError | null;
|
|
18
|
-
/**
|
|
19
|
-
* 清除错误
|
|
20
|
-
*/
|
|
21
|
-
clearError(): void;
|
|
22
|
-
/**
|
|
23
|
-
* 订阅错误变化
|
|
24
|
-
*/
|
|
25
|
-
subscribe(listener: () => void): () => void;
|
|
26
|
-
/**
|
|
27
|
-
* 检查是否有错误
|
|
28
|
-
*/
|
|
29
|
-
hasError(): boolean;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* 全局初始化错误状态管理器实例
|
|
33
|
-
*/
|
|
34
|
-
export declare const initializationErrorState: InitializationErrorState;
|
|
35
|
-
export {};
|
|
@@ -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{errorUtils}from"@vlian/utils";let InitializationErrorState=class InitializationErrorState{setError(error){this.error=errorUtils.normalizeError(error);this.listeners.forEach(listener=>listener())}getError(){return this.error}clearError(){this.error=null;this.listeners.forEach(listener=>listener())}subscribe(listener){this.listeners.add(listener);return()=>{this.listeners.delete(listener)}}hasError(){return this.error!==null}constructor(){_define_property(this,"error",null);_define_property(this,"listeners",new Set)}};export const initializationErrorState=new InitializationErrorState;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"resolveKernelAdapters",{enumerable:true,get:function(){return resolveKernelAdapters}});const _logger=require("@vlian/logger");const _monitoring=require("@vlian/monitoring");const _state=require("../../state");const _AppEventBus=require("../event/AppEventBus");const _library=require("../../library");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}const defaultLoggerAdapter={initialize(options){if(options.loggerLevel){_logger.logger.setLevel(options.loggerLevel)}},setLevel(level){_logger.logger.setLevel(level)},debug(message,...args){_logger.logger.debug(message,...args)},info(message,...args){_logger.logger.info(message,...args)},warn(message,...args){_logger.logger.warn(message,...args)},error(message,...args){_logger.logger.error(message,...args)}};const defaultMonitoringAdapter={initialize(){(0,_monitoring.initMonitoring)()},captureError(error,metadata){try{const service=(0,_monitoring.initMonitoring)();service.captureError(error,metadata)}catch{_logger.logger.error("监控适配器上报失败",error,metadata)}},reportMetric(name,value,tags){_logger.logger.debug(`metric:${name}`,{value,tags})},reportPhase(metric){_logger.logger.debug("kernel.phase.metric",metric)}};let DefaultStateAdapter=class DefaultStateAdapter{initialize(){this.instance=new _state.StateManager({enableRegistry:true,defaultScope:"app"})}getInstance(){if(!this.instance){this.initialize()}return this.instance}destroy(){if(this.instance){this.instance.destroy();this.instance=null}}constructor(){_define_property(this,"instance",null)}};let DefaultEventBusAdapter=class DefaultEventBusAdapter{initialize(options){this.bus=new _AppEventBus.AppEventBus({enableTracking:process.env.NODE_ENV==="development",maxHistorySize:100,enableValidation:false,enablePerformanceMonitoring:process.env.NODE_ENV==="development",instanceId:options.instanceId})}emit(event,payload){if(!this.bus){this.initialize({})}this.bus.emit(event,payload)}on(event,handler){if(!this.bus){this.initialize({})}return this.bus.on(event,handler)}destroy(){if(this.bus){this.bus.clear();this.bus=null}}constructor(){_define_property(this,"bus",null)}};const defaultI18nAdapter={initialize(snapshot){(0,_library.setupI18n)(snapshot.resources||{});(0,_library.setLang)(snapshot.locale)},setLocale(locale){(0,_library.setLang)(locale)}};const defaultThemeAdapter={initialize(snapshot){if(typeof document==="undefined"){return}applyThemeToDocument(snapshot)},apply(snapshot){if(typeof document==="undefined"){return}applyThemeToDocument(snapshot)}};function applyThemeToDocument(theme){const root=document.documentElement;root.classList.remove("light","dark");const resolvedMode=theme.mode==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":theme.mode;root.classList.add(resolvedMode);if(theme.primaryColor){root.style.setProperty("--app-primary-color",theme.primaryColor)}if(theme.compatibility?.shadcn){Object.entries(theme.compatibility.shadcn).forEach(([key,value])=>{root.style.setProperty(`--${key}`,String(value))})}}const defaultErrorHandler={async handle(error){_logger.logger.error("Kernel 启动失败",error);return{handled:true,shouldThrow:true}}};function resolveKernelAdapters(options){return{logger:options.adapters?.logger||defaultLoggerAdapter,monitoring:options.adapters?.monitoring||defaultMonitoringAdapter,state:options.adapters?.state||new DefaultStateAdapter,eventBus:options.adapters?.eventBus||new DefaultEventBusAdapter,i18n:options.adapters?.i18n||defaultI18nAdapter,theme:options.adapters?.theme||defaultThemeAdapter,errorHandler:options.adapters?.errorHandler||defaultErrorHandler}}
|
|
@@ -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{initMonitoring}from"@vlian/monitoring";import{StateManager}from"../../state";import{AppEventBus}from"../event/AppEventBus";import{setupI18n,setLang}from"../../library";const defaultLoggerAdapter={initialize(options){if(options.loggerLevel){logger.setLevel(options.loggerLevel)}},setLevel(level){logger.setLevel(level)},debug(message,...args){logger.debug(message,...args)},info(message,...args){logger.info(message,...args)},warn(message,...args){logger.warn(message,...args)},error(message,...args){logger.error(message,...args)}};const defaultMonitoringAdapter={initialize(){initMonitoring()},captureError(error,metadata){try{const service=initMonitoring();service.captureError(error,metadata)}catch{logger.error("监控适配器上报失败",error,metadata)}},reportMetric(name,value,tags){logger.debug(`metric:${name}`,{value,tags})},reportPhase(metric){logger.debug("kernel.phase.metric",metric)}};let DefaultStateAdapter=class DefaultStateAdapter{initialize(){this.instance=new StateManager({enableRegistry:true,defaultScope:"app"})}getInstance(){if(!this.instance){this.initialize()}return this.instance}destroy(){if(this.instance){this.instance.destroy();this.instance=null}}constructor(){_define_property(this,"instance",null)}};let DefaultEventBusAdapter=class DefaultEventBusAdapter{initialize(options){this.bus=new AppEventBus({enableTracking:process.env.NODE_ENV==="development",maxHistorySize:100,enableValidation:false,enablePerformanceMonitoring:process.env.NODE_ENV==="development",instanceId:options.instanceId})}emit(event,payload){if(!this.bus){this.initialize({})}this.bus.emit(event,payload)}on(event,handler){if(!this.bus){this.initialize({})}return this.bus.on(event,handler)}destroy(){if(this.bus){this.bus.clear();this.bus=null}}constructor(){_define_property(this,"bus",null)}};const defaultI18nAdapter={initialize(snapshot){setupI18n(snapshot.resources||{});setLang(snapshot.locale)},setLocale(locale){setLang(locale)}};const defaultThemeAdapter={initialize(snapshot){if(typeof document==="undefined"){return}applyThemeToDocument(snapshot)},apply(snapshot){if(typeof document==="undefined"){return}applyThemeToDocument(snapshot)}};function applyThemeToDocument(theme){const root=document.documentElement;root.classList.remove("light","dark");const resolvedMode=theme.mode==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":theme.mode;root.classList.add(resolvedMode);if(theme.primaryColor){root.style.setProperty("--app-primary-color",theme.primaryColor)}if(theme.compatibility?.shadcn){Object.entries(theme.compatibility.shadcn).forEach(([key,value])=>{root.style.setProperty(`--${key}`,String(value))})}}const defaultErrorHandler={async handle(error){logger.error("Kernel 启动失败",error);return{handled:true,shouldThrow:true}}};export function resolveKernelAdapters(options){return{logger:options.adapters?.logger||defaultLoggerAdapter,monitoring:options.adapters?.monitoring||defaultMonitoringAdapter,state:options.adapters?.state||new DefaultStateAdapter,eventBus:options.adapters?.eventBus||new DefaultEventBusAdapter,i18n:options.adapters?.i18n||defaultI18nAdapter,theme:options.adapters?.theme||defaultThemeAdapter,errorHandler:options.adapters?.errorHandler||defaultErrorHandler}}
|