@hai3/framework 0.2.0-alpha.4 → 0.4.0-alpha.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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types.ts"],"sourcesContent":["/**\n * @hai3/framework - Type Definitions\n *\n * Core types for HAI3 framework with plugin architecture.\n * Integrates all SDK packages into a cohesive framework.\n */\n\n// ============================================================================\n// Type Imports from SDK Packages\n// ============================================================================\n\n// From @hai3/state\nimport type {\n HAI3Store as StoreType,\n EffectInitializer,\n} from '@hai3/state';\n\nimport type { MatchFunction, PathFunction } from 'path-to-regexp';\nimport type { Reducer } from '@reduxjs/toolkit';\n\n// From @hai3/screensets\nimport type { ScreensetRegistry } from '@hai3/screensets';\n\n// From @hai3/api\nimport type { ApiRegistry } from '@hai3/api';\n\n// From @hai3/i18n\nimport type { I18nRegistry } from '@hai3/i18n';\n\n// Re-export HAI3Store from @hai3/store for framework consumers\nexport type HAI3Store = StoreType;\n\n// ============================================================================\n// HAI3 Configuration\n// ============================================================================\n\n/**\n * Router mode type\n */\nexport type RouterMode = 'browser' | 'hash' | 'memory';\n\n/**\n * HAI3 Application Configuration\n * Configuration options for creating a HAI3 application.\n */\nexport interface HAI3Config {\n /** Application name */\n name?: string;\n /** Enable development mode */\n devMode?: boolean;\n /** Enable strict mode (throws on errors) */\n strictMode?: boolean;\n /**\n * Auto-navigate to first screenset on mount.\n * When false, stays on \"/\" until navigateToScreen/navigateToScreenset is called.\n * @default true\n */\n autoNavigate?: boolean;\n /**\n * Base path for navigation. Example: '/console' makes routes /console/*.\n * @default '/'\n */\n base?: string;\n /**\n * Router mode - browser (default), hash, or memory.\n * - browser: Uses HTML5 history API (clean URLs)\n * - hash: Uses URL hash (#/path)\n * - memory: In-memory routing without URL sync\n * @default 'browser'\n */\n routerMode?: RouterMode;\n}\n\n// ============================================================================\n// Internal Slice Types\n// ============================================================================\n\n/**\n * Registerable Slice Interface\n * Minimal interface for slices that can be registered with the framework.\n * Used for heterogeneous slice collections where different state types are mixed.\n *\n * This is an internal framework type - plugins provide slices matching this structure.\n * The Reducer type uses RTK's default, avoiding explicit `any` in HAI3 code.\n */\nexport interface RegisterableSlice {\n /** Slice name - becomes the state key */\n readonly name: string;\n /** Slice reducer function */\n readonly reducer: Reducer;\n /** Slice action creators (optional for registration) */\n readonly actions?: Record<string, unknown>;\n}\n\n// ============================================================================\n// Plugin System Types\n// ============================================================================\n\n/**\n * HAI3 Actions Interface\n * Central registry of all actions available in the application.\n *\n * Built-in actions are defined here. Consumers can extend this interface\n * via module augmentation to add custom actions:\n *\n * @example\n * ```typescript\n * declare module '@hai3/framework' {\n * interface HAI3Actions {\n * myCustomAction: (payload: MyPayload) => void;\n * }\n * }\n * ```\n *\n * Design: Interface (not type) enables TypeScript declaration merging.\n */\nexport interface HAI3Actions {\n // ==========================================================================\n // Navigation actions (from navigation plugin)\n // ==========================================================================\n navigateToScreen: (payload: NavigateToScreenPayload) => void;\n navigateToScreenset: (payload: NavigateToScreensetPayload) => void;\n\n // ==========================================================================\n // Theme actions (from themes plugin)\n // ==========================================================================\n changeTheme: (payload: ChangeThemePayload) => void;\n\n // ==========================================================================\n // I18n actions (from i18n plugin)\n // ==========================================================================\n setLanguage: (payload: SetLanguagePayload) => void;\n\n // ==========================================================================\n // Layout actions (from layout plugin)\n // ==========================================================================\n showPopup: (payload: ShowPopupPayload) => void;\n hidePopup: () => void;\n showOverlay: (payload: { id: string }) => void;\n hideOverlay: () => void;\n toggleMenuCollapsed: (payload: { collapsed: boolean }) => void;\n toggleSidebarCollapsed: (payload: { collapsed: boolean }) => void;\n setHeaderVisible: (payload: boolean) => void;\n setFooterVisible: (payload: boolean) => void;\n setMenuCollapsed: (payload: boolean) => void;\n setSidebarCollapsed: (payload: boolean) => void;\n\n // ==========================================================================\n // Screenset actions (from screensets plugin)\n // ==========================================================================\n setActiveScreen: (payload: string) => void;\n setScreenLoading: (payload: boolean) => void;\n\n // ==========================================================================\n // Mock actions (from mock plugin)\n // ==========================================================================\n toggleMockMode: (enabled: boolean) => void;\n}\n\n/**\n * Plugin Provides Interface\n * What a plugin contributes to the application.\n */\nexport interface PluginProvides {\n /** Registry contributions */\n registries?: Record<string, unknown>;\n /** Redux slices to register */\n slices?: RegisterableSlice[];\n /** Effect initializers to register */\n effects?: EffectInitializer[];\n /** Actions provided by the plugin (subset of HAI3Actions) */\n actions?: Partial<HAI3Actions>;\n}\n\n/**\n * Plugin Lifecycle Interface\n * Lifecycle hooks for plugin initialization.\n */\nexport interface PluginLifecycle {\n /**\n * Called when plugin is registered (before app starts).\n *\n * @param app - The app builder instance\n * @param config - Plugin configuration\n */\n onRegister?(app: HAI3AppBuilder, config: unknown): void;\n\n /**\n * Called after all plugins registered, before app starts.\n *\n * @param app - The built app instance\n */\n onInit?(app: HAI3App): void | Promise<void>;\n\n /**\n * Called when app is destroyed.\n *\n * @param app - The app instance\n */\n onDestroy?(app: HAI3App): void;\n}\n\n/**\n * HAI3 Plugin Interface\n * All plugins implement this contract.\n * Follows Liskov Substitution Principle - any plugin can be used interchangeably.\n *\n * @template TConfig - Plugin configuration type\n *\n * @example\n * ```typescript\n * const screensetsPlugin: HAI3Plugin = {\n * name: 'screensets',\n * dependencies: [],\n * provides: {\n * registries: { screensetRegistry: createScreensetRegistry() },\n * slices: [screenSlice],\n * },\n * onInit(app) {\n * discoverScreensets(app.screensetRegistry);\n * },\n * };\n * ```\n */\nexport interface HAI3Plugin<TConfig = unknown> extends PluginLifecycle {\n /** Unique plugin identifier */\n name: string;\n\n /** Other plugins this plugin requires */\n dependencies?: string[];\n\n /** What this plugin provides to the app */\n provides?: PluginProvides;\n\n /** Plugin configuration type marker (used for type inference) */\n _configType?: TConfig;\n}\n\n/**\n * Plugin Factory Function\n * Factory function that creates a plugin with optional configuration.\n *\n * @template TConfig - Plugin configuration type\n */\nexport type PluginFactory<TConfig = unknown> = (config?: TConfig) => HAI3Plugin<TConfig>;\n\n// ============================================================================\n// App Builder Interface\n// ============================================================================\n\n/**\n * HAI3 App Builder Interface\n * Fluent builder for composing HAI3 applications with plugins.\n *\n * @example\n * ```typescript\n * const app = createHAI3()\n * .use(screensets())\n * .use(themes())\n * .use(layout())\n * .build();\n * ```\n */\nexport interface HAI3AppBuilder {\n /**\n * Add a plugin to the application.\n *\n * @param plugin - Plugin instance or factory\n * @returns Builder for chaining\n */\n use(plugin: HAI3Plugin | PluginFactory): HAI3AppBuilder;\n\n /**\n * Add multiple plugins at once.\n *\n * @param plugins - Array of plugins or factories\n * @returns Builder for chaining\n */\n useAll(plugins: Array<HAI3Plugin | PluginFactory>): HAI3AppBuilder;\n\n /**\n * Build the application.\n * Resolves dependencies, initializes plugins, and returns the app.\n *\n * @returns The built HAI3 application\n */\n build(): HAI3App;\n}\n\n// ============================================================================\n// Built App Interface\n// ============================================================================\n\n// Re-export ScreensetRegistry from SDK - do NOT duplicate the interface\nexport type { ScreensetRegistry } from '@hai3/screensets';\n\n/**\n * Theme Configuration\n * Configuration for a theme.\n */\nexport interface ThemeConfig {\n /** Theme ID */\n id: string;\n /** Theme name */\n name: string;\n /** CSS custom properties */\n variables: Record<string, string>;\n /** Whether this is the default theme */\n default?: boolean;\n}\n\n/**\n * UIKit Theme type (from @hai3/uikit)\n * Used for themes that require custom apply functions (e.g., @hai3/uikit's applyTheme).\n * Using 'unknown' as the base type to accept any theme structure.\n */\nexport type UikitTheme = unknown;\n\n/**\n * Theme apply function type\n * Generic to accept any theme type from UI kit implementations.\n * @internal - uses generic function signature for compatibility with various theme implementations\n */\nexport interface ThemeApplyFn {\n (theme: unknown, themeName?: string): void;\n}\n\n/**\n * Theme Registry Interface\n * Registry for managing themes.\n */\nexport interface ThemeRegistry {\n /**\n * Register a theme.\n * Supports both config-based API and UIKit theme API.\n *\n * @param configOrId - ThemeConfig or theme ID (for UIKit themes)\n * @param uikitTheme - UIKit Theme object (optional, for @hai3/uikit themes)\n */\n register(configOrId: ThemeConfig | string, uikitTheme?: UikitTheme): void;\n\n /** Get theme by ID */\n get(id: string): ThemeConfig | undefined;\n /** Get all themes */\n getAll(): ThemeConfig[];\n /** Apply a theme */\n apply(id: string): void;\n /** Get current theme */\n getCurrent(): ThemeConfig | undefined;\n\n /**\n * Subscribe to theme changes.\n * @param callback - Called when theme changes\n * @returns Unsubscribe function\n */\n subscribe(callback: () => void): () => void;\n\n /**\n * Get current version number.\n * Used by React for re-rendering on theme changes.\n */\n getVersion(): number;\n}\n\n/**\n * Route Registry Interface\n * Registry for managing routes (auto-synced from screensets).\n */\n/**\n * Route match result from matchRoute()\n */\nexport interface RouteMatchResult {\n screensetId: string;\n screenId: string;\n params: Record<string, string>;\n}\n\n/**\n * Compiled route with matcher and path generator\n */\nexport interface CompiledRoute {\n pattern: string;\n screensetId: string;\n screenId: string;\n matcher: MatchFunction<Record<string, string>>;\n toPath: PathFunction<Record<string, string>>;\n}\n\n/**\n * Route params interface for module augmentation\n *\n * Users can extend this interface to provide type-safe route parameters:\n *\n * ```typescript\n * declare module '@hai3/framework' {\n * interface RouteParams {\n * 'users.detail': { userId: string };\n * 'users.posts.detail': { userId: string; postId: string };\n * }\n * }\n * ```\n */\nexport interface RouteParams {\n [screenId: string]: Record<string, string> | undefined;\n}\n\nexport interface RouteRegistry {\n /** Check if a screen exists by screenId only (globally unique) */\n hasScreenById(screenId: string): boolean;\n /** Check if a screen exists by both screensetId and screenId (explicit lookup when screenset context is known) */\n hasScreen(screensetId: string, screenId: string): boolean;\n /** Get screenset ID for a given screen ID (reverse lookup) */\n getScreensetForScreen(screenId: string): string | undefined;\n /** Get screen loader by screenId only */\n getScreenById(screenId: string): (() => Promise<{ default: React.ComponentType }>) | undefined;\n /** Get screen loader by both screensetId and screenId (explicit lookup when screenset context is known) */\n getScreen(screensetId: string, screenId: string): (() => Promise<{ default: React.ComponentType }>) | undefined;\n /** Get all routes */\n getAll(): Array<{ screensetId: string; screenId: string }>;\n /** Match a URL path against registered routes, extracting params */\n matchRoute(path: string): RouteMatchResult | undefined;\n /** Generate a URL path for a screen with given params */\n generatePath(screenId: string, params?: Record<string, string>): string;\n /** Get the route pattern for a screen */\n getRoutePattern(screenId: string): string | undefined;\n}\n\n/**\n * HAI3 App Interface\n * The built application with all features available.\n *\n * @example\n * ```typescript\n * const app = createHAI3App();\n *\n * // Access registries\n * const screensets = app.screensetRegistry.getAll();\n *\n * // Access store\n * const state = app.store.getState();\n *\n * // Access actions\n * app.actions.navigateToScreen({ screensetId: 'demo', screenId: 'home' });\n * ```\n */\nexport interface HAI3App {\n /** Application configuration */\n config: HAI3Config;\n\n /** Redux store */\n store: HAI3Store;\n\n /** Screenset registry */\n screensetRegistry: ScreensetRegistry;\n\n /** Theme registry */\n themeRegistry: ThemeRegistry;\n\n /** Route registry */\n routeRegistry: RouteRegistry;\n\n /** API registry */\n apiRegistry: ApiRegistry;\n\n /** I18n registry */\n i18nRegistry: I18nRegistry;\n\n /** All registered actions (type-safe via HAI3Actions interface) */\n actions: HAI3Actions;\n\n /** Destroy the application and cleanup resources */\n destroy(): void;\n}\n\n// ============================================================================\n// Create HAI3 App Function Signature\n// ============================================================================\n\n/**\n * Create HAI3 App Function Signature\n * Creates a fully configured HAI3 application using the full preset.\n *\n * @param config - Optional configuration\n * @returns The built HAI3 application\n *\n * @example\n * ```typescript\n * // Default - uses full() preset\n * const app = createHAI3App();\n *\n * // With configuration\n * const app = createHAI3App({ devMode: true });\n * ```\n */\nexport type CreateHAI3App = (config?: HAI3Config) => HAI3App;\n\n/**\n * Create HAI3 Function Signature\n * Creates a HAI3 app builder for custom plugin composition.\n *\n * @returns App builder for plugin composition\n *\n * @example\n * ```typescript\n * const app = createHAI3()\n * .use(screensets())\n * .use(themes())\n * .build();\n * ```\n */\nexport type CreateHAI3 = () => HAI3AppBuilder;\n\n// ============================================================================\n// Preset Types\n// ============================================================================\n\n/**\n * Preset Type\n * A preset is a function that returns an array of plugins.\n *\n * @example\n * ```typescript\n * const minimal: Preset = () => [\n * screensets({ autoDiscover: true }),\n * themes(),\n * ];\n * ```\n */\nexport type Preset = () => HAI3Plugin[];\n\n/**\n * Presets Collection\n * Available presets for different use cases.\n */\nexport interface Presets {\n /** All plugins - default for hai3 create */\n full: Preset;\n /** Screensets + themes only */\n minimal: Preset;\n /** Screensets only - for external platform integration */\n headless: Preset;\n}\n\n// ============================================================================\n// Plugin Configurations\n// ============================================================================\n\n/**\n * Navigation Plugin Configuration\n * Configuration options for the navigation plugin.\n */\nexport interface NavigationConfig {\n /**\n * Base path for navigation. Overrides app.config.base if set.\n */\n base?: string;\n}\n\n/**\n * Screensets Plugin Configuration\n * Configuration options for the screensets plugin.\n */\nexport interface ScreensetsConfig {\n /** Auto-discover screensets via glob */\n autoDiscover?: boolean;\n /** Glob pattern for screenset discovery */\n globPattern?: string;\n}\n\n/**\n * Themes Plugin Configuration\n * Configuration options for the themes plugin.\n */\nexport interface ThemesConfig {\n /**\n * Custom apply function for UIKit themes.\n * Called when a theme is applied to execute theme-specific logic.\n *\n * @example\n * ```typescript\n * import { applyTheme } from '@hai3/uikit';\n *\n * const app = createHAI3()\n * .use(themes({ applyFn: applyTheme }))\n * .build();\n * ```\n */\n applyFn?: ThemeApplyFn;\n}\n\n// ============================================================================\n// Navigation Action Payloads\n// ============================================================================\n\n/**\n * Navigate to Screen Payload\n */\nexport interface NavigateToScreenPayload {\n screensetId: string;\n screenId: string;\n params?: Record<string, string>;\n}\n\n/**\n * Navigate to Screenset Payload\n */\nexport interface NavigateToScreensetPayload {\n screensetId: string;\n}\n\n/**\n * Show Popup Payload\n */\nexport interface ShowPopupPayload {\n id: string;\n title?: string;\n content?: () => Promise<{ default: React.ComponentType }>;\n size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';\n}\n\n/**\n * Change Theme Payload\n */\nexport interface ChangeThemePayload {\n themeId: string;\n}\n\n/**\n * Set Language Payload\n */\nexport interface SetLanguagePayload {\n language: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["/**\n * @hai3/framework - Type Definitions\n *\n * Core types for HAI3 framework with plugin architecture.\n * Integrates all SDK packages into a cohesive framework.\n */\n\n// ============================================================================\n// Type Imports from SDK Packages\n// ============================================================================\n\n// From @hai3/state\nimport type {\n HAI3Store as StoreType,\n EffectInitializer,\n} from '@hai3/state';\n\nimport type { Reducer } from '@reduxjs/toolkit';\n\n// From @hai3/api\nimport type { ApiRegistry } from '@hai3/api';\n\n// From @hai3/i18n\nimport type { I18nRegistry } from '@hai3/i18n';\n\n// Re-export HAI3Store from @hai3/store for framework consumers\nexport type HAI3Store = StoreType;\n\n// ============================================================================\n// HAI3 Configuration\n// ============================================================================\n\n/**\n * Router mode type\n */\nexport type RouterMode = 'browser' | 'hash' | 'memory';\n\n/**\n * HAI3 Application Configuration\n * Configuration options for creating a HAI3 application.\n */\nexport interface HAI3Config {\n /** Application name */\n name?: string;\n /** Enable development mode */\n devMode?: boolean;\n /** Enable strict mode (throws on errors) */\n strictMode?: boolean;\n /**\n * Auto-route to the first registered route on mount.\n * When false, stays on \"/\" until explicit navigation occurs.\n * @default true\n * @deprecated Legacy option, will be removed in a future version.\n */\n autoNavigate?: boolean;\n /**\n * Base path for navigation. Example: '/console' makes routes /console/*.\n * @default '/'\n */\n base?: string;\n /**\n * Router mode - browser (default), hash, or memory.\n * - browser: Uses HTML5 history API (clean URLs)\n * - hash: Uses URL hash (#/path)\n * - memory: In-memory routing without URL sync\n * @default 'browser'\n */\n routerMode?: RouterMode;\n}\n\n// ============================================================================\n// Internal Slice Types\n// ============================================================================\n\n/**\n * Registerable Slice Interface\n * Minimal interface for slices that can be registered with the framework.\n * Used for heterogeneous slice collections where different state types are mixed.\n *\n * This is an internal framework type - plugins provide slices matching this structure.\n * The Reducer type uses RTK's default, avoiding explicit `any` in HAI3 code.\n */\nexport interface RegisterableSlice {\n /** Slice name - becomes the state key */\n readonly name: string;\n /** Slice reducer function */\n readonly reducer: Reducer;\n /** Slice action creators (optional for registration) */\n readonly actions?: Record<string, unknown>;\n}\n\n// ============================================================================\n// Plugin System Types\n// ============================================================================\n\n/**\n * HAI3 Actions Interface\n * Central registry of all actions available in the application.\n *\n * Built-in actions are defined here. Consumers can extend this interface\n * via module augmentation to add custom actions:\n *\n * @example\n * ```typescript\n * declare module '@hai3/framework' {\n * interface HAI3Actions {\n * myCustomAction: (payload: MyPayload) => void;\n * }\n * }\n * ```\n *\n * Design: Interface (not type) enables TypeScript declaration merging.\n */\nexport interface HAI3Actions {\n // ==========================================================================\n // Theme actions (from themes plugin)\n // ==========================================================================\n changeTheme: (payload: ChangeThemePayload) => void;\n\n // ==========================================================================\n // I18n actions (from i18n plugin)\n // ==========================================================================\n setLanguage: (payload: SetLanguagePayload) => void;\n\n // ==========================================================================\n // Layout actions (from layout plugin)\n // ==========================================================================\n showPopup: (payload: ShowPopupPayload) => void;\n hidePopup: () => void;\n showOverlay: (payload: { id: string }) => void;\n hideOverlay: () => void;\n toggleMenuCollapsed: (payload: { collapsed: boolean }) => void;\n toggleSidebarCollapsed: (payload: { collapsed: boolean }) => void;\n setHeaderVisible: (payload: boolean) => void;\n setFooterVisible: (payload: boolean) => void;\n setMenuCollapsed: (payload: boolean) => void;\n setSidebarCollapsed: (payload: boolean) => void;\n\n // ==========================================================================\n // Screenset actions (from screensets plugin)\n // ==========================================================================\n setActiveScreen: (payload: string) => void;\n setScreenLoading: (payload: boolean) => void;\n\n // ==========================================================================\n // Mock actions (from mock plugin)\n // ==========================================================================\n toggleMockMode: (enabled: boolean) => void;\n\n // ==========================================================================\n // MFE actions (from microfrontends plugin)\n // ==========================================================================\n loadExtension: (extensionId: string) => void;\n mountExtension: (extensionId: string) => void;\n unmountExtension: (extensionId: string) => void;\n registerExtension: (extension: import('@hai3/screensets').Extension) => void;\n unregisterExtension: (extensionId: string) => void;\n}\n\n/**\n * Plugin Provides Interface\n * What a plugin contributes to the application.\n */\nexport interface PluginProvides {\n /** Registry contributions */\n registries?: Record<string, unknown>;\n /** Redux slices to register */\n slices?: RegisterableSlice[];\n /** Effect initializers to register */\n effects?: EffectInitializer[];\n /** Actions provided by the plugin (subset of HAI3Actions) */\n actions?: Partial<HAI3Actions>;\n}\n\n/**\n * Plugin Lifecycle Interface\n * Lifecycle hooks for plugin initialization.\n */\nexport interface PluginLifecycle {\n /**\n * Called when plugin is registered (before app starts).\n *\n * @param app - The app builder instance\n * @param config - Plugin configuration\n */\n onRegister?(app: HAI3AppBuilder, config: unknown): void;\n\n /**\n * Called after all plugins registered, before app starts.\n *\n * @param app - The built app instance\n */\n onInit?(app: HAI3App): void | Promise<void>;\n\n /**\n * Called when app is destroyed.\n *\n * @param app - The app instance\n */\n onDestroy?(app: HAI3App): void;\n}\n\n/**\n * HAI3 Plugin Interface\n * All plugins implement this contract.\n * Follows Liskov Substitution Principle - any plugin can be used interchangeably.\n *\n * @template TConfig - Plugin configuration type\n *\n * @example\n * ```typescript\n * const microfrontendsPlugin: HAI3Plugin = {\n * name: 'microfrontends',\n * dependencies: [],\n * provides: {\n * slices: [mfeSlice],\n * actions: {\n * mountExtension: (extensionId: string) => { ... },\n * },\n * },\n * onInit(app) {\n * // Initialize MFE registry\n * app.screensetsRegistry = screensetsRegistryFactory.create(...);\n * },\n * };\n * ```\n */\nexport interface HAI3Plugin<TConfig = unknown> extends PluginLifecycle {\n /** Unique plugin identifier */\n name: string;\n\n /** Other plugins this plugin requires */\n dependencies?: string[];\n\n /** What this plugin provides to the app */\n provides?: PluginProvides;\n\n /** Plugin configuration type marker (used for type inference) */\n _configType?: TConfig;\n}\n\n/**\n * Plugin Factory Function\n * Factory function that creates a plugin with optional configuration.\n *\n * @template TConfig - Plugin configuration type\n */\nexport type PluginFactory<TConfig = unknown> = (config?: TConfig) => HAI3Plugin<TConfig>;\n\n// ============================================================================\n// App Builder Interface\n// ============================================================================\n\n/**\n * HAI3 App Builder Interface\n * Fluent builder for composing HAI3 applications with plugins.\n *\n * @example\n * ```typescript\n * const app = createHAI3()\n * .use(screensets())\n * .use(themes())\n * .use(layout())\n * .build();\n * ```\n */\nexport interface HAI3AppBuilder {\n /**\n * Add a plugin to the application.\n *\n * @param plugin - Plugin instance or factory\n * @returns Builder for chaining\n */\n use(plugin: HAI3Plugin | PluginFactory): HAI3AppBuilder;\n\n /**\n * Add multiple plugins at once.\n *\n * @param plugins - Array of plugins or factories\n * @returns Builder for chaining\n */\n useAll(plugins: Array<HAI3Plugin | PluginFactory>): HAI3AppBuilder;\n\n /**\n * Build the application.\n * Resolves dependencies, initializes plugins, and returns the app.\n *\n * @returns The built HAI3 application\n */\n build(): HAI3App;\n}\n\n// ============================================================================\n// Built App Interface\n// ============================================================================\n\n/**\n * Theme Configuration\n * Configuration for a theme.\n */\nexport interface ThemeConfig {\n /** Theme ID */\n id: string;\n /** Theme name */\n name: string;\n /** CSS custom properties */\n variables: Record<string, string>;\n /** Whether this is the default theme */\n default?: boolean;\n}\n\n/**\n * UIKit Theme type (from @hai3/uikit)\n * Used for themes that require custom apply functions (e.g., @hai3/uikit's applyTheme).\n * Using 'unknown' as the base type to accept any theme structure.\n */\nexport type UikitTheme = unknown;\n\n/**\n * Theme apply function type\n * Generic to accept any theme type from UI kit implementations.\n * @internal - uses generic function signature for compatibility with various theme implementations\n */\nexport interface ThemeApplyFn {\n (theme: unknown, themeName?: string): void;\n}\n\n/**\n * Theme Registry Interface\n * Registry for managing themes.\n */\nexport interface ThemeRegistry {\n /**\n * Register a theme.\n * Supports both config-based API and UIKit theme API.\n *\n * @param configOrId - ThemeConfig or theme ID (for UIKit themes)\n * @param uikitTheme - UIKit Theme object (optional, for @hai3/uikit themes)\n */\n register(configOrId: ThemeConfig | string, uikitTheme?: UikitTheme): void;\n\n /** Get theme by ID */\n get(id: string): ThemeConfig | undefined;\n /** Get all themes */\n getAll(): ThemeConfig[];\n /** Apply a theme */\n apply(id: string): void;\n /** Get current theme */\n getCurrent(): ThemeConfig | undefined;\n\n /**\n * Subscribe to theme changes.\n * @param callback - Called when theme changes\n * @returns Unsubscribe function\n */\n subscribe(callback: () => void): () => void;\n\n /**\n * Get current version number.\n * Used by React for re-rendering on theme changes.\n */\n getVersion(): number;\n}\n\n/**\n * MFE-enabled ScreensetsRegistry (optional)\n * When the microfrontends plugin is used, this registry is available.\n * It provides MFE capabilities: registerDomain(), registerExtension(), etc.\n */\nexport type MfeScreensetsRegistry = import('@hai3/screensets').ScreensetsRegistry;\n\n/**\n * HAI3 App Interface\n * The built application with all features available.\n *\n * @example\n * ```typescript\n * const app = createHAI3App();\n *\n * // Access store\n * const state = app.store.getState();\n *\n * // Access actions\n * app.actions.mountExtension(extensionId);\n *\n * // Access MFE registry (if microfrontends plugin is used)\n * if (app.screensetsRegistry) {\n * app.screensetsRegistry.registerDomain(myDomain, containerProvider);\n * }\n * ```\n */\nexport interface HAI3App {\n /** Application configuration */\n config: HAI3Config;\n\n /** Redux store */\n store: HAI3Store;\n\n /** Theme registry */\n themeRegistry: ThemeRegistry;\n\n /** API registry */\n apiRegistry: ApiRegistry;\n\n /** I18n registry */\n i18nRegistry: I18nRegistry;\n\n /** MFE-enabled ScreensetsRegistry (optional, provided by microfrontends plugin) */\n screensetsRegistry?: MfeScreensetsRegistry;\n\n /** All registered actions (type-safe via HAI3Actions interface) */\n actions: HAI3Actions;\n\n /** Destroy the application and cleanup resources */\n destroy(): void;\n}\n\n// ============================================================================\n// Create HAI3 App Function Signature\n// ============================================================================\n\n/**\n * Create HAI3 App Function Signature\n * Creates a fully configured HAI3 application using the full preset.\n *\n * @param config - Optional configuration\n * @returns The built HAI3 application\n *\n * @example\n * ```typescript\n * // Default - uses full() preset\n * const app = createHAI3App();\n *\n * // With configuration\n * const app = createHAI3App({ devMode: true });\n * ```\n */\nexport type CreateHAI3App = (config?: HAI3Config) => HAI3App;\n\n/**\n * Create HAI3 Function Signature\n * Creates a HAI3 app builder for custom plugin composition.\n *\n * @returns App builder for plugin composition\n *\n * @example\n * ```typescript\n * const app = createHAI3()\n * .use(screensets())\n * .use(themes())\n * .build();\n * ```\n */\nexport type CreateHAI3 = () => HAI3AppBuilder;\n\n// ============================================================================\n// Preset Types\n// ============================================================================\n\n/**\n * Preset Type\n * A preset is a function that returns an array of plugins.\n *\n * @example\n * ```typescript\n * const minimal: Preset = () => [\n * screensets({ autoDiscover: true }),\n * themes(),\n * ];\n * ```\n */\nexport type Preset = () => HAI3Plugin[];\n\n/**\n * Presets Collection\n * Available presets for different use cases.\n */\nexport interface Presets {\n /** All plugins - default for hai3 create */\n full: Preset;\n /** Screensets + themes only */\n minimal: Preset;\n /** Screensets only - for external platform integration */\n headless: Preset;\n}\n\n// ============================================================================\n// Plugin Configurations\n// ============================================================================\n\n/**\n * Screensets Plugin Configuration\n * Configuration options for the screensets plugin.\n */\nexport interface ScreensetsConfig {\n /** Auto-discover screensets via glob */\n autoDiscover?: boolean;\n /** Glob pattern for screenset discovery */\n globPattern?: string;\n}\n\n/**\n * Themes Plugin Configuration\n * Configuration options for the themes plugin.\n */\nexport interface ThemesConfig {\n /**\n * Custom apply function for UIKit themes.\n * Called when a theme is applied to execute theme-specific logic.\n *\n * @example\n * ```typescript\n * import { applyTheme } from '@hai3/uikit';\n *\n * const app = createHAI3()\n * .use(themes({ applyFn: applyTheme }))\n * .build();\n * ```\n */\n applyFn?: ThemeApplyFn;\n}\n\n// ============================================================================\n// Action Payloads\n// ============================================================================\n\n/**\n * Show Popup Payload\n */\nexport interface ShowPopupPayload {\n id: string;\n title?: string;\n content?: () => Promise<{ default: React.ComponentType }>;\n size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';\n}\n\n/**\n * Change Theme Payload\n */\nexport interface ChangeThemePayload {\n themeId: string;\n}\n\n/**\n * Set Language Payload\n */\nexport interface SetLanguagePayload {\n language: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
package/dist/types.d.cts CHANGED
@@ -1,18 +1,9 @@
1
+ import * as _hai3_screensets from '@hai3/screensets';
1
2
  import { HAI3Store as HAI3Store$1, EffectInitializer } from '@hai3/state';
