/** * Single Page Application routing system with multiple target support. * Designed for scenarios where you need: * - Multiple navigation targets (main content, modals, sidebars) * - Strongly typed route parameters * - History management with back/forward support * * @example * // Configure routes * const routes = [ * { name: 'user', path: '/users/:id' }, // String parameter * { name: 'order', path: '/orders/;orderId' }, // Number parameter * { name: 'modal', path: '/detail/:id', target: 'modal' } // Custom target * ]; */ import { type Route, type NavigateOptions } from './types'; export declare const internalRoutes: Route[]; export declare const MyData: { routes: never[]; }; /** * Debug helper to print all registered routes to console. */ export declare function printRoutes(): void; /** * Registers application routes with the router. * Call this at application startup before routing begins. * * @param appRoutes - Array of route configurations * @throws Error if referenced components are not registered * * @example * const routes: Route[] = [ * { name: 'home', path: '/', componentTagName: 'app-home' }, * { name: 'user', path: '/users/:id', componentTagName: 'user-profile' }, * { name: 'login', path: '/auth/', componentTagName: 'login-form', layout: 'noauth' } * ]; * defineRoutes(routes); */ export declare function defineRoutes(appRoutes: Route[]): void; /** * Initializes routing and navigates to the current URL. * Call this after DOM is ready and routes are defined. * * @example * // In your main application component * connectedCallback() { * defineRoutes(routes); * startRouting(); * } */ export declare function startRouting(): void; /** * Navigates to a route by name or URL. * Updates browser history and dispatches navigation events. * * @param routeNameOrUrl - Route name or URL path to navigate to * @param options - Navigation options including params and target * * @example * // Navigate by route name * navigate('user', { params: { id: '123' } }); * * // Navigate by URL * navigate('/users/123'); * * // Navigate to specific target * navigate('detail', { params: { id: '42' }, target: 'modal' }); */ export declare function navigate(routeNameOrUrl: string, options?: NavigateOptions): void; /** * Returns `true` when the named target has a previous navigation it can * step back to. Pass `undefined` (or omit) for the default unnamed target. * * @example * if (canGoBack()) navigateBack(); */ export declare function canGoBack(target?: string): boolean; /** * Returns `true` when the named target was stepped back and can be stepped * forward again. Pass `undefined` for the default unnamed target. */ export declare function canGoForward(target?: string): boolean; /** * Replays the previous navigation in the named target's history. * Updates the browser URL bar via `pushState`. Does nothing if the target * has no prior entry. * * @param target - Target name. Omit for the default unnamed target. * * @example * navigateBack(); // step the default target back * navigateBack('modal'); // step the modal target back independently */ export declare function navigateBack(target?: string): void; /** * Replays the next navigation in the named target's history (after a back). * Does nothing if the target has no forward entry. */ export declare function navigateForward(target?: string): void;