/** Route configuration object */ export interface RouteConfig { /** The path pattern to match (supports parameters like /users/:id) */ path: string; /** Optional component to render when route matches */ component?: any; /** Additional metadata for the route */ meta?: Record; } /** Parsed route parameters from URL */ export interface RouteParams { [key: string]: string; } /** Current location information */ export interface LocationInfo { /** Current pathname (e.g., '/users/123') */ pathname: string; /** Current search string (e.g., '?page=1') */ search: string; /** Current hash (e.g., '#section') */ hash: string; /** Complete URL object */ url: URL; /** Parsed route parameters */ params: RouteParams; /** Current query parameters */ query: URLSearchParams; } /** History entry for navigation tracking */ export interface HistoryEntry { /** The pathname of the history entry */ pathname: string; /** Timestamp when entry was created */ timestamp: number; /** Optional state data */ state?: any; } /** Router configuration options */ export interface RouterConfig { /** Base path for all routes (default: '') */ basePath?: string; /** Whether to use hash-based routing (default: false) */ hashMode?: boolean; /** Initial route to navigate to if no route matches */ fallbackRoute?: string; /** Whether to automatically initialize on browser load */ autoInit?: boolean; } /** Custom Router Class for Svelte 5 */ export declare class Router { #private; /** Creates a new Router instance */ constructor(config?: RouterConfig); /** Initialize the router and start listening to navigation events */ init(): void; /** Navigate to the root path */ gotoRootPath(): void; /** Initialize the app version path that will be persisted across all routes */ initAppVersion(appVersionPath: string): void; /** Clean up event listeners and stop the router */ destroy(): void; /** Register a route with the router */ addRoute(route: RouteConfig): void; /** Register multiple routes at once */ addRoutes(routes: RouteConfig[]): void; /** Navigate to a specified pathname */ navigate(pathname: string, options?: { replace?: boolean; state?: any; }): void; /** Navigate back in history */ back(): void; /** Navigate forward in history */ forward(): void; /** Get reactive location information */ useLocation(): LocationInfo; /** Get reactive current route information */ useRoute(): RouteConfig | null; /** Get reactive navigation history */ useHistory(): HistoryEntry[]; /** Get reactive navigation state */ useNavigating(): boolean; /** Check if a path matches the current location */ isActive(path: string, exact?: boolean): boolean; /** Get the current app version path */ getAppVersionPath(): string; /** Get the full pathname including app version path */ getFullPathname(): string; /** Get the current active path */ getActivePath(): string; /** Get the current route parameters */ getParams(): RouteParams; /** Get current query parameters */ getQuery(): URLSearchParams; } /** * Create a router instance with the given configuration */ export declare function createRouter(config?: RouterConfig): Router; /** * Default router instance for convenience */ export declare const router: Router; export * from './hooks.svelte.js';