2
- import { MatchFunction, PathFunction } from 'path-to-regexp';
3
3
  import { Reducer } from '@reduxjs/toolkit';
4
- import { ScreensetRegistry } from '@hai3/screensets';
5
- export { ScreensetRegistry } from '@hai3/screensets';
6
4
  import { ApiRegistry } from '@hai3/api';
7
5
  import { I18nRegistry } from '@hai3/i18n';
8
6
 
9
- /**
10
- * @hai3/framework - Type Definitions
11
- *
12
- * Core types for HAI3 framework with plugin architecture.
13
- * Integrates all SDK packages into a cohesive framework.
14
- */
15
-
16
7
  type HAI3Store = HAI3Store$1;
17
8
  /**
18
9
  * Router mode type
@@ -30,9 +21,10 @@ interface HAI3Config {
30
21
  /** Enable strict mode (throws on errors) */
31
22
  strictMode?: boolean;
32
23
  /**
33
- * Auto-navigate to first screenset on mount.
34
- * When false, stays on "/" until navigateToScreen/navigateToScreenset is called.
24
+ * Auto-route to the first registered route on mount.
25
+ * When false, stays on "/" until explicit navigation occurs.
35
26
  * @default true
27
+ * @deprecated Legacy option, will be removed in a future version.
36
28
  */
37
29
  autoNavigate?: boolean;
38
30
  /**
@@ -84,8 +76,6 @@ interface RegisterableSlice {
84
76
  * Design: Interface (not type) enables TypeScript declaration merging.
85
77
  */
86
78
  interface HAI3Actions {
87
- navigateToScreen: (payload: NavigateToScreenPayload) => void;
88
- navigateToScreenset: (payload: NavigateToScreensetPayload) => void;
89
79
  changeTheme: (payload: ChangeThemePayload) => void;
90
80
  setLanguage: (payload: SetLanguagePayload) => void;
91
81
  showPopup: (payload: ShowPopupPayload) => void;
@@ -107,6 +97,11 @@ interface HAI3Actions {
107
97
  setActiveScreen: (payload: string) => void;
108
98
  setScreenLoading: (payload: boolean) => void;
109
99
  toggleMockMode: (enabled: boolean) => void;
100
+ loadExtension: (extensionId: string) => void;
101
+ mountExtension: (extensionId: string) => void;
102
+ unmountExtension: (extensionId: string) => void;
103
+ registerExtension: (extension: _hai3_screensets.Extension) => void;
104
+ unregisterExtension: (extensionId: string) => void;
110
105
  }
111
106
  /**
112
107
  * Plugin Provides Interface
@@ -156,15 +151,18 @@ interface PluginLifecycle {
156
151
  *
157
152
  * @example
158
153
  * ```typescript
159
- * const screensetsPlugin: HAI3Plugin = {
160
- * name: 'screensets',
154
+ * const microfrontendsPlugin: HAI3Plugin = {
155
+ * name: 'microfrontends',
161
156
  * dependencies: [],
162
157
  * provides: {
163
- * registries: { screensetRegistry: createScreensetRegistry() },
164
- * slices: [screenSlice],
158
+ * slices: [mfeSlice],
159
+ * actions: {
160
+ * mountExtension: (extensionId: string) => { ... },
161
+ * },
165
162
  * },
166
163
  * onInit(app) {
167
- * discoverScreensets(app.screensetRegistry);
164
+ * // Initialize MFE registry
165
+ * app.screensetsRegistry = screensetsRegistryFactory.create(...);
168
166
  * },
169
167
  * };
170
168
  * ```
@@ -222,7 +220,6 @@ interface HAI3AppBuilder {
222
220
  */
223
221
  build(): HAI3App;
224
222
  }
225
-
226
223
  /**
227
224
  * Theme Configuration
228
225
  * Configuration for a theme.
@@ -285,71 +282,11 @@ interface ThemeRegistry {
285
282
  getVersion(): number;
286
283
  }
287
284
  /**
288
- * Route Registry Interface
289
- * Registry for managing routes (auto-synced from screensets).
290
- */
291
- /**
292
- * Route match result from matchRoute()
293
- */
294
- interface RouteMatchResult {
295
- screensetId: string;
296
- screenId: string;
297
- params: Record<string, string>;
298
- }
299
- /**
300
- * Compiled route with matcher and path generator
301
- */
302
- interface CompiledRoute {
303
- pattern: string;
304
- screensetId: string;
305
- screenId: string;
306
- matcher: MatchFunction<Record<string, string>>;
307
- toPath: PathFunction<Record<string, string>>;
308
- }
309
- /**
310
- * Route params interface for module augmentation
311
- *
312
- * Users can extend this interface to provide type-safe route parameters:
313
- *
314
- * ```typescript
315
- * declare module '@hai3/framework' {
316
- * interface RouteParams {
317
- * 'users.detail': { userId: string };
318
- * 'users.posts.detail': { userId: string; postId: string };
319
- * }
320
- * }
321
- * ```
285
+ * MFE-enabled ScreensetsRegistry (optional)
286
+ * When the microfrontends plugin is used, this registry is available.
287
+ * It provides MFE capabilities: registerDomain(), registerExtension(), etc.
322
288
  */
323
- interface RouteParams {
324
- [screenId: string]: Record<string, string> | undefined;
325
- }
326
- interface RouteRegistry {
327
- /** Check if a screen exists by screenId only (globally unique) */
328
- hasScreenById(screenId: string): boolean;
329
- /** Check if a screen exists by both screensetId and screenId (explicit lookup when screenset context is known) */
330
- hasScreen(screensetId: string, screenId: string): boolean;
331
- /** Get screenset ID for a given screen ID (reverse lookup) */
332
- getScreensetForScreen(screenId: string): string | undefined;
333
- /** Get screen loader by screenId only */
334
- getScreenById(screenId: string): (() => Promise<{
335
- default: React.ComponentType;
336
- }>) | undefined;
337
- /** Get screen loader by both screensetId and screenId (explicit lookup when screenset context is known) */
338
- getScreen(screensetId: string, screenId: string): (() => Promise<{
339
- default: React.ComponentType;
340
- }>) | undefined;
341
- /** Get all routes */
342
- getAll(): Array<{
343
- screensetId: string;
344
- screenId: string;
345
- }>;
346
- /** Match a URL path against registered routes, extracting params */
347
- matchRoute(path: string): RouteMatchResult | undefined;
348
- /** Generate a URL path for a screen with given params */
349
- generatePath(screenId: string, params?: Record<string, string>): string;
350
- /** Get the route pattern for a screen */
351
- getRoutePattern(screenId: string): string | undefined;
352
- }
289
+ type MfeScreensetsRegistry = _hai3_screensets.ScreensetsRegistry;
353
290
  /**
354
291
  * HAI3 App Interface
355
292
  * The built application with all features available.
@@ -358,14 +295,16 @@ interface RouteRegistry {
358
295
  * ```typescript
359
296
  * const app = createHAI3App();
360
297
  *
361
- * // Access registries
362
- * const screensets = app.screensetRegistry.getAll();
363
- *
364
298
  * // Access store
365
299
  * const state = app.store.getState();
366
300
  *
367
301
  * // Access actions
368
- * app.actions.navigateToScreen({ screensetId: 'demo', screenId: 'home' });
302
+ * app.actions.mountExtension(extensionId);
303
+ *
304
+ * // Access MFE registry (if microfrontends plugin is used)
305
+ * if (app.screensetsRegistry) {
306
+ * app.screensetsRegistry.registerDomain(myDomain, containerProvider);
307
+ * }
369
308
  * ```
370
309
  */
371
310
  interface HAI3App {
@@ -373,16 +312,14 @@ interface HAI3App {
373
312
  config: HAI3Config;
374
313
  /** Redux store */
375
314
  store: HAI3Store;
376
- /** Screenset registry */
377
- screensetRegistry: ScreensetRegistry;
378
315
  /** Theme registry */
379
316
  themeRegistry: ThemeRegistry;
380
- /** Route registry */
381
- routeRegistry: RouteRegistry;
382
317
  /** API registry */
383
318
  apiRegistry: ApiRegistry;
384
319
  /** I18n registry */
385
320
  i18nRegistry: I18nRegistry;
321
+ /** MFE-enabled ScreensetsRegistry (optional, provided by microfrontends plugin) */
322
+ screensetsRegistry?: MfeScreensetsRegistry;
386
323
  /** All registered actions (type-safe via HAI3Actions interface) */
387
324
  actions: HAI3Actions;
388
325
  /** Destroy the application and cleanup resources */
@@ -445,16 +382,6 @@ interface Presets {
445
382
  /** Screensets only - for external platform integration */
446
383
  headless: Preset;
447
384
  }
448
- /**
449
- * Navigation Plugin Configuration
450
- * Configuration options for the navigation plugin.
451
- */
452
- interface NavigationConfig {
453
- /**
454
- * Base path for navigation. Overrides app.config.base if set.
455
- */
456
- base?: string;
457
- }
458
385
  /**
459
386
  * Screensets Plugin Configuration
460
387
  * Configuration options for the screensets plugin.
@@ -485,20 +412,6 @@ interface ThemesConfig {
485
412
  */
486
413
  applyFn?: ThemeApplyFn;
487
414
  }
488
- /**
489
- * Navigate to Screen Payload
490
- */
491
- interface NavigateToScreenPayload {
492
- screensetId: string;
493
- screenId: string;
494
- params?: Record<string, string>;
495
- }
496
- /**
497
- * Navigate to Screenset Payload
498
- */
499
- interface NavigateToScreensetPayload {
500
- screensetId: string;
501
- }
502
415
  /**
503
416
  * Show Popup Payload
504
417
  */
@@ -523,4 +436,4 @@ interface SetLanguagePayload {
523
436
  language: string;
524
437
  }
525
438
 
526
- export type { ChangeThemePayload, CompiledRoute, CreateHAI3, CreateHAI3App, HAI3Actions, HAI3App, HAI3AppBuilder, HAI3Config, HAI3Plugin, HAI3Store, NavigateToScreenPayload, NavigateToScreensetPayload, NavigationConfig, PluginFactory, PluginLifecycle, PluginProvides, Preset, Presets, RegisterableSlice, RouteMatchResult, RouteParams, RouteRegistry, RouterMode, ScreensetsConfig, SetLanguagePayload, ShowPopupPayload, ThemeApplyFn, ThemeConfig, ThemeRegistry, ThemesConfig, UikitTheme };
439
+ export type { ChangeThemePayload, CreateHAI3, CreateHAI3App, HAI3Actions, HAI3App, HAI3AppBuilder, HAI3Config, HAI3Plugin, HAI3Store, MfeScreensetsRegistry, PluginFactory, PluginLifecycle, PluginProvides, Preset, Presets, RegisterableSlice, RouterMode, ScreensetsConfig, SetLanguagePayload, ShowPopupPayload, ThemeApplyFn, ThemeConfig, ThemeRegistry, ThemesConfig, UikitTheme };
package/dist/types.d.ts CHANGED
@@ -1,18 +1,9 @@
1
+ import * as _hai3_screensets from '@hai3/screensets';
1
2
  import { HAI3Store as HAI3Store$1, EffectInitializer } from '@hai3/state';
2
- import { MatchFunction, PathFunction } from 'path-to-regexp';
3
3
  import { Reducer } from '@reduxjs/toolkit';
4
- import { ScreensetRegistry } from '@hai3/screensets';
5
- export { ScreensetRegistry } from '@hai3/screensets';
6
4
  import { ApiRegistry } from '@hai3/api';
7
5
  import { I18nRegistry } from '@hai3/i18n';
8
6
 
9
- /**
10
- * @hai3/framework - Type Definitions
11
- *
12
- * Core types for HAI3 framework with plugin architecture.
13
- * Integrates all SDK packages into a cohesive framework.
14
- */
15
-
16
7
  type HAI3Store = HAI3Store$1;
17
8
  /**
18
9
  * Router mode type
@@ -30,9 +21,10 @@ interface HAI3Config {
30
21
  /** Enable strict mode (throws on errors) */
31
22
  strictMode?: boolean;
32
23
  /**
33
- * Auto-navigate to first screenset on mount.
34
- * When false, stays on "/" until navigateToScreen/navigateToScreenset is called.
24
+ * Auto-route to the first registered route on mount.
25
+ * When false, stays on "/" until explicit navigation occurs.
35
26
  * @default true
27
+ * @deprecated Legacy option, will be removed in a future version.
36
28
  */
37
29
  autoNavigate?: boolean;
38
30
  /**
@@ -84,8 +76,6 @@ interface RegisterableSlice {
84
76
  * Design: Interface (not type) enables TypeScript declaration merging.
85
77
  */
86
78
  interface HAI3Actions {
87
- navigateToScreen: (payload: NavigateToScreenPayload) => void;
88
- navigateToScreenset: (payload: NavigateToScreensetPayload) => void;
89
79
  changeTheme: (payload: ChangeThemePayload) => void;
90
80
  setLanguage: (payload: SetLanguagePayload) => void;
91
81
  showPopup: (payload: ShowPopupPayload) => void;
@@ -107,6 +97,11 @@ interface HAI3Actions {
107
97
  setActiveScreen: (payload: string) => void;
108
98
  setScreenLoading: (payload: boolean) => void;
109
99
  toggleMockMode: (enabled: boolean) => void;
100
+ loadExtension: (extensionId: string) => void;
101
+ mountExtension: (extensionId: string) => void;
102
+ unmountExtension: (extensionId: string) => void;
103
+ registerExtension: (extension: _hai3_screensets.Extension) => void;
104
+ unregisterExtension: (extensionId: string) => void;
110
105
  }
111
106
  /**
112
107
  * Plugin Provides Interface
@@ -156,15 +151,18 @@ interface PluginLifecycle {
156
151
  *
157
152
  * @example
158
153
  * ```typescript
159
- * const screensetsPlugin: HAI3Plugin = {
160
- * name: 'screensets',
154
+ * const microfrontendsPlugin: HAI3Plugin = {
155
+ * name: 'microfrontends',
161
156
  * dependencies: [],
162
157
  * provides: {
163
- * registries: { screensetRegistry: createScreensetRegistry() },
164
- * slices: [screenSlice],
158
+ * slices: [mfeSlice],
159
+ * actions: {
160
+ * mountExtension: (extensionId: string) => { ... },
161
+ * },
165
162
  * },
166
163
  * onInit(app) {
167
- * discoverScreensets(app.screensetRegistry);
164
+ * // Initialize MFE registry
165
+ * app.screensetsRegistry = screensetsRegistryFactory.create(...);
168
166
  * },
169
167
  * };
170
168
  * ```
@@ -222,7 +220,6 @@ interface HAI3AppBuilder {
222
220
  */
223
221
  build(): HAI3App;
224
222
  }
225
-
226
223
  /**
227
224
  * Theme Configuration
228
225
  * Configuration for a theme.
@@ -285,71 +282,11 @@ interface ThemeRegistry {
285
282
  getVersion(): number;
286
283
  }
287
284
  /**
288
- * Route Registry Interface
289
- * Registry for managing routes (auto-synced from screensets).
290
- */
291
- /**
292
- * Route match result from matchRoute()
293
- */
294
- interface RouteMatchResult {
295
- screensetId: string;
296
- screenId: string;
297
- params: Record<string, string>;
298
- }
299
- /**
300
- * Compiled route with matcher and path generator
301
- */
302
- interface CompiledRoute {
303
- pattern: string;
304
- screensetId: string;
305
- screenId: string;
306
- matcher: MatchFunction<Record<string, string>>;
307
- toPath: PathFunction<Record<string, string>>;
308
- }
309
- /**
310
- * Route params interface for module augmentation
311
- *
312
- * Users can extend this interface to provide type-safe route parameters:
313
- *
314
- * ```typescript
315
- * declare module '@hai3/framework' {
316
- * interface RouteParams {
317
- * 'users.detail': { userId: string };
318
- * 'users.posts.detail': { userId: string; postId: string };
319
- * }
320
- * }
321
- * ```
285
+ * MFE-enabled ScreensetsRegistry (optional)
286
+ * When the microfrontends plugin is used, this registry is available.
287
+ * It provides MFE capabilities: registerDomain(), registerExtension(), etc.
322
288
  */
323
- interface RouteParams {
324
- [screenId: string]: Record<string, string> | undefined;
325
- }
326
- interface RouteRegistry {
327
- /** Check if a screen exists by screenId only (globally unique) */
328
- hasScreenById(screenId: string): boolean;
329
- /** Check if a screen exists by both screensetId and screenId (explicit lookup when screenset context is known) */
330
- hasScreen(screensetId: string, screenId: string): boolean;
331
- /** Get screenset ID for a given screen ID (reverse lookup) */
332
- getScreensetForScreen(screenId: string): string | undefined;
333
- /** Get screen loader by screenId only */
334
- getScreenById(screenId: string): (() => Promise<{
335
- default: React.ComponentType;
336
- }>) | undefined;
337
- /** Get screen loader by both screensetId and screenId (explicit lookup when screenset context is known) */
338
- getScreen(screensetId: string, screenId: string): (() => Promise<{
339
- default: React.ComponentType;
340
- }>) | undefined;
341
- /** Get all routes */
342
- getAll(): Array<{
343
- screensetId: string;
344
- screenId: string;
345
- }>;
346
- /** Match a URL path against registered routes, extracting params */
347
- matchRoute(path: string): RouteMatchResult | undefined;
348
- /** Generate a URL path for a screen with given params */
349
- generatePath(screenId: string, params?: Record<string, string>): string;
350
- /** Get the route pattern for a screen */
351
- getRoutePattern(screenId: string): string | undefined;
352
- }
289
+ type MfeScreensetsRegistry = _hai3_screensets.ScreensetsRegistry;
353
290
  /**
354
291
  * HAI3 App Interface
355
292
  * The built application with all features available.
@@ -358,14 +295,16 @@ interface RouteRegistry {
358
295
  * ```typescript
359
296
  * const app = createHAI3App();
360
297
  *
361
- * // Access registries
362
- * const screensets = app.screensetRegistry.getAll();
363
- *
364
298
  * // Access store
365
299
  * const state = app.store.getState();
366
300
  *
367
301
  * // Access actions
368
- * app.actions.navigateToScreen({ screensetId: 'demo', screenId: 'home' });
302
+ * app.actions.mountExtension(extensionId);
303
+ *
304
+ * // Access MFE registry (if microfrontends plugin is used)
305
+ * if (app.screensetsRegistry) {
306
+ * app.screensetsRegistry.registerDomain(myDomain, containerProvider);
307
+ * }
369
308
  * ```
370
309
  */
371
310
  interface HAI3App {
@@ -373,16 +312,14 @@ interface HAI3App {
373
312
  config: HAI3Config;
374
313
  /** Redux store */
375
314
  store: HAI3Store;
376
- /** Screenset registry */
377
- screensetRegistry: ScreensetRegistry;
378
315
  /** Theme registry */
379
316
  themeRegistry: ThemeRegistry;
380
- /** Route registry */
381
- routeRegistry: RouteRegistry;
382
317
  /** API registry */
383
318
  apiRegistry: ApiRegistry;
384
319
  /** I18n registry */
385
320
  i18nRegistry: I18nRegistry;
321
+ /** MFE-enabled ScreensetsRegistry (optional, provided by microfrontends plugin) */
322
+ screensetsRegistry?: MfeScreensetsRegistry;
386
323
  /** All registered actions (type-safe via HAI3Actions interface) */
387
324
  actions: HAI3Actions;
388
325
  /** Destroy the application and cleanup resources */
@@ -445,16 +382,6 @@ interface Presets {
445
382
  /** Screensets only - for external platform integration */
446
383
  headless: Preset;
447
384
  }
448
- /**
449
- * Navigation Plugin Configuration
450
- * Configuration options for the navigation plugin.
451
- */
452
- interface NavigationConfig {
453
- /**
454
- * Base path for navigation. Overrides app.config.base if set.
455
- */
456
- base?: string;
457
- }
458
385
  /**
459
386
  * Screensets Plugin Configuration
460
387
  * Configuration options for the screensets plugin.
@@ -485,20 +412,6 @@ interface ThemesConfig {
485
412
  */
486
413
  applyFn?: ThemeApplyFn;
487
414
  }
488
- /**
489
- * Navigate to Screen Payload
490
- */
491
- interface NavigateToScreenPayload {
492
- screensetId: string;
493
- screenId: string;
494
- params?: Record<string, string>;
495
- }
496
- /**
497
- * Navigate to Screenset Payload
498
- */
499
- interface NavigateToScreensetPayload {
500
- screensetId: string;
501
- }
502
415
  /**
503
416
  * Show Popup Payload
504
417
  */
@@ -523,4 +436,4 @@ interface SetLanguagePayload {
523
436
  language: string;
524
437
  }
525
438
 
526
- export type { ChangeThemePayload, CompiledRoute, CreateHAI3, CreateHAI3App, HAI3Actions, HAI3App, HAI3AppBuilder, HAI3Config, HAI3Plugin, HAI3Store, NavigateToScreenPayload, NavigateToScreensetPayload, NavigationConfig, PluginFactory, PluginLifecycle, PluginProvides, Preset, Presets, RegisterableSlice, RouteMatchResult, RouteParams, RouteRegistry, RouterMode, ScreensetsConfig, SetLanguagePayload, ShowPopupPayload, ThemeApplyFn, ThemeConfig, ThemeRegistry, ThemesConfig, UikitTheme };
439
+ export type { ChangeThemePayload, CreateHAI3, CreateHAI3App, HAI3Actions, HAI3App, HAI3AppBuilder, HAI3Config, HAI3Plugin, HAI3Store, MfeScreensetsRegistry, PluginFactory, PluginLifecycle, PluginProvides, Preset, Presets, RegisterableSlice, RouterMode, ScreensetsConfig, SetLanguagePayload, ShowPopupPayload, ThemeApplyFn, ThemeConfig, ThemeRegistry, ThemesConfig, UikitTheme };