import { AppConfiguration, NavigationConfig, NavigationPage } from '../../service-provider/service-provider-model.js'; import { LoaderStyle } from '@progressive-development/pd-content'; import { PwaUpdateConfig } from '../../pwa/types.js'; import { RouteDefinition } from '../../router/rout-types.js'; /** * Internal SPA configuration state */ export interface SpaConfigState { /** Navigation configuration with pages and settings */ navigation: NavigationConfig; /** Transformed route definitions for the router */ routes: RouteDefinition[]; /** Map for quick page lookup by route name */ routeMap: Map; /** Whether the configuration has been initialized */ initialized: boolean; /** Default loader style for pd-loading-state */ defaultLoaderStyle?: LoaderStyle; /** PWA update flow: dialog texts + service options */ pwaUpdateConfig?: PwaUpdateConfig; } /** * Singleton configuration manager for SPA settings. * Handles initialization, route transformation, and page lookup. */ declare class SpaConfigManager { private _state; /** * Check if configuration has been initialized */ get isInitialized(): boolean; /** * Get the current configuration state * @throws Error if not initialized */ get state(): SpaConfigState; /** * Initialize the SPA configuration. * This sets up the store, routes, and navigation. * * IMPORTANT: ServiceProvider must be initialized via services.initialize() * BEFORE calling this method. * * @param config - The application configuration */ initialize(config: AppConfiguration): void; /** * Get a navigation page by route name * * @param routeName - The name of the route * @returns The navigation page configuration * @throws Error if page not found */ getNavigationPage(routeName: string): NavigationPage; /** * Check if a route exists * * @param routeName - The name of the route */ hasRoute(routeName: string): boolean; /** * Get the navigation configuration */ getNavigationConfig(): NavigationConfig; /** * Check if login is included in the configuration * Safe to call even if not initialized (returns false) */ get includesLogin(): boolean; /** * Get the route to redirect to after logout. * Defaults to "/" (home) if not configured. */ get logoutRedirect(): string; /** * Get the default loader style for pd-loading-state. * Returns undefined if not configured (component default "spinner" applies). */ /** * PWA update flow configuration (dialog texts + service options). * Safe to call even if not initialized (returns undefined) */ get pwaUpdateConfig(): PwaUpdateConfig | undefined; get defaultLoaderStyle(): LoaderStyle | undefined; /** * Reset the configuration (useful for testing) */ reset(): void; /** * Build the navigation config with system pages */ private _buildNavigationConfig; /** * Transform navigation pages to route definitions */ private _transformRoutes; } /** * Global SPA configuration manager instance */ export declare const spaConfig: SpaConfigManager; export {}; //# sourceMappingURL=spa-config.d.ts.